code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class string_unit(nonnumeric_unit): <NEW_LINE> <INDENT> def __init__(self, name, symbol): <NEW_LINE> <INDENT> nonnumeric_unit.__init__(self, name, symbol) <NEW_LINE> <DEDENT> def value_to_string(self, value): <NEW_LINE> <INDENT> return '' if value is None else value <NEW_LINE> <DEDENT> def is_valid_value(self, value): ... | String unit objects define quantities with a string value.
These have no physical meaning, but are needed for some
legacy codes. For example the path of a file. | 62598ef48da39b475be019fc |
class Repo: <NEW_LINE> <INDENT> def __init__(self, name: str, url: str) -> None: <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.url = url <NEW_LINE> <DEDENT> def is_name(self, name: str) -> bool: <NEW_LINE> <INDENT> return self.name is name <NEW_LINE> <DEDENT> def __repr__(self) -> str: <NEW_LINE> <INDENT> return... | represents an repo with:
- name
- url | 62598ef47c178a314d78bce6 |
class CustomField(ModelType): <NEW_LINE> <INDENT> def from_json(self, value): <NEW_LINE> <INDENT> return value['value'] <NEW_LINE> <DEDENT> def to_json(self, value): <NEW_LINE> <INDENT> return {'value': value} | Specifiy a custom field that defines its own serialization | 62598ef4283ffb24f3cf20f5 |
class Loginlog(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey("User", on_delete=models.CASCADE) <NEW_LINE> classify = models.IntegerField('分类1为登录,2为登出', default=1) <NEW_LINE> created = models.DateTimeField('登录登出时间', auto_now_add=True, ) <NEW_LINE> ip = models.CharField('ip地址', max_length=20, null=True) | 登录日志 | 62598ef4aad79263cf42d05c |
class okay: <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> return "okay" | Signifies an undefined value. | 62598ef430bbd72246468484 |
class BlankTransport(Transport): <NEW_LINE> <INDENT> def connect(self): <NEW_LINE> <INDENT> self.messages = [] <NEW_LINE> <DEDENT> def send(self, message): <NEW_LINE> <INDENT> self.messages.append(message) <NEW_LINE> reply = riemann_client.riemann_pb2.Msg() <NEW_LINE> reply.ok = True <NEW_LINE> return reply <NEW_LINE> ... | A transport that collects messages in a list, and has no connection
Used by ``--transport none``, which is useful for testing commands without
contacting a Riemann server. This is also used by the automated tests in
``riemann_client/tests/test_riemann_command.py``. | 62598ef4009cb60464cffd9e |
class QuantizedConnection(SimpleNamespace): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> object.__setattr__(self, "_attributes", set()) <NEW_LINE> <DEDENT> def __setattr__(self, name: str, value: typing.Union[DatasetRef, typing.List[DatasetRef]]): <NEW_LINE> <INDENT> self._attributes.add(name) ... | A Namespace to map defined variable names of connections to their
`lsst.daf.buter.DatasetRef`s
This class maps the names used to define a connection on a
PipelineTaskConnectionsClass to the corresponding
`lsst.daf.butler.DatasetRef`s provided by a `lsst.daf.butler.Quantum`
instance. This will be a quantum of executio... | 62598ef4a05bb46b384890c1 |
class GomokuRecordFile(models.Model): <NEW_LINE> <INDENT> profile = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) <NEW_LINE> game_record_file = models.FileField( default=None, null=True, blank=True, upload_to=gomoku_record_image_file_path ) <NEW_LINE> url = models.CharField(max_length=255, null=... | Class defining GomokuRecordFiles objects | 62598ef4460517430c430cd7 |
class GraphicsLineScene(QtWidgets.QGraphicsScene): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> super(GraphicsLineScene, self).__init__(parent) <NEW_LINE> self.view = parent <NEW_LINE> <DEDENT> def contextMenuEvent(self, event): <NEW_LINE> <INDENT> if event.reason() == event.Mouse and self.v... | class which holds the qgraphics scene widget about line graphs along with
its own methods | 62598ef4a219f33f346c507f |
class NoMeasurementsInTimePeriod(Exception): <NEW_LINE> <INDENT> pass | Raised when there are no measurements inside the requested time period | 62598ef4be7bc26dc925128a |
class TransformerEncoderLayer(nn.Module): <NEW_LINE> <INDENT> def __init__(self, args): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.embed_dim = args.encoder_embed_dim <NEW_LINE> self.self_attn = MultiheadAttention( self.embed_dim, args.encoder_attention_heads, dropout=args.attention_dropout, ) <NEW_LINE> sel... | Encoder layer block.
In the original paper each operation (multi-head attention or FFN) is
postprocessed with: `dropout -> add residual -> layernorm`. In the
tensor2tensor code they suggest that learning is more robust when
preprocessing each layer with layernorm and postprocessing with:
`dropout -> add residual`. We ... | 62598ef423849d37ff84f90b |
class Series(list): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> list.__init__(self) <NEW_LINE> self.indexes = [] <NEW_LINE> self.x = [] <NEW_LINE> self.y = [] <NEW_LINE> <DEDENT> def append(self, value): <NEW_LINE> <INDENT> list.append(self, value) <NEW_LINE> if value is not None: <NEW_LINE> <INDENT> se... | Series objects are lists that maintain indexes.
| 62598ef4a17c0f6771d5aaa4 |
class OptOutAlreadyExists(Exception): <NEW_LINE> <INDENT> pass | Raised when opt out already exists. | 62598ef456ac1b37e6300a3c |
class EnvironmentResource(TrackedResource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, 'sku': {'required': True}, 'kind': {'required': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'na... | An environment is a set of time-series data available for query, and is the top level Azure Time Series Insights resource.
You probably want to use the sub-classes and not this class directly. Known
sub-classes are: Gen1EnvironmentResource, Gen2EnvironmentResource.
Variables are only populated by the server, and will... | 62598ef45fcc89381b265550 |
class Base: <NEW_LINE> <INDENT> symbol = None <NEW_LINE> style = game.constants.STYLE_NORMAL <NEW_LINE> color = game.constants.COLOR_WK <NEW_LINE> isCollider = False <NEW_LINE> def __init__(self, uid, name, x=0, y=0, z=0): <NEW_LINE> <INDENT> super(Base, self).__init__() <NEW_LINE> self.uid = uid <NEW_LINE> self.name =... | This object implements all the common entities methods | 62598ef4d268445f26638fb7 |
class ValueIterationAgent(ValueEstimationAgent): <NEW_LINE> <INDENT> def __init__(self, mdp, discount = 0.9, iterations = 100): <NEW_LINE> <INDENT> self.mdp = mdp <NEW_LINE> self.discount = discount <NEW_LINE> self.iterations = iterations <NEW_LINE> self.values = util.Counter() <NEW_LINE> self.nextValues = util.Counter... | * Please read learningAgents.py before reading this.*
A ValueIterationAgent takes a Markov decision process
(see mdp.py) on initialization and runs value iteration
for a given number of iterations using the supplied
discount factor. | 62598ef4091ae35668703469 |
class MacroVariable(Header): <NEW_LINE> <INDENT> __slots__ = ('_name','_master') <NEW_LINE> def __init__(self, name, master): <NEW_LINE> <INDENT> if not isinstance(name, (str, DottedName)): <NEW_LINE> <INDENT> raise TypeError('name must be of type str or DottedName') <NEW_LINE> <DEDENT> if not isinstance(master, (str,... | . | 62598ef466673b3332c2ebfb |
class DemoExecutor(base_executor.BaseExecutor): <NEW_LINE> <INDENT> def Do(self, input_dict: Dict[Text, List[types.Artifact]], output_dict: Dict[Text, List[types.Artifact]], exec_properties: Dict[Text, Any]) -> None: <NEW_LINE> <INDENT> split_to_instance = {} | DemoExecutor for HelloComponent. | 62598ef48a349b6b43684a92 |
class Recruiter(models.Model): <NEW_LINE> <INDENT> recruiterid = models.AutoField(primary_key=True, verbose_name='编号') <NEW_LINE> name = models.CharField(max_length=255, verbose_name='名字') <NEW_LINE> tel = models.CharField(max_length=20, verbose_name='联系方式') <NEW_LINE> servstar = models.IntegerField(default=0, verbose_... | 招聘人 | 62598ef4bf627c535bcafcc1 |
class StorageDomainCache: <NEW_LINE> <INDENT> log = logging.getLogger('Storage.StorageDomainCache') <NEW_LINE> def __init__(self, storage_repo): <NEW_LINE> <INDENT> self._syncroot = threading.Lock() <NEW_LINE> self.__cache = {} <NEW_LINE> self.__weakCache = {} <NEW_LINE> self.storage_repo = storage_repo <NEW_LINE> self... | Storage Domain List keeps track of all the storage domains accessible by the
current system. | 62598ef4627d3e7fe0e056dc |
class FallbackIntentHandler(AbstractRequestHandler): <NEW_LINE> <INDENT> def can_handle(self, handler_input): <NEW_LINE> <INDENT> return ask_utils.is_intent_name("AMAZON.FallbackIntent")(handler_input) <NEW_LINE> <DEDENT> def handle(self, handler_input): <NEW_LINE> <INDENT> logger.info("In FallbackIntentHandler") <NEW_... | Handler for Fallback Intent | 62598ef47047854f4633dc18 |
class GoodsSerializers(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Goods <NEW_LINE> fields = '__all__' | 推荐商品序列化器 | 62598ef4283ffb24f3cf20f8 |
class GRUCell(RNNCell): <NEW_LINE> <INDENT> def __init__(self, num_units, input_size=None): <NEW_LINE> <INDENT> if input_size is not None: <NEW_LINE> <INDENT> logging.warn("%s: The input_size parameter is deprecated." % self) <NEW_LINE> <DEDENT> self._num_units = num_units <NEW_LINE> <DEDENT> @property <NEW_LINE> def s... | Gated Recurrent Unit cell (cf. http://arxiv.org/abs/1406.1078). | 62598ef4009cb60464cffda0 |
class PNGChecker(object): <NEW_LINE> <INDENT> categories = set(['image/png']) <NEW_LINE> def __init__(self, file_path, handle_style_error, filesystem=None, scm=None, platform=None): <NEW_LINE> <INDENT> self._file_path = file_path <NEW_LINE> self._handle_style_error = handle_style_error <NEW_LINE> self._fs = filesystem ... | Check svn:mime-type for checking style | 62598ef4f548e778e5969ddd |
class CustomourList(APIView): <NEW_LINE> <INDENT> def get(self, request, format=None): <NEW_LINE> <INDENT> custmour = Customer.objects.all() <NEW_LINE> serializer = CustomorSerializers(custmour, many=True) <NEW_LINE> return Response(serializer.data) <NEW_LINE> <DEDENT> def post(self, request, format=None): <NEW_LINE> <... | List all snippets, or create a new snippet. | 62598ef432920d7e50bc487d |
class Mail(BaseJsonEncodableObject): <NEW_LINE> <INDENT> def __init__(self, subject, body, sendstatus, afterstatus): <NEW_LINE> <INDENT> self.subject = subject <NEW_LINE> self.body = body <NEW_LINE> self.sendstatus = sendstatus <NEW_LINE> self.afterstatus = afterstatus <NEW_LINE> self.recipients = [] <NEW_LINE> <DEDENT... | A Mail that accepts recipients | 62598ef4a219f33f346c5080 |
class AvailableDelegationsOperations: <NEW_LINE> <INDENT> models = _models <NEW_LINE> def __init__(self, client, config, serializer, deserializer) -> None: <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._serialize = serializer <NEW_LINE> self._deserialize = deserializer <NEW_LINE> self._config = config <NEW_... | AvailableDelegationsOperations async operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2018_11_01.m... | 62598ef4851cf427c66b6b16 |
@final <NEW_LINE> class ClockSignal(Value): <NEW_LINE> <INDENT> def __init__(self, domain="sync", *, src_loc_at=0): <NEW_LINE> <INDENT> super().__init__(src_loc_at=src_loc_at) <NEW_LINE> if not isinstance(domain, str): <NEW_LINE> <INDENT> raise TypeError("Clock domain name must be a string, not {!r}".format(domain)) <N... | Clock signal for a clock domain.
Any ``ClockSignal`` is equivalent to ``cd.clk`` for a clock domain with the corresponding name.
All of these signals ultimately refer to the same signal, but they can be manipulated
independently of the clock domain, even before the clock domain is created.
Parameters
----------
domai... | 62598ef4956e5f7376df4aa1 |
class DeepTDTrainable(tune.Trainable): <NEW_LINE> <INDENT> def _setup(self, config: Dict): <NEW_LINE> <INDENT> self.experiment_cfg, self.agent_cfg = config['experiment_cfg'], config[ 'agent_cfg'] <NEW_LINE> env = gym.make(config['env_name']) <NEW_LINE> self.agent = Agent.build(type=config['agent'], env=env, params=self... | Abstract class for trainable models, functions, etc.
A call to ``train()`` on a trainable will execute one logical iteration of
training. As a rule of thumb, the execution time of one train call should
be large enough to avoid overheads (i.e. more than a few seconds), but
short enough to report progress periodically (... | 62598ef47d847024c075ac21 |
class SynapseCredentialsProvider(with_metaclass(ABCMeta)): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def _get_auth_info(self, syn, user_login_args): <NEW_LINE> <INDENT> return None, None, None <NEW_LINE> <DEDENT> def get_synapse_credentials(self, syn, user_login_args): <NEW_LINE> <INDENT> return self._create_synap... | A credential provider is responsible for retrieving synapse authentication information (e.g. username/password or
username/api key) from a source(e.g. login args, config file, cached credentials in keyring), and use them to return
a ``SynapseCredentials` instance. | 62598ef4d58c6744b42db6de |
@manual.builddict(tags=["python"]) <NEW_LINE> class PythonAntlrLibrary(PythonTarget): <NEW_LINE> <INDENT> def __init__(self, name, module, antlr_version='3.1.3', sources=None, resources=None, dependencies=None, exclusives=None): <NEW_LINE> <INDENT> def get_all_deps(): <NEW_LINE> <INDENT> all_deps = OrderedSet() <NEW_LI... | Generates a stub Python library from Antlr grammar files. | 62598ef43d592f4c4edb973e |
class BlobDetector: <NEW_LINE> <INDENT> def __init__(self, image, voxel_size, **kwargs): <NEW_LINE> <INDENT> image = np.asfarray(image) <NEW_LINE> self.image = color.rgb2gray(image) <NEW_LINE> self.image = dwi.util.flip_minmax(self.image) <NEW_LINE> self.voxel_size = voxel_size <NEW_LINE> self.set_kwargs(**kwargs) <NEW... | ... | 62598ef4aad79263cf42d05f |
class App(object): <NEW_LINE> <INDENT> _namespace = 'iron-app' <NEW_LINE> def __init__(self, app_name, **kwargs): <NEW_LINE> <INDENT> self._app = app_name <NEW_LINE> self._consul = Consul( host=kwargs.get('consul_host', None), port=kwargs.get('consul_port', None) ) <NEW_LINE> self.metrics = Metrics( app_name, host=kwar... | Iron-app protocol abstraction
See https://github.com/hivetech/iron-app | 62598ef47c178a314d78bcea |
class DisableAllReactionsWithLock(object): <NEW_LINE> <INDENT> __slots__ = ( '_lockID', ) <NEW_LINE> @property <NEW_LINE> def lockID(self): <NEW_LINE> <INDENT> return self._lockID <NEW_LINE> <DEDENT> @lockID.setter <NEW_LINE> def lockID(self, value): <NEW_LINE> <INDENT> self._lockID = msgbuffers.validate_string( 'Disab... | Generated message-passing message. | 62598ef44527f215b58e8751 |
class Test_Base(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.baseModel = BaseModel() <NEW_LINE> <DEDENT> def test_method(self): <NEW_LINE> <INDENT> self.assertTrue(hasattr(self.baseModel, "__init__")) <NEW_LINE> self.assertTrue(hasattr(self.baseModel, "save")) <NEW_LINE> self.assert... | test 1 | 62598ef4283ffb24f3cf20f9 |
class GroundDisconnector(ConductingEquipment): <NEW_LINE> <INDENT> def __init__(self, *args, **kw_args): <NEW_LINE> <INDENT> super(GroundDisconnector, self).__init__(*args, **kw_args) <NEW_LINE> <DEDENT> _attrs = [] <NEW_LINE> _attr_types = {} <NEW_LINE> _defaults = {} <NEW_LINE> _enums = {} <NEW_LINE> _refs = [] <NEW_... | A manually operated or motor operated mechanical switching device used for isolating a circuit or equipment from Ground.
| 62598ef4cc40096d61619601 |
class ScribeInMemoryFitness(ScribeInMemory): <NEW_LINE> <INDENT> def __init__(self, eng=None, period=10): <NEW_LINE> <INDENT> super(ScribeInMemoryFitness, self).__init__(eng, period) <NEW_LINE> self.fitness = [] <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> super(ScribeInMemoryFitness, self).reset() <NEW_LIN... | Stores fitness apart from best fitness - useful only for simulated annealing | 62598ef4e1aae11d1e7cdc6a |
class EmailTemplateViewSet(ViewSet): <NEW_LINE> <INDENT> permission_classes = (permissions.ApiAuthRequired,) <NEW_LINE> serializer_class = EmailTemplateSerializer <NEW_LINE> queryset = EmailTemplate.objects.all() <NEW_LINE> def list(self, request): <NEW_LINE> <INDENT> return self.retrieve(1) <NEW_LINE> <DEDENT> def ret... | API endpoint that allows scripts to be viewed or edited. | 62598ef43317a56b869bd98f |
class DirFullPaths(FullPaths): <NEW_LINE> <INDENT> pass | Class that gui uses to determine if you need to open a directory | 62598ef44a966d76dd5ed72e |
class IPAddress(object): <NEW_LINE> <INDENT> def __init__(self, address): <NEW_LINE> <INDENT> self.address = address <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> if type(self) is not type(other): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> return self.__dict__ == other.__dict__ <NEW_LINE> <... | An IP Address stores the level 3 information about a logical ethernet port.
The data can be ipv4 or ipv6. | 62598ef499fddb7c1ca6222d |
@dataclass <NEW_LINE> class P160HasTemporalProjection: <NEW_LINE> <INDENT> URI = "http://erlangen-crm.org/current/P160_has_temporal_projection" | Scope note:
This property describes the temporal projection of an instance of E92 Spacetime Volume. The property P4 has time-span is the same as P160 has temporal projection if it is used to document an instance of E4 Period or any subclass of it.
Example:
In First Order Logic:
P160(x,y) ⊃ E92(x)
P160(x,y)... | 62598ef4fff4ab517ebcc02a |
class PrivilegeItemMock(BaseItemMock): <NEW_LINE> <INDENT> def __init__(self, path, error=None): <NEW_LINE> <INDENT> BaseItemMock.__init__(self, path) <NEW_LINE> self.acl = AccessControlList() <NEW_LINE> self.acl.addDefaultPrincipal(SPECIAL_PRINCIPALS[0]) <NEW_LINE> if not self.parent is None: <NEW_LINE> <INDENT> self.... | Used to mock an item and its ACL. | 62598ef4796e427e5384cfec |
class VanillaView(controller.TemplateRenderer): <NEW_LINE> <INDENT> __filename = "error.html" <NEW_LINE> def get(self, template_filename): <NEW_LINE> <INDENT> self.__filename = template_filename <NEW_LINE> self.render() <NEW_LINE> <DEDENT> def get_template(self): <NEW_LINE> <INDENT> return self.__filename | Renders template files without any additional data or processing. | 62598ef4a8370b77170eec37 |
class AuthControlsCollection(object): <NEW_LINE> <INDENT> _endpoint = 'authcontrols' <NEW_LINE> def __init__(self, client): <NEW_LINE> <INDENT> self.client = client <NEW_LINE> self.collections = Collection(self.client, AuthControlResponse) <NEW_LINE> self.exempt_mids = AuthcontrolsExemptmidsCollection(self.client) <NEW... | Marqeta API 'authcontrols' endpoint list, create, find and update operations | 62598ef48e7ae83300ee78dd |
class WwfPipeline(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> engine = db_connect() <NEW_LINE> create_articles_table(engine) <NEW_LINE> self.Session = sessionmaker(bind=engine) <NEW_LINE> <DEDENT> def process_item(self, item, spider): <NEW_LINE> <INDENT> session = self.Session() <NEW_LINE> arti... | Working Waterfront pipeline for storing scraped items in the database | 62598ef44c34283577618b3a |
class Base(object): <NEW_LINE> <INDENT> interface.implements(IInfo) <NEW_LINE> def __init__(self, context): <NEW_LINE> <INDENT> self.context = context <NEW_LINE> self.keys = [] <NEW_LINE> self.ignore = [] <NEW_LINE> self.attributes = { "id": "getId", "uid": "UID", "title": "Title", "description": "Description", "create... | Base Adapter
| 62598ef4236d856c2adc8841 |
class GraphicControlBase(DbrTypeBase): <NEW_LINE> <INDENT> graphic_fields = ('upper_disp_limit', 'lower_disp_limit', 'upper_alarm_limit', 'upper_warning_limit', 'lower_warning_limit', 'lower_alarm_limit') <NEW_LINE> control_fields = ('upper_ctrl_limit', 'lower_ctrl_limit') <NEW_LINE> info_fields = ('status', 'severity'... | DBR_CTRL_* and DBR_GR_* base | 62598ef42c8b7c6e89bd2016 |
class StringFieldTest(object): <NEW_LINE> <INDENT> @pytest.mark.parametrize(("pos", "width"), [(0, 1), ((0, 4), 4)]) <NEW_LINE> def test_init(self, pos, width): <NEW_LINE> <INDENT> field = StringField(__name__, pos) <NEW_LINE> assert field.name == __name__ <NEW_LINE> assert field.pos == pos or field.pos == slice(*pos) ... | Unit testing for the StringField class.
| 62598ef466656f66f7d58c37 |
class FilesystemError(BundleError): <NEW_LINE> <INDENT> pass | Missing file, etc. | 62598ef43d592f4c4edb9740 |
class Discriminator(ABC): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def check(self, d: dict): <NEW_LINE> <INDENT> return | Base class for all discriminator. | 62598ef4d58c6744b42db6df |
class Body(object): <NEW_LINE> <INDENT> def __init__(self, shield=items.armour.Bare(), head=items.armour.Bare(), chest=items.armour.Bare(), legs=items.armour.Bare(), boots=items.armour.Bare()): <NEW_LINE> <INDENT> self.shield = shield <NEW_LINE> self.head = head <NEW_LINE> self.chest = chest <NEW_LINE> self.legs = legs... | represents body slots, defence items | 62598ef4f548e778e5969de0 |
class TickTestSuite(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.timestamp_now = Timestamp.now() <NEW_LINE> self.tick = Tick(OrderId(TraderId(b'0'), OrderNumber(1)), AssetPair(AssetAmount(30, 'BTC'), AssetAmount(30, 'MB')), Timeout(30), Timestamp(0.0), True) <NEW_LINE> self.tick2 = ... | This class contains tests for the Tick object. | 62598ef467a9b606de544822 |
class TestUMLS(_DataSetTestCase, unittest.TestCase): <NEW_LINE> <INDENT> exp_num_entities = 135 <NEW_LINE> exp_num_relations = 46 <NEW_LINE> dataset = UMLS() | Test the Nations dataset. | 62598ef421bff66bcd7214aa |
class ConfProfile(MSA_API): <NEW_LINE> <INDENT> def __init__(self, profile_id=None, name=None, externalReference=None, comment=None, vendor_id=None, model_id=None, microserviceUris=[], templateUris=[], attachedManagedEntities=[], customer_id=None): <NEW_LINE> <INDENT> MSA_API.__init__(self) <NEW_LINE> self.api_path = "... | Class ConfProfile. | 62598ef4d7e4931a7ef3a8f0 |
class VoucherGroup(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=100) <NEW_LINE> creator = models.ForeignKey(User, models.SET_NULL, blank=True, null=True) <NEW_LINE> creation_date = models.DateTimeField(auto_now_add=True) <NEW_LINE> position = models.PositiveSmallIntegerField(default=10) <NEW_LI... | Groups vouchers together.
| 62598ef466673b3332c2ebff |
class Italian(Network): <NEW_LINE> <INDENT> def __init__(self, ch_n, ch_f, ch_b): <NEW_LINE> <INDENT> super(Italian, self).__init__(ch_n, ch_f, ch_b) <NEW_LINE> self.name = 'ITA' <NEW_LINE> self.fullname = u'Italian' <NEW_LINE> self.num_nodes = len(self.get_nodes_2D_pos()) <NEW_LINE> self.num_links = len(... | Italian Network (NSFNET) | 62598ef44527f215b58e8754 |
class GitTreeViewSet(ReadOnlyModelViewSet): <NEW_LINE> <INDENT> queryset = GitTree.objects.select_related( 'subdomain__domain', ).prefetch_related( 'packages', 'licenses', 'role_set__user_set' ).order_by('gitpath') <NEW_LINE> serializer_class = GitTreeSerializer <NEW_LINE> lookup_field = 'gitpath' | View to the GitTrees provided by the API. | 62598ef4aad79263cf42d062 |
class EquipmentManagerBuildEquipmentCommandsInvertTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def helper(self, invert): <NEW_LINE> <INDENT> eq_dict = { 'mrid1': equipment.SwitchSinglePhase( name='switch1', mrid='mrid1', phase='A', controllable=True, state=1) } <NEW_LINE> eq_meas = pd.DataFrame([['mrid1', 'meas1']]... | Ensure build_equipment_commands acts appropriately depending on
the equipment's INVERT_STATES_FOR_COMMANDS attribute. | 62598ef42c8b7c6e89bd2017 |
class CodeBlock(Converter): <NEW_LINE> <INDENT> codeblock_parser = re.compile(r"\`\`\`(.*\n)?((?:[^\`]*\n*)+)\`\`\`") <NEW_LINE> inline_code_parser = re.compile(r"\`(.*\n*)\`") <NEW_LINE> async def convert(self, ctx: Context, codeblock: str) -> t.Tuple[t.Optional[str], str]: <NEW_LINE> <INDENT> codeblock_match = self.c... | Convert given wrapped string in codeblock into a tuple of language and the wrapped string | 62598ef45166f23b2e241c2e |
class PrintSelectionCommand(SublimePrint): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> settings = load_settings() <NEW_LINE> view = self.window.active_view() <NEW_LINE> if view.file_name(): <NEW_LINE> <INDENT> title = os.path.basename(view.file_name()) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> title = "*... | This command prints the current selection. If there are multiple
selections, they will all be printed with a separator line between them. | 62598ef43d592f4c4edb9741 |
class TestBaseModel_save(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> os.rename("file.json", "tmp") <NEW_LINE> <DEDENT> except IOError: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> <DEDENT> @classmethod <NEW_LINE> def tearDown(self): <NEW_... | Unittests for testing save method of the BaseModel class. | 62598ef4f548e778e5969de1 |
class SHA256PasswordHasher(BasePasswordHasher): <NEW_LINE> <INDENT> algorithm = "sha256" <NEW_LINE> def encode(self, password, salt): <NEW_LINE> <INDENT> assert password <NEW_LINE> assert salt and '$' not in salt <NEW_LINE> hash = hashlib.sha256(salt + password).hexdigest() <NEW_LINE> return "%s$%s$%s" % (self.algorith... | The SHA256 password hashing algorithm. | 62598ef416aa5153ce3fed56 |
class Error(Finish): <NEW_LINE> <INDENT> def __init__(self, obj): <NEW_LINE> <INDENT> Finish.__init__(self, [['*error',str(obj)]]) | Error Event, thrown if there was an not to be
ignored error in the command line. | 62598ef47b180e01f3e48470 |
class Data52(object): <NEW_LINE> <INDENT> swagger_types = { 'name': 'str', 'slug': 'str' } <NEW_LINE> attribute_map = { 'name': 'name', 'slug': 'slug' } <NEW_LINE> def __init__(self, name=None, slug=None): <NEW_LINE> <INDENT> self._name = None <NEW_LINE> self._slug = None <NEW_LINE> self.name = name <NEW_LINE> self.slu... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598ef432920d7e50bc4882 |
class LessEqual(Directive): <NEW_LINE> <INDENT> u <NEW_LINE> def run(self, value1, value2): <NEW_LINE> <INDENT> return value1 <= value2 | Directive ``lessequal`` compares if a value1 is less of equals to value2. | 62598ef463b5f9789fe839b4 |
class AnnotatedChallenge(jose.ImmutableMap): <NEW_LINE> <INDENT> __slots__ = ('challb',) <NEW_LINE> acme_type = NotImplemented <NEW_LINE> def __getattr__(self, name): <NEW_LINE> <INDENT> return getattr(self.challb, name) | Client annotated challenge.
Wraps around server provided challenge and annotates with data
useful for the client.
:ivar challb: Wrapped `~.ChallengeBody`. | 62598ef4a8370b77170eec39 |
class StorageProfile(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'image_reference': {'key': 'imageReference', 'type': 'ImageReference'}, 'os_disk': {'key': 'osDisk', 'type': 'OSDisk'}, 'data_disks': {'key': 'dataDisks', 'type': '[DataDisk]'}, } <NEW_LINE> def __init__( self, *, image_reference: ... | Specifies the storage settings for the virtual machine disks.
:ivar image_reference: Specifies information about the image to use. You can specify
information about platform images, marketplace images, or virtual machine images. This element
is required when you want to use a platform image, marketplace image, or vi... | 62598ef4167d2b6e312b57ef |
class SetCurrentScene(Baserequests): <NEW_LINE> <INDENT> def __init__(self, scene_name): <NEW_LINE> <INDENT> Baserequests.__init__(self) <NEW_LINE> self.name = 'SetCurrentScene' <NEW_LINE> self.dataout['scene-name'] = scene_name | Switch to the specified scene.
:Arguments:
*scene_name*
type: String
Name of the scene to switch to. | 62598ef48e7ae83300ee78df |
class TopicType(ConditionType): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(TopicType, self).__init__('topic') <NEW_LINE> <DEDENT> def get(self, agentml, user=None, key=None): <NEW_LINE> <INDENT> user = agentml.get_user(key) if key else user <NEW_LINE> if not user: <NEW_LINE> <INDENT> return <NEW_... | Topic condition type | 62598ef492d797404e387fa6 |
class TestETag(object): <NEW_LINE> <INDENT> @pytest.fixture() <NEW_LINE> def sess(self, server): <NEW_LINE> <INDENT> self.etag_url = urljoin(server.application_url, '/etag') <NEW_LINE> self.update_etag_url = urljoin(server.application_url, '/update_etag') <NEW_LINE> self.cache = DictCache() <NEW_LINE> sess = CacheContr... | Test our equal priority caching with ETags
Equal Priority Caching is a term I've defined to describe when
ETags are cached orthgonally from Time Based Caching. | 62598ef4498bea3a75a56389 |
class DeferredSetApp(object): <NEW_LINE> <INDENT> def __call__(self, environ, start_response): <NEW_LINE> <INDENT> req = Request(environ) <NEW_LINE> sess = req.environ['gimlet.session'] <NEW_LINE> def do_stuff(): <NEW_LINE> <INDENT> for ii in range(5): <NEW_LINE> <INDENT> yield "%d\n" % ii <NEW_LINE> <DEDENT> sess.set(... | This is a sample app which tries to set a session key AFTER returning the
WSGI response, by returning a generator, and setting a key when the
generator is consumed. This should fail with a ValueError. | 62598ef466656f66f7d58c39 |
class ThroughputSettingsGetResults(ARMResourceProperties): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'st... | An Azure Cosmos DB resource throughput.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype t... | 62598ef4f9cc0f698b1c46fa |
class NoHistoryKept(AdviserException): <NEW_LINE> <INDENT> pass | Raised if a user asks for history, but history was not kept (e.g. temperature function history in annealing). | 62598ef4d486a94d0ba2a81e |
class New_WeightedCrossEntropyLoss(nn.Module): <NEW_LINE> <INDENT> def __init__(self, ignore_index=-1): <NEW_LINE> <INDENT> super(New_WeightedCrossEntropyLoss, self).__init__() <NEW_LINE> self.ignore_index = ignore_index <NEW_LINE> <DEDENT> def forward(self, input, target): <NEW_LINE> <INDENT> loss = [] <NEW_LINE> for ... | WeightedCrossEntropyLoss (WCE) as described in https://arxiv.org/pdf/1707.03237.pdf
| 62598ef421bff66bcd7214ac |
class Advisory(models.Model): <NEW_LINE> <INDENT> number = models.IntegerField('Número de asesoría') <NEW_LINE> description = models.TextField('Descripción') <NEW_LINE> date = models.DateTimeField(auto_now_add=True) <NEW_LINE> master = models.ForeignKey(Master, verbose_name='Otorgada por', related_name='Advisories') <N... | Cada categoría cuenta debería contar con varias subcategorías y estás a su vez sólo deben estar disponibles en los idiomas a los que se le asocie. | 62598ef401c39578d7f115f9 |
class AutocapField(QtWidgets.QLineEdit): <NEW_LINE> <INDENT> def __init__(self, placeholder_text): <NEW_LINE> <INDENT> super(AutocapField, self).__init__(placeholder_text) <NEW_LINE> self.setText("") <NEW_LINE> self.setPlaceholderText(placeholder_text) <NEW_LINE> self.textChanged.connect(self.autocapitalize) <NEW_LINE>... | A QLineEdit that autocapitalizes input and has completers. | 62598ef4d268445f26638fba |
class ImapFolderSyncStatus(MailSyncBase): <NEW_LINE> <INDENT> account_id = Column(ForeignKey(ImapAccount.id, ondelete='CASCADE'), nullable=False) <NEW_LINE> account = relationship(ImapAccount, backref=backref( 'foldersyncstatuses', primaryjoin='and_(' 'ImapFolderSyncStatus.account_id == ImapAccount.id, ' 'ImapFolderSyn... | Per-folder status state saving for IMAP folders. | 62598ef4442bda511e95acb9 |
class AdministeredOrgsPrefetcher(lists.Prefetcher): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.org_dict = dict((org.key, org) for org in data.org_admin_for) <NEW_LINE> <DEDENT> def prefetch(self, entities): <NEW_LINE> <INDENT> return [self.org_dict], {} | A simple lists.Prefetcher implementation which prefetches organizations
for which the current user is an administrator.
It is used in case the component is created for organization administrator.
Only memebers belonging to one of his or her organizations will be listed.
Therefore, organization entities, which have alr... | 62598ef463d6d428bbee1025 |
@python_2_unicode_compatible <NEW_LINE> class Bootstrap3CarouselSlideFolderPlugin(CMSPlugin): <NEW_LINE> <INDENT> folder = filer.fields.folder.FilerFolderField( verbose_name=_('Folder'), ) <NEW_LINE> classes = model_fields.Classes() <NEW_LINE> cmsplugin_ptr = model_fields.CMSPluginField() <NEW_LINE> def __str__(self): ... | JavaScript - Carousel: "Slide folder" Model
http://getbootstrap.com/javascript/#carousel | 62598ef4cc0a2c1114479856 |
class MelissaHumiditySensor(MelissaSensor): <NEW_LINE> <INDENT> _type = 'humidity' <NEW_LINE> _unit = '%' <NEW_LINE> @property <NEW_LINE> def unit_of_measurement(self): <NEW_LINE> <INDENT> return self._unit <NEW_LINE> <DEDENT> def update(self): <NEW_LINE> <INDENT> super().update() <NEW_LINE> try: <NEW_LINE> <INDENT> se... | Representation of a Melissa humidity Sensor. | 62598ef460cbc95b06362b8c |
class ItemSearch(osid_searches.OsidSearch): <NEW_LINE> <INDENT> def search_among_items(self, item_ids): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def order_item_results(self, item_search_order): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def get_item_search_record(self, item_search_record_type): <NEW_LINE> <INDENT... | ``ItemSearch`` defines the interface for specifying item search options. | 62598ef44a966d76dd5ed731 |
class checksum(service.service): <NEW_LINE> <INDENT> pass | Calculate checksum
| 62598ef4bf627c535bcafcc7 |
class PostViewSet(ModelViewSet): <NEW_LINE> <INDENT> serializer_class = PostSerializers <NEW_LINE> pagination_class = ResultPagination <NEW_LINE> queryset = Post.objects.all() <NEW_LINE> permission_classes = [IsAuthenticated] <NEW_LINE> @swagger_auto_schema(responses={'204': EmptySchema}) <NEW_LINE> @action(detail=True... | list:
Get list of posts
Get list of user posts
retrieve:
Retrieve post
Retrieve specific post with ID
create:
Create new Post
Create new Post.
update:
Update Post with
Update Post with the given ID.
partial_update:
Partial update of Post
Partial update of Post
destroy:
Delete Post
Delete Post with given ID
... | 62598ef4009cb60464cffda6 |
class Domain(Resource): <NEW_LINE> <INDENT> @auth.login_required <NEW_LINE> def get(self, domain_id): <NEW_LINE> <INDENT> domain = DomainModel.query.get(domain_id) <NEW_LINE> if domain is None: <NEW_LINE> <INDENT> abort(404) <NEW_LINE> <DEDENT> return domain.serialize, 200 <NEW_LINE> <DEDENT> @auth.login_required <NEW_... | Define the endpoints for the domain node. | 62598ef456ac1b37e6300a43 |
class TestBoundaryMask(object): <NEW_LINE> <INDENT> def test_make_inner_mask_from_fp(self): <NEW_LINE> <INDENT> fp_mask = skimage.io.imread(os.path.join(data_dir, 'sample_fp_mask.tif')) <NEW_LINE> output_mask = boundary_mask(fp_mask) <NEW_LINE> truth_mask = skimage.io.imread(os.path.join(data_dir, 'sample_b_mask_inner.... | Tests for cw_geodata.vector_label.mask.boundary_mask. | 62598ef47b180e01f3e48471 |
class BroadlinkSP4Switch(BroadlinkSP1Switch): <NEW_LINE> <INDENT> def __init__(self, device, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(device, *args, **kwargs) <NEW_LINE> self._state = self._coordinator.data["pwr"] <NEW_LINE> <DEDENT> @property <NEW_LINE> def assumed_state(self): <NEW_LINE> <INDENT> return... | Representation of a Broadlink SP4 switch. | 62598ef423849d37ff84f913 |
class UsersConfig(AppConfig): <NEW_LINE> <INDENT> name = 'user' | Defines the user app. | 62598ef42ae34c7f260a9937 |
class Link(models.Model): <NEW_LINE> <INDENT> url = models.URLField(unique=True) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.url | Ссылка | 62598ef4a8370b77170eec3b |
class NFSPPolicies(policy.Policy): <NEW_LINE> <INDENT> def __init__(self, env, nfsp_policies, mode): <NEW_LINE> <INDENT> game = env.game <NEW_LINE> player_ids = [0, 1] <NEW_LINE> super(NFSPPolicies, self).__init__(game, player_ids) <NEW_LINE> self._policies = nfsp_policies <NEW_LINE> self._mode = mode <NEW_LINE> self._... | Joint policy to be evaluated. | 62598ef467a9b606de544825 |
class KNNBackgroundSubtractor(BackgroundSubtractor): <NEW_LINE> <INDENT> def __init__( self, history=500, threshold=400.0, learning_rate=-1, detect_shadows=False): <NEW_LINE> <INDENT> self.history = history <NEW_LINE> self.threshold = threshold <NEW_LINE> self.learning_rate = learning_rate <NEW_LINE> self.detect_shadow... | Performs background subtraction on a video using K-nearest
neighbors-based foreground-background segmentation.
This class is a wrapper around the OpenCV `BackgroundSubtractorKNN` class.
This model is only supported when using OpenCV 3. | 62598ef457b8e32f5250752f |
class TestAccountSettingsRecording(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 testAccountSettingsRecording(self): <NEW_LINE> <INDENT> pass | AccountSettingsRecording unit test stubs | 62598ef4a219f33f346c5085 |
class SFU(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_size, fusion_size): <NEW_LINE> <INDENT> super(SFU, self).__init__() <NEW_LINE> self.linear_r = nn.Linear(input_size + fusion_size, input_size) <NEW_LINE> self.linear_g = nn.Linear(input_size + fusion_size, input_size) <NEW_LINE> <DEDENT> def forward(sel... | Semantic Fusion Unit
The ouput vector is expected to not only retrieve correlative information from fusion vectors,
but also retain partly unchange as the input vector | 62598ef4956e5f7376df4aa4 |
@dataclass <NEW_LINE> class YieldLoop(contextlib.AbstractAsyncContextManager, collections.abc.Awaitable): <NEW_LINE> <INDENT> on_enter: bool = True <NEW_LINE> on_exit: bool = True <NEW_LINE> def __await__(self): <NEW_LINE> <INDENT> return asyncio.sleep(0).__await__() <NEW_LINE> <DEDENT> async def __aenter__(self): <NEW... | The expression `await yield_loop` yields control of the event loop so that a different task can be scheduled.
Can also be used as an asynchronous context manager, yielding on enter and/or on exit, depending on the constructor
parameters. | 62598ef4236d856c2adc8843 |
class LTRLoader(torch.utils.data.dataloader.DataLoader): <NEW_LINE> <INDENT> __initialized = False <NEW_LINE> def __init__(self, name, dataset, training=True, batch_size=1, shuffle=False, sampler=None, batch_sampler=None, num_workers=0, epoch_interval=1, collate_fn=None, stack_dim=0, pin_memory=False, drop_last=False, ... | Data loader. Combines a dataset and a sampler, and provides
single- or multi-process iterators over the dataset.
Note: The only difference with default pytorch DataLoader is that an additional option stack_dim is available to
select along which dimension the data should be stacked to form a batch.
Arguments:
... | 62598ef476e4537e8c3ede0f |
class MsaRequestException(IOException): <NEW_LINE> <INDENT> __slots__ = [ ] | The "MsaRequestException" class is used to indicate errors related to the
execution of an request for an action of a specific service and module.
:author: direct Netware Group et al.
:copyright: (C) direct Netware Group - All rights reserved
:package: pas
:subpackage: server
:since: v1.0.0
:license: ht... | 62598ef467a9b606de544826 |
class SVM(object): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> @abstractmethod <NEW_LINE> def model(self): pass <NEW_LINE> @staticmethod <NEW_LINE> def predict(params_w, params_b, x, y): <NEW_LINE> <INDENT> prediction = np.dot(params_w[:, None].T, x.T) + params_b <NEW_LINE> prediction = np.squeeze(prediction... | Abstract class having the methods that are common to all concrete SVM algorithm implementations | 62598ef471ff763f4b5e5fb7 |
class OP_normalize(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "object.normalize_normalize" <NEW_LINE> bl_label = "Normalize" <NEW_LINE> def execute(self,context): <NEW_LINE> <INDENT> print ("normalize vertices") <NEW_LINE> ob = bpy.context.object <NEW_LINE> obdata = ob.data <NEW_LINE> bpy.ops.object.mode_set(... | Normalize normals | 62598ef4283ffb24f3cf20ff |
class Machine(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.operating_system = platform.system().lower() <NEW_LINE> self.processor = platform.processor() <NEW_LINE> self.arch_size = self._arch_size() <NEW_LINE> self.package_manager = self._package_manager() <NEW_LINE> <DEDENT> @staticmethod <NEW_L... | Identify common attributes for current system.
Class that identifies system attributes that have an effect on determining
which vscode editor(s) and/or extension(s) are appropriate for a pyvem
action.
NOTE: This class is only concerned with the system attributes that help
distinguish the current system within the sco... | 62598ef44527f215b58e8758 |
class BITMAPFILEHEADER(ctypes.Structure): <NEW_LINE> <INDENT> _fields_ = [ ('bfType', ctypes.c_uint16), ('bfSize', ctypes.c_uint32), ('bfReserved1', ctypes.c_uint16), ('bfReserved2', ctypes.c_uint16), ('bfOffBits', ctypes.c_uint32) ] | BITMAP File Header
| 62598ef4cc40096d61619604 |
class Business(): <NEW_LINE> <INDENT> def __init__(self, business_id, name, location, description, category): <NEW_LINE> <INDENT> self.business_id = business_id <NEW_LINE> self.name = name <NEW_LINE> self.location = location <NEW_LINE> self.description = description <NEW_LINE> self.category = category <NEW_LINE> <DEDEN... | Basic blueprint of the Business class.
Provides the foundation for how the businesses will
be modeled in with the application. | 62598ef4627d3e7fe0e056e4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.