code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Function: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def wn_clear(cls) -> None: <NEW_LINE> <INDENT> if os.name == "nt": <NEW_LINE> <INDENT> os.system("cls") <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> os.system("clear") <NEW_LINE> <DEDENT> <DEDENT> @classmethod <NEW_LINE> def undo(cls, filename_1: str, filenam... | Class for terminal functionalities. | 62598f6cd10714528d69d671 |
class Function(_Routine): <NEW_LINE> <INDENT> def __init__(self, line, cName, fName, prefix, result, args, signed_to_unsigned_char): <NEW_LINE> <INDENT> super(Function, self).__init__(signed_to_unsigned_char) <NEW_LINE> self.comment = Comment( '\n'.join(( "%s" % cName, "Generated from FORTRAN routine '%s'" % fName, "FO... | Representing Fortran FUNCTIONs | 62598f6c6aa9bd52df0d4677 |
class Type(enum.IntEnum): <NEW_LINE> <INDENT> TYPE_UNSPECIFIED = 0 <NEW_LINE> SPACE = 1 <NEW_LINE> WIDE_SPACE = 2 <NEW_LINE> HYPHEN = 3 | Enum to denote the type of break found.
Attributes:
TYPE_UNSPECIFIED (int): Unspecified break type.
SPACE (int): A single whitespace.
WIDE_SPACE (int): A wider whitespace.
HYPHEN (int): A hyphen that indicates that a token has been split across lines. | 62598f6c4d74a7450cd58aab |
class HSRP(dpkt.Packet): <NEW_LINE> <INDENT> __hdr__ = ( ('version', 'B', 0), ('opcode', 'B', 0), ('state', 'B', 0), ('hello', 'B', 0), ('hold', 'B', 0), ('priority', 'B', 0), ('group', 'B', 0), ('rsvd', 'B', 0), ('auth', '8s', 'cisco'), ('vip', '4s', '') ) | Cisco Hot Standby Router Protocol.
TODO: Longer class information....
Attributes:
__hdr__: Header fields of HSRP.
TODO. | 62598f6c3eb6a72ae0389de6 |
class And(NAryCombinator): <NEW_LINE> <INDENT> def __init__(self, *ns): <NEW_LINE> <INDENT> super(And, self).__init__('and', *ns) | And combinator for combining SignalFlow objects.
| 62598f6c1f5feb6acb1623dd |
class Agent(base.APIBase): <NEW_LINE> <INDENT> project_id = wtypes.text <NEW_LINE> user_id = wtypes.text <NEW_LINE> uuid = wtypes.text <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.fields = vars(models.Agent) <NEW_LINE> for k in self.fields: <NEW_LINE> <INDENT> setattr(self, k, kwargs.get(k)) | API representation of an agent. | 62598f6c1d351010ab8f32e7 |
class CouponTieredPercentOffSubtotal(object): <NEW_LINE> <INDENT> swagger_types = { 'items': 'list[str]', 'tiers': 'list[CouponTierPercent]' } <NEW_LINE> attribute_map = { 'items': 'items', 'tiers': 'tiers' } <NEW_LINE> def __init__(self, items=None, tiers=None): <NEW_LINE> <INDENT> self._items = None <NEW_LINE> self._... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f6c16aa5153ce3ffca0 |
class BlockRpcStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.getBlockHeaderByHash = channel.unary_unary( '/org.qsn.protobuf.BlockRpc/getBlockHeaderByHash', request_serializer=qsn_dot_entity_dot_request_dot_BlockRequests__pb2.GetBlockHeaderByHashRequest.SerializeToString, respons... | Missing associated documentation comment in .proto file. | 62598f6cd53ae8145f917c3c |
class MambaTemplate(object): <NEW_LINE> <INDENT> def __init__(self, env=None, template=None): <NEW_LINE> <INDENT> if env is None: <NEW_LINE> <INDENT> loader = PackageLoader('mamba', 'templates/jinja') <NEW_LINE> self.env = Environment(loader=loader) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.env = env <NEW_LINE... | This class loads templates from the Mamba package and is used internally
by Mamba. You are not supossed to use this class in your code
:param env: jinja2 environment
:type env: :class:`jinja2.Environment`
:param template: the template to render
:type template: str | 62598f6c38b623060ffa8841 |
class Price(models.Model): <NEW_LINE> <INDENT> product = models.ForeignKey(Product, on_delete=models.CASCADE) <NEW_LINE> service_life = models.IntegerField(choices=((30,'30天'), (60,'60天'), (180,'180天'), (360,'360天'), (720,'720天'))) <NEW_LINE> price = models.CharField(max_length=20) <NEW_LINE> def __str__(se... | 价格信息 | 62598f6c5166f23b2e242b81 |
class ObtainJSONWebTokenCustomer(JSONWebTokenAPIView): <NEW_LINE> <INDENT> serializer_class = JSONWebTokenSerializerCustomer | API View that receives a POST with a user's username and password.
Returns a JSON Web Token that can be used for authenticated requests. | 62598f6c925a0f43d25e77e2 |
class CutMixCallback(Callback): <NEW_LINE> <INDENT> def __init__(self, alpha: float = 0.4, softmax_target: bool = False, minmax: Optional[Tuple[float, float]] = None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.alpha = alpha <NEW_LINE> self.softmax_target = softmax_target <NEW_LINE> self.minmax = minmax <NE... | Callback that perform CutMix augmentation on the input batch.
Assumes the first dimension is batch.
Reference: `rwightman/pytorch-image-models/ <https://github.com/rwightman/pytorch-image-models/blob/8c9814e3f500e8b37aae86dd4db10aba2c295bd2/timm/data/mixup.py>`_ | 62598f6c3eb6a72ae0389de8 |
class BOX(Structure): <NEW_LINE> <INDENT> _fields_ = [("x", c_float), ("y", c_float), ("w", c_float), ("h", c_float)] | Structure definision of BBOX | 62598f6c9b70327d1c57e552 |
class TestVIPSubnet(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 testVIPSubnet(self): <NEW_LINE> <INDENT> pass | VIPSubnet unit test stubs | 62598f6cd10714528d69d674 |
class PooledComponent(BaseComponent): <NEW_LINE> <INDENT> def pool(self): <NEW_LINE> <INDENT> for pool in self.device().pools.objectValuesGen(): <NEW_LINE> <INDENT> return pool | Abstract base class for all pooled components. | 62598f6c711fe17d825dfe92 |
@dataclass <NEW_LINE> class Spawn: <NEW_LINE> <INDENT> type: Type[SpazBot] <NEW_LINE> path: int = 0 <NEW_LINE> point: Optional[Point] = None | Defines a bot spawn event. | 62598f6c287bf620b6271367 |
class UIDQuery(Query): <NEW_LINE> <INDENT> base_url = r"https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?" <NEW_LINE> fields = OrderedDict([('db','pubmed'), ('rettype', 'abstract'), ('retmode', 'xml'), ('version', '2.0'), ('retmax', str(SUMMARY_RETMAX)), ('retstart', '0'), ]) <NEW_LINE> searchable_db = ['pubme... | Holds PubMed IDs, and creates URLs for downloading PubMed Data (e.g.
titles, abstracts, etc.) | 62598f6c167d2b6e312b6726 |
class SyncTableJob(AsyncResource): <NEW_LINE> <INDENT> id = CharField() <NEW_LINE> name = CharField() <NEW_LINE> interval = IntegerField() <NEW_LINE> url = CharField() <NEW_LINE> state = CharField() <NEW_LINE> created_at = DateTimeField() <NEW_LINE> updated_at = DateTimeField() <NEW_LINE> run_at = DateTimeField() <NEW_... | This class provides support for creating Sync Tables into CARTO | 62598f6c507cdc57c63a4544 |
class Producer: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> config = Config() <NEW_LINE> service_uri = "{}:{}".format(config.get("host"), config.get("port")) <NEW_LINE> try: <NEW_LINE> <INDENT> self.producer = KafkaProducer( bootstrap_servers=service_uri, security_protocol=SSL, ssl_cafile=CA_PEM, ssl_ce... | This class is Kafka Producer class. It used initializing producer instance & has all related action methods. | 62598f6c1f5feb6acb1623e1 |
class LegacyRegionTemplate(BalancedRegionBase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def STRATOSPHERE_TYPES(cls): <NEW_LINE> <INDENT> types = BalancedRegionBase.STRATOSPHERE_TYPES() <NEW_LINE> types.update({ 'app': AppStack, }) <NEW_LINE> return types <NEW_LINE> <DEDENT> def vpc(self): <NEW_LINE> <INDENT> return... | Template our legacy VPC region. | 62598f6c16aa5153ce3ffca4 |
class Segment_TOO(models.Model): <NEW_LINE> <INDENT> segment = models.ForeignKey( X12Segment ) <NEW_LINE> TOO01 = models.CharField( max_length=3 ) <NEW_LINE> TOO02 = models.CharField( max_length=30, null=True, blank=True ) <NEW_LINE> TOO03_01 = models.CharField( max_length=2 ) <NEW_LINE> TOO03_02 = models.CharField( ma... | Properties(syntax='',req_sit=u'S',repeat=u'32',pos=u'382',desc=u'Tooth Information') | 62598f6cd6c5a102081e18ee |
class CurriculumPrompt(models.Model): <NEW_LINE> <INDENT> section = models.ForeignKey(CurriculumSection, null=False) <NEW_LINE> title = models.CharField(max_length=128) <NEW_LINE> summary = models.TextField() <NEW_LINE> mentor_doc = models.TextField() <NEW_LINE> mentee_doc = models.TextField() <NEW_LINE... | `CurriculumPrompt` represents a sigle writing prompt. | 62598f6c5166f23b2e242b85 |
class Scotvote(object): <NEW_LINE> <INDENT> params = ( 4.961768e-5, 2.034423e-3, -7.181429e-5, 1.11852e-4, -1.467515e-7, -5.186831e-4, -2.42717498e-6, -1.776527e-2) <NEW_LINE> bse = ( 1.621577e-5, 5.320802e-4, 2.711664e-5, 4.057691e-5, 1.236569e-7, 2.402534e-4, 7.460253e-7, 1.147922e-2) <NEW_LINE> null_deviance = 0.536... | Scotvot class is used with TestGlmGamma. | 62598f6c91af0d3eaad395b4 |
class RegexMatchLexicon(RegexMatch): <NEW_LINE> <INDENT> def _f(self, c): <NEW_LINE> <INDENT> tokens = c.get_attrib_tokens(self.attrib) <NEW_LINE> trend_kw = { "unknown": ["seasonality", "consistent", "rebound", "average", "exceed" "steadily", "regain", "rebound", "retrace", "hyperdemic", "advance", "retreat", "up", "... | Matches regex pattern on **each token** | 62598f6c6fece00bbaccb136 |
class SizeHintMode(IntEnum): <NEW_LINE> <INDENT> Union = 0 <NEW_LINE> Current = 1 | An int enum defining the size hint modes of the stack.
| 62598f6c925a0f43d25e77e6 |
class ReportsForType(OperatorPermissionMixin, TemplateView): <NEW_LINE> <INDENT> template_name = "logger/reports_for_type.html" <NEW_LINE> def dispatch(self, request, report_type): <NEW_LINE> <INDENT> report_type = int(report_type) <NEW_LINE> if report_type not in dict(REPORTS_CHOICES): <NEW_LINE> <INDENT> raise Http40... | отображение отчетов определенного типа | 62598f6c7c178a314d78cc4e |
class MemoizedMethod(object): <NEW_LINE> <INDENT> def __init__(self, func): <NEW_LINE> <INDENT> self.func = func <NEW_LINE> <DEDENT> def __get__(self, obj, objtype=None): <NEW_LINE> <INDENT> if obj is None: <NEW_LINE> <INDENT> return self.func <NEW_LINE> <DEDENT> return partial(self, obj) <NEW_LINE> <DEDENT> def __call... | cache the return value of a method
This class is meant to be used as a decorator of methods. The return value
from a given method invocation will be cached on the instance whose method
was invoked. All arguments passed to a method decorated with memoize must
be hashable.
If a memoized method is invoked direc... | 62598f6cec188e330fdf804c |
class Testcase_430_160_BufferEmpty(base_tests.SimpleDataPlane): <NEW_LINE> <INDENT> @wireshark_capture <NEW_LINE> def runTest(self): <NEW_LINE> <INDENT> logging.info("Running test case Buffer Empty") <NEW_LINE> delete_all_flows(self.controller) <NEW_LINE> port_a, port_b= openflow_ports(2) <NEW_LINE> priority=1 <NEW_LIN... | 430.160 - Bad request buffer empty
If a request specifies a buffer that has already been emptied, verify the device generates
a bad request error with a buffer empty code. | 62598f6c6fece00bbaccb137 |
class Game: <NEW_LINE> <INDENT> league = None <NEW_LINE> def __init__(self, white_name, black_name, winner_id=None, date=None): <NEW_LINE> <INDENT> if isinstance(white_name, str): <NEW_LINE> <INDENT> self.white = self.league.get_player(white_name) <NEW_LINE> <DEDENT> elif isinstance(white_name, Player): <NEW_LINE> <IND... | game class | 62598f6c16aa5153ce3ffca6 |
class PythonConfigFile(object): <NEW_LINE> <INDENT> def ReadConfiguration(self, fileName): <NEW_LINE> <INDENT> if not os.path.exists(fileName): <NEW_LINE> <INDENT> raise cx_Exceptions.MissingConfigurationFile(fileName = fileName) <NEW_LINE> <DEDENT> message = "Reading configuration from %s..." % fileName <NEW_LINE> pri... | Base class for all configuration files which use Python itself to
define the configuration. | 62598f6c711fe17d825dfe96 |
class ApiTimeoutException(APIException): <NEW_LINE> <INDENT> def __init__(self, request): <NEW_LINE> <INDENT> super(ApiTimeoutException, self).__init__("ApiTimeout: client did not get response within %s ms" % request.timeout) <NEW_LINE> self.request = request | Exception which is thrown when a request is not processed within the timeout | 62598f6c38b623060ffa8847 |
class GetTagResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_Limit(self): <NEW_LINE> <INDENT> return self._output.get('Limit', None) <NEW_LINE> <DEDENT> def get_Remaining(self): <NEW_LINE> <INDENT> return self._output.get(... | A ResultSet with methods tailored to the values returned by the GetTag Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution. | 62598f6c6e29344779affe09 |
class FESOMRunBase(DataSet): <NEW_LINE> <INDENT> version=(0,0,0) <NEW_LINE> scheme='fesom' <NEW_LINE> grid=None <NEW_LINE> def __init__(self,dbcon): <NEW_LINE> <INDENT> super().__init__(dbcon) <NEW_LINE> self.table=type(self.name+"Table",(FESOMRunTBase,),{}) <NEW_LINE> self.createTable() <NEW_LINE> self.grid=self.name.... | FESOM template table for runs | 62598f6ca4f1c619b294dda2 |
class PostgisInsertMessageHandler(PgBaseMessageHandler): <NEW_LINE> <INDENT> writer = None <NEW_LINE> _geometry_column = None <NEW_LINE> _discard_geometries = False <NEW_LINE> _mapping_properties = None <NEW_LINE> _mapping_metafields = None <NEW_LINE> _predefined_values = None <NEW_LINE> def __init__(self, cur, schema_... | insert incomming messages in an database table.
performs some schema introspection to find common attributes between
the incomming data and the target tables columns + adds typecasts.
Timestamps are analyzed and brought into ISO-format when possible. | 62598f6c4d74a7450cd58aaf |
@override_settings( TEMPLATES=[{ 'BACKEND': 'django.template.backends.jinja2.Jinja2', 'DIRS': ['tests/templates'], 'APP_DIRS': True, },] ) <NEW_LINE> class TestJinja2(TestCase): <NEW_LINE> <INDENT> def assertExceptionMessageEquals(self, exception, expected): <NEW_LINE> <INDENT> result = exception.message if six.PY2 els... | Test the Django templating engine. | 62598f6cb57a9660fecd123b |
class ReportClassManager(object): <NEW_LINE> <INDENT> _register = OrderedDict() <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._register = OrderedDict() <NEW_LINE> <DEDENT> def register(self, slug, rclass): <NEW_LINE> <INDENT> if slug in self._register: <NEW_LINE> <INDENT> raise ValueError('Slug already exists... | Class to handle registered reports class. | 62598f6c287bf620b627136d |
class StoreNotPickedUpEvent(FailedDeliveryEvent): <NEW_LINE> <INDENT> DESCRIPTION = "storage time exceeded" | Store not picked up event
The parcel was dropped off at a store but never picked up by the recipient | 62598f6cd4950a0f3b110a0e |
class RelativeSinusoidalPositionalEmbedding(RelativeEmbedding): <NEW_LINE> <INDENT> def __init__(self, embedding_dim, padding_idx, init_size=1568): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.embedding_dim = embedding_dim <NEW_LINE> self.padding_idx = padding_idx <NEW_LINE> assert init_size % 2 == 0 <NEW_LIN... | This module produces sinusoidal positional embeddings of any length.
Padding symbols are ignored. | 62598f6cd53ae8145f917c44 |
class PhoneAuthenticationBackend(backends.ModelBackend): <NEW_LINE> <INDENT> def authenticate(self, request, username=None, password=None, **kwargs): <NEW_LINE> <INDENT> phone = username <NEW_LINE> if phone: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> user = UserModel().objects.filter(phone=phone) <NEW_LINE> user = us... | Authenticate users with 'phone number'. Default implementation by django is 'username' and 'password' | 62598f6c66673b3332c2fb6b |
class Captor(BaseMatcher): <NEW_LINE> <INDENT> __slots__ = ('matcher', 'value') <NEW_LINE> def __init__(self, matcher=None): <NEW_LINE> <INDENT> if matcher is None: <NEW_LINE> <INDENT> matcher = Any() <NEW_LINE> <DEDENT> if not isinstance(matcher, BaseMatcher): <NEW_LINE> <INDENT> raise TypeError("expected a matcher, g... | Argument captor.
You can use :class:`Captor` to "capture" the original argument
that the mock was called with, and perform custom assertions on it.
Example::
captor = Captor()
mock_foo.assert_called_with(captor)
# captured value is available as the `arg` attribute
self.assertEquals(captor.arg.some_m... | 62598f6c63f4b57ef0085946 |
class LoginRequiredMixin(object): <NEW_LINE> <INDENT> @method_decorator(login_required) <NEW_LINE> def dispatch(self, *args, **kwargs): <NEW_LINE> <INDENT> return super(LoginRequiredMixin, self).dispatch(*args, **kwargs) | Se asegura que el usuario este autentificado para acceder a las vistas!. | 62598f6c5166f23b2e242b89 |
class TransactionImporter(CSVImporter): <NEW_LINE> <INDENT> def _addObject(self, row): <NEW_LINE> <INDENT> if row.has_key('id'): <NEW_LINE> <INDENT> txn_id = row.get('id') <NEW_LINE> prefix = self.context.getLedger().getTransactionPrefix() <NEW_LINE> txn_number = int(txn_id.replace(prefix, '')) <NEW_LINE> if self.conte... | Specialise CSVImporter to import transaction csv files
| 62598f6c0a366e3fb87dc174 |
class NukiLock(LockEntity): <NEW_LINE> <INDENT> def __init__(self, nuki_lock): <NEW_LINE> <INDENT> self._nuki_lock = nuki_lock <NEW_LINE> self._available = nuki_lock.state not in ERROR_STATES <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self._nuki_lock.name <NEW_LINE> <DEDENT> @pr... | Representation of a Nuki lock. | 62598f6cd53ae8145f917c46 |
class CoMatrix(object): <NEW_LINE> <INDENT> def build_matrix(self, data_list): <NEW_LINE> <INDENT> first_items = {} <NEW_LINE> other_items = {} <NEW_LINE> item_groups = {} <NEW_LINE> for item in data_list: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> str_data_list = item.rstrip(';').split(';') <NEW_LINE> first_item = s... | @description: 构建共现矩阵
@param {List} 以['A;B;',...]形式形成的数据列表
@return:
{dict}以字典形式存储的'A;B;...;'第一个数据(A)出现次数
{dict}以字典形式存储的'A;B;...;'除第一个数据(A)外其他数据出现次数
{dict}以字典形式存储稀疏共现矩阵,key:'共现A,共现B',value:共现次数 | 62598f6c50485f2cf55da71d |
class RegressionHelper(tf.contrib.seq2seq.Helper): <NEW_LINE> <INDENT> def __init__(self, batch_size, max_sequence_size, n_features): <NEW_LINE> <INDENT> self._batch_size = batch_size <NEW_LINE> self._max_sequence_size = max_sequence_size <NEW_LINE> self._n_features = n_features <NEW_LINE> self._batch_size_tensor = tf.... | Helper interface. Helper instances are used by SamplingDecoder. | 62598f6c507cdc57c63a454b |
class ProjectileFlightType(enum.IntEnum): <NEW_LINE> <INDENT> BALLISTIC = 1 <NEW_LINE> TRUE_BALLISTIC = 3 <NEW_LINE> DYNAMIC = 9 <NEW_LINE> PROXIMITY_DETONATE = 10 | A projectile flight type.
structable items.
Values:::
BALLISTIC = 1
TRUE_BALLISTIC = 3
DYNAMIC = 9
PROXIMITY_DETONATE = 10 | 62598f6c38b623060ffa884b |
class PermanentException(Exception): <NEW_LINE> <INDENT> pass | Base class for exceptions that should not be retried. | 62598f6c6aa9bd52df0d4683 |
class DeleteDirectConnectRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.DirectConnectId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.DirectConnectId = params.get("DirectConnectId") | DeleteDirectConnect请求参数结构体
| 62598f6cd164cc6175820725 |
class Menu: <NEW_LINE> <INDENT> pass | Меню | 62598f6c91af0d3eaad395ba |
class CoordConv(base.Layer): <NEW_LINE> <INDENT> def compute_output_shape(self, input_shape): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __init__(self, x_dim, y_dim, with_r): <NEW_LINE> <INDENT> super(CoordConv, self).__init__() <NEW_LINE> self.addcoords = AddCoords(x_dim=x_dim, y_dim=y_dim, with_r=with_r) <NEW_L... | CoordConv layer as in the paper. | 62598f6c8a349b6b436859f1 |
class _MetaOrderedHashable(abc.ABCMeta): <NEW_LINE> <INDENT> def __new__(cls, name, bases, namespace): <NEW_LINE> <INDENT> if '_names' in namespace and not isinstance(namespace['_names'], abc.abstractproperty): <NEW_LINE> <INDENT> args = ', '.join(namespace['_names']) <NEW_LINE> if '__init__' not in name... | A metaclass that ensures that non-abstract subclasses of _OrderedHashable
without an explicit __init__ method are given a default __init__ method
with the appropriate method signature.
Also, an _init method is provided to allow subclasses with their own
__init__ constructors to initialise their values via an explicit ... | 62598f6cc432627299fa2787 |
class DataPiecesModel(QtCore.QAbstractListModel): <NEW_LINE> <INDENT> def __init__(self,profile,left): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.profile = profile <NEW_LINE> self.left = left <NEW_LINE> profiles.category('delegates').profileChanged.connect(self._handleProfileChanged) <NEW_LINE> <DEDENT> def... | Depending on *left*, this model manages the datapieces in the left or right column of *profile*. | 62598f6cb57a9660fecd123f |
class CaseData: <NEW_LINE> <INDENT> def __init__(self, selector, population, selected): <NEW_LINE> <INDENT> self.selector = selector <NEW_LINE> self.population = population <NEW_LINE> self.selected = selected | A test case.
Attributes
----------
selector : :class:`.Selector`
The selector to test.
population : :class:`tuple` of :class:`.MoleculeRecord`
The population from which batches are selected.
selected : :class:`tuple` of :class:`.Batch`
The batches which should be selected. | 62598f6c8c3a8732951f5d00 |
class VoterBlockchain(Blockchain): <NEW_LINE> <INDENT> pass | Blockchain that tracks voters. | 62598f6c30c21e258be97fb2 |
class CreateGroupInputSet(InputSet): <NEW_LINE> <INDENT> def set_AWSAccessKeyId(self, value): <NEW_LINE> <INDENT> super(CreateGroupInputSet, self)._set_input('AWSAccessKeyId', value) <NEW_LINE> <DEDENT> def set_AWSSecretKeyId(self, value): <NEW_LINE> <INDENT> super(CreateGroupInputSet, self)._set_input('AWSSecretKeyId'... | An InputSet with methods appropriate for specifying the inputs to the CreateGroup
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 62598f6c8e05c05ec3f6ea1e |
class VarsParser: <NEW_LINE> <INDENT> def __init__(self, vars_file_content): <NEW_LINE> <INDENT> self.vars_file_content = self.__strip_comments(vars_file_content) <NEW_LINE> <DEDENT> @property <NEW_LINE> def user_id(self): <NEW_LINE> <INDENT> id_match = re.search(r'ID:(.*)', self.vars_file_content) <NEW_LINE> return id... | This class parses the content of the vars.yml file in the samples directory, e.g:
>>> vars = VarsParser('# change to another value, e.g. your User ID\nID: X0000000\n# Choose cfapps.eu10.hana.ondemand.com for the EU10 landscape, cfapps.us10.hana.ondemand.com for US10\nLANDSCAPE_APPS_DOMAIN: cfapps.sap.hana.ondemand.... | 62598f6c56b00c62f0fb2067 |
class ImportINSEE(ModelView, ModelSQL): <NEW_LINE> <INDENT> __name__ = 'download_shape.insee.importer' <NEW_LINE> @classmethod <NEW_LINE> def __setup__(cls): <NEW_LINE> <INDENT> super(ImportINSEE, cls).__setup__() <NEW_LINE> cls.__rpc__.update({ 'importerINSEE': RPC(readonly=False), }) <NEW_LINE> <DEDENT> @classmethod ... | Import de données pour appel via api | 62598f6c6fece00bbaccb13d |
class CategoryIndexView(LoginRequiredMixin, SimpleListView): <NEW_LINE> <INDENT> template_name = 'forum/category/index.html' <NEW_LINE> queryset = Category.objects.filter(visible=True).annotate(num_threads=Count('thread')).order_by('order', 'title') <NEW_LINE> paginate_by = settings.FORUM_CATEGORY_INDEX_PAGINATE <NEW_L... | Category list view | 62598f6ca8ecb033258709b8 |
class Vertex: <NEW_LINE> <INDENT> def __init__(self, x=0, y=0, z=0): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.z = z <NEW_LINE> <DEDENT> def __repr__(self, *args): <NEW_LINE> <INDENT> return '(%s %s %s)' % (self.x, self.y, self.z) | An XYZ location given by 3 decimal values and printed with parens. | 62598f6ca4f1c619b294dda8 |
class Conversion( object ): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def x12_to_python( raw ): <NEW_LINE> <INDENT> return NotImplemented <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def python_to_x12( value ): <NEW_LINE> <INDENT> return NotImplemented | Convert between X12 strings and Python objects.
This is the abstract superclass for all conversions. | 62598f6c8a349b6b436859f3 |
class LBaaSAgentSchedulerTestJSON(base.BaseAdminNetworkTest): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def skip_checks(cls): <NEW_LINE> <INDENT> super(LBaaSAgentSchedulerTestJSON, cls).skip_checks() <NEW_LINE> if not test.is_extension_enabled('lbaas_agent_scheduler', 'network'): <NEW_LINE> <INDENT> msg = "LBaaS Agen... | Tests the following operations in the Neutron API using the REST client for
Neutron:
List pools the given LBaaS agent is hosting.
Show a LBaaS agent hosting the given pool.
v2.0 of the Neutron API is assumed. It is also assumed that the following
options are defined in the [networki-feature-enabled] section o... | 62598f6c16aa5153ce3ffcae |
class MemorySignature(object): <NEW_LINE> <INDENT> def __init__(self, key_data, cert_data, password=None): <NEW_LINE> <INDENT> check_xmlsec_import() <NEW_LINE> self.key_data = key_data <NEW_LINE> self.cert_data = cert_data <NEW_LINE> self.password = password <NEW_LINE> <DEDENT> def apply(self, envelope, headers): <NEW_... | Sign given SOAP envelope with WSSE sig using given key and cert. | 62598f6cc432627299fa2789 |
class NodeFilter(Filter): <NEW_LINE> <INDENT> BASE_EXCLUSIONS = {'/roslaunch'} <NEW_LINE> DEBUG_EXCLUSIONS = {'/rosout'} | Default filter for Nodes | 62598f6c925a0f43d25e77ee |
@dataclass <NEW_LINE> class UniSpeechBaseModelOutput(ModelOutput): <NEW_LINE> <INDENT> last_hidden_state: torch.FloatTensor = None <NEW_LINE> extract_features: torch.FloatTensor = None <NEW_LINE> hidden_states: Optional[Tuple[torch.FloatTensor]] = None <NEW_LINE> attentions: Optional[Tuple[torch.FloatTensor]] = None | Output type of [`UniSpeechBaseModelOutput`], with potential hidden states and attentions.
Args:
last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`):
Sequence of hidden-states at the output of the last layer of the model.
extract_features (`torch.FloatTensor` of... | 62598f6c8c3a8732951f5d02 |
class RegularFile(_messages.Message): <NEW_LINE> <INDENT> content = _messages.MessageField('FileReference', 1) <NEW_LINE> devicePath = _messages.StringField(2) | A file or directory to install on the device before the test starts
Fields:
content: Required
devicePath: Where to put the content on the device. Must be an absolute,
whitelisted path. If the file exists, it will be replaced. The following
device-side directories and any of their subdirectories are whiteli... | 62598f6c50485f2cf55da721 |
class IndexArrayData(IntegerArrayData): <NEW_LINE> <INDENT> _ui_name = "Index array" <NEW_LINE> target = Array(label="Indexed array", file_storage=core.FILE_STORAGE_NONE, doc="A link to the array that the indices index.") | An array that indexes another array. | 62598f6c711fe17d825dfe9d |
class DirichletMultinomial(Discrete): <NEW_LINE> <INDENT> rv_op = dirichlet_multinomial <NEW_LINE> @classmethod <NEW_LINE> def dist(cls, n, a, *args, **kwargs): <NEW_LINE> <INDENT> n = intX(n) <NEW_LINE> a = floatX(a) <NEW_LINE> return super().dist([n, a], **kwargs) <NEW_LINE> <DEDENT> def get_moment(rv, size, n, a): <... | Dirichlet Multinomial log-likelihood.
Dirichlet mixture of Multinomials distribution, with a marginalized PMF.
.. math::
f(x \mid n, a) = \frac{\Gamma(n + 1)\Gamma(\sum a_k)}
{\Gamma(n + \sum a_k)}
\prod_{k=1}^K
\frac{\Gamma(x_k + a_k)}
... | 62598f6c30c21e258be97fb4 |
class SOFTParser(object): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> self._handle = gzip.open(path) <NEW_LINE> self._lines = self._read_lines() <NEW_LINE> self._read_until("!platform_table_begin") <NEW_LINE> self.feature_data = self._read_table("!platform_table_end") <NEW_LINE> expression = {} <N... | A class to read from whole-platform SOFT datasets, such
as those found at ftp://ftp.ncbi.nlm.nih.gov/geo/platforms/ .
It assumes the platform data will precede the samples. | 62598f6c6fece00bbaccb13e |
class SimKeys: <NEW_LINE> <INDENT> number_agents = 'pop_size' <NEW_LINE> initial_infected_count = 'pop_infected' <NEW_LINE> start_day = 'start_day' <NEW_LINE> number_simulated_days = 'n_days' <NEW_LINE> random_seed = 'rand_seed' <NEW_LINE> pass | Define mapping to simulation keys | 62598f6c1d351010ab8f32f5 |
class WinkShadeGroup(WinkDevice): <NEW_LINE> <INDENT> def state(self): <NEW_LINE> <INDENT> return self.reading_aggregation().get("position").get("average") <NEW_LINE> <DEDENT> def reading_aggregation(self): <NEW_LINE> <INDENT> return self.json_state.get("reading_aggregation") <NEW_LINE> <DEDENT> def available(self): <N... | Represents a Wink shade group. | 62598f6c6e29344779affe11 |
class MySQLConnectError(BasicException): <NEW_LINE> <INDENT> pass | Exception raised when connect failed with MySQL | 62598f6cd53ae8145f917c4a |
class GreedyBustersAgent(BustersAgent): <NEW_LINE> <INDENT> def registerInitialState(self, gameState): <NEW_LINE> <INDENT> BustersAgent.registerInitialState(self, gameState) <NEW_LINE> self.distancer = Distancer(gameState.data.layout, False) <NEW_LINE> <DEDENT> def chooseAction(self, gameState): <NEW_LINE> <INDENT> pac... | An agent that charges the closest ghost. | 62598f6cd4950a0f3b110a11 |
class RDFReader(Plugin): <NEW_LINE> <INDENT> def _get(self, subject, attribute, direct, context): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> def _load(self, subject, context): <NEW_LINE> <INDENT> return {} <NEW_LINE> <DEDENT> def _is_present(self, subject, context): <NEW_LINE> <INDENT> return False <NEW_LINE> ... | Super class for all surf Reader plugins. | 62598f6c5e10d32532ce34c5 |
class DelTapRd(UGen): <NEW_LINE> <INDENT> _ordered_input_names = collections.OrderedDict( [ ("buffer_id", None), ("phase", None), ("delay_time", 0.0), ("interpolation", 1.0), ] ) <NEW_LINE> _valid_calculation_rates = (CalculationRate.AUDIO, CalculationRate.CONTROL) | A delay tap reader unit generator.
::
>>> buffer_id = 0
>>> source = supriya.ugens.SoundIn.ar(0)
>>> tapin = supriya.ugens.DelTapWr.ar(
... buffer_id=buffer_id,
... source=source,
... )
::
>>> tapin
DelTapWr.ar()
::
>>> tapout = supriya.ugens.DelTapRd.ar(
... bu... | 62598f6c21bff66bcd722413 |
class InvalidAnnotationBodyTypeError(InvalidInputWebAnnotationError): <NEW_LINE> <INDENT> status = HTTPStatus.UNPROCESSABLE_ENTITY | type value in body is invalid. | 62598f6cff9c53063f519e0b |
class PreambleOp(AbstractResOp): <NEW_LINE> <INDENT> op = None <NEW_LINE> def __init__(self, op, preamble_op, invented_name): <NEW_LINE> <INDENT> self.op = op <NEW_LINE> self.preamble_op = preamble_op <NEW_LINE> self.invented_name = invented_name <NEW_LINE> <DEDENT> def numargs(self): <NEW_LINE> <INDENT> if self.op is ... | An operations that's only found in preamble and not
in the list of constructed operations. When encountered (can be found
either in pure ops or heap ops), it must be put in inputargs as well
as short preamble (together with corresponding guards). Extra_ops is
for extra things to be found in the label, for now only inpu... | 62598f6c5166f23b2e242b8f |
class Softmax (object): <NEW_LINE> <INDENT> def __init__ (self, inputDim, outputDim): <NEW_LINE> <INDENT> self.W = None <NEW_LINE> self.W = 0.01 * np.random.randn(inputDim, outputDim) <NEW_LINE> <DEDENT> def calLoss (self, x, y, reg): <NEW_LINE> <INDENT> loss = 0.0 <NEW_LINE> dW = np.zeros_like(self.W) <NEW_LINE> N = x... | " Softmax classifier | 62598f6c91af0d3eaad395be |
class TestInitialCondition(TestAbstractComponent): <NEW_LINE> <INDENT> _class = InitialCondition | Unit testing of InitialCondition object.
| 62598f6da4f1c619b294ddaa |
class QuestionSurrender(rootbutton.RootButton): <NEW_LINE> <INDENT> def __init__(self, path, x=-0.5, y=0): <NEW_LINE> <INDENT> self.posInitX = x <NEW_LINE> self.posInitY = y <NEW_LINE> self.industrySim = None <NEW_LINE> self.textTitle = None <NEW_LINE> self.textDescription = None <NEW_LINE> rootbutton.RootButton.__init... | Ask the player if they want to Surrender | 62598f6d9b70327d1c57e560 |
class FavouriteProduct(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(User, on_delete=models.DO_NOTHING) <NEW_LINE> product = models.ForeignKey(Product, on_delete=models.DO_NOTHING) | Favourite product model. Reference table between Product and User. | 62598f6db57a9660fecd1243 |
class SettingError(errors.DataError): <NEW_LINE> <INDENT> pass | Setting model data error.
| 62598f6d8c3a8732951f5d05 |
class SimpleConvNet(ConvNet): <NEW_LINE> <INDENT> n_layers_in_between = Param() <NEW_LINE> n_conv_blocks = Param() <NEW_LINE> stride = Param() <NEW_LINE> base_n_filters = Param() <NEW_LINE> max_n_filters = Param() <NEW_LINE> kernel_size = Param() <NEW_LINE> n_fc_layers = Param() <NEW_LINE> n_fc_units = Param() <NEW_LIN... | A standard ConvNet that ends with a series of fully connected layers. | 62598f6d0383005118f6cebe |
class Tekuila(object): <NEW_LINE> <INDENT> DEFAULT_CONFIG_PATH = os.path.expanduser('~/.tekuila') <NEW_LINE> def __init__(self, apikey=None, cap=None, warn_ratio=None, verbose=False): <NEW_LINE> <INDENT> self.api_key = apikey <NEW_LINE> self.cap = cap <NEW_LINE> self.warn_ratio = warn_ratio <NEW_LINE> self._data = None... | Base class for parsing the ISP quota API and act upon the results. | 62598f6d6e29344779affe13 |
class FilesContextMenu(menu.MultiProviderMenu): <NEW_LINE> <INDENT> def __init__(self, panel): <NEW_LINE> <INDENT> menu.MultiProviderMenu.__init__(self, ['track-panel-menu', 'files-panel-context-menu'] , panel) <NEW_LINE> <DEDENT> def get_context(self): <NEW_LINE> <INDENT> context = common.LazyDict(self._parent) <NEW_L... | Context menu when a files panel track is clicked
Provider keys: track-panel-menu, files-panel-context-menu | 62598f6dd18da76e235b6d11 |
class TimeBesselianEpochString(TimeEpochDateString): <NEW_LINE> <INDENT> name = 'byear_str' <NEW_LINE> epoch_to_jd = 'epb2jd' <NEW_LINE> jd_to_epoch = 'epb' <NEW_LINE> epoch_prefix = 'B' | Besselian Epoch year as string value(s) like 'B1950.0' | 62598f6da8ecb033258709bc |
class MixinSpikeTrainComparison: <NEW_LINE> <INDENT> def __init__(self, delta_time=0.4, n_jobs=-1): <NEW_LINE> <INDENT> self.delta_time = delta_time <NEW_LINE> self.n_jobs = n_jobs <NEW_LINE> self.sampling_frequency = None <NEW_LINE> self.delta_frames = None <NEW_LINE> <DEDENT> def set_frames_and_frequency(self, sortin... | Mixin for spike train comparisons to define:
* delta_time / delta_frames
* sampling frequency
* n_jobs | 62598f6d21bff66bcd722415 |
class PreprocessorError(Exception): <NEW_LINE> <INDENT> file_name: str <NEW_LINE> line_number: int <NEW_LINE> message: str <NEW_LINE> def __init__(self, file_name: str, line_number: int, message: str) -> None: <NEW_LINE> <INDENT> self.file_name = file_name <NEW_LINE> self.line_number = line_number <NEW_LINE> self.messa... | Error raised during preprocessing. | 62598f6d8a349b6b436859f7 |
class Spider(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.session = requests.session() <NEW_LINE> self.html = '' <NEW_LINE> <DEDENT> def login(self, url, data, headers = None): <NEW_LINE> <INDENT> if headers == None: <NEW_LINE> <INDENT> self.session.post(url, data = data) <NEW_LINE> <DEDENT... | This is a general spider to get the information from the web,
with the login function. | 62598f6dd10714528d69d683 |
class TemporalAuthServicer(object): <NEW_LINE> <INDENT> def Register(self, request, context): <NEW_LINE> <INDENT> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!') <NEW_LINE> <DEDENT> def Recover(self... | TemporalAuth implements Temporal's authentication and account management APIs
| 62598f6d16aa5153ce3ffcb2 |
class TemplateRendererTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self._template_renderer = ServerInstance.ForLocal().template_renderer <NEW_LINE> <DEDENT> def testSimpleWiring(self): <NEW_LINE> <INDENT> template = Motemplate('hello {{?true}}{{strings.extension}}{{/}}') <NEW_LINE> ... | Basic test for TemplateRenderer.
When the DataSourceRegistry conversion is finished then we could do some more
meaningful tests by injecting a different set of DataSources. | 62598f6d925a0f43d25e77f2 |
class DataPack(object): <NEW_LINE> <INDENT> DATA_FILENAME = 'data.dill' <NEW_LINE> def __init__(self, data: list, context: dict={}): <NEW_LINE> <INDENT> self._dataframe = pd.DataFrame(data) <NEW_LINE> self._context = context <NEW_LINE> <DEDENT> def __len__(self) -> int: <NEW_LINE> <INDENT> return self._dataframe.shape[... | Matchzoo DataPack data structure, store dataframe and context.
Example:
>>> features = [([1,3], [2,3]), ([3,0], [1,6])]
>>> context = {'vocab_size': 2000}
>>> dp = DataPack(data=features,
... context=context)
>>> type(dp.sample(1))
<class 'matchzoo.datapack.DataPack'>
>>> len(... | 62598f6d0383005118f6cec0 |
class AccountLock(models.Model): <NEW_LINE> <INDENT> account = models.ForeignKey('Account', unique=True) <NEW_LINE> created_at = models.DateTimeField(auto_now_add=True) | Model for lock in account operation locking mechanism. | 62598f6da8ecb033258709be |
class AtomFeaturizer: <NEW_LINE> <INDENT> def __init__(self, atom_features_json: str): <NEW_LINE> <INDENT> if not os.path.exists(atom_features_json): <NEW_LINE> <INDENT> raise FileNotFoundError("atom_features_json not found:", atom_features_json) <NEW_LINE> <DEDENT> with open(atom_features_json, "r") as f: <NEW_LINE> <... | Featurize each atom in structure
Parameters
----------
atom_features_json: path to the precomputed "atom_init.json" | 62598f6d63f4b57ef008594b |
class CanFrameEncodingTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_frame_constructor(self): <NEW_LINE> <INDENT> frame = Frame(id=42) <NEW_LINE> self.assertEqual(frame.id, 42) <NEW_LINE> self.assertEqual(frame.data, bytes()) <NEW_LINE> self.assertFalse(frame.extended) <NEW_LINE> self.assertFalse(frame.trans... | Testcase grouping all the functions relating to encoding CAN frames. | 62598f6d711fe17d825dfea2 |
class Joomla(CMS): <NEW_LINE> <INDENT> def __init__(self, path, name): <NEW_LINE> <INDENT> super().__init__(path, name) <NEW_LINE> <DEDENT> def get_version(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def download_clean_installation(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def search_suspect_content(s... | This class represents a Joomla installation | 62598f6d7c178a314d78cc5b |
class AutoCompletion( Suggestion ): <NEW_LINE> <INDENT> def __init__( self, originalText, suggestedText, helpText=None ): <NEW_LINE> <INDENT> if len( suggestedText ) > 0: <NEW_LINE> <INDENT> assertionText = "Attempted to create AutoCompletion %s from %s, " "but %s was not found." <NEW_LINE> w... | Encapsulates a single auto-completed suggestion.
Basically the same as a suggestion, except that it requires either
(1) that each word of the original text be contained in the
suggestion, or (2) that the suggestion be empty (indicating a
failed autocompletion). | 62598f6d15fb5d323ce7e4df |
class HostnameNotResolvableOrDNSUnavailable(Exception): <NEW_LINE> <INDENT> def __init__(self, hostname): <NEW_LINE> <INDENT> self.name = hostname <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return 'Unable to resolve host %s' % self.name | Raised if a host name does not resolve or DNS server cannot be reached. | 62598f6dcad5886f8bdc4ad8 |
class Alien(Sprite): <NEW_LINE> <INDENT> def __init__(self, settings, screen): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.screen = screen <NEW_LINE> self.settings = settings <NEW_LINE> self.image = pygame.image.load('images/alien.png') <NEW_LINE> self.image = pygame.transform.scale(self.image, (settings.ali... | Spawn aliens and control their behaviour | 62598f6dd99f1b3c44d04e6d |
class EnvelopeOriginalFile(BaseEnvelopeFile): <NEW_LINE> <INDENT> class Meta(BaseEnvelopeFile.Meta): <NEW_LINE> <INDENT> db_table = 'core_envelope_original_file' <NEW_LINE> <DEDENT> _download_view_name = 'api:envelope-original-file-download' <NEW_LINE> _class_specifier = 'original_file' <NEW_LINE> envelope = models.For... | Used to describe original non-XML files uploaded to the envelope
that are converted to and stored as XML EnvelopeFiles. | 62598f6d167d2b6e312b6736 |
class NewMazeDialog(object): <NEW_LINE> <INDENT> def __init__(self, maze_editor, parent): <NEW_LINE> <INDENT> self.maze_editor = maze_editor <NEW_LINE> top = self.top = Toplevel(parent) <NEW_LINE> Label(top, text="New Maze Dimensions").pack() <NEW_LINE> self.width_frame = Frame(self.top) <NEW_LINE> Label(self.width_fra... | Prompts the user for a size and height and creates a new maze | 62598f6d4d74a7450cd58ab5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.