code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class FileObjectAdapter(tink_bindings.PythonFileObjectAdapter): <NEW_LINE> <INDENT> def __init__(self, file_object: BinaryIO): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._file_object = file_object <NEW_LINE> <DEDENT> def write(self, data: bytes) -> int: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> written =... | Adapts a Python file object for use in C++. | 62598f9d60cbc95b06364128 |
class AirflowNetworkDistributionComponentLeak(DataObject): <NEW_LINE> <INDENT> _schema = {'extensible-fields': OrderedDict(), 'fields': OrderedDict([(u'name', {'name': u'Name', 'pyname': u'name', 'required-field': True, 'autosizable': False, 'autocalculatable': False, 'type': u'alpha'}), (u'air mass flow coefficient', ... | Corresponds to IDD object `AirflowNetwork:Distribution:Component:Leak`
This object defines the characteristics of a supply or return air leak. | 62598f9d7b25080760ed7281 |
class Toolbar_Videos_Izquierda(Gtk.Toolbar): <NEW_LINE> <INDENT> __gsignals__ = { "borrar": (GObject.SIGNAL_RUN_FIRST, GObject.TYPE_NONE, []), "mover_videos": (GObject.SIGNAL_RUN_FIRST, GObject.TYPE_NONE, [])} <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> Gtk.Toolbar.__init__(self) <NEW_LINE> self.insert(get_separ... | toolbar inferior izquierda para videos encontrados. | 62598f9d6e29344779b00437 |
class SingleValueFitnessFunction(FitnessFunction): <NEW_LINE> <INDENT> def __call__(self, individual): <NEW_LINE> <INDENT> self.eval_count += 1 <NEW_LINE> return individual.value | Fitness for single valued chromosomes
Fitness equals the chromosomes value. | 62598f9d009cb60464d01300 |
class DWalker: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def entries(fs_entry_params): <NEW_LINE> <INDENT> for rpath, dnames, fnames in os.walk(fs_entry_params.src_dir): <NEW_LINE> <INDENT> fs_entry_params.rpath = rpath <NEW_LINE> if fs_entry_params.skip_iteration: <NEW_LINE> <INDENT> continue <NEW_LINE> <DEDENT> fs... | Walks content of a directory, generating
a sequence of structured FS elements (FSEntry) | 62598f9da79ad16197769e3f |
class ExpectimaxAgent(MultiAgentSearchAgent): <NEW_LINE> <INDENT> def value(self, gameState, agentIndex, depth): <NEW_LINE> <INDENT> numAgents=gameState.getNumAgents() <NEW_LINE> if gameState.isWin() or gameState.isLose(): <NEW_LINE> <INDENT> v=self.evaluationFunction(gameState) <NEW_LINE> <DEDENT> elif agentIndex==(nu... | Your expectimax agent (question 4) | 62598f9d4f6381625f1993a9 |
class PascalProgram(object): <NEW_LINE> <INDENT> def __init__(self, file): <NEW_LINE> <INDENT> self._file = file <NEW_LINE> self._name = None <NEW_LINE> self._uses = None <NEW_LINE> self._block = None <NEW_LINE> self._code = dict() <NEW_LINE> self._meta_comment = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def code(s... | The model object to represent a pascal program:
Syntax for a program is:
program = "program", identifier, ";", [uses clause], block, "." ;
block = "begin", { statement }+(";"), "end" ; | 62598f9d56b00c62f0fb268c |
class AttackManager(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(AttackManager, self).__init__() <NEW_LINE> <DEDENT> def manage(self, event): <NEW_LINE> <INDENT> LOGGER.info('Managing event: %s' % event) | Manager for attack type events. | 62598f9d01c39578d7f12b59 |
class GRUCell(RNNCellBase): <NEW_LINE> <INDENT> def __init__(self, input_size, hidden_size, bias=True): <NEW_LINE> <INDENT> super(GRUCell, self).__init__() <NEW_LINE> self.input_size = input_size <NEW_LINE> self.hidden_size = hidden_size <NEW_LINE> self.bias = bias <NEW_LINE> self.weight_ih = Parameter(torch.Tensor(3*h... | A gated recurrent unit (GRU) cell
.. math::
\begin{array}{ll}
r = sigmoid(W_{ir} x + b_{ir} + W_{hr} h + b_{hr}) \\
i = sigmoid(W_{ii} x + b_{ii} + W_{hi} h + b_{hi}) \\
n = \tanh(W_{in} x + r * W_{hn} h) \\
h' = (1 - i) * n + i * h
\end{array}
Args:
input_size: The number of expected feat... | 62598f9d442bda511e95c237 |
class IRmiSiteLayer(IDefaultBrowserLayer): <NEW_LINE> <INDENT> pass | Marker interface that defines a browser layer. | 62598f9d3c8af77a43b67e2c |
class __Instance: <NEW_LINE> <INDENT> def __init__(self, arg=None): <NEW_LINE> <INDENT> self.val = arg | a sample instance w/ only one param, arg | 62598f9d090684286d5935c8 |
class MPLengthHypothesis: <NEW_LINE> <INDENT> RATING_THRESHOLD = 0.3 <NEW_LINE> def __init__(self, maximum_interesting_length=4): <NEW_LINE> <INDENT> self.maximum_interesting_length = maximum_interesting_length <NEW_LINE> <DEDENT> def update(self, meta_path: MetaPath, rating: float) -> None: <NEW_LINE> <INDENT> if rati... | A Hypothesis over a rating of meta-paths. It decides which meta-path will be sent to the oracle next.
This is just a simple example with a hypothesis, that the rating depends on the length of the meta-path and has a
cutoff at some length. | 62598f9d24f1403a926857a0 |
class AvroSerDeBase(ConfluentMessageSerializer): <NEW_LINE> <INDENT> def decode_message(self, message): <NEW_LINE> <INDENT> if message is None: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> if len(message) <= 5: <NEW_LINE> <INDENT> raise SerializerError("message is too small to decode") <NEW_LINE> <DEDENT> with C... | A subclass of MessageSerializer from Confluent's kafka-python,
adding schema to deserialized Avro messages. | 62598f9d4e4d5625663721ff |
class SceneBalloonComponent(Component): <NEW_LINE> <INDENT> def __init__(self,owner): <NEW_LINE> <INDENT> Component.__init__(self,owner) | Balloon component for scene | 62598f9dd268445f26639a71 |
class _Collection(SlotNode): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> def addChild(self, child): <NEW_LINE> <INDENT> if child.getName() != 'package': <NEW_LINE> <INDENT> raise UnknownElement(child) <NEW_LINE> <DEDENT> child.name = None <NEW_LINE> child.arch = None <NEW_LINE> child.version = None <NEW_LINE> child.r... | Represents a pkglist collection in updateinfo.xml. | 62598f9d004d5f362081eeeb |
class ArrayPool(OutputPool): <NEW_LINE> <INDENT> def _make_store_for(self, node): <NEW_LINE> <INDENT> if not self.has_context: <NEW_LINE> <INDENT> raise ValueError('ArrayPool has no context set') <NEW_LINE> <DEDENT> os.makedirs(self.path, exist_ok=True) <NEW_LINE> filename = os.path.join(self.path, node) <NEW_LINE> ret... | OutputPool that uses binary .npy files as default stores.
The default store medium for output data is a NumPy binary `.npy` file for NumPy
array data. You can however also add other types of stores as well.
Notes
-----
The default store is implemented in elfi.store.NpyStore that uses NpyArrays as stores.
The NpyArray... | 62598f9d3cc13d1c6d465548 |
class CreateFolderMixin: <NEW_LINE> <INDENT> def _process(self): <NEW_LINE> <INDENT> form = AttachmentFolderForm(obj=FormDefaults(is_always_visible=True), linked_object=self.object) <NEW_LINE> if form.validate_on_submit(): <NEW_LINE> <INDENT> folder = AttachmentFolder(object=self.object) <NEW_LINE> form.populate_obj(fo... | Create a new empty folder. | 62598f9dd7e4931a7ef3be75 |
class EntityTemplateTask(TypedDict, total=False): <NEW_LINE> <INDENT> complete: bool <NEW_LINE> description: str <NEW_LINE> external_id: str <NEW_LINE> owner_ids: List[ str ] | Request parameters for specifying how to pre-populate a task through a template. | 62598f9dd99f1b3c44d0548c |
class SearchableMixin: <NEW_LINE> <INDENT> __searchable__ = [] <NEW_LINE> @classmethod <NEW_LINE> def fulltext_query(cls, query_str, db_query): <NEW_LINE> <INDENT> query_str = '%{}%'.format(query_str) <NEW_LINE> condition = sqlalchemy.or_( *[getattr(cls, col).like(query_str) for col in cls.__searchable__] ) <NEW_LINE> ... | Mixin for models that support fulltext query | 62598f9d1f037a2d8b9e3ec3 |
class KongZhengmin_Classifier(nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_features, n_classes, return_sequence=False): <NEW_LINE> <INDENT> super(KongZhengmin_Classifier, self).__init__() <NEW_LINE> self.return_sequnce = return_sequence <NEW_LINE> self.module = nn.Sequential( nn.Linear(in_features=in_features,... | Classifier of the Kong Zhengmin model.
Parameters
----------
in_features: int
Number of features of the input tensors
n_classes: int
Number of classes to predict at the end of the network
return_sequence: bool, defaults=True
Parameter that controls wether the module returns the se... | 62598f9d8e71fb1e983bb892 |
class ComputeInstancesSetTagsRequest(_messages.Message): <NEW_LINE> <INDENT> instance = _messages.StringField(1, required=True) <NEW_LINE> project = _messages.StringField(2, required=True) <NEW_LINE> tags = _messages.MessageField('Tags', 3) <NEW_LINE> zone = _messages.StringField(4, required=True) | A ComputeInstancesSetTagsRequest object.
Fields:
instance: Name of the instance scoping this request.
project: Project ID for this request.
tags: A Tags resource to be passed as the request body.
zone: The name of the zone for this request. | 62598f9d498bea3a75a578fd |
class ProyectoForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Proyecto <NEW_LINE> exclude = ('macroproyecto',) <NEW_LINE> labels={ 'nombreProyecto': ("Nombre"), 'descripcionProyecto': ("Descripción"), 'm2PorProyecto': ("Metros Cuadrados"), } | Form definition for Proyecto. | 62598f9d7047854f4633f1bf |
class DihedralType(_ListItem, _ParameterType): <NEW_LINE> <INDENT> def __init__(self, phi_k, per, phase, scee=1.0, scnb=1.0, list=None): <NEW_LINE> <INDENT> _ParameterType.__init__(self) <NEW_LINE> self.phi_k = _strip_units(phi_k, u.kilocalories_per_mole) <NEW_LINE> self.per = per <NEW_LINE> self.phase = _strip_units(p... | A dihedral type with a set of dihedral parameters
Parameters
----------
phi_k : ``float``
The force constant in kcal/mol
per : ``int``
The dihedral periodicity
phase : ``float``
The dihedral phase in degrees
scee : ``float``
1-4 electrostatic scaling factor
scnb : ``float``
1-4 Lennard-Jones scalin... | 62598f9d097d151d1a2c0e04 |
class Cart(object): <NEW_LINE> <INDENT> openapi_types = { 'cart_id': 'str', 'cart_total': 'float', 'contact': 'ContactBaseExtraFull', 'products': 'list[Product]' } <NEW_LINE> attribute_map = { 'cart_id': 'cart_id', 'cart_total': 'cart_total', 'contact': 'contact', 'products': 'products' } <NEW_LINE> def __init__(self, ... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598f9d4527f215b58e9cc0 |
@python_2_unicode_compatible <NEW_LINE> class RegistrationProfile(models.Model): <NEW_LINE> <INDENT> ACTIVATED = "ALREADY_ACTIVATED" <NEW_LINE> user = models.ForeignKey(UserModelString(), unique=True, verbose_name=_('user')) <NEW_LINE> activation_key = models.CharField(_('activation key'), max_length=40) <NEW_LINE> obj... | A simple profile which stores an activation key for use during
user account registration.
Generally, you will not want to interact directly with instances
of this model; the provided manager includes methods
for creating and activating new accounts, as well as for cleaning
out accounts which have never been activated.
... | 62598f9d91f36d47f2230d8e |
class md4_mac: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.key = urandom(32) <NEW_LINE> <DEDENT> def tag(self, message): <NEW_LINE> <INDENT> s = md4() <NEW_LINE> return s.digest(self.key+message) <NEW_LINE> <DEDENT> def validate(self, message, tag): <NEW_LINE> <INDENT> return self.tag(message) == t... | keyed mac. appends randomly generated key to message and applies md4 hash
function | 62598f9d97e22403b383ace8 |
class DeleteInventoryItemsInputSet(InputSet): <NEW_LINE> <INDENT> def set_SKUs(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'SKUs', value) <NEW_LINE> <DEDENT> def set_AWSAccessKeyId(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'AWSAccessKeyId', value) <NEW_LINE> <DEDENT> def set_AWSMarketp... | An InputSet with methods appropriate for specifying the inputs to the DeleteInventoryItems
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 62598f9d3d592f4c4edbacab |
class DownloadDestructionReportView(UserPassesTestMixin, DetailView): <NEW_LINE> <INDENT> sendfile_options = None <NEW_LINE> model = DestructionReport <NEW_LINE> def test_func(self): <NEW_LINE> <INDENT> config = ArchiveConfig.get_solo() <NEW_LINE> if not config.destruction_report_downloadable: <NEW_LINE> <INDENT> retur... | Verify the permission required and send the filefield via sendfile.
:param permission_required: the permission required to view the file
:param model: the model class to look up the object
:param file_field: the name of the ``Filefield`` | 62598f9d07f4c71912baf228 |
class _form_field(object): <NEW_LINE> <INDENT> scope = None <NEW_LINE> registry = { SCOPE_USER: {}, SCOPE_GROUP: {} } <NEW_LINE> def __init__(self, field, backend=BACKEND_ALL): <NEW_LINE> <INDENT> assert self.scope <NEW_LINE> self.field = field <NEW_LINE> self.backend = backend <NEW_LINE> <DEDENT> def __call__(self, fa... | Abstract form field factory registry and decorator.
| 62598f9da79ad16197769e41 |
class GenshiMixin(object): <NEW_LINE> <INDENT> def render_template(self, filename, _method=None, **context): <NEW_LINE> <INDENT> request_context = dict(self.request.context) <NEW_LINE> request_context.update(context) <NEW_LINE> return render_template(filename, _method=_method, **request_context) <NEW_LINE> <DEDENT> def... | :class:`tipfy.RequestHandler` mixin that add ``render_template`` and
``render_response`` methods to a :class:`tipfy.RequestHandler`. It will
use the request context to render templates. | 62598f9d4f6381625f1993aa |
class PeerReviewInvitationReplyForm(forms.ModelForm): <NEW_LINE> <INDENT> def clean_accepted(self): <NEW_LINE> <INDENT> data = self.cleaned_data["accepted"] <NEW_LINE> if data is None: <NEW_LINE> <INDENT> raise forms.ValidationError("Please accept or decline the invitation") <NEW_LINE> <DEDENT> return data <NEW_LINE> <... | Processes a peer review invitation reply (accept / decline) from a candidate reviewer | 62598f9d435de62698e9bbd1 |
class ATLinkSchemaModifier(object): <NEW_LINE> <INDENT> adapts(IATLink) <NEW_LINE> implements(IOrderableSchemaExtender) <NEW_LINE> _fields = [ _StringExtensionField('obrirfinestra', required=False, searchable=True, widget=BooleanWidget( label='Open in a new window', label_msgid='upc.genweb.banners_label_Obrirennovafine... | Afegeix un check nou al contingut enllas | 62598f9d0a50d4780f7051b7 |
class EmployeeDetail(generics.RetrieveAPIView): <NEW_LINE> <INDENT> queryset = Employee.objects.all() <NEW_LINE> serializer_class = EmployeeSerializer | Вывод детальной информации одного сотрудника | 62598f9ddd821e528d6d8d12 |
class DummyStdout: <NEW_LINE> <INDENT> def write(self, _): <NEW_LINE> <INDENT> pass | Used to disable write to stdout
| 62598f9deab8aa0e5d30bb63 |
class NamedURL(object): <NEW_LINE> <INDENT> def __init__(self, name, *args, **kwargs): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.args = args <NEW_LINE> self.kwargs = kwargs <NEW_LINE> <DEDENT> def reverse_url(self): <NEW_LINE> <INDENT> return reverse(self.name, args=self.args, kwargs=self.kwargs) | Wrapper over named URLs to provide lazy reversion | 62598f9de5267d203ee6b6eb |
class Value: <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> return str(self) <NEW_LINE> <DEDENT> def bool_evaluate(self): <NEW_LINE> <INDENT> code = self.fetch_to_stack() <NEW_LINE> code += ['; Bool evaluation', '\tPOP R0', '\tCMP R0, 0', '\tMOVE SR, R0', '\tAND R0, 8, R0', '\tXOR R0, 8, R0', '\tSHR R0, 3,... | A value of an expression | 62598f9d99cbb53fe6830cb0 |
class OffensEval2019Task2Processor(DataProcessor): <NEW_LINE> <INDENT> def get_example_from_tensor_dict(self, tensor_dict): <NEW_LINE> <INDENT> return InputExample(tensor_dict['idx'].numpy(), tensor_dict['sentence'].numpy().decode('utf-8'), None, str(tensor_dict['label'].numpy())) <NEW_LINE> <DEDENT> def get_train_exam... | Processor for the OffensEval2019Task2 data set (My version). | 62598f9da8370b77170f01c1 |
class ContentContentRepresentation(object): <NEW_LINE> <INDENT> swagger_types = { 'name': 'str', 'path': 'str', 'validation_string': 'str' } <NEW_LINE> attribute_map = { 'name': 'name', 'path': 'path', 'validation_string': 'validationString' } <NEW_LINE> def __init__(self, name=None, path=None, validation_string=None):... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f9d56ac1b37e6301fc8 |
class ConvBN(nn.Module): <NEW_LINE> <INDENT> def __init__(self, ch_in, ch_out, kernel_size = 3, stride=1, padding=0): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.conv = nn.Conv2d(ch_in, ch_out, kernel_size=kernel_size, stride=stride, padding=padding, bias=False) <NEW_LINE> self.bn = nn.BatchNorm2d(ch_out, mo... | convolutional layer then batchnorm | 62598f9d63d6d428bbee2590 |
class ResultsCollection: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._list = list() <NEW_LINE> <DEDENT> def add_result(self, r): <NEW_LINE> <INDENT> self._list.append(r) <NEW_LINE> <DEDENT> def add_results(self, res): <NEW_LINE> <INDENT> for r in res: <NEW_LINE> <INDENT> self.add_result(r) <NEW_LIN... | Base class to handle detection results and IO of results | 62598f9d1f5feb6acb162a00 |
class MatchMplsTcIDL(object): <NEW_LINE> <INDENT> thrift_spec = (None, (1, TType.I32, 'sense', None, None), (2, TType.LIST, 'mplsTc', (TType.BYTE, None), None)) <NEW_LINE> def __init__(self, sense = None, mplsTc = None): <NEW_LINE> <INDENT> self.sense = sense <NEW_LINE> self.mplsTc = mplsTc <NEW_LINE> <DEDENT> def read... | MPLS Traffic Class match
Attributes:
- sense
- mplsTc | 62598f9d99cbb53fe6830cb1 |
class AccessRights(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> REGISTRY_READ = "RegistryRead" <NEW_LINE> REGISTRY_WRITE = "RegistryWrite" <NEW_LINE> SERVICE_CONNECT = "ServiceConnect" <NEW_LINE> DEVICE_CONNECT = "DeviceConnect" <NEW_LINE> REGISTRY_READ_REGISTRY_WRITE = "RegistryRead, Regist... | The permissions assigned to the shared access policy.
| 62598f9d656771135c489461 |
class Index(PostsCollection): <NEW_LINE> <INDENT> _path_template_key = 'index pages path template' <NEW_LINE> _template_file_key = 'index' <NEW_LINE> def __init__(self, page_number, posts, settings, newer_index_url=None, older_index_url=None): <NEW_LINE> <INDENT> super().__init__(posts=posts, settings=settings) <NEW_LI... | Index represents a blog index page
It has the following attributes:
page_number: 1 to len(index_pages)
newer_index_url: url to an index with more recent posts or None
older_index_url: url to an index with less recent posts or None
output_path: path the index should be written to (pa... | 62598f9d45492302aabfc2b6 |
class FakeAPIView(CrudAPIView): <NEW_LINE> <INDENT> model = FakeModel <NEW_LINE> url_lookup = "some_id" | Fake CrudAPI imoplementation for tests. | 62598f9d7047854f4633f1c1 |
class Section (object): <NEW_LINE> <INDENT> def __init__(self, key, dialog, app, label=u"", icon=None): <NEW_LINE> <INDENT> self.key = key <NEW_LINE> self.dialog = dialog <NEW_LINE> self.label = label <NEW_LINE> self.icon = icon <NEW_LINE> self.frame = gtk.Frame("") <NEW_LINE> self.frame.get_label_widget().set_text("<b... | A Section in the Options Dialog | 62598f9d097d151d1a2c0e06 |
class KNearestNeighbour: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def train(self, x, y): <NEW_LINE> <INDENT> self.x_train = x <NEW_LINE> self.y_train = y <NEW_LINE> <DEDENT> def predict(self, x, k=1, num_loops=0): <NEW_LINE> <INDENT> if num_loops == 0: <NEW_LINE> <INDENT> dis... | L2 distance | 62598f9d3539df3088ecc094 |
class BuildCoreHierarchyAction(BuildAction): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> if self.groupName: <NEW_LINE> <INDENT> grpNode = pm.group(name=self.groupName, em=True, p=self.rig) <NEW_LINE> for a in ('tx', 'ty', 'tz', 'rx', 'ry', 'rz', 'sx', 'sy', 'sz'): <NEW_LINE> <INDENT> grpNode.attr(a).setLocke... | Builds a core hierarchy of the rig.
This creates a group for one of the rig's main
features (usually ctls, joints, or meshes) and
parents the corresponding nodes. | 62598f9da219f33f346c65f8 |
class DynCodeHook(Hook): <NEW_LINE> <INDENT> def __init__(self, se_obj, emu_eng, cb, ctx=[]): <NEW_LINE> <INDENT> super(DynCodeHook, self).__init__(se_obj, emu_eng, cb) | This hook type is used to get a callback when dynamically created/copied code is executed
Currently, this will only fire once per dynamic code mapping. Could be useful for unpacking. | 62598f9d7cff6e4e811b5801 |
class get_results_metadata_result(object): <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.STRUCT, 'success', (ResultsMetadata, ResultsMetadata.thrift_spec), None, ), (1, TType.STRUCT, 'error', (QueryNotFoundException, QueryNotFoundException.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, success=None, error=None,... | Attributes:
- success
- error | 62598f9d4527f215b58e9cc2 |
class DerivedParameters(parametertools.SubParameters): <NEW_LINE> <INDENT> _PARCLASSES = (TOY, Seconds, NmbSubsteps, VQ) | Derived parameters of HydPy-L-Lake, indirectly defined by the user. | 62598f9d97e22403b383acea |
class Station(Producer): <NEW_LINE> <INDENT> key_schema = avro.load(f"{Path(__file__).parents[0]}/schemas/arrival_key.json") <NEW_LINE> value_schema = avro.load(f"{Path(__file__).parents[0]}/schemas/arrival_value.json") <NEW_LINE> def __init__(self, station_id, name, color, direction_a=None, direction_b=None): <NEW_LIN... | Defines a single station | 62598f9d57b8e32f5250800b |
class Loan: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.id = 0 <NEW_LINE> self.user_id = 0 <NEW_LINE> self.account_type = AccountType.INVALID <NEW_LINE> self.symbol = "" <NEW_LINE> self.currency = "" <NEW_LINE> self.loan_amount = 0.0 <NEW_LINE> self.loan_balance = 0.0 <NEW_LINE> self.interest_rate ... | The margin order information.
:member
id: The order id.
user_id: The user id.
account_type: The account type which created the loan order.
symbol: The symbol, like "btcusdt".
currency: The currency name.
loan_amount: The amount of the origin loan.
loan_balance: The amount of the loan left.
... | 62598f9d3d592f4c4edbacad |
class McgLogCombiner: <NEW_LINE> <INDENT> mcgLogAllName = "mcgLog_all.log" <NEW_LINE> def __init__(self, issueArchiveDir): <NEW_LINE> <INDENT> issueArchivePath = Path(issueArchiveDir) <NEW_LINE> if issueArchivePath.exists(): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> mcgLogAllPath = issueArchivePath / McgLogCombiner.... | classdocs | 62598f9d596a897236127a5a |
class WCV(NMEASentence): <NEW_LINE> <INDENT> fields = ( ("Velocity", "velocity"), ("Velocity Units", "vel_units"), ("Waypoint ID", "waypoint_id") ) | Waypoint Closure Velocity
| 62598f9d30bbd72246469866 |
class Records(object): <NEW_LINE> <INDENT> def __init__(self, rectype, rdataset): <NEW_LINE> <INDENT> self.type = rectype <NEW_LINE> self._rdataset = rdataset <NEW_LINE> <DEDENT> def add(self, item): <NEW_LINE> <INDENT> if self.type == 'MX': <NEW_LINE> <INDENT> assert type(item) == types.TupleType <NEW_LINE> assert len... | Represents the records associated with a name node.
Record items are common DNS types such as 'A', 'MX',
'NS', etc. | 62598f9d01c39578d7f12b5d |
class GyroSensor(Sensor): <NEW_LINE> <INDENT> SYSTEM_CLASS_NAME = Sensor.SYSTEM_CLASS_NAME <NEW_LINE> SYSTEM_DEVICE_NAME_CONVENTION = Sensor.SYSTEM_DEVICE_NAME_CONVENTION <NEW_LINE> MODE_GYRO_ANG = 'GYRO-ANG' <NEW_LINE> MODE_GYRO_RATE = 'GYRO-RATE' <NEW_LINE> MODE_GYRO_FAS = 'GYRO-FAS' <NEW_LINE> MODE_GYRO_G_A = 'GYRO-... | LEGO EV3 gyro sensor. | 62598f9d8e7ae83300ee8e7f |
class kstwobign_gen(rv_continuous): <NEW_LINE> <INDENT> def _cdf(self, x): <NEW_LINE> <INDENT> return 1.0 - sc.kolmogorov(x) <NEW_LINE> <DEDENT> def _sf(self, x): <NEW_LINE> <INDENT> return sc.kolmogorov(x) <NEW_LINE> <DEDENT> def _ppf(self, q): <NEW_LINE> <INDENT> return sc.kolmogi(1.0 - q) | Kolmogorov-Smirnov two-sided test for large N.
%(default)s | 62598f9dcb5e8a47e493c064 |
class SteelCommand(BaseCommand): <NEW_LINE> <INDENT> keyword = 'steel' <NEW_LINE> help = 'SteelScript commands' <NEW_LINE> submodule = 'steelscript.commands' <NEW_LINE> @property <NEW_LINE> def subcommands(self): <NEW_LINE> <INDENT> if not self._subcommands_loaded: <NEW_LINE> <INDENT> super(SteelCommand, self).subcomma... | The 'steel' command, top of all other commands. | 62598f9deab8aa0e5d30bb65 |
class TestNodeNetworkInterfaceProperties(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 testNodeNetworkInterfaceProperties(self): <NEW_LINE> <INDENT> pass | NodeNetworkInterfaceProperties unit test stubs | 62598f9d8da39b475be02fbe |
class CandidatePrometheus(object): <NEW_LINE> <INDENT> def __init__(self, push_gateaway, nodename, jobname = "Duty"): <NEW_LINE> <INDENT> self.push_gateaway = push_gateaway <NEW_LINE> self.registry = pc.CollectorRegistry() <NEW_LINE> self.nodename = nodename <NEW_LINE> self.jobname = jobname <NEW_LINE> self.heimdall_up... | Prometheus for candidates | 62598f9d24f1403a926857a2 |
class ModelTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.category_name = "Test" <NEW_LINE> self.category = Category(name=self.category_name) <NEW_LINE> <DEDENT> def test_model_can_create_a_category(self): <NEW_LINE> <INDENT> old_count = Category.objects.count() <NEW_LINE> self.catego... | This class defines the test suite for the Category model. | 62598f9d4e4d562566372203 |
class IPhotoFolder(Interface): <NEW_LINE> <INDENT> pass | Photo Folders store images and present a slideshow display
| 62598f9d30dc7b766599f62d |
class Meme(db.Model): <NEW_LINE> <INDENT> uid = db.StringProperty() <NEW_LINE> top = db.StringProperty() <NEW_LINE> bottom = db.StringProperty() <NEW_LINE> meme = db.BlobProperty(default=None) <NEW_LINE> thumb = db.BlobProperty(default=None) <NEW_LINE> meme_width = db.IntegerProperty <NEW_LINE> meme_height = db.Integer... | Finalized meem | 62598f9dd7e4931a7ef3be79 |
class RecoverAccount(db.Document): <NEW_LINE> <INDENT> user = db.ReferenceField('User') <NEW_LINE> requestIP = db.StringField(default="") <NEW_LINE> created = db.DateTimeField(default=datetime.utcnow()) | An object for recovering an account | 62598f9dd99f1b3c44d05490 |
class CmdGen(): <NEW_LINE> <INDENT> def __init__(self, cmd_prototype, dataset_name): <NEW_LINE> <INDENT> self.cmd_prototype = cmd_prototype <NEW_LINE> self.dname = dataset_name <NEW_LINE> self.dataset = get_dataset(dataset_name).get_index() <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> self.i = 0 <NEW_LIN... | command generator | 62598f9d1f5feb6acb162a02 |
class ResidualSeqTransducer(transducers.SeqTransducer, Serializable): <NEW_LINE> <INDENT> yaml_tag = '!ResidualSeqTransducer' <NEW_LINE> @events.register_xnmt_handler <NEW_LINE> @serializable_init <NEW_LINE> def __init__(self, child: transducers.SeqTransducer, input_dim: numbers.Integral, layer_norm: bool = False, drop... | A sequence transducer that wraps a :class:`xnmt.transducers.base.SeqTransducer` in an additive residual
connection, and optionally performs some variety of normalization.
Args:
child: the child transducer to wrap
layer_norm: whether to perform layer normalization
dropout: whether to apply residual dropout | 62598f9dfff4ab517ebcd5ce |
class ApplyTransforms(bpy.types.Operator): <NEW_LINE> <INDENT> bl_label = "Apply Transforms" <NEW_LINE> bl_idname = "object.apply_transforms" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> loc = BoolProperty(name="Location", default=False) <NEW_LINE> rot = BoolProperty(name="Rotation", default=True) <NEW_LINE>... | Click to apply transforms on selected objects. | 62598f9de76e3b2f99fd8817 |
class TaggedName(GenericTaggedItemBase, ReadPermissionMixin): <NEW_LINE> <INDENT> tag = models.ForeignKey(Tag, related_name="%(app_label)s_%(class)s_tags") | Tags to represent people names.
This class has been created to allow define restrictions on it. If had not been needed an only read view set
through the model this would not overwritten it. | 62598f9d097d151d1a2c0e08 |
class User(UserMixin, db.Model): <NEW_LINE> <INDENT> __tablename__ = 'users' <NEW_LINE> __table_args__ = {'mysql_engine': 'InnoDB'} <NEW_LINE> id = db.Column(db.String(11), doc='手机号码', primary_key=True) <NEW_LINE> password = db.Column(db.String(32), doc='密码', nullable=False) <NEW_LINE> payPassword = db.Column(db.String... | 用户 | 62598f9d498bea3a75a57902 |
class Filler: <NEW_LINE> <INDENT> chunksize = 1000 <NEW_LINE> def __init__(self, infile, sound, samplerate=None): <NEW_LINE> <INDENT> self.sound = sound <NEW_LINE> self.infile = infile <NEW_LINE> self.ratefilter = ratefilter.RateFilter() <NEW_LINE> self.samplerate = samplerate <NEW_LINE> self._write_cur = 0 <NEW_LINE> ... | buffer filler | 62598f9d3d592f4c4edbacaf |
class InlineAdminForm(DjangoInlineAdminForm, AdminForm): <NEW_LINE> <INDENT> def __init__(self, formset, form, fieldsets, prepopulated_fields, original, readonly_fields=None, model_admin=None): <NEW_LINE> <INDENT> self.formset = formset <NEW_LINE> self.model_admin = model_admin <NEW_LINE> self.original = original <NEW_... | A wrapper around an inline form for use in the admin system. | 62598f9da79ad16197769e45 |
class LoginPage(base.Page): <NEW_LINE> <INDENT> URL = environment.APP_URL <NEW_LINE> def __init__(self, driver): <NEW_LINE> <INDENT> super(LoginPage, self).__init__(driver) <NEW_LINE> self.button_login = base.Button(driver, locator.Login.BUTTON_LOGIN) <NEW_LINE> <DEDENT> def login(self): <NEW_LINE> <INDENT> self.button... | Login page model. | 62598f9d91af0d3eaad39bec |
class Player(): <NEW_LINE> <INDENT> def __init__(self, name, hand): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.hand = hand <NEW_LINE> <DEDENT> def play_card(self): <NEW_LINE> <INDENT> drawn_card = self.hand.remove_card() <NEW_LINE> print("{} has placed: {}".format(self.name,drawn_card)) <NEW_LINE> print('\n')... | This is the Player class, which takes in a name and an instance of a Hand
class object. The Payer can then play cards and check if they still have cards. | 62598f9d01c39578d7f12b5f |
class PhabricatorSource: <NEW_LINE> <INDENT> base_url: str <NEW_LINE> token: str <NEW_LINE> story_limit: int <NEW_LINE> def __init__(self, server, token, story_limit): <NEW_LINE> <INDENT> self.base_url = f"{server}/api" <NEW_LINE> self.token = token <NEW_LINE> self.story_limit = story_limit <NEW_LINE> <DEDENT> def _req... | Fetches feed information directly from the Phabricator API. | 62598f9d0c0af96317c56164 |
class JoinFinishForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Member <NEW_LINE> fields = ('image',) <NEW_LINE> <DEDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(JoinFinishForm, self).__init__(*args, **kwargs) <NEW_LINE> self.fields['image'].label = _("Upload a ... | Show avatar selection form | 62598f9db5575c28eb712bbe |
class MotionController(Protocol): <NEW_LINE> <INDENT> async def halt(self) -> None: <NEW_LINE> <INDENT> ... <NEW_LINE> <DEDENT> async def stop(self, home_after: bool = True) -> None: <NEW_LINE> <INDENT> ... <NEW_LINE> <DEDENT> async def reset(self) -> None: <NEW_LINE> <INDENT> ... <NEW_LINE> <DEDENT> async def home_z(s... | Protocol specifying fundamental motion controls. | 62598f9df7d966606f747dc9 |
class WindowedTextsAnalyzer(UsesDictionary): <NEW_LINE> <INDENT> def __init__(self, relevant_ids, dictionary): <NEW_LINE> <INDENT> super(WindowedTextsAnalyzer, self).__init__(relevant_ids, dictionary) <NEW_LINE> self._none_token = self._vocab_size <NEW_LINE> <DEDENT> def accumulate(self, texts, window_size): <NEW_LINE>... | Gather some stats about relevant terms of a corpus by iterating over windows of texts. | 62598f9d0a50d4780f7051bb |
class BaseSSHTransportDHGroupExchangeSHA1Tests( BaseSSHTransportDHGroupExchangeBaseCase, DHGroupExchangeSHA1Mixin, TransportTestCase): <NEW_LINE> <INDENT> pass | diffie-hellman-group-exchange-sha1 tests for TransportBase. | 62598f9d99cbb53fe6830cb4 |
class ParentPathError(Exception): <NEW_LINE> <INDENT> def __init__(self, path: str, parent_path: str, message: Optional[str] = None): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.sandbox_path = parent_path <NEW_LINE> self.message = message or f'{path} is not a part of {parent_path}' <NEW_LINE> super().__init__(... | ParentPathError class. | 62598f9d090684286d5935cb |
class TaskPool(BasePool): <NEW_LINE> <INDENT> Pool = Pool <NEW_LINE> requires_mediator = True <NEW_LINE> uses_semaphore = True <NEW_LINE> def on_start(self): <NEW_LINE> <INDENT> self._pool = self.Pool(processes=self.limit, initializer=process_initializer, **self.options) <NEW_LINE> self.on_apply = self._pool.apply_asyn... | Multiprocessing Pool implementation. | 62598f9d67a9b606de545dab |
class TestEmbeddedStruct(rdf_structs.RDFProtoStruct): <NEW_LINE> <INDENT> type_description = type_info.TypeDescriptorSet( rdf_structs.ProtoString(name="e_string_field", field_number=1), rdf_structs.ProtoDouble(name="e_double_field", field_number=2)) | Custom struct for testing schema generation. | 62598f9d656771135c489465 |
class State(Base): <NEW_LINE> <INDENT> __tablename__ = 'states' <NEW_LINE> id = Column(Integer, unique=True, primary_key=True, nullable=False) <NEW_LINE> name = Column(String(128), nullable=False) | Class of states table | 62598f9d097d151d1a2c0e0a |
class NotRespondingError(PJCError): <NEW_LINE> <INDENT> pass | Exception raised if the device does not appear to be responding; that is, it never sent back
a response to a sent command. | 62598f9e21a7993f00c65d65 |
class ParserVariable: <NEW_LINE> <INDENT> def __init__(self, s, rvalue): <NEW_LINE> <INDENT> self.className = None <NEW_LINE> self.methodName = None <NEW_LINE> self.value = None <NEW_LINE> self.comment = None <NEW_LINE> self.isCustomClass = False <NEW_LINE> if s is not None: <NEW_LINE> <INDENT> s = s.strip() <NEW_LINE>... | A ParserVariable instance holds information about a value.
Properties:
className -- The class of the value, if detected. If the type is
None, then className holds a string of the word 'None'.
However, if no type is detected, then className
actually is None. | 62598f9e7cff6e4e811b5805 |
class Encoder(nn.Module): <NEW_LINE> <INDENT> num_blocks: int <NEW_LINE> num_channels: int <NEW_LINE> bottlenecked_num_channels: int <NEW_LINE> downsampling_rates: Sequence[Tuple[int, int]] <NEW_LINE> precision: Optional[jax.lax.Precision] = None <NEW_LINE> def setup(self): <NEW_LINE> <INDENT> self._in_conv = blocks_li... | The Encoder of a VDVAE, mapping from images to latents. | 62598f9e8e7ae83300ee8e82 |
class Scheduler(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.events = list() <NEW_LINE> self.update = self.update_noprofile <NEW_LINE> self._profile = False <NEW_LINE> self.profile = False <NEW_LINE> self._profiler = cProfile.Profile() <NEW_LINE> self.error_handler = None <NEW_LINE> <DEDENT... | A scheduler for running functions. By default one is initilized
in bge.logic.scheduler, though others can easily be created.
Note that the scheduler has to be updated manually each frame. | 62598f9e38b623060ffa8e74 |
class MeanAbsoluteError(function_node.FunctionNode): <NEW_LINE> <INDENT> def __init__(self, ignore_nan=False): <NEW_LINE> <INDENT> self.ignore_nan = ignore_nan <NEW_LINE> <DEDENT> def check_type_forward(self, in_types): <NEW_LINE> <INDENT> type_check.expect(in_types.size() == 2) <NEW_LINE> type_check.expect( in_types[0... | Mean absolute error function. | 62598f9e60cbc95b06364130 |
class SPMError(EntropyException): <NEW_LINE> <INDENT> pass | Source Package Manager generic errors | 62598f9e4428ac0f6e65830d |
class NavigationDrawerException(Exception): <NEW_LINE> <INDENT> pass | Raised when add_widget or remove_widget called incorrectly on a
NavigationDrawer. | 62598f9e9c8ee8231304005f |
class BudgetYearAddTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> create_user() <NEW_LINE> systems = create_financial_code_systems() <NEW_LINE> self.valid_data = { "financial_code_system": systems[0].id, "date_start": "2017-04-01", "date_end": "2018-03-31", "short_name": "2017-2018", } <NEW_LI... | Tests for the add financial code group view | 62598f9e07f4c71912baf22e |
class Settings(dict): <NEW_LINE> <INDENT> app_id = None <NEW_LINE> settings_directory = None <NEW_LINE> settings_file = None <NEW_LINE> _settings_types = {} <NEW_LINE> _settings_defaults = {} <NEW_LINE> def __init__(self, app_id): <NEW_LINE> <INDENT> self.app_id = app_id <NEW_LINE> self.settings_directory = appdirs.use... | Provide interface for portable persistent user editable settings | 62598f9e498bea3a75a57904 |
class VideoDescriptor(VideoFields, RawDescriptor): <NEW_LINE> <INDENT> module_class = VideoModule <NEW_LINE> stores_state = True <NEW_LINE> template_dir_name = "video" | Descriptor for `VideoModule`. | 62598f9e01c39578d7f12b61 |
class InfoDownloader(Downloader): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Downloader.__init__(self) <NEW_LINE> <DEDENT> def cache_artist_info(self, artist): <NEW_LINE> <INDENT> if not get_network_available("DATA"): <NEW_LINE> <INDENT> self.emit("artist-info-changed", artist) <NEW_LINE> return <NEW_L... | Download info from the web | 62598f9ec432627299fa2dbc |
class covariance_test(two_sample_test): <NEW_LINE> <INDENT> required_capabilities = (ProducesSpikeTrains, ) <NEW_LINE> def generate_prediction(self, model, **kwargs): <NEW_LINE> <INDENT> covariances = self.get_prediction(model) <NEW_LINE> if covariances is None: <NEW_LINE> <INDENT> if kwargs: <NEW_LINE> <INDENT> self.p... | Test to compare the pairwise covariances of a set of neurons in a network.
The statistical testing method needs to be set in form of a
sciunit.Score as score_type.
Parameters (in dict params):
----------
binsize: quantity, None (default: 2*ms)
Size of bins used to calculate the correlation coefficients.
num_bins: ... | 62598f9e4f6381625f1993ad |
class RandomUserAgentMiddleware(UserAgentMiddleware): <NEW_LINE> <INDENT> def process_request(self, request, spider): <NEW_LINE> <INDENT> ua = random.choice(USER_AGENT_LIST) <NEW_LINE> request.headers.setdefault("User-Agent", ua) | 方法说明
随机指定一个user agent | 62598f9e8e7ae83300ee8e83 |
class InvalidTagException(Exception): <NEW_LINE> <INDENT> pass | * Raised if tag that isn't defined is found.
@exception .InvalidTagException | 62598f9ecb5e8a47e493c066 |
class PropertyExists(ResourceConflict): <NEW_LINE> <INDENT> pass | Raised when a property already exists. | 62598f9e090684286d5935cc |
class Sum(Stage): <NEW_LINE> <INDENT> def __init__(self, name, inputNames, numComponents, outputDim, defaultValue=0.0): <NEW_LINE> <INDENT> Stage.__init__( self, name=name, inputNames=inputNames, outputDim=outputDim, defaultValue=defaultValue) <NEW_LINE> self.numComponents = numComponents <NEW_LINE> <DEDENT> def forwar... | Stage summing first half of the input with second half. | 62598f9edd821e528d6d8d19 |
class Melon(object): <NEW_LINE> <INDENT> def __init__(self, melon_type, shape_rating, color_rating, harvested_from_field, harvested_by): <NEW_LINE> <INDENT> self.melon_type = melon_type <NEW_LINE> self.shape_rating = shape_rating <NEW_LINE> self.color_rating = color_rating <NEW_LINE> self.harvested_from_field = harvest... | A melon in a melon harvest. | 62598f9ed7e4931a7ef3be7d |
class Course(object): <NEW_LINE> <INDENT> name = "" <NEW_LINE> def getAssignmentsForCredit(self,credit): <NEW_LINE> <INDENT> assignments = [] <NEW_LINE> for a in self.assignments.keys(): <NEW_LINE> <INDENT> if self.assignments[a]==credit: <NEW_LINE> <INDENT> assignments.append(a) <NEW_LINE> <DEDENT> elif self.assignmen... | classdocs | 62598f9e1f5feb6acb162a06 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.