code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class StateFormula(PathFormula): <NEW_LINE> <INDENT> __desc__ = 'CTL* state formula' <NEW_LINE> def is_a_state_formula(self): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def __init__(self, *phi): <NEW_LINE> <INDENT> self.wrap_subformulas(phi, sys.modules[self.__module__].Formula) | A class representing CTL* state formulas. | 6259907c67a9b606de5477c5 |
class ParseRawTraj(ParseTraj): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> <DEDENT> def parse(self, input_path): <NEW_LINE> <INDENT> time_format = '%Y/%m/%d %H:%M:%S' <NEW_LINE> tid_to_remove = '[:/ ]' <NEW_LINE> with open(input_path, 'r') as f: <NEW_LINE> <INDENT> trajs = ... | Parse original GPS points to trajectories list. No extra data preprocessing | 6259907cd486a94d0ba2d9f6 |
class TestX8664Arch(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.Triton = TritonContext() <NEW_LINE> self.assertFalse(self.Triton.isArchitectureValid()) <NEW_LINE> self.Triton.setArchitecture(ARCH.X86_64) <NEW_LINE> self.assertTrue(self.Triton.isArchitectureValid()) <NEW_LINE> <DEDE... | Testing the X8664 Architecture. | 6259907c091ae3566870667d |
class GlucosuriaForm(BaseForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Glucosuria <NEW_LINE> fields = '__all__' <NEW_LINE> <DEDENT> control = forms.CharField(widget=forms.TextInput) <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(GlucosuriaForm, self).__init__(*args, **kwa... | Muestra un formulario que permite registrar :class:`Glucosuria`s a una
:class:`Persona` durante una :class:`Admision` | 6259907c32920d7e50bc7a81 |
class StreamNotBuiltException(Exception): <NEW_LINE> <INDENT> pass | @author starchmd
An exception thrown when the stream is not built but other functions are called | 6259907c4a966d76dd5f0925 |
class TestReferenceOpener(TestCaseWithTransport): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestReferenceOpener, self).setUp() <NEW_LINE> SafeBranchOpener.install_hook() <NEW_LINE> <DEDENT> def createBranchReference(self, url): <NEW_LINE> <INDENT> t = get_transport(self.get_url('.')) <NEW_LINE> t.m... | Feature tests for safe opening of branch references. | 6259907c7d847024c075de1c |
class ToTorchFormatTensor(object): <NEW_LINE> <INDENT> def __init__(self, div=True): <NEW_LINE> <INDENT> self.div = div <NEW_LINE> <DEDENT> def __call__(self, pic): <NEW_LINE> <INDENT> if isinstance(pic, np.ndarray): <NEW_LINE> <INDENT> img = torch.from_numpy(pic).permute(2, 0, 1).contiguous() <NEW_LINE> <DEDENT> else:... | Converts a PIL.Image (RGB) or numpy.ndarray (H x W x C) in the range [0, 255]
to a torch.FloatTensor of shape (C x H x W) in the range [0.0, 1.0] | 6259907c66673b3332c31e3e |
class ZIPCodec(Codec): <NEW_LINE> <INDENT> def encode(self, data, *args, **kwargs): <NEW_LINE> <INDENT> import zlib <NEW_LINE> format = 'zip' <NEW_LINE> if len(data[0]): format += '_%s' % data[0] <NEW_LINE> return format, zlib.compress(data[1]) <NEW_LINE> <DEDENT> def decode(self, data, *args, **kwargs): <NEW_LINE> <IN... | A codec able to encode/decode to/from gzip format. It uses the :mod:`zlib` module
Example::
>>> from taurus.core.util.codecs import CodecFactory
>>> # first encode something
>>> data = 100 * "Hello world\n"
>>> cf = CodecFactory()
>>> codec = cf.getCodec('zip')
>>> format, encoded_data = ... | 6259907c442bda511e95da77 |
class linkedlist: <NEW_LINE> <INDENT> class _node: <NEW_LINE> <INDENT> __slots__ = "_element", "_next" <NEW_LINE> def __init__(self, element, next): <NEW_LINE> <INDENT> self._element = element <NEW_LINE> self._next = next <NEW_LINE> <DEDENT> <DEDENT> def __init__(self): <NEW_LINE> <INDENT> self._head=None <NEW_LINE> se... | LIFO stack implementation using a single linked list for storage | 6259907c4527f215b58eb6c0 |
class ModificarLB(flask.views.MethodView): <NEW_LINE> <INDENT> @login_required <NEW_LINE> def post(self): <NEW_LINE> <INDENT> idLb=flask.request.form['idLB'] <NEW_LINE> descripcion=flask.request.form['descripcion'] <NEW_LINE> estado=flask.request.form['estado'] <NEW_LINE> sesion=Session() <NEW_LINE> l=sesion.query(Line... | Clase utilizada cuando se hace una peticion de modificacion de
Linea Base al servidor. Los metodos get y post indican como
debe comportarse la clase segun el tipo de peticion que
se realizo | 6259907c1f5feb6acb164638 |
class itkConstrainedValueDifferenceImageFilterIUC2IUC2IUC2(itkConstrainedValueDifferenceImageFilterIUC2IUC2IUC2_Superclass): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> def __init__(self, *args, **kwargs): raise AttributeError("N... | Proxy of C++ itkConstrainedValueDifferenceImageFilterIUC2IUC2IUC2 class | 6259907c009cb60464d02f7f |
class ClassInfo(object): <NEW_LINE> <INDENT> def __init__(self, name, base, is_abstract, doc_string, properties, decodings): <NEW_LINE> <INDENT> for prp in properties: <NEW_LINE> <INDENT> prp.cls = self <NEW_LINE> <DEDENT> self.__all_decodings = None <NEW_LINE> self.__all_properties = None <NEW_LINE> self.__base = base... | Represents a class within an ontology.
| 6259907cd268445f2663a87e |
class _GetchUnix(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> import sys <NEW_LINE> import tty <NEW_LINE> <DEDENT> def __call__(self): <NEW_LINE> <INDENT> import sys <NEW_LINE> import tty <NEW_LINE> import termios <NEW_LINE> fd = sys.stdin.fileno() <NEW_LINE> old_settings = termios.tcgetattr(fd) <NEW_... | Implementing a getch call to read a single character from stdin | 6259907ce1aae11d1e7cf531 |
class Class(object): <NEW_LINE> <INDENT> def method(self): <NEW_LINE> <INDENT> pass | class documentation | 6259907c91f36d47f2231bae |
class LoopLimiter(ExplorationTechnique): <NEW_LINE> <INDENT> def __init__(self, count=5, discard_stash='spinning'): <NEW_LINE> <INDENT> super(LoopLimiter, self).__init__() <NEW_LINE> self.count = count <NEW_LINE> self.discard_stash = discard_stash <NEW_LINE> <DEDENT> def step(self, pg, stash, **kwargs): <NEW_LINE> <IND... | Limit the number of loops a path may go through.
Paths that exceed the loop limit are moved to a discard stash.
Note that this uses the default detect_loops method from Path, which approximates loop
counts by counting the number of times each basic block is executed in a given stack frame. | 6259907c4c3428357761bcfa |
class ShibbolethRemoteUserMiddleware(RemoteUserMiddleware): <NEW_LINE> <INDENT> def process_request(self, request): <NEW_LINE> <INDENT> if not hasattr(request, 'user'): <NEW_LINE> <INDENT> raise ImproperlyConfigured( "The Django remote user auth middleware requires the" " authentication middleware to be installed. Edi... | Authentication Middleware for use with Shibboleth. Uses the recommended pattern
for remote authentication from: http://code.djangoproject.com/svn/django/tags/releases/1.3/django/contrib/auth/middleware.py | 6259907c7d43ff2487428135 |
class Request(pydantic.BaseModel): <NEW_LINE> <INDENT> aclass: typing.Optional[ASSETCLASS] <NEW_LINE> asset: ASSET <NEW_LINE> key: str <NEW_LINE> amount: Decimal <NEW_LINE> nonce: pydantic.PositiveInt | Request model for endpoint POST https://api.kraken.com/0/private/WithdrawInfo
Model Fields:
-------------
aclass : str
Default = currency (optional)
asset : str enum
Asset being withdrawn
key : str
Withdrawal key name, as set up on account
amount : Decimal
Amount to wit... | 6259907cec188e330fdfa2e9 |
class default_resource(Resource): <NEW_LINE> <INDENT> pass | Default foreman resource | 6259907c3317a56b869bf266 |
class ReverseAndRedirect(HttpResponseException): <NEW_LINE> <INDENT> def __init__(self, view_name, *args, **kwargs): <NEW_LINE> <INDENT> url = reverse(view_name, args=args, kwargs=kwargs) <NEW_LINE> self.http_response = HttpResponseRedirect(url) | A shortcut allowing to do a reverse, then redirect the user by raising an exception. | 6259907c99fddb7c1ca63af8 |
class AssociateElasticIpRequest(JDCloudRequest): <NEW_LINE> <INDENT> def __init__(self, parameters, header=None, version="v1"): <NEW_LINE> <INDENT> super(AssociateElasticIpRequest, self).__init__( '/regions/{regionId}/loadBalancers/{loadBalancerId}:associateElasticIp', 'POST', header, version) <NEW_LINE> self.parameter... | 负载均衡绑定弹性公网IP | 6259907ca05bb46b3848be49 |
class Reference: <NEW_LINE> <INDENT> _TYPES_TITLES = [('cover', __('Cover')), ('title-page', __('Title page')), ('toc', __('Table of Contents')), ('index', __('Index')), ('glossary', __('Glossary')), ('acknowledgements', __('Acknowledgements')), ('bibliography', __('Bibliography')), ('colophon', __('Colophon')), ('copy... | Reference to a standard book section.
Provides the following instance data members:
:attr:`type`: Reference type identifier, as chosen from the list
allowed in the OPF 2.0 specification.
:attr:`title`: Human-readable section title.
:attr:`href`: Book-internal URL of the referenced section. May include
a frag... | 6259907c1b99ca4002290256 |
class RegisterView(View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> register_form = RegisterForm() <NEW_LINE> return render(request, 'register.html', {'register_form': register_form}) <NEW_LINE> <DEDENT> def post(self, request): <NEW_LINE> <INDENT> register_form = RegisterForm(request.POST) <NEW_L... | 注册 | 6259907c3617ad0b5ee07b8f |
class SeriesBook(models.Model): <NEW_LINE> <INDENT> book = models.ForeignKey(Book, on_delete=models.CASCADE, verbose_name=_('book_title')) <NEW_LINE> series = models.ForeignKey(Series, on_delete=models.CASCADE, verbose_name=_('series_name')) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> db_table = 'series_book' <NEW_LINE>... | Series and Book Relational Model | 6259907ce1aae11d1e7cf532 |
class Hamiltonian(object): <NEW_LINE> <INDENT> def __init__(self, H, eig=False, nstates=None, baths=None, units='au', convert=None): <NEW_LINE> <INDENT> const.hbar = const.get_hbar(units) <NEW_LINE> if nstates==None: <NEW_LINE> <INDENT> self.nstates = H.shape[0] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.nstate... | Base Hamiltonian class.
| 6259907daad79263cf4301fc |
class Notifier: <NEW_LINE> <INDENT> def __init__(self, lock): <NEW_LINE> <INDENT> self.observers = [] <NEW_LINE> self.lock = lock <NEW_LINE> <DEDENT> def clear(self): <NEW_LINE> <INDENT> self.observers = [] <NEW_LINE> <DEDENT> def add(self, observer): <NEW_LINE> <INDENT> self.observers.append(observer) <NEW_LINE> <DEDE... | Class composed of PhraseHandlers. Each observer called when new key input
is ready to be checked against phrase database.
Notifier acquires a global lock while iterating observers. This prevents
infinite loops when a value being "typed out" contains a phrase-key.
i.e. we don't want the automated keyboard typing to be ... | 6259907d091ae35668706681 |
class Fibonacci_Sequence: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def __nth_fibonacci(cls, n): <NEW_LINE> <INDENT> a = 0 <NEW_LINE> b = 1 <NEW_LINE> if n == 0: <NEW_LINE> <INDENT> return a <NEW_LINE> <DEDENT> elif n == 1: <NEW_LINE> <INDENT> return b <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> for _ in range(2, n... | Fibonacci sequence generator class | 6259907d656771135c48ad51 |
class HostAlreadyExists(Exception): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> super(HostAlreadyExists, self).__init__() <NEW_LINE> self.name = name | The specified host already exists. | 6259907d7c178a314d78e90c |
class Restart(base.BaseCommand): <NEW_LINE> <INDENT> name = 'restart' <NEW_LINE> log_to_stdout = True <NEW_LINE> @utils.log_command_exception <NEW_LINE> def do(self): <NEW_LINE> <INDENT> conf_file = _get_running_conf() <NEW_LINE> if not conf_file: <NEW_LINE> <INDENT> LOG.info("No running agent found, please start a age... | Dell-EMC SNMP agent: Restart the running SNMP agent.
usage:
snmpagent-unity restart
examples:
snmpagent-unity restart
| 6259907da8370b77170f1e12 |
class TestAnalyticsModel(BaseAnalyticsSetup): <NEW_LINE> <INDENT> def test_analytics_model_can_create_report(self): <NEW_LINE> <INDENT> report = ReadsReport.objects.create(user=self.author, article=self.article) <NEW_LINE> self.assertEqual(report.article, self.article) <NEW_LINE> <DEDENT> def test_report_model_string_r... | Test the Analytics model functions and methods | 6259907d7047854f46340df8 |
class Solution(object): <NEW_LINE> <INDENT> def __init__(self, num, cache): <NEW_LINE> <INDENT> divisor = least_divisor(num) <NEW_LINE> if divisor == num: <NEW_LINE> <INDENT> self.sequences = [(num)] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> quotient = num // divisor <NEW_LINE> sub_solution = cache[quotient] | Data structure specifically for this problem.
Components:
- traditional factorization
- all the product-sum factorizations | 6259907d283ffb24f3cf52e3 |
class SensitiveWordsDB(DBbase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> <DEDENT> def get_sensitive_words_by_channel(self, channel_id): <NEW_LINE> <INDENT> sql = f'select sensitive_words from sms_sensitiveWords where is_active=1 and channel_id={channel_id};' <NEW_LINE> r... | 发敏感词数据表管理 | 6259907d4527f215b58eb6c2 |
class SQLConnection: <NEW_LINE> <INDENT> def __init__(self,path): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.db = None <NEW_LINE> <DEDENT> def open_database(self): <NEW_LINE> <INDENT> if self.db: <NEW_LINE> <INDENT> self.close_database() <NEW_LINE> <DEDENT> self.db = QSqlDatabase.addDatabase("QSQLITE") <NEW_L... | Handles the conncetion to the SQL database | 6259907d5fdd1c0f98e5f9c3 |
class GoatDetector(Subject): <NEW_LINE> <INDENT> def detect(self, line): <NEW_LINE> <INDENT> if line.find('goat') >= 0: <NEW_LINE> <INDENT> self.notifyObservers('goats detected') | This class notifies its observers if a string contains the word 'goat'. | 6259907df548e778e596cfd5 |
class ChangeTimeoutOnTimeoutHandler(ActionIndependentDNSResponseHandler): <NEW_LINE> <INDENT> def __init__(self, timeout, timeouts): <NEW_LINE> <INDENT> self._timeout = timeout <NEW_LINE> self._timeouts = timeouts <NEW_LINE> <DEDENT> def handle(self, response_wire, response, response_time): <NEW_LINE> <INDENT> timeouts... | Modify timeout value when a certain number of timeouts is reached. | 6259907d7b180e01f3e49d87 |
class Singleton(object): <NEW_LINE> <INDENT> def __new__(cls, *args, **kwds): <NEW_LINE> <INDENT> it = cls.__dict__.get("__it__") <NEW_LINE> if it is not None: <NEW_LINE> <INDENT> return it <NEW_LINE> <DEDENT> cls.__it__ = it = object.__new__(cls) <NEW_LINE> it.init(*args, **kwds) <NEW_LINE> return it <NEW_LINE> <DEDEN... | From Brian Bruggeman's answer here
http://stackoverflow.com/questions/31875/is-there-a-simple-elegant-way-to
-define-singletons-in-python | 6259907d7d43ff2487428137 |
class Settings(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Settings, self).__init__() <NEW_LINE> self._setup(global_settings) <NEW_LINE> user_settings = os.environ.get(ENVIRONMENT_VARIABLE, None) <NEW_LINE> if user_settings: <NEW_LINE> <INDENT> user_settings = importlib.import_module(user... | Settings class of application. | 6259907d656771135c48ad52 |
class Building(Location): <NEW_LINE> <INDENT> __tablename__ = _TN <NEW_LINE> __mapper_args__ = {'polymorphic_identity': _TN} <NEW_LINE> valid_parents = [City, Campus] <NEW_LINE> id = Column(ForeignKey(Location.id, ondelete='CASCADE'), primary_key=True) <NEW_LINE> address = Column(String(255), nullable=False) <NEW_LINE>... | Building is a subtype of location | 6259907dec188e330fdfa2ed |
class TestSampleSimilarityResult(BaseTestCase): <NEW_LINE> <INDENT> def test_add_sample_similarity(self): <NEW_LINE> <INDENT> sample_similarity_result = SampleSimilarityResult(categories=CATEGORIES, tools=TOOLS, data_records=DATA_RECORDS) <NEW_LINE> wrapper = AnalysisResultWrapper(data=sample_similarity_result).save() ... | Test suite for Sample Similarity model. | 6259907d32920d7e50bc7a87 |
class UserProfile(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> email = models.EmailField(max_length=255, unique=True) <NEW_LINE> name = models.CharField(max_length=255) <NEW_LINE> is_active = models.BooleanField(default=True) <NEW_LINE> is_staff = models.BooleanField(default=False) <NEW_LINE> objects = User... | Database model for users in the system | 6259907dbe7bc26dc9252b78 |
class BaseRenderer(object): <NEW_LINE> <INDENT> media_type = None <NEW_LINE> format = None <NEW_LINE> charset = 'utf-8' <NEW_LINE> def render(self, data, accepted_media_type=None, renderer_context=None): <NEW_LINE> <INDENT> raise NotImplemented('Renderer class requires .render() to be implemented') | All renderers should extend this class, setting the `media_type`
and `format` attributes, and override the `.render()` method. | 6259907d71ff763f4b5e91f1 |
class ZionConfigHelper: <NEW_LINE> <INDENT> def __init__(self, config_file, host): <NEW_LINE> <INDENT> self.host=host <NEW_LINE> with open(config_file) as config_file: <NEW_LINE> <INDENT> self.zion_conf = json.load(config_file) <NEW_LINE> <DEDENT> <DEDENT> def get_conf(self, key): <NEW_LINE> <INDENT> return self.zion_c... | This helper class will return shared config or config for the current host.
The config file should be a json document with this shape:
{
"shared_conf": {
"key": "value"
},
"host_conf": {
"env.host": {
"key": "value"
}
}
} | 6259907d55399d3f05627f59 |
class ServerException(Exception): <NEW_LINE> <INDENT> pass | inner server error | 6259907d1b99ca4002290258 |
@pulumi.output_type <NEW_LINE> class GetGroupResult: <NEW_LINE> <INDENT> def __init__(__self__, arn=None, group_id=None, group_name=None, id=None, path=None, users=None): <NEW_LINE> <INDENT> if arn and not isinstance(arn, str): <NEW_LINE> <INDENT> raise TypeError("Expected argument 'arn' to be a str") <NEW_LINE> <DEDEN... | A collection of values returned by getGroup. | 6259907d67a9b606de5477c9 |
class GameHistoryForm(messages.Message): <NEW_LINE> <INDENT> user_name = messages.StringField(1, required=True) <NEW_LINE> history = messages.MessageField(GameRoundForm, 2, repeated=True) | Returns a history of rounds played | 6259907d76e4537e8c3f0fc5 |
class ContainsKeyValueTest(unittest.TestCase): <NEW_LINE> <INDENT> def testValidPair(self): <NEW_LINE> <INDENT> self.assertTrue(mox.ContainsKeyValue("key", 1) == {"key": 1}) <NEW_LINE> <DEDENT> def testInvalidValue(self): <NEW_LINE> <INDENT> self.assertFalse(mox.ContainsKeyValue("key", 1) == {"key": 2}) <NEW_LINE> <DED... | Test ContainsKeyValue correctly identifies key/value pairs in a dict.
| 6259907d7d43ff2487428138 |
@register <NEW_LINE> class ContinueArguments(BaseSchema): <NEW_LINE> <INDENT> __props__ = { "threadId": { "type": "integer", "description": "Continue execution for the specified thread (if possible).\nIf the backend cannot continue on a single thread but will continue on all threads, it should set the 'allThreadsContin... | Arguments for 'continue' request.
Note: automatically generated code. Do not edit manually. | 6259907d97e22403b383c947 |
class product(object): <NEW_LINE> <INDENT> def __init__(self, name, price, quantity): <NEW_LINE> <INDENT> self.id = id(self) <NEW_LINE> self.name = name <NEW_LINE> self.price = price <NEW_LINE> self.quantity = quantity | A class to represent a product
.....
Attributes
-----------
id : This is created automatically using in-built function id(), which creates unique id for each object
name : name of the product
price(only positive integer) : price of the product in dollars
quantity(only positive integer) : indicates the quantity of a p... | 6259907d3317a56b869bf269 |
class HighScoreWindow(MainWindow): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> score = highscores.HighScoreManager() <NEW_LINE> highestdata = score.get_sorted_data()[0] <NEW_LINE> highestgrid = highestdata['grid'] <NEW_LINE> highestname = highestdata['name'] <NEW_LINE> highestscore = highestdata['score'... | High Score Screen. | 6259907d56ac1b37e6303a06 |
class GetSingleStudentTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.student2 = Student.objects.create( first_name='first_name3', surname='surname3', last_name='last_name3', date_of_birth=datetime.date(month=3, year=1993, day=3), grade=3 ) <NEW_LINE> self.student4 = Student.objects.create... | Test case for GET single record of Student | 6259907d4f6381625f19a1d1 |
class LoggersError(ODfuzzException): <NEW_LINE> <INDENT> pass | An error occurred while creating directories. | 6259907d7cff6e4e811b7487 |
class StdOutPrinter(IO): <NEW_LINE> <INDENT> async def _read(self, length=1): <NEW_LINE> <INDENT> await curio.sleep(0) <NEW_LINE> return bytearray([0]) <NEW_LINE> <DEDENT> async def _write(self, data): <NEW_LINE> <INDENT> data = data.decode(self._encoding) <NEW_LINE> logger.info(f"{type(self).__name__}: {data}") <NEW_L... | IO-Class for StdOut | 6259907d442bda511e95da7b |
class DownloadStats(base.ScriptBaseWithConfig): <NEW_LINE> <INDENT> ARGS_HELP = "" <NEW_LINE> VERSION = '1.0' <NEW_LINE> FIELDS = ('is_active', 'left_bytes', 'size_bytes', 'down.rate', 'priority') <NEW_LINE> MIN_STALLED_RATE = 5 * 1024 <NEW_LINE> STALLED_PERCENT = 10 <NEW_LINE> def add_options(self): <NEW_LINE> <INDENT... | Show stats about currently active & pending downloads. | 6259907d92d797404e389880 |
class DirectoryGalaxyOptionManager(object): <NEW_LINE> <INDENT> def __init__(self, app, conf_dir=None, conf_file_name=OPTIONS_FILE_NAME): <NEW_LINE> <INDENT> self.app = app <NEW_LINE> if not conf_dir: <NEW_LINE> <INDENT> conf_dir = app.ud["galaxy_conf_dir"] <NEW_LINE> <DEDENT> self.conf_dir = conf_dir <NEW_LINE> self.c... | When `galaxy_conf_dir` in specified in UserData this is used to
manage Galaxy's options. | 6259907d7b180e01f3e49d89 |
class Clickable: <NEW_LINE> <INDENT> def on_click(self): <NEW_LINE> <INDENT> print(self.__class__.__name__, 'clicked') | Класс объекта - обработчика нажатия мыши | 6259907d56b00c62f0fb431c |
class ImageUploadSerializer(UserDetailsSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = UserModel <NEW_LINE> fields = ('picture') | User Profile Image upload serializer | 6259907d23849d37ff852b01 |
class RoleLoad(object): <NEW_LINE> <INDENT> def __init__(self, config_type): <NEW_LINE> <INDENT> self.config_type = config_type <NEW_LINE> <DEDENT> def get_method(self, path, name): <NEW_LINE> <INDENT> to_import = '%s.%s' % (path, name) <NEW_LINE> return __import__(to_import, fromlist=[name]) <NEW_LINE> <DEDENT> def va... | Load a given Configuration Management role.
:param config_type: ``str`` | 6259907d796e427e538501c3 |
class WebApplicationFirewallCustomRule(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'name': {'max_length': 128, 'min_length': 0}, 'etag': {'readonly': True}, 'priority': {'required': True}, 'rule_type': {'required': True}, 'match_conditions': {'required': True}, 'action': {'required': True}, } <NEW_... | Defines contents of a web application rule.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:param name: The name of the resource that is unique within a policy. This name can be used to
access the resource.... | 6259907d1f5feb6acb164642 |
@gin.configurable <NEW_LINE> class BackboneAngleTransform(Transform): <NEW_LINE> <INDENT> def single_call(self, angles): <NEW_LINE> <INDENT> sin, cos = tf.sin(angles), tf.cos(angles) <NEW_LINE> return tf.concat([sin, cos], -1) | Maps tf.Tensor<float>[len, 1] of angles to [len, 2] tensor of sin/cos. | 6259907d4527f215b58eb6c5 |
class RestaurantImages(Base): <NEW_LINE> <INDENT> __tablename__ = 'restaurant_images' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> restaurant_id = Column(Integer, ForeignKey('restaurant.id')) <NEW_LINE> restaurant = relationship(Restaurant) <NEW_LINE> image_id = Column(Integer, ForeignKey('image.id')) <... | Restaurant & Image pairs stored here. Many-to-many relationship. | 6259907d5fdd1c0f98e5f9c9 |
class Battery(): <NEW_LINE> <INDENT> def __init__(self, battery_size=70): <NEW_LINE> <INDENT> self.battery_size = battery_size <NEW_LINE> <DEDENT> def describe_battery(self): <NEW_LINE> <INDENT> print("This car has a " + str(self.battery_size) + "-kWh battery.") <NEW_LINE> <DEDENT> def get_range(self): <NEW_LINE> <INDE... | 一次模拟电动汽车电瓶的简单尝试 | 6259907d7d43ff248742813a |
class Comment(db.Model): <NEW_LINE> <INDENT> comment = db.StringProperty(required=True) <NEW_LINE> post = db.StringProperty(required=True) <NEW_LINE> @classmethod <NEW_LINE> def render(self): <NEW_LINE> <INDENT> self.render("comment.html") | This is the database which will hold the individual comments for the posts
:comment = The comment that was made
:post = the Post id that is commented. | 6259907daad79263cf430204 |
class GetNotifySettings(Object): <NEW_LINE> <INDENT> ID = 0x12b3ad31 <NEW_LINE> def __init__(self, peer): <NEW_LINE> <INDENT> self.peer = peer <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def read(b: BytesIO, *args) -> "GetNotifySettings": <NEW_LINE> <INDENT> peer = Object.read(b) <NEW_LINE> return GetNotifySettings(pe... | Attributes:
ID: ``0x12b3ad31``
Args:
peer: Either :obj:`InputNotifyPeer <pyrogram.api.types.InputNotifyPeer>`, :obj:`InputNotifyUsers <pyrogram.api.types.InputNotifyUsers>`, :obj:`InputNotifyChats <pyrogram.api.types.InputNotifyChats>` or :obj:`InputNotifyBroadcasts <pyrogram.api.types.InputNotifyBroadcasts>`
... | 6259907d91f36d47f2231bb3 |
class LangException(Exception): <NEW_LINE> <INDENT> pass | Base class for exceptions in this package | 6259907d656771135c48ad55 |
class NotSubset(Negate, Subset): <NEW_LINE> <INDENT> reason = '{0} is a subset of {comparable}' | Asserts that `value` is a not a subset of `comparable`.
Aliases:
- ``to_not_be_subset``
- ``is_not_subset``
.. versionadded:: 0.5.0 | 6259907d5fcc89381b266e81 |
class ConferenceReference(InbookReference): <NEW_LINE> <INDENT> implements(IConferenceReference) <NEW_LINE> security = ClassSecurityInfo() <NEW_LINE> source_fields = ('booktitle', 'volume', 'number', 'series', 'pages', 'address', 'organization', 'publisher', ) <NEW_LINE> archetype_name = "Conference Reference" <NEW_L... | content type to make reference to a conference volume.
| 6259907d283ffb24f3cf52eb |
class Call(object): <NEW_LINE> <INDENT> DTMF_COMMAND_BASE = '+VTS=' <NEW_LINE> dtmfSupport = False <NEW_LINE> def __init__(self, gsmModem, callId, callType, number, callStatusUpdateCallbackFunc=None): <NEW_LINE> <INDENT> self._gsmModem = weakref.proxy(gsmModem) <NEW_LINE> self._callStatusUpdateCallbackFunc = callStatus... | A voice call | 6259907d26068e7796d4e38a |
class zerotime(restart_base): <NEW_LINE> <INDENT> pass | Test usage of docker 'restart' command (docker exits on SIGTERM)
initialize:
1) start container with test command
run_once:
2) check container output for start message
3) execute docker restart without timeout, container should not log
info about SIGTERM
4) check container output for restart message
5) execute dock... | 6259907d4428ac0f6e659f7b |
class AMYFilterSet(django_filters.FilterSet): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.form.helper = bootstrap_helper_filter | This base class sets FormHelper. | 6259907d55399d3f05627f60 |
class FlujoCreateForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Flujo <NEW_LINE> fields = ('nombre',) | Formulario para la creación de flujos. | 6259907d67a9b606de5477cc |
class Template(Classifier) : <NEW_LINE> <INDENT> attributes = {} <NEW_LINE> def __init__(self, arg = None, **args) : <NEW_LINE> <INDENT> Classifier.__init__(self, **args) <NEW_LINE> <DEDENT> def train(self, data, **args) : <NEW_LINE> <INDENT> Classifier.train(self, data, **args) <NEW_LINE> self.log.trainingTime = self.... | A template for a pyml classifier | 6259907d76e4537e8c3f0fcb |
class PackageURLParser(StaticURLParser): <NEW_LINE> <INDENT> def __init__(self, package_name, resource_name, root_resource=None, cache_max_age=None): <NEW_LINE> <INDENT> self.package_name = package_name <NEW_LINE> self.resource_name = os.path.normpath(resource_name) <NEW_LINE> if root_resource is None: <NEW_LINE> <INDE... | This probably won't work with zipimported resources | 6259907d283ffb24f3cf52ec |
class agilent8594Q(agilent8590E): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.__dict__.setdefault('_instrument_id', '') <NEW_LINE> super(agilent8594Q, self).__init__(*args, **kwargs) <NEW_LINE> self._input_impedance = 50 <NEW_LINE> self._frequency_low = 9e3 <NEW_LINE> self._frequen... | Agilent 8594Q IVI spectrum analyzer driver | 6259907d656771135c48ad56 |
class ToolValidator(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.params = arcpy.GetParameterInfo() <NEW_LINE> <DEDENT> def initializeParameters(self): <NEW_LINE> <INDENT> self.params[0].value = 1 <NEW_LINE> self.params[1].value = 0 <NEW_LINE> self.params[2].value = 0 <NEW_LINE> return <NEW_... | Class for validating a tool's parameter values and controlling
the behavior of the tool's dialog. | 6259907d99fddb7c1ca63afe |
class Solution: <NEW_LINE> <INDENT> def climbStairs(self, n): <NEW_LINE> <INDENT> if n == 0: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> if n == 1: <NEW_LINE> <INDENT> return 1 <NEW_LINE> <DEDENT> if n == 2: <NEW_LINE> <INDENT> return 2 <NEW_LINE> <DEDENT> f = [0] * (n+1) <NEW_LINE> f[0] = 0 <NEW_LINE> f[1] = 1 <N... | @param n: An integer
@return: An integer | 6259907d796e427e538501c7 |
class GcsViolations(base_notification.BaseNotification): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> if not self.notification_config['gcs_path'].startswith('gs://'): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> data_format = self.notification_config.get('data_format', 'csv') <NEW_LINE> if data_format not i... | Upload violations to GCS. | 6259907d3617ad0b5ee07b9b |
class SectionMatcher(object): <NEW_LINE> <INDENT> def __init__(self, store): <NEW_LINE> <INDENT> self.store = store <NEW_LINE> <DEDENT> def get_sections(self): <NEW_LINE> <INDENT> sections = self.store.get_sections() <NEW_LINE> for store, s in sections: <NEW_LINE> <INDENT> if self.match(s): <NEW_LINE> <INDENT> yield st... | Select sections into a given Store.
This is intended to be used to postpone getting an iterable of sections
from a store. | 6259907d3346ee7daa338388 |
class EventPaymentReminder(CronJobBase): <NEW_LINE> <INDENT> RUN_EVERY_MINS = 5 <NEW_LINE> schedule = Schedule(run_every_mins=RUN_EVERY_MINS) <NEW_LINE> code = 'bccf.event_payment_reminder' <NEW_LINE> email_title = 'Event Registration Payment Reminder' <NEW_LINE> def do(self): <NEW_LINE> <INDENT> events = Event.objects... | CronJob for sending a payment reminder to users who have not paid their
registrations. The is reminder will be sent 4 weeks before the event. | 6259907d97e22403b383c94e |
class OSMusicPlayer(MusicPlayer): <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._want_to_play = False <NEW_LINE> self._actually_playing = False <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_valid_music_file_extensions(cls) -> List[str]: <NEW_LINE> <INDENT> ... | Music player that talks to internal C++ layer for functionality.
(internal) | 6259907d1b99ca400229025c |
class Dotfile: <NEW_LINE> <INDENT> def __init__(self, name, gitplace, sysplace, isdir=False, place=""): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.gitplace = gitplace <NEW_LINE> self.sysplace = sysplace <NEW_LINE> self.isdir = isdir <NEW_LINE> self.place = place <NEW_LINE> dotfiles.append(self) <NEW... | A object for each file or directory that needs to be setup. | 6259907d5166f23b2e244e26 |
class SimulatedReferenceSet(AbstractReferenceSet): <NEW_LINE> <INDENT> def __init__(self, localId, randomSeed=0, numReferences=1): <NEW_LINE> <INDENT> super(SimulatedReferenceSet, self).__init__(localId) <NEW_LINE> self._randomSeed = randomSeed <NEW_LINE> self._randomGenerator = random.Random() <NEW_LINE> self._randomG... | A simulated referenceSet | 6259907d4527f215b58eb6c7 |
class SerializationMixin: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def _pickle_serialize(obj): <NEW_LINE> <INDENT> return pickle.dumps(obj, protocol=pickle.HIGHEST_PROTOCOL) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _pickle_deserialize(bstring): <NEW_LINE> <INDENT> return pickle.loads(bstring) <NEW_LINE> <DE... | Mixin to do serialization for a datastore if required. Supports ability to do serialization in a separate process. | 6259907d5fdd1c0f98e5f9cd |
class Entry_u_boot_tpl_dtb_with_ucode(Entry_u_boot_dtb_with_ucode): <NEW_LINE> <INDENT> def __init__(self, section, etype, node): <NEW_LINE> <INDENT> Entry_u_boot_dtb_with_ucode.__init__(self, section, etype, node) <NEW_LINE> <DEDENT> def GetDefaultFilename(self): <NEW_LINE> <INDENT> return 'tpl/u-boot-tpl.dtb' | U-Boot TPL with embedded microcode pointer
This is used when TPL must set up the microcode for U-Boot.
See Entry_u_boot_ucode for full details of the entries involved in this
process. | 6259907d67a9b606de5477cd |
class SimulationType(enum.IntEnum): <NEW_LINE> <INDENT> UNSPECIFIED = 0 <NEW_LINE> UNKNOWN = 1 <NEW_LINE> CPC_BID = 2 <NEW_LINE> CPV_BID = 3 <NEW_LINE> TARGET_CPA = 4 <NEW_LINE> BID_MODIFIER = 5 | Enum describing the field a simulation modifies.
Attributes:
UNSPECIFIED (int): Not specified.
UNKNOWN (int): Used for return value only. Represents value unknown in this version.
CPC_BID (int): The simulation is for a cpc bid.
CPV_BID (int): The simulation is for a cpv bid.
TARGET_CPA (int): The simulation ... | 6259907ddc8b845886d55008 |
class FoveaPrintLogger(object): <NEW_LINE> <INDENT> def __init__(self, filestream=None, dbfilepath=None): <NEW_LINE> <INDENT> self._file = filestream or sys.stdout <NEW_LINE> self._write = self._file.write <NEW_LINE> self._flush = self._file.flush <NEW_LINE> self.event_list = [] <NEW_LINE> self.counter = counter_util()... | (Non-thread safe version of structlog.PrintLogger)
Prints events into a file AND store event structure internally
as `event_list` attribute and an SQL database (accessible via get_DB method).
:param filestream file: File (stream) to print to. (default: stdout)
:param dbfilepath: tinydb file path or None (default) for ... | 6259907d3317a56b869bf26d |
class ChinaDailySpider(WebsiteSpider): <NEW_LINE> <INDENT> name = 'china_daily' <NEW_LINE> allowed_domains = ['china.chinadaily.com.cn'] <NEW_LINE> start_urls = ['http://china.chinadaily.com.cn/'] <NEW_LINE> def parse_content(self, response): <NEW_LINE> <INDENT> categories = [] <NEW_LINE> try: <NEW_LINE> <INDENT> categ... | This crawler fetches articles from the ChinaDaily website. | 6259907d7c178a314d78e912 |
class ProductionConfig(BaseConfig): <NEW_LINE> <INDENT> DEBUG = False | 生产环境配置 | 6259907d7d847024c075de2c |
class Counter: <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> self.parent = parent <NEW_LINE> self.frame = tkinter.Frame(parent) <NEW_LINE> self.frame.pack() <NEW_LINE> self.state = tkinter.IntVar() <NEW_LINE> self.state.set(0) <NEW_LINE> self.label = tkinter.Label(self.frame, textvariable=self.sta... | A simple counter GUI using object-oriented programming. | 6259907d2c8b7c6e89bd5235 |
class BertWrapper(torch.nn.Module): <NEW_LINE> <INDENT> def __init__( self, bert_model, output_dim, add_transformer_layer=False, layer_pulled=-1, aggregation="first", ): <NEW_LINE> <INDENT> super(BertWrapper, self).__init__() <NEW_LINE> self.layer_pulled = layer_pulled <NEW_LINE> self.aggregation = aggregation <NEW_LIN... | Adds a optional transformer layer and a linear layer on top of BERT. | 6259907d67a9b606de5477ce |
class AsignarEquipoConfirm(AsignarHistorias): <NEW_LINE> <INDENT> template_name = 'AsignarEquipoConfirm.html' <NEW_LINE> context_object_name = 'lista_sprints' <NEW_LINE> def post(self, request, *args, **kwargs): <NEW_LINE> <INDENT> diccionario={} <NEW_LINE> usuario_logueado= Usuario.objects.get(id= request.POST['login'... | Confirma la asignacion de usuario a un sprint especifico | 6259907dad47b63b2c5a92a0 |
class stopwatch(object): <NEW_LINE> <INDENT> def __init__(self, level=logging.DEBUG): <NEW_LINE> <INDENT> self._level = level <NEW_LINE> <DEDENT> def __call__(self, method): <NEW_LINE> <INDENT> @wraps(method) <NEW_LINE> def wrapped_f(*args, **options): <NEW_LINE> <INDENT> _self = args[0] <NEW_LINE> fname = method.__nam... | Decorator class for measuring the execution time of methods. | 6259907d3317a56b869bf26e |
class Supply(models.Model): <NEW_LINE> <INDENT> name = models.CharField() <NEW_LINE> type = models.ForeignKey('DevTypes') <NEW_LINE> part_number = models.CharField() <NEW_LINE> manufacturer = models.ForeignKey('Manufacturer') <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return "%s %s" % (self.Manufacturer, sel... | Расходник: картриджи, бумага, тонер, ЗиПы, ремкомплекты и т.д. | 6259907d23849d37ff852b09 |
class FirewallPolicyNatRule(FirewallPolicyRule): <NEW_LINE> <INDENT> _validation = { 'rule_type': {'required': True}, 'priority': {'maximum': 65000, 'minimum': 100}, } <NEW_LINE> _attribute_map = { 'rule_type': {'key': 'ruleType', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'priority': {'key': 'priority', '... | Firewall Policy NAT Rule.
All required parameters must be populated in order to send to Azure.
:param rule_type: Required. The type of the rule.Constant filled by server. Possible values
include: "FirewallPolicyNatRule", "FirewallPolicyFilterRule".
:type rule_type: str or ~azure.mgmt.network.v2019_06_01.models.Fire... | 6259907d4f88993c371f124a |
class AssemblyMapper: <NEW_LINE> <INDENT> map_cache = dict() <NEW_LINE> def __init__(self, from_assembly='GRCh37', to_assembly='GRCh38', species='human'): <NEW_LINE> <INDENT> self.client = EnsemblClient() <NEW_LINE> self.assembly_map = self._fetch_mapping(from_assembly, to_assembly, species) <NEW_LINE> <DEDENT> def _fe... | Structure that optimizes the mapping between
diferent genome assemblies.
Example::
>>> mapper = AssemblyMapper(from_assembly='GRCh37'
... to_assembly='GRCh38')
>>> mapper.map(chrom='1', pos=1000000)
1064620
| 6259907da8370b77170f1e20 |
class ModifyCCThresholdPolicyRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.InstanceId = None <NEW_LINE> self.Ip = None <NEW_LINE> self.Domain = None <NEW_LINE> self.Protocol = None <NEW_LINE> self.Threshold = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> ... | ModifyCCThresholdPolicy请求参数结构体
| 6259907d32920d7e50bc7a92 |
class Sprite(object): <NEW_LINE> <INDENT> def __init__(self, file_path): <NEW_LINE> <INDENT> self.file_path = file_path <NEW_LINE> self.image = Image.open(file_path) <NEW_LINE> self.name = basename(file_path) <NEW_LINE> self.unrotated_source_size = self.image.size <NEW_LINE> self.position = (-1, -1) <NEW_LINE> self.rot... | A reference of a sprite, with all the information needed for the packing algorithm,
i.e. without any actual image data, just the size. | 6259907d4f6381625f19a1d6 |
class TestComposedBool(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_ComposedBool(self): <NEW_LINE> <INDENT> pass | ComposedBool unit test stubs | 6259907da8370b77170f1e21 |
class MoodiesUser: <NEW_LINE> <INDENT> def __init__(self, user_id): <NEW_LINE> <INDENT> self.user_id = user_id <NEW_LINE> self.moods_container = MoodsContainer() <NEW_LINE> self.top_mood = self.moods_container.moods['default'] <NEW_LINE> <DEDENT> def compute_top_mood(self): <NEW_LINE> <INDENT> self.top_mood = self.mood... | User class, store Mood per users in a MoodsContainer | 6259907d71ff763f4b5e91fe |
class ImageListView(OpenstackListView): <NEW_LINE> <INDENT> serializer_class = ImageSerializer <NEW_LINE> service = OpenstackService.Services.IMAGES | Image list view. | 6259907d66673b3332c31e50 |
class ConfirmationQuestion(Question): <NEW_LINE> <INDENT> def __init__(self, question, default=True, true_answer_regex="(?i)^y"): <NEW_LINE> <INDENT> super(ConfirmationQuestion, self).__init__(question, default) <NEW_LINE> self._true_answer_regex = true_answer_regex <NEW_LINE> self._normalizer = self._get_default_norma... | Represents a yes/no question. | 6259907d3617ad0b5ee07b9f |
class ChecklistIdentifier(ValidationTestCase): <NEW_LINE> <INDENT> def test_checklist_version(self): <NEW_LINE> <INDENT> for checklist in checklists: <NEW_LINE> <INDENT> self.assertIsInstance(checklist['identifier'], unicode, msg=checklist['source']) <NEW_LINE> <DEDENT> <DEDENT> def test_checklist_identifier(self): <NE... | Validate the checklist identifier in the downloaded checklists. | 6259907d97e22403b383c952 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.