code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class RouterStatusEntryV3(RouterStatusEntry): <NEW_LINE> <INDENT> def __init__(self, content, validate = True, document = None): <NEW_LINE> <INDENT> self.or_addresses = [] <NEW_LINE> self.digest = None <NEW_LINE> self.bandwidth = None <NEW_LINE> self.measured = None <NEW_LINE> self.is_unmeasured = False <NEW_LINE> self...
Information about an individual router stored within a version 3 network status document. :var list or_addresses: **\*** relay's OR addresses, this is a tuple listing of the form (address (**str**), port (**int**), is_ipv6 (**bool**)) :var str digest: **\*** router's upper-case hex digest :var int bandwidth: bandwi...
62598fb68a349b6b43686343
class FunctionOptionsDialogTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_buildForm(self): <NEW_LINE> <INDENT> myFunctionId...
Test the InaSAFE GUI for Configurable Impact Functions
62598fb644b2445a339b69f7
class DupCheckLoader(yaml.Loader): <NEW_LINE> <INDENT> pass
Local class to prevent pollution of global yaml.Loader.
62598fb69c8ee823130401f7
class Model(Validator): <NEW_LINE> <INDENT> def __init__(self, model): <NEW_LINE> <INDENT> self.model = model <NEW_LINE> <DEDENT> def validate(self, value): <NEW_LINE> <INDENT> if not value: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> if not isinstance(value, self.model): <NEW_LINE> <INDENT> raise InvalidModelFieldE...
Validate the field is a model
62598fb671ff763f4b5e787e
class TumorExtent(Outcome): <NEW_LINE> <INDENT> length = fields.IntField() <NEW_LINE> width = fields.IntField() <NEW_LINE> depth = fields.IntField()
The tumor 3D measurements in millimeters.
62598fb6627d3e7fe0e06fb8
class Hash: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def hash(block): <NEW_LINE> <INDENT> block_string = json.dumps(block, sort_keys=True).encode() <NEW_LINE> return hashlib.sha256(block_string).hexdigest()
Hashing Operations.
62598fb6236d856c2adc94c3
class ProxyDialog(ProxyWindow): <NEW_LINE> <INDENT> declaration = ForwardTyped(lambda: Dialog) <NEW_LINE> def exec_(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def done(self, result): <NEW_LINE> <INDENT> raise NotImplementedError
The abstract definition of a proxy Dialog object.
62598fb655399d3f0562661c
@compat.python_2_unicode_compatible <NEW_LINE> class BaseNgramModel(object): <NEW_LINE> <INDENT> def __init__(self, ngram_counter): <NEW_LINE> <INDENT> self.ngram_counter = ngram_counter <NEW_LINE> self.ngrams = ngram_counter.ngrams[ngram_counter.order] <NEW_LINE> self._ngrams = ngram_counter.ngrams <NEW_LINE> self._or...
An example of how to consume NgramCounter to create a language model. This class isn't intended to be used directly, folks should inherit from it when writing their own ngram models.
62598fb67cff6e4e811b5b28
class BadValue(ErrorResponse): <NEW_LINE> <INDENT> DEFAULT_MESSAGE = "Bad value" <NEW_LINE> def __init__(self, offending_oid, message=""): <NEW_LINE> <INDENT> super().__init__(3, offending_oid, message)
This error is returned whenever a variable is set using an incompatible type.
62598fb6a05bb46b3848a973
class PriorBox(object): <NEW_LINE> <INDENT> def __init__(self, input_size, feature_maps, cfg): <NEW_LINE> <INDENT> super(PriorBox, self).__init__() <NEW_LINE> self.imh = input_size[0] <NEW_LINE> self.imw = input_size[1] <NEW_LINE> self.variance = cfg.VARIANCE or [0.1] <NEW_LINE> self.num_priors = len(cfg.ASPECT_RATIOS)...
docstring for PriorBox
62598fb656b00c62f0fb29c1
class AddEditTaskForm(ModelForm): <NEW_LINE> <INDENT> def __init__(self, user, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> task_list = kwargs.get("initial").get("task_list") <NEW_LINE> members = task_list.group.user_set.all() <NEW_LINE> self.fields["assigned_to"].queryset = member...
The picklist showing the users to which a new task can be assigned must find other members of the group this TaskList is attached to.
62598fb6a17c0f6771d5c33e
class getRows_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT,(TRowResult, TRowResult.thrift_spec)), None, ), (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, success=None, io=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LIN...
Attributes: - success - io
62598fb67b180e01f3e490d5
class ListenerUpdateEnd(ListenerNotificationBase): <NEW_LINE> <INDENT> event_types = ['listener.update.end'] <NEW_LINE> def process_notification(self, message): <NEW_LINE> <INDENT> LOG.warn('Do action for event: %s, resource_id: %s', message['event_type'], message['payload']['listener']['id']) <NEW_LINE> quantity = int...
Handle the events that listener's connection_limit or admin_state_up be changed
62598fb68a43f66fc4bf2282
class ContextNotFound(EnvironmentError): <NEW_LINE> <INDENT> pass
Raised when bigip or Infra does not find a context for a given Object
62598fb6fff4ab517ebcd8ef
class Views(db.Model): <NEW_LINE> <INDENT> post_id = db.Column(db.Integer, db.ForeignKey('post.id'), primary_key=True) <NEW_LINE> view_total = db.Column(db.Integer) <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return f"Total views is('{self.view_total}')"
Post Views model
62598fb699cbb53fe6830fdf
class Webapp2Session(interfaces.BaseSession): <NEW_LINE> <INDENT> def __init__(self, handler, session=None, secret=None, cookie_name='webapp2authomatic', backend='memcache', config=None): <NEW_LINE> <INDENT> self.handler = handler <NEW_LINE> if session is None: <NEW_LINE> <INDENT> if not secret: <NEW_LINE> <INDENT> rai...
A simple wrapper for |webapp2|_ sessions. If you provide a session it wraps it and adds the :meth:`.save` method. If you don't provide a session it creates a new one but you must provide the :data:`.secret`. For more about |webapp2| sessions see: http://webapp-improved.appspot.com/api/webapp2_extras/sessions.html.
62598fb64a966d76dd5eefe0
class RSS(object): <NEW_LINE> <INDENT> def __init__(self, url='', referrer='http://yandex.ru'): <NEW_LINE> <INDENT> self.rssurl = url <NEW_LINE> self.rss = fp.parse(self.rssurl, referrer=referrer) <NEW_LINE> try: <NEW_LINE> <INDENT> self.status = self.rss.status <NEW_LINE> if self.status != 200: <NEW_LINE> <INDENT> log...
RSS related stuff is here
62598fb6ff9c53063f51a757
class LazyString(object): <NEW_LINE> <INDENT> __slots__ = ('_func', '_args') <NEW_LINE> def __init__(self, func, *args): <NEW_LINE> <INDENT> self._func = func <NEW_LINE> self._args = args <NEW_LINE> <DEDENT> value = property(lambda x: x._func(*x._args)) <NEW_LINE> def __contains__(self, key): <NEW_LINE> <INDENT> return...
Class for strings created by a function call. The proxy implementation attempts to be as complete as possible, so that the lazy objects should mostly work as expected, for example for sorting.
62598fb671ff763f4b5e7880
class MaxRetryLimit(MyError): <NEW_LINE> <INDENT> pass
If re-try count for requests reached
62598fb656ac1b37e63022f5
class DeleteLiveCallbackTemplateRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TemplateId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.TemplateId = params.get("TemplateId")
DeleteLiveCallbackTemplate请求参数结构体
62598fb6bd1bec0571e15147
class Teacher: <NEW_LINE> <INDENT> def __init__(self, tname, tclass): <NEW_LINE> <INDENT> self._tname = tname <NEW_LINE> self._tclass = tclass <NEW_LINE> if len(teacher_list)==0: <NEW_LINE> <INDENT> self._tid = 1 <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._tid = teacher_list[-1].get_tid()+1 <NEW_LINE> <DEDENT> ...
Teachers have a name and a class they are attached to.
62598fb6851cf427c66b83c0
class KuntzmannButcher6: <NEW_LINE> <INDENT> A = array([[5./36, 2./9 - sqrt(15.)/15., 5./36 - sqrt(15.)/30], [5./36 + sqrt(15.)/24, 2./9 , 5./36 - sqrt(15.)/24], [5./36 + sqrt(15.)/30, 2./9 + sqrt(15.)/15 , 5./36]]) <NEW_LINE> b = array([ 5./18, 4./9., 5./18]) <NEW_LI...
IRK, Gauss-Legendre based.
62598fb6956e5f7376df5702
class DummyDetectorRandomClass(DetectorBase): <NEW_LINE> <INDENT> DETECTOR_STATUS_IDLE, DETECTOR_STATUS_BUSY, DETECTOR_STATUS_PAUSED, DETECTOR_STATUS_STANDBY, DETECTOR_STATUS_FAULT, DETECTOR_STATUS_MONITORING = range(6); <NEW_LINE> def __init__(self, name, numberOfChannels=32): <NEW_LINE> <INDENT> self.setName(name); <...
A dummy detector that can returns many channels of Gaussian output with random parameters
62598fb60fa83653e46f4feb
class Projectile(object): <NEW_LINE> <INDENT> def __init__(self, mass): <NEW_LINE> <INDENT> self._mass = mass <NEW_LINE> self.pos = np.array([0.0, 0.0]) <NEW_LINE> self.speed = np.array([0.0, 0.0]) <NEW_LINE> <DEDENT> @property <NEW_LINE> def mass(self): <NEW_LINE> <INDENT> return self._mass <NEW_LINE> <DEDENT> def cop...
Defines a Projectile with mass m. Speed and position are set by default at zero 2-dim.
62598fb656ac1b37e63022f6
class AbstractConsumer(object): <NEW_LINE> <INDENT> def _unhandled_section(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def _unhandled(self, data): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __getattr__(self, attr): <NEW_LINE> <INDENT> if attr[:6] == 'start_' or attr[:4] == 'end_': <NEW_LINE> <INDENT> meth...
Base class for other Consumers. Derive Consumers from this class and implement appropriate methods for each event that you want to receive.
62598fb6a05bb46b3848a975
class CallTreeNode(object): <NEW_LINE> <INDENT> def __init__(self, percentage, function_name): <NEW_LINE> <INDENT> self.percentage = percentage <NEW_LINE> self.call_stack = [function_name] <NEW_LINE> self.children = [] <NEW_LINE> <DEDENT> def add_call(self, function_name): <NEW_LINE> <INDENT> self.call_stack.append(fun...
Representing a node in call-graph.
62598fb67b180e01f3e490d6
class ModelCommand(Command): <NEW_LINE> <INDENT> scaffold_name = "Model" <NEW_LINE> template = '/masonite/snippets/scaffold/model' <NEW_LINE> base_directory = 'app/' <NEW_LINE> def handle(self): <NEW_LINE> <INDENT> class_name = self.argument('name') <NEW_LINE> view = View(App()) <NEW_LINE> class_directory = '{}{}.py'.f...
Creates a model. model {name : Name of the model} {--m|migration : Create a migration for specified model} {--s|seed=? : Create a database seed}
62598fb6f548e778e596b6ae
class GroupRoom(BaseRoom): <NEW_LINE> <INDENT> users = models.ManyToManyField(get_user_model(), related_name='group_rooms', through='GroupChatUser', through_fields=('room', 'user','admin','silenced', 'active')) <NEW_LINE> expiry = models.DateTimeField(default=None, blank=True, null=True) <NEW_LINE> private = models.Bo...
GroupRoom extends Room REASONING FOR DUPLICATION: 1) Helps to distribute the data and decouple each chat application
62598fb65fc7496912d48300
class TaggitSelect2(TagSelect2): <NEW_LINE> <INDENT> def value_from_datadict(self, data, files, name): <NEW_LINE> <INDENT> value = super(TaggitSelect2, self).value_from_datadict(data, files, name) <NEW_LINE> if value and ',' not in value: <NEW_LINE> <INDENT> value = '%s,' % value <NEW_LINE> <DEDENT> return value <NEW_L...
Select2 tag widget for taggit's TagField.
62598fb62c8b7c6e89bd38ce
class _PriorityQueue(list): <NEW_LINE> <INDENT> def __init__(self, items): <NEW_LINE> <INDENT> for item in items: <NEW_LINE> <INDENT> self.enqueue(item) <NEW_LINE> <DEDENT> <DEDENT> def enqueue(self, item): <NEW_LINE> <INDENT> heapq.heappush(self, (item.priority(), item)) <NEW_LINE> <DEDENT> def deque(self): <NEW_LINE>...
PriorityQueue adds and removes items based on the provided priority
62598fb6e1aae11d1e7ce8a9
class WhereEnumerable(Enumerable): <NEW_LINE> <INDENT> def __init__(self, enumerable, predicate): <NEW_LINE> <INDENT> super(WhereEnumerable, self).__init__(enumerable) <NEW_LINE> self.predicate = predicate <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> for e in iter(self._iterable): <NEW_LINE> <INDENT> if ...
Class to hold state for filtering elements in a collection
62598fb657b8e32f525081a2
class Dog: <NEW_LINE> <INDENT> species = ["canius lupus"] <NEW_LINE> def __init__(self, n, c): <NEW_LINE> <INDENT> self.name = n <NEW_LINE> self.state = "sleeping" <NEW_LINE> self.color = c <NEW_LINE> <DEDENT> def command(self, x): <NEW_LINE> <INDENT> if x == self.name: <NEW_LINE> <INDENT> self.bark(2) <NEW_LINE> <DEDE...
Blueprint of a dog
62598fb6be383301e0253906
@tags_namespace.route("/") <NEW_LINE> class Tags(Resource): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.datastore = DefaultStore(model=TagModel, database=DATABASE) <NEW_LINE> <DEDENT> @tags_namespace.marshal_list_with(tag_representation)...
Resource representing tags collection.
62598fb63539df3088ecc3b7
class Address(EC2Object): <NEW_LINE> <INDENT> def __init__(self, connection=None, public_ip=None, instance_id=None): <NEW_LINE> <INDENT> EC2Object.__init__(self, connection) <NEW_LINE> self.connection = connection <NEW_LINE> self.public_ip = public_ip <NEW_LINE> self.instance_id = instance_id <NEW_LINE> self.domain = N...
Represents an EC2 Elastic IP Address :ivar public_ip: The Elastic IP address. :ivar instance_id: The instance the address is associated with (if any). :ivar domain: Indicates whether the address is a EC2 address or a VPC address (standard|vpc). :ivar allocation_id: The allocation ID for the address (VPC addresses only...
62598fb61f5feb6acb162d29
@ddt.ddt <NEW_LINE> class TestUserInfoApi(MobileAPITestCase, MobileAuthTestMixin): <NEW_LINE> <INDENT> REVERSE_INFO = {'name': 'user-info', 'params': ['api_version']} <NEW_LINE> @ddt.data(API_V05, API_V1) <NEW_LINE> def test_success(self, api_version): <NEW_LINE> <INDENT> self.login() <NEW_LINE> response = self.api_res...
Tests for /api/mobile/{api_version}/my_user_info
62598fb623849d37ff8511bd
class IdentifiableDataTypeAggregator(Rewriter): <NEW_LINE> <INDENT> @contract <NEW_LINE> def _rewrite_data_type(self, data_type: DataType, definitions: Dict) -> Tuple: <NEW_LINE> <INDENT> if isinstance(data_type, IdentifiableDataType): <NEW_LINE> <INDENT> definitions.setdefault('data', {}) <NEW_LINE> if data_type.name ...
Rewrites a JSON Schema's IdentifiableDataTypes.
62598fb6ec188e330fdf899a
class GasBC(sc.BC): <NEW_LINE> <INDENT> _ghostgeom_ = None <NEW_LINE> def __init__(self, **kw): <NEW_LINE> <INDENT> super(GasBC, self).__init__(**kw) <NEW_LINE> self.bcd = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def alg(self): <NEW_LINE> <INDENT> return self.svr.alg <NEW_LINE> <DEDENT> def init(self, **kw): <NEW_...
Base class for all boundary conditions of the gas solver.
62598fb610dbd63aa1c70cc1
class Abs(VbaLibraryFunc): <NEW_LINE> <INDENT> def eval(self, context, params=None): <NEW_LINE> <INDENT> if ((params is None) or (len(params) < 1)): <NEW_LINE> <INDENT> return "NULL" <NEW_LINE> <DEDENT> r = '' <NEW_LINE> try: <NEW_LINE> <INDENT> num = utils.int_convert(params[0]) <NEW_LINE> r = abs(num) <NEW_LINE> <DED...
Abs() math function.
62598fb6f548e778e596b6af
class UserSettingsHolder: <NEW_LINE> <INDENT> SETTINGS_MODULE = None <NEW_LINE> def __init__(self, default_settings): <NEW_LINE> <INDENT> self.__dict__['_deleted'] = set() <NEW_LINE> self.default_settings = default_settings <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> if not name.isupper() or na...
Holder for user configured settings.
62598fb6aad79263cf42e8de
class ServerException(Error): <NEW_LINE> <INDENT> pass
Indicates a problem handling the request.
62598fb6167d2b6e312b707e
@register <NEW_LINE> class CompoundMonitor(Monitor): <NEW_LINE> <INDENT> type = "compound" <NEW_LINE> def __init__(self, name, config_options): <NEW_LINE> <INDENT> Monitor.__init__(self, name, config_options) <NEW_LINE> self.monitors = Monitor.get_config_option( config_options, 'monitors', required_type='[str]', requir...
Combine (logical-and) multiple failures for emergency escalation. Check most recent proble of provided monitors, if all are fail, then report fail.
62598fb632920d7e50bc6159
class FreeboxFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): <NEW_LINE> <INDENT> VERSION = 1 <NEW_LINE> CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._host = None <NEW_LINE> self._port = None <NEW_LINE> <DEDENT> def _show_setup_form(self, user_inp...
Handle a config flow.
62598fb660cbc95b06364449
class GetPrepaysResponse(messages.Message): <NEW_LINE> <INDENT> ok = messages.BooleanField(1) <NEW_LINE> prepays = messages.MessageField(Prepay, 2, repeated=True) <NEW_LINE> error = messages.StringField(3)
Response to a location search ok: (Boolean) Bill search successful or failed prepays: (String) If search successful contains a list of prepay events (see class Prepay on messages.py) error: (String) If search failed, contains the reason, otherwise empty.
62598fb6236d856c2adc94c5
class ResNetUpSample(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_shape, block, layers, num_classes=1, **kwargs): <NEW_LINE> <INDENT> super(ResNetUpSample, self).__init__() <NEW_LINE> self.base = ResNet( input_shape, block, layers, num_classes=num_classes, **kwargs) <NEW_LINE> last_layer = [ obj for obj in ...
Upsampled variant of ResNet This is a simpler variant which does not rely on complex reconstruction methods, instead it employs a naive interpolation (nearest neighbor/bilinear) at the very end to recover the original size.
62598fb630bbd722464699ff
class seq_region: <NEW_LINE> <INDENT> def __init__(self, seq): <NEW_LINE> <INDENT> self.seq = seq <NEW_LINE> self.coords = [] <NEW_LINE> self.exon = [] <NEW_LINE> for i, char in enumerate(self.seq): <NEW_LINE> <INDENT> if char.isupper(): <NEW_LINE> <INDENT> self.coords.append(i) <NEW_LINE> self.exon.append(char) <NEW_L...
Class for each exon region
62598fb756b00c62f0fb29c5
class Address(BaseModel): <NEW_LINE> <INDENT> receiver_name = models.CharField(max_length=20, verbose_name="收件人") <NEW_LINE> receiver_mobile = models.CharField(max_length=11, verbose_name="联系电话") <NEW_LINE> detail_addr = models.CharField(max_length=256, verbose_name="详细地址") <NEW_LINE> zip_code = models.CharField(max_le...
地址模型类
62598fb73d592f4c4edbafcc
class LoginPage(BasePage): <NEW_LINE> <INDENT> username_loc=(By.NAME,'email') <NEW_LINE> password_loc=(By.NAME,'password') <NEW_LINE> sumbit_loc=(By.ID,'dologin') <NEW_LINE> turnright_button_loc=(By.ID,'nextTheme') <NEW_LINE> turnleft_button_loc=(By.ID,'prevTheme') <NEW_LINE> user_loc = (By.ID, 'spnUid') <NEW_LINE> '''...
============定位器============
62598fb78e7ae83300ee91ab
class CommandAPDURegister(CommandAPDU): <NEW_LINE> <INDENT> APDU_INS = const.U2F.REGISTER <NEW_LINE> APDU_RESPONSE = ResponseAPDURegister <NEW_LINE> def verify_request_data(self, *, untrusted_request_data): <NEW_LINE> <INDENT> assert len(untrusted_request_data ) == const.U2F_NONCE_SIZE + const.U2F_APPID_SIZE <NEW_LINE>...
U2F_REGISTER
62598fb7cc0a2c111447b118
class LFWTrainer(GRUTrainer): <NEW_LINE> <INDENT> def __init__(self, folder): <NEW_LINE> <INDENT> super(LFWTrainer, self).__init__() <NEW_LINE> self.folder = folder <NEW_LINE> self.env = neighbors.KNeighborsClassifier(3) <NEW_LINE> self.cv = StratifiedKFold(n_splits=3) <NEW_LINE> <DEDENT> def load_data(self, data_dir):...
Train on real data set (LFW)
62598fb744b2445a339b69f9
class RevokedNotSigning(DNSKEYError): <NEW_LINE> <INDENT> _abstract = False <NEW_LINE> description_template = "The key was revoked but was not found signing the RRset." <NEW_LINE> code = 'REVOKED_NOT_SIGNING'
>>> e = RevokedNotSigning() >>> e.description 'The key was revoked but was not found signing the RRset.'
62598fb7377c676e912f6df4
class _SequenceType(_BuiltinType): <NEW_LINE> <INDENT> def __init__(cls, name, bases, namespace): <NEW_LINE> <INDENT> super().__init__(name, bases, namespace) <NEW_LINE> cls._elem_type = None <NEW_LINE> cls._bases = bases <NEW_LINE> cls._namespace = namespace <NEW_LINE> <DEDENT> def __instancecheck__(cls, inst): <NEW_L...
A metaclass for containers with uniformly typed elements.
62598fb7a05bb46b3848a977
class CheckerForm(AlwaysChangedModelForm): <NEW_LINE> <INDENT> def __init__(self, **args): <NEW_LINE> <INDENT> super(CheckerForm, self).__init__(**args) <NEW_LINE> self.fields["_flags"].initial = "-Wall -static" <NEW_LINE> self.fields["_output_flags"].initial = "--main=%s" <NEW_LINE> self.fields["_file_pattern"].initia...
override default values for the model fields
62598fb74a966d76dd5eefe3
class BadPlugin(Exception): <NEW_LINE> <INDENT> pass
Invalid plugin exception
62598fb73d592f4c4edbafcd
class GymnasiumDeleteView(DeleteView): <NEW_LINE> <INDENT> model = Gymnasium <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> if True not in [request.user.is_superuser, request.user.is_staff]: <NEW_LINE> <INDENT> raise PermissionDenied <NEW_LINE> <DEDENT> return super().get(request, args, kwargs)...
Delete of a Gymnasium.
62598fb72ae34c7f260ab1e8
class IndexFileSHA1Writer(object): <NEW_LINE> <INDENT> __slots__ = ("f", "sha1") <NEW_LINE> def __init__(self, f: IO) -> None: <NEW_LINE> <INDENT> self.f = f <NEW_LINE> self.sha1 = make_sha(b"") <NEW_LINE> <DEDENT> def write(self, data: AnyStr) -> int: <NEW_LINE> <INDENT> self.sha1.update(data) <NEW_LINE> return self.f...
Wrapper around a file-like object that remembers the SHA1 of the data written to it. It will write a sha when the stream is closed or if the asked for explicitly using write_sha. Only useful to the indexfile :note: Based on the dulwich project
62598fb7a8370b77170f04ea
class Freespace: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._ranges = [] <NEW_LINE> <DEDENT> @property <NEW_LINE> def data(self): <NEW_LINE> <INDENT> return [[r.start, r.stop] for r in self._ranges] <NEW_LINE> <DEDENT> def _ranges_with(self, start, size): <NEW_LINE> <INDENT> merged_start = start <...
Represents a set of "free" locations in the file to be patched.
62598fb7cc40096d6161a25f
class Portfolio(object): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> @abstractmethod <NEW_LINE> def update_signal(self, event): <NEW_LINE> <INDENT> raise NotImplementedError("Should implement update_signal()") <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def update_fill(self, event): <NEW_LINE> <INDENT> ra...
The Portfolio class handles the positions and market value of all instruments at a resolution of a "bar", i.e. secondly, minutely, 5-min, 30-min, 60-min, or EOD.
62598fb7bf627c535bcb15ae
class VirtualNetworkPeeringListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[VirtualNetworkPeering]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(VirtualNetworkPeeringListResult,...
Response for ListSubnets API service call. Retrieves all subnets that belong to a virtual network. :param value: The peerings in a virtual network. :type value: list[~azure.mgmt.network.v2016_09_01.models.VirtualNetworkPeering] :param next_link: The URL to get the next set of results. :type next_link: str
62598fb730dc7b766599f959
class CompleteServiceJobByServiceJobIdResponse(__BaseDictObject): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> super().__init__(data) <NEW_LINE> if "errors" in data: <NEW_LINE> <INDENT> self.errors: ErrorList = self._get_value(ErrorList, "errors") <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self....
Response schema for CompleteServiceJobByServiceJobId operation.
62598fb767a9b606de5460dd
class _Cache(MutableMapping): <NEW_LINE> <INDENT> def __init__(self, registry, tags): <NEW_LINE> <INDENT> self._registry = registry <NEW_LINE> self._tags = tags <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> return self._registry[self._tags | set([key])] <NEW_LINE> <DEDENT> def __setitem__(self, ke...
The object returned by :func:`Bcfg2.Server.Cache.Cache` that presents a dict-like interface to the portion of the unified cache that uses the specified tags.
62598fb74527f215b58e9fe2
class CliAlarmShow(show.ShowOne): <NEW_LINE> <INDENT> def get_parser(self, prog_name): <NEW_LINE> <INDENT> return _add_name_to_parser( _add_id_to_parser( super(CliAlarmShow, self).get_parser(prog_name))) <NEW_LINE> <DEDENT> def take_action(self, parsed_args): <NEW_LINE> <INDENT> _check_name_and_id(parsed_args, 'query')...
Show an alarm
62598fb792d797404e388be9
class Ethertype(enum.Enum): <NEW_LINE> <INDENT> IPv4 = 4 <NEW_LINE> IPv6 = 6
A rule's ethertype
62598fb73346ee7daa3376ce
class SampleInput(unittest.TestCase): <NEW_LINE> <INDENT> def test_sample_input(self): <NEW_LINE> <INDENT> inputs = [] <NEW_LINE> inputs.append('42') <NEW_LINE> inputs.append('5') <NEW_LINE> inputs.append('END') <NEW_LINE> inputs = '\n'.join(inputs) + '\n' <NEW_LINE> outputs = [] <NEW_LINE> outputs.append('3') <NEW_LIN...
Problem statement sample inputs and outputs
62598fb7ec188e330fdf899c
class NamedTemporaryFile(io.BufferedIOBase): <NEW_LINE> <INDENT> def __init__(self, dir=None, suffix='.tmp', prefix='obspy-'): <NEW_LINE> <INDENT> fd, self.name = tempfile.mkstemp(dir=dir, prefix=prefix, suffix=suffix) <NEW_LINE> self._fileobj = os.fdopen(fd, 'w+b', 0) <NEW_LINE> <DEDENT> def read(self, *args, **kwargs...
Weak replacement for the Python's tempfile.TemporaryFile. This class is a replacement for :func:`tempfile.NamedTemporaryFile` but will work also with Windows 7/Vista's UAC. :type dir: str :param dir: If specified, the file will be created in that directory, otherwise the default directory for temporary files is u...
62598fb721bff66bcd722d74
class Manager(object): <NEW_LINE> <INDENT> model = Model <NEW_LINE> def __init__(self, datastore, model=None): <NEW_LINE> <INDENT> if model: <NEW_LINE> <INDENT> self.model = model <NEW_LINE> <DEDENT> self.datastore = ObjectDatastore(datastore, model=self.model) <NEW_LINE> <DEDENT> def key(self, key_or_name): <NEW_LINE>...
Simplified manager for model instances.
62598fb710dbd63aa1c70cc4
class SignalRKeys(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'primary_key': {'key': 'primaryKey', 'type': 'str'}, 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, 'primary_connection_string': {'key': 'primaryConnectionString', 'type': 'str'}, 'secondary_connection_string': {'key': 'seco...
A class represents the access keys of the resource. :param primary_key: The primary access key. :type primary_key: str :param secondary_key: The secondary access key. :type secondary_key: str :param primary_connection_string: Connection string constructed via the primaryKey. :type primary_connection_string: str :param...
62598fb7d486a94d0ba2c0da
class TestFranchisereferalincomeCreateObjectV1Request(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 testFranchisereferalincomeCreateObjectV1Request(self): <NEW_LINE> <INDENT> pass
FranchisereferalincomeCreateObjectV1Request unit test stubs
62598fb74527f215b58e9fe3
class MapboxQuery(MultipleResultsQuery): <NEW_LINE> <INDENT> provider = 'mapbox' <NEW_LINE> method = 'geocode' <NEW_LINE> _URL = u'https://api.mapbox.com/geocoding/v5/mapbox.places/{0}.json' <NEW_LINE> _RESULT_CLASS = MapboxResult <NEW_LINE> _KEY = mapbox_access_token <NEW_LINE> def _build_params(self, location, provid...
Mapbox Geocoding ================ The Mapbox Geocoding API lets you convert location text into geographic coordinates (1600 Pennsylvania Ave NW → -77.0366,38.8971). API Reference ------------- https://www.mapbox.com/developers/api/geocoding/ Get Mapbox Access Token ----------------------- https://www.mapbox.com/accou...
62598fb7fff4ab517ebcd8f4
class HTTPException(BaseException): <NEW_LINE> <INDENT> code = 'N/A' <NEW_LINE> def __init__(self, message=None, code=None): <NEW_LINE> <INDENT> super(HTTPException, self).__init__(message) <NEW_LINE> try: <NEW_LINE> <INDENT> self.error = jsonutils.loads(message) <NEW_LINE> if 'error' not in self.error: <NEW_LINE> <IND...
Base exception for all HTTP-derived exceptions.
62598fb77c178a314d78d5aa
class NoCsvError(RwrtrackException): <NEW_LINE> <INDENT> pass
Raised when there are no CSV files to migrate.
62598fb771ff763f4b5e7884
class IRCBot(SocketBot): <NEW_LINE> <INDENT> def __init__(self, host, port=6667, channel=None, nickname="ircbot", fullname="IRC Bot", *args, **kwargs): <NEW_LINE> <INDENT> super(IRCBot, self).__init__(host, port, *args, **kwargs) <NEW_LINE> if channel and not channel.startswith("#"): <NEW_LINE> <INDENT> channel = "#" +...
Internet Relay Chat bot. :param host: hostname or IP address :param port: port number :param channel: IRC channel :param nickname: bot's nickname :param fullname: bot's fullname :param disp: display all exchanged messages or not :param verbose: verbose mode or not :param prefix: prefix messages for dis...
62598fb756ac1b37e63022f9
class TestNodeStatusNvramNodeBattery(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 testNodeStatusNvramNodeBattery(self): <NEW_LINE> <INDENT> pass
NodeStatusNvramNodeBattery unit test stubs
62598fb756b00c62f0fb29c7
class NotificationStageName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> SHIPPED = "Shipped" <NEW_LINE> DELIVERED = "Delivered"
Name of the stage.
62598fb77047854f4633f4e3
class MediaRatios(object): <NEW_LINE> <INDENT> standard = 4.0 / 5.0, 90.0 / 47.0 <NEW_LINE> __device_ratios = [(3, 4), (2, 3), (5, 8), (3, 5), (9, 16), (10, 16), (40, 71)] <NEW_LINE> __aspect_ratios = [1.0 * x[0] / x[1] for x in __device_ratios] <NEW_LINE> reel = min(__aspect_ratios), max(__aspect_ratios)
Class holding valid aspect ratios (width: height) for media uploads.
62598fb78e7ae83300ee91ad
class SparseGPLVM(SparseGPRegression, GPLVM): <NEW_LINE> <INDENT> def __init__(self, Y, input_dim, kernel=None, init='PCA', num_inducing=10): <NEW_LINE> <INDENT> X = self.initialise_latent(init, input_dim, Y) <NEW_LINE> SparseGPRegression.__init__(self, X, Y, kernel=kernel, num_inducing=num_inducing) <NEW_LINE> <DEDENT...
Sparse Gaussian Process Latent Variable Model :param Y: observed data :type Y: np.ndarray :param input_dim: latent dimensionality :type input_dim: int :param init: initialisation method for the latent space :type init: 'PCA'|'random'
62598fb7851cf427c66b83c4
class AnalyticLineValidator(orm.TransientModel): <NEW_LINE> <INDENT> _name = 'analytic.line.validator' <NEW_LINE> def action_confirm(self, cr, uid, ids, context=None): <NEW_LINE> <INDENT> import pdb <NEW_LINE> pdb.set_trace() <NEW_LINE> aa_line_ids = context.get('active_ids', []) <NEW_LINE> return self.pool['account.an...
This wizard allows to change state for massive amount of analytic AnalyticLineValidator
62598fb7a05bb46b3848a979
class TicketFile(Base): <NEW_LINE> <INDENT> __tablename__ = 'tickets_files' <NEW_LINE> __table_args__ = ( Comment('File mappings to tickets'), Index('tickets_files_u_tfl', 'ticketid', 'fileid', unique=True), Index('tickets_files_i_fileid', 'fileid'), { 'mysql_engine': 'InnoDB', 'mysql_charset': 'utf8', 'info': ...
Many-to-many relationship object. Links tickets and files from VFS.
62598fb799cbb53fe6830fe4
class Order(Option): <NEW_LINE> <INDENT> __metaclass__ = OptionType <NEW_LINE> option = 'order' <NEW_LINE> requires = [] <NEW_LINE> excludes = [] <NEW_LINE> @classmethod <NEW_LINE> def default(cls): <NEW_LINE> <INDENT> return sympy.polys.orderings.lex <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def preprocess(cls, orde...
``order`` option to polynomial manipulation functions.
62598fb73d592f4c4edbafcf
class ClasseFonction(Fonction): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def init_types(cls): <NEW_LINE> <INDENT> cls.ajouter_types(cls.est_allume, "Objet") <NEW_LINE> cls.ajouter_types(cls.prototype_est_allume, "PrototypeObjet") <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def est_allume(objet): <NEW_LINE> <INDENT>...
Retourne vrai si est allumé.
62598fb73317a56b869be5d4
class InvalidBundleError(BundleError): <NEW_LINE> <INDENT> pass
Raised when the bundle (.xo) is not a valid packaged bundle
62598fb7adb09d7d5dc0a69c
class NonTerminalOp(Operation): <NEW_LINE> <INDENT> is_block_terminal = False <NEW_LINE> @property <NEW_LINE> def dwarfname(self): <NEW_LINE> <INDENT> return self.ast.tokens[0].text
Base class for all operations that don't terminate basic blocks.
62598fb77d847024c075c4ca
class Receipt(object): <NEW_LINE> <INDENT> _date_format = '%Y-%m-%d' <NEW_LINE> def __init__(self, vat, price, when): <NEW_LINE> <INDENT> self.vat = Vat(vat) <NEW_LINE> self.price = Price(price) <NEW_LINE> self.date = self._date_from_string(when) <NEW_LINE> self._pk = None <NEW_LINE> <DEDENT> def _date_from_string(self...
Receipt type.
62598fb7f548e778e596b6b3
class QAObject: <NEW_LINE> <INDENT> def __init__(self, start_idx, end_idx, name, synset): <NEW_LINE> <INDENT> self.start_idx = start_idx <NEW_LINE> self.end_idx = end_idx <NEW_LINE> self.name = name <NEW_LINE> self.synset = synset <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return str(self)
Question Answer Objects are localized in the image and refer to a part of the question text or the answer text. start_idx int end_idx int name string synset_name string synset_definition string
62598fb7498bea3a75a57c30
class Solution: <NEW_LINE> <INDENT> def twoSumClosest(self, nums, target): <NEW_LINE> <INDENT> diff = float('inf') <NEW_LINE> nums.sort() <NEW_LINE> left, right = 0, len(nums) - 1 <NEW_LINE> while left < right: <NEW_LINE> <INDENT> total = nums[left] + nums[right] <NEW_LINE> if total == target: <NEW_LINE> <INDENT> retur...
@param: nums: an integer array @param: target: An integer @return: the difference between the sum and the target
62598fb7236d856c2adc94c7
class GamificationPublisher(object): <NEW_LINE> <INDENT> def publish_event(self, event): <NEW_LINE> <INDENT> publish_event_to_gamma(params, event, settings.GAMMA_FIRST_SLEEP_INTERVAL)
Gamification publisher. Work with Gamma default storage to interact with storage backend.
62598fb79c8ee823130401fb
class NullBooleanSelectForm(forms.Form, BaseFormFieldPluginForm): <NEW_LINE> <INDENT> plugin_data_fields = [ ("label", ""), ("name", ""), ("help_text", ""), ("initial", ""), ("required", False) ] <NEW_LINE> label = forms.CharField( label=_("Label"), required=True, widget=forms.widgets.TextInput( attrs={'class': theme.f...
Form for ``NullBooleanSelectPlugin``.
62598fb7a17c0f6771d5c346
class Task(TimeStampedModel): <NEW_LINE> <INDENT> task_name = models.CharField(max_length=50) <NEW_LINE> task_description = models.TextField(max_length=3000, blank=True) <NEW_LINE> topic = models.ForeignKey(Topic, on_delete=models.CASCADE) <NEW_LINE> NOT_IMPORTANT = 0 <NEW_LINE> LESS_IMPORTANT = 1 <NEW_LINE> IMPORTANT ...
define model Task. Fremdschluessel: Topic: Topic Name: String (max=50) Beschreibung: String (max=3000) Wichtigkeit: String Due Date Erledigt Duration
62598fb71b99ca400228f5b8
class IActivityRecordRemovedEvent(IActivityRecordEvent): <NEW_LINE> <INDENT> pass
record removed
62598fb72ae34c7f260ab1ec
class UserTicketsApiView(APIView): <NEW_LINE> <INDENT> authentication_classes = (authentication.TokenAuthentication,) <NEW_LINE> permission_classes = (permissions.IsAuthenticated,) <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> tickets = Ticket.objects.filter(Q(reporter=request.user) | Q(assignee=request.user))...
get: Returns all the Tickets where user is a 'reporter' or 'assignee'.
62598fb75fcc89381b2661d4
class MTAPI: <NEW_LINE> <INDENT> def __init__(self, sock): <NEW_LINE> <INDENT> self.sock = sock <NEW_LINE> self.state = self.read_sof <NEW_LINE> <DEDENT> def read_sof(self): <NEW_LINE> <INDENT> byte = self.sock.read(1) <NEW_LINE> if len(byte) == 1 and byte[0] == 0xfe: <NEW_LINE> <INDENT> self.state = self.read_len <NEW...
State machine for managing serial comms reception from a device talking the MTAPI protocols.
62598fb776e4537e8c3ef6b6
class Describe(base.Command): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> parser.add_argument('id', help='The ID of the reference to be described.') <NEW_LINE> <DEDENT> @genomics_util.ReraiseHttpException <NEW_LINE> def Run(self, args): <NEW_LINE> <INDENT> apitools_client = self.c...
Returns details about a reference.
62598fb799fddb7c1ca62e73
class Menu(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=32) <NEW_LINE> url_type_choice = ((1,'alias'), (2,'abslute_url'),) <NEW_LINE> url_type = models.SmallIntegerField(choices=url_type_choice,default=2) <NEW_LINE> url_name = models.CharField(max_length=64) <NEW_LINE> def __str__(self): <NEW_L...
菜单
62598fb7adb09d7d5dc0a69e
class LogMessage(Base): <NEW_LINE> <INDENT> __tablename__ = 'log_once' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> md5sum = Column(String) <NEW_LINE> added = Column(DateTime, default=datetime.now()) <NEW_LINE> def __init__(self, md5sum): <NEW_LINE> <INDENT> self.md5sum = md5sum <NEW_LINE> <DEDENT> def ...
Declarative
62598fb7f9cc0f698b1c5354
class PackageAvailability(NotContainerizedMixin, OpenShiftCheck): <NEW_LINE> <INDENT> name = "package_availability" <NEW_LINE> tags = ["preflight"] <NEW_LINE> def run(self, tmp, task_vars): <NEW_LINE> <INDENT> rpm_prefix = get_var(task_vars, "openshift", "common", "service_type") <NEW_LINE> group_names = get_var(task_v...
Check that required RPM packages are available.
62598fb766673b3332c304df
class Driver(object): <NEW_LINE> <INDENT> def __init__(self, transport, protocol=None, *args, **kw): <NEW_LINE> <INDENT> self._transport = transport <NEW_LINE> self._protocol = protocol or protocol_module.IEC60488() <NEW_LINE> super(Driver, self).__init__(*args, **kw) <NEW_LINE> <DEDENT> def _write(self, cmd, *datas): ...
Base class of all instruments. The Driver class applies some *magic* to simplify the Command interaction. Read access on :class:`~.Command` attributes is redirected to the :class:`Command.query`, write access to the :class:`Command.write` member function. :param transport: The transport object. :param protocol: The p...
62598fb797e22403b383b016
class CampaignStatistics(object): <NEW_LINE> <INDENT> swagger_types = { 'bounce_rate': 'float', 'click_rate': 'float', 'num_recipients': 'int', 'open_rate': 'float' } <NEW_LINE> attribute_map = { 'bounce_rate': 'bounce_rate', 'click_rate': 'click_rate', 'num_recipients': 'num_recipients', 'open_rate': 'open_rate' } <NE...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598fb74527f215b58e9fe7
class Fmow(base_dataset.MutliEnvironmentImageDataset): <NEW_LINE> <INDENT> _ALL_ENVIRONMENTS = ['train', 'val_id', 'val_ood', 'test_id', 'test_ood'] <NEW_LINE> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return 'fmow' <NEW_LINE> <DEDENT> def get_builder(self, name): <NEW_LINE> <INDENT> return fmow_builder....
Data loader for FMoW.
62598fb7a219f33f346c6916
class Monster(LivingObject): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> LivingObject.__init__(self) <NEW_LINE> self.mDNA = random_beast() <NEW_LINE> self.parts = [] <NEW_LINE> self.rect = None <NEW_LINE> self.render() <NEW_LINE> <DEDENT> def render(self): <NEW_LINE> <INDENT> d = self.mDNA.d <NEW_LINE> ...
this is a monster.
62598fb757b8e32f525081a5
class NcbiDownload: <NEW_LINE> <INDENT> def __init__(self, ftp_path, outdir): <NEW_LINE> <INDENT> self.ftp_dir = ftp_path <NEW_LINE> self.outdir = outdir <NEW_LINE> self.gbff = None <NEW_LINE> self.checksum_file = self.outdir + '/md5checksums.txt' <NEW_LINE> <DEDENT> def unzip_gbff(self): <NEW_LINE> <INDENT> call(['gun...
Files related to an ncbi genome assembly
62598fb74f6381625f19954a
class GscData: <NEW_LINE> <INDENT> def __init__(self, service_gsc): <NEW_LINE> <INDENT> self.service_gsc = service_gsc <NEW_LINE> self._siteUrl = None <NEW_LINE> <DEDENT> def list_sites(self) -> pd.DataFrame: <NEW_LINE> <INDENT> tmp = self.service_gsc.sites().list().execute() <NEW_LINE> if tmp.get('siteEntry'): <NEW_LI...
Google Search Console reporter
62598fb756ac1b37e63022fe