code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class AbstractGraph(metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> @property <NEW_LINE> @abc.abstractmethod <NEW_LINE> def directed(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def add_vertex(self, v: int): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> de... | Abstract class representing graph structure.
Consider nodes to be integers, because they could be mapped into any data. | 625990697047854f46340b77 |
class CanonicalizationMethodType (pyxb.binding.basis.complexTypeDefinition): <NEW_LINE> <INDENT> _TypeDefinition = None <NEW_LINE> _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_MIXED <NEW_LINE> _Abstract = False <NEW_LINE> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'CanonicalizationMethodTy... | Complex type {http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethodType with content type MIXED | 625990698e7ae83300eea850 |
class Weapon(object): <NEW_LINE> <INDENT> def attack(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def speed(self): <NEW_LINE> <INDENT> raise NotImplementedError | Weapon common class | 62599069aad79263cf42ff78 |
class Accuracy(EvalMetric): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Accuracy, self).__init__('accuracy') <NEW_LINE> <DEDENT> def update(self, label, pred): <NEW_LINE> <INDENT> pred = pred.asnumpy() <NEW_LINE> label = label.asnumpy().astype('int32') <NEW_LINE> py = numpy.argmax(pred, axis=1) <N... | Calculate accuracy | 62599069d6c5a102081e38ea |
class TokenDoesNotExists(Exception): <NEW_LINE> <INDENT> pass | Token does not (yet) exists
| 625990697b180e01f3e49c45 |
class Point(object): <NEW_LINE> <INDENT> def __init__(self, name, coords, classification=None, alpha=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.coords = coords <NEW_LINE> self.classification = classification <NEW_LINE> self.alpha = alpha <NEW_LINE> <DEDENT> def copy(self): <NEW_LINE> <INDENT> return de... | A Point has a name and a list or tuple of coordinates, and optionally a
classification, and/or alpha value. | 62599069460517430c432c36 |
class ComboEntryField(gtk.HBox): <NEW_LINE> <INDENT> def __init__(self, values): <NEW_LINE> <INDENT> gtk.HBox.__init__(self) <NEW_LINE> self.combo = gtk.combo_box_entry_new_text() <NEW_LINE> for value in values: <NEW_LINE> <INDENT> self.combo.append_text(value) <NEW_LINE> <DEDENT> self.pack_start(self.combo) <NEW_LINE>... | Select from multiple fixed values, but allow the user to enter text | 625990694428ac0f6e659cf4 |
class SysVarDigitalLabSmith_AV201Position(SysVarDigital): <NEW_LINE> <INDENT> states = ('A', 'closed', 'B') <NEW_LINE> def __init__(self, name, valvesControllerPort, helpLine='', editable=True): <NEW_LINE> <INDENT> SysVarDigital.__init__(self, name, self.states, LabSmithEIB, helpLine=helpLine, editable=editable) <NEW_L... | A LabSmith AV201 valve position | 625990698e7ae83300eea851 |
class Trie: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.root = self.__get_node() <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def __get_node(): <NEW_LINE> <INDENT> return TrieNode() <NEW_LINE> <DEDENT> def insert(self, word) -> None: <NEW_LINE> <INDENT> current_node = self.root <NEW_LINE> for char ... | Trie class
Implements 'Trie' tree.
Supported operations are:
- insert: Inserts a word in the Trie
- search: Indicates whether a word exists in the Trie or not
- words_with_prefix: Finds all words that starts by a given prefix | 6259906921bff66bcd724429 |
class RecipeSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> ingredients = serializers.PrimaryKeyRelatedField( many=True, queryset = Ingredient.objects.all() ) <NEW_LINE> tags = serializers.PrimaryKeyRelatedField( many=True, queryset = Tag.objects.all() ) <NEW_LINE> class Meta(): <NEW_LINE> <INDENT> model =... | serializer for recipe obejct | 62599069adb09d7d5dc0bd2d |
class DescribeCertificatesResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.CertificateSet = None <NEW_LINE> self.TotalCount = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("CertificateSet") is not None... | DescribeCertificates返回参数结构体
| 6259906976e4537e8c3f0d46 |
class ScaledDotProductAttention(nn.Module): <NEW_LINE> <INDENT> def __init__(self, temperature, attn_dropout=0.1): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.temperature = temperature <NEW_LINE> self.dropout = nn.Dropout(attn_dropout) <NEW_LINE> <DEDENT> def forward(self, q, k, v, mask=None): <NEW_LINE> <IN... | 定义基于点积的Attention类.
:param temperature: 表示向量的维度,即v的向量维度
:param attn_dropout: | 625990696e29344779b01e15 |
class UserProfile(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField(User) <NEW_LINE> member = models.OneToOneField(Member) <NEW_LINE> favorite_videos = models.ManyToManyField( Video, related_name="%(class)s_favorite_set") <NEW_LINE> watch_later_videos = models.ManyToManyField( Video, related_name="%(class)... | A model describing a user profile. User profiles attach additional
information to a django User model. Here, a reference to a Member
object is held thus enabling access to a particular Member subclass
directly from the User. | 625990697c178a314d78e7cd |
class CapabilitiesFile(Element, HomogeneousList): <NEW_LINE> <INDENT> def __init__(self, config=None, pos=None, _name='capabilities', **kwargs): <NEW_LINE> <INDENT> Element.__init__(self, config=config, pos=pos, **kwargs) <NEW_LINE> HomogeneousList.__init__(self, vr.Capability) <NEW_LINE> <DEDENT> @xmlelement(name='cap... | capabilities element: represents an entire file.
The keyword arguments correspond to setting members of the same
name, documented below. | 62599069462c4b4f79dbd1ca |
class ADT(object): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> self.constr = self.__class__.__name__ <NEW_LINE> self.arg = args if len(args) != 1 else args[0] <NEW_LINE> <DEDENT> def __cmp__(self,other): <NEW_LINE> <INDENT> return self.__dict__.__cmp__(other.__dict__) <NEW_LINE> <DEDENT> def __re... | Algebraic Data Type.
This is a base class for all ADTs. ADT represented by a tuple of arguments,
stored in a val field. Arguments should be instances of ADT class, or numbers,
or strings. Empty set of arguments is permitted.
A one-tuple is automatically untupled, i.e., `Int(12)` has value `12`, not `(12,)`.
For conven... | 62599069442bda511e95d93a |
class Task(object): <NEW_LINE> <INDENT> def __init__(self,name,session): <NEW_LINE> <INDENT> self.session = session <NEW_LINE> self.name = name <NEW_LINE> <DEDENT> @property <NEW_LINE> def description(self): <NEW_LINE> <INDENT> if not hasattr(self,"_description"): <NEW_LINE> <INDENT> self._retrieve_data() <NEW_LINE> <D... | Contains data for each task.
Task is identified by id/name (the id used by the site to reference the problem)
Data is being loaded lazily so object initialization doesn't infer any cost. | 625990697047854f46340b79 |
class SearchForm(FlaskForm): <NEW_LINE> <INDENT> page = HiddenField('page') <NEW_LINE> search = SearchField( 'search', render_kw={"placeholder": "Ingrese nombre de usuario a buscar"}) <NEW_LINE> active = RadioField('active', coerce=int, choices=[(1, 'Activos'), (0, 'Bloqueados')], default=1) | Clase que se encarga de generar formulario para busqueda de usuarios
para luego realizar validaciones correspondientes, tanto del lado del
servidor como del cliente | 62599069d268445f2663a73f |
class DebugMetricsLogger(MetricsLogger): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(DebugMetricsLogger, self).__init__() <NEW_LINE> <DEDENT> def _format_name(self, *args, **kwargs): <NEW_LINE> <INDENT> pprint.pprint(("_format_name call:", args, kwargs)) <NEW_LINE> <DEDENT> def _gauge(self, *args,... | MetricsLogger that prints all calls for debugging purposes | 6259906956ac1b37e63038c4 |
class Explosion(Projectile): <NEW_LINE> <INDENT> lifetime: Tuple[int, int] <NEW_LINE> radius: int <NEW_LINE> hull_damage: int <NEW_LINE> energy_damage: int <NEW_LINE> strength: int | A very strange thing to call equipment, whatever way you look at it, yet defined in weapon_equip. | 625990698e7ae83300eea852 |
class Message(models.Model): <NEW_LINE> <INDENT> id = models.CharField(max_length=32, default=_random_uuid, primary_key=True) <NEW_LINE> type = models.CharField(max_length=10, choices=MessageType.choices) <NEW_LINE> sender = models.ForeignKey(Sender, related_name='messages') <NEW_LINE> application = models.ForeignKey(A... | a message to one or more people | 6259906991f36d47f2231a71 |
class GroupInvitationSerializer(InvitationSeralizer): <NEW_LINE> <INDENT> group = (serializers .HyperlinkedRelatedField(queryset=Group.objects.all(), view_name='group-detail')) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = GroupInvitation <NEW_LINE> fields = ('url', 'accepted', 'inviter', 'invitee', 'created_on', ... | Serializer for a Group Invitation | 6259906932920d7e50bc780b |
class TaskResource(PandaModelResource): <NEW_LINE> <INDENT> from panda.api.users import UserResource <NEW_LINE> creator = fields.ForeignKey(UserResource, 'creator') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> queryset = TaskStatus.objects.all() <NEW_LINE> resource_name = 'task' <NEW_LINE> allowed_methods = ['get'] <NEW_... | Simple wrapper around django-celery's task API. | 6259906999cbb53fe68326aa |
class AbsoluteFilenames(Error): <NEW_LINE> <INDENT> pass | Files with absolute path inside archive forbidden
| 62599069009cb60464d02cfd |
class DataProcessor: <NEW_LINE> <INDENT> def get_train_examples(self, data_dir): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def get_dev_examples(self, data_dir): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def get_test_examples(self, input_file): <NEW_LINE> <INDENT> rais... | Base class for data converters for sequence classification data sets. | 62599069f548e778e596cd50 |
class resolve_coreferences_in_tokenized_sentences_args(object): <NEW_LINE> <INDENT> __slots__ = [ 'sentencesWithTokensSeparatedBySpace', ] <NEW_LINE> thrift_spec = ( None, (1, TType.LIST, 'sentencesWithTokensSeparatedBySpace', (TType.STRING,None), None, ), ) <NEW_LINE> def __init__(self, sentencesWithTokensSeparatedByS... | Attributes:
- sentencesWithTokensSeparatedBySpace | 62599069460517430c432c37 |
class writer(DictWriter): <NEW_LINE> <INDENT> pass | A wrapper for ris.io.DictWriter.
Unlike in the csv module, there is no difference between these classes. | 625990697d847024c075db9e |
@add_wrapper_method <NEW_LINE> class WfSerializationTrans(WfSrSerializationTrans): <NEW_LINE> <INDENT> def __init__( self, assert_sr=None, dtype=DFLT_DTYPE, format=DFLT_FORMAT, subtype=None, endian=None, ): <NEW_LINE> <INDENT> super().__init__(dtype, format, subtype, endian) <NEW_LINE> self.assert_sr = assert_sr <NEW_L... | An audio serializatiobn object like WfSrSerializationTrans, but working with waveforms only (sample rate fixed).
See WavSerializationTrans for explanations and doctest examples. | 625990698e71fb1e983bd28b |
class HtmlTagMismatchException(Exception): <NEW_LINE> <INDENT> pass | Pairing of the tags is not done properly | 6259906997e22403b383c6d2 |
class PyTautulliAuthenticationException(PyTautulliException): <NEW_LINE> <INDENT> pass | pytautulli authentication exception. | 6259906967a9b606de547684 |
class CancelActionMiddleware(object): <NEW_LINE> <INDENT> def __init__(self, get_response=None): <NEW_LINE> <INDENT> if get_response is None: <NEW_LINE> <INDENT> get_response = lambda x:x <NEW_LINE> <DEDENT> self.get_response = get_response <NEW_LINE> <DEDENT> def __call__(self, request): <NEW_LINE> <INDENT> return sel... | Django middleware that redirects to the next url
if the request has "cancel" parameter. | 625990695fc7496912d48e4a |
class PyAdam(mx.optimizer.Optimizer): <NEW_LINE> <INDENT> def __init__(self, learning_rate=0.001, beta1=0.9, beta2=0.999, epsilon=1e-8, lazy_update=True, **kwargs): <NEW_LINE> <INDENT> super(PyAdam, self).__init__(learning_rate=learning_rate, **kwargs) <NEW_LINE> self.beta1 = beta1 <NEW_LINE> self.beta2 = beta2 <NEW_LI... | python reference implemenation of adam | 62599069e5267d203ee6cfa0 |
class ReportStatus: <NEW_LINE> <INDENT> def __init__(self, report, jobs): <NEW_LINE> <INDENT> self.__report = report <NEW_LINE> self.__jobs = jobs <NEW_LINE> <DEDENT> @property <NEW_LINE> def slurm_sbatches(self): <NEW_LINE> <INDENT> return bool(self.jobs) <NEW_LINE> <DEDENT> @property <NEW_LINE> def report(self): <NEW... | Build a dictionary reporting benchmarks execution status | 6259906944b2445a339b7542 |
class JSONLogWebFormatter(JSONLogFormatter): <NEW_LINE> <INDENT> def _format_log_object(self, record, request_util): <NEW_LINE> <INDENT> json_log_object = super(JSONLogWebFormatter, self)._format_log_object(record, request_util) <NEW_LINE> if "correlation_id" not in json_log_object: <NEW_LINE> <INDENT> json_log_object.... | Formatter for web application log with correlation-id | 6259906999cbb53fe68326ab |
class Meta: <NEW_LINE> <INDENT> model = Career <NEW_LINE> exclude = ['created', 'modified', 'tiles', 'university', 'active'] | Defining serializer meta data. | 62599069baa26c4b54d50a6c |
class TensorDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, data_tensor, target_tensor): <NEW_LINE> <INDENT> assert data_tensor.size(0) == target_tensor.size(0) <NEW_LINE> self.data_tensor = data_tensor <NEW_LINE> self.target_tensor = target_tensor <NEW_LINE> <DEDENT> def __getitem__(self, index): <NEW_LINE> <... | 包装数据和目标张量的数据集.
通过沿着第一个维度索引两个张量来恢复每个样本.
Args:
data_tensor (Tensor): 包含样本数据.
target_tensor (Tensor): 包含样本目标 (标签). | 625990692ae34c7f260ac8ae |
class ShipmentUnassignManualShow(ModelView): <NEW_LINE> <INDENT> __name__ = 'stock.shipment.unassign.manual.show' <NEW_LINE> moves = fields.One2Many( 'stock.shipment.assigned.move', None, "Moves", domain=[('move.id', 'in', Eval('assigned_moves'))], depends=['assigned_moves'], help="The moves to unassign.") <NEW_LINE> a... | Manually Unassign Shipment | 62599069796e427e5384ff3d |
@httpretty.activate <NEW_LINE> @disable_signal(api, 'thread_deleted') <NEW_LINE> @mock.patch.dict("django.conf.settings.FEATURES", {"ENABLE_DISCUSSION_SERVICE": True}) <NEW_LINE> class ThreadViewSetDeleteTest(DiscussionAPIViewTestMixin, ModuleStoreTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> supe... | Tests for ThreadViewSet delete | 62599069a219f33f346c7fce |
class Hero(NPC): <NEW_LINE> <INDENT> bullets_created = 0 <NEW_LINE> bullets = [] <NEW_LINE> shoot_wait = 0 <NEW_LINE> def process(self, doc): <NEW_LINE> <INDENT> shot_used = False <NEW_LINE> for item in doc['cmd_lst']: <NEW_LINE> <INDENT> if item['cmd'] == 'move': <NEW_LINE> <INDENT> x_step = y_step = 0 <NEW_LINE> if i... | NPC teached by user | 6259906999cbb53fe68326ac |
class BadDataException(Exception): <NEW_LINE> <INDENT> pass | An exception raised when an argument comes in with improperly formatted or invalid data. | 62599069009cb60464d02cff |
class Messages(TLObject): <NEW_LINE> <INDENT> __slots__: List[str] = ["messages", "chats", "users"] <NEW_LINE> ID = 0x8c718e87 <NEW_LINE> QUALNAME = "types.messages.Messages" <NEW_LINE> def __init__(self, *, messages: List["raw.base.Message"], chats: List["raw.base.Chat"], users: List["raw.base.User"]) -> None: <NEW_LI... | This object is a constructor of the base type :obj:`~pyrogram.raw.base.messages.Messages`.
Details:
- Layer: ``122``
- ID: ``0x8c718e87``
Parameters:
messages: List of :obj:`Message <pyrogram.raw.base.Message>`
chats: List of :obj:`Chat <pyrogram.raw.base.Chat>`
users: List of :obj:`User <pyrogram... | 625990694e4d562566373bcd |
class AT_076: <NEW_LINE> <INDENT> inspire = Summon(CONTROLLER, RandomMurloc()) | Murloc Knight | 62599069f548e778e596cd52 |
@characteristic.with_repr(["logfile"]) <NEW_LINE> class LogfileProgress(Base): <NEW_LINE> <INDENT> __tablename__ = "logfile_progress" <NEW_LINE> source_url = Column(String(100), primary_key=True) <NEW_LINE> current_key = Column(Integer, default=0, nullable=False) | Logfile import progress.
Columns:
source_url: logfile source url
current_key: the key of the next logfile event to import. | 6259906901c39578d7f14318 |
class UserViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> permission_classes = (UserPermissions,) <NEW_LINE> serializer_class = UserSerializer <NEW_LINE> queryset = User.objects.all() | User API view | 6259906916aa5153ce401ca0 |
class MyTcpServerFactory(Factory): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.numProtocols = 1 <NEW_LINE> print("Serveur twisted reception TCP lance\n") <NEW_LINE> <DEDENT> def buildProtocol(self, addr): <NEW_LINE> <INDENT> print("Nombre de protocol dans factory", self.numProtocols) <NEW_LINE> ret... | self ici sera self.factory dans les objets MyTcpServer. | 625990695fc7496912d48e4b |
class itkContourSpatialObjectPoint2(itkSpatialObjectPointPython.itkSpatialObjectPoint2): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def __init__(self, *args): <NEW_LINE> <INDENT> _itkContourSpati... | Proxy of C++ itkContourSpatialObjectPoint2 class | 625990692ae34c7f260ac8af |
class TestReplaceDataSource(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(self): <NEW_LINE> <INDENT> with open(os.path.join(os.getcwd(), 'replace_data_source.test.json')) as data_file: <NEW_LINE> <INDENT> self.request = json.load(data_file) <NEW_LINE> <DEDENT> self.temp_folder = tempfil... | Test case for Replace Data Source task. | 6259906966673b3332c31bc5 |
class BuildItem(Base): <NEW_LINE> <INDENT> __tablename__ = 'build_item' <NEW_LINE> host_id = Column('host_id', Integer, ForeignKey('host.machine_id', ondelete='CASCADE', name='build_item_host_fk'), nullable=False) <NEW_LINE> service_instance_id = Column(Integer, ForeignKey('service_instance.id', name='build_item_svc_in... | Identifies the service_instance bindings of a machine. | 625990697047854f46340b7d |
class MsiModifiedPlessey(Barcode): <NEW_LINE> <INDENT> codetype = 'msi' <NEW_LINE> aliases = ('msi-plessey', 'msi plessey', 'msi_plessey', 'msiplessey') <NEW_LINE> class _Renderer(LinearCodeRenderer): <NEW_LINE> <INDENT> default_options = dict( LinearCodeRenderer.default_options, height=1, includecheck=False, includech... | >>> bc = MsiModifiedPlessey()
>>> bc # doctest: +ELLIPSIS
<....MsiModifiedPlessey object at ...>
>>> print(bc.render_ps_code('0123456789')) # doctest: +ELLIPSIS
%!PS-Adobe-2.0
%%Pages: (attend)
%%Creator: Elaphe powered by barcode.ps
%%BoundingBox: 0 0 127 72
%%LanguageLevel: 2
%%EndComments
...
gsave
0 0 moveto
1.0000... | 62599069d268445f2663a741 |
class MediaContainerView(object): <NEW_LINE> <INDENT> def __init__(self, context, request): <NEW_LINE> <INDENT> self.context = context <NEW_LINE> self.request = request <NEW_LINE> <DEDENT> def media_items(self, media_type=None): <NEW_LINE> <INDENT> provider = IMediaProvider(self.context) <NEW_LINE> provider.media_type ... | Media Container View
| 62599069aad79263cf42ff7d |
class WhiteListElement(object): <NEW_LINE> <INDENT> asString = None <NEW_LINE> def __init__(self, elementAsString): <NEW_LINE> <INDENT> self.asString = elementAsString <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.asString <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return u"Whi... | A class that represents a domain, IP address range or network segment that has been verified as not being suspicious. | 625990691f5feb6acb1643b5 |
class Httpd(SelectSocket.SelectSocketServer): <NEW_LINE> <INDENT> def __init__(self, iface=None, port=None, root=None): <NEW_LINE> <INDENT> super(Httpd, self).__init__(iface, port) <NEW_LINE> log("HTTP 服务启动, 服务端口:", port) <NEW_LINE> self.path_route = dict() <NEW_LINE> self.root = './www/' if root is None else root <NEW... | httpd | 625990692ae34c7f260ac8b0 |
class HaarCascade(): <NEW_LINE> <INDENT> _mCascade = None <NEW_LINE> _mName = None <NEW_LINE> _cache = {} <NEW_LINE> _fhandle = None <NEW_LINE> def __init__(self, fname=None, name=None): <NEW_LINE> <INDENT> if( name is None ): <NEW_LINE> <INDENT> self._mName = fname <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._m... | This class wraps HaarCascade files for the findHaarFeatures file.
To use the class provide it with the path to a Haar cascade XML file and
optionally a name. | 62599069d6c5a102081e38f0 |
class Course(object): <NEW_LINE> <INDENT> def __init__(self, client, course_id): <NEW_LINE> <INDENT> self.client = client <NEW_LINE> self.course_id = unicode(course_id) <NEW_LINE> <DEDENT> def enrollment(self, demographic=None, start_date=None, end_date=None, data_format=DF.JSON): <NEW_LINE> <INDENT> path = 'courses/{0... | Course-related analytics. | 625990694a966d76dd5f06bd |
class QueueProcessor(object): <NEW_LINE> <INDENT> def __init__(self, queueName, pollUrl, scoreUrl, apiKey, graders={}, pollTime=10, pollTimeout=30): <NEW_LINE> <INDENT> self.graders = {} <NEW_LINE> for (partNames, grader) in graders.iteritems(): <NEW_LINE> <INDENT> if isinstance(partNames, basestring): <NEW_LINE> <INDE... | Polls coursera for solutions, posts the grades. | 6259906991f36d47f2231a73 |
class DecoderRNN(Decoder): <NEW_LINE> <INDENT> def __init__(self, input_size, emb_size, hidden_size, dropout=.3, pad_idx=0): <NEW_LINE> <INDENT> super(DecoderRNN, self).__init__(input_size, emb_size, hidden_size, pad_idx) <NEW_LINE> output_size = input_size <NEW_LINE> self.dropout_layer = nn.Dropout(p=dropout) <NEW_LIN... | Decodes a sequence of words given an initial context vector
representing the input sequence and using a Bahdanau (MLP) attention. | 62599069009cb60464d02d01 |
class UserPermissionError(Exception): <NEW_LINE> <INDENT> pass | User has no permission to make this change | 62599069a8370b77170f1b8d |
class gtrend(extract): <NEW_LINE> <INDENT> def __init__(self, keyword:str, start:str, end:str) -> None: <NEW_LINE> <INDENT> self.keyword = keyword <NEW_LINE> super().__init__(start, end) <NEW_LINE> self.connect_API() <NEW_LINE> <DEDENT> def connect_API(self): <NEW_LINE> <INDENT> self.pytrend = TrendReq() <NEW_LINE> <DE... | Google trend data extraction.
The class connects to Google trend API for data download
and returns the processed data in DataFrame.
Attributes:
keyword: (str) The word of interest for trend data download.
start: (str) The start date of extracted data.
end: (str) The end date of extracted data. | 62599069379a373c97d9a7e7 |
class Tests(IMP.test.TestCase): <NEW_LINE> <INDENT> def _test_allp(self): <NEW_LINE> <INDENT> m = IMP.Model() <NEW_LINE> ps = [] <NEW_LINE> psr = [] <NEW_LINE> for i in range(0, 50): <NEW_LINE> <INDENT> p = IMP.Particle(m) <NEW_LINE> ps.append(p) <NEW_LINE> if i % 5 == 0: <NEW_LINE> <INDENT> psr.append(p) <NEW_LINE> <D... | Tests for all pairs pair container | 625990699c8ee82313040d6c |
class BasicView(ElementaryView): <NEW_LINE> <INDENT> isexecutable = False <NEW_LINE> def __init__(self, context, request, parent=None, wizard=None, stepid=None, **kwargs): <NEW_LINE> <INDENT> super(BasicView, self).__init__(context, request, parent, wizard, stepid, **kwargs) <NEW_LINE> self.finished_successfully = True... | Basic view | 6259906901c39578d7f14319 |
class EnableJITTracking(PolyJITConfig): <NEW_LINE> <INDENT> def __init__(self, *args, project=None, **kwargs): <NEW_LINE> <INDENT> super(EnableJITTracking, self).__init__( *args, project=project, **kwargs) <NEW_LINE> self.project = project <NEW_LINE> <DEDENT> def __call__(self, binary_command, *args, **kwargs): <NEW_LI... | The run and given extensions store polli's statistics to the database. | 62599069adb09d7d5dc0bd33 |
@api.route('/<string:cveId>') <NEW_LINE> @api.doc(params={'cveId': 'Id of CVE item'}) <NEW_LINE> class CVE(Resource): <NEW_LINE> <INDENT> def __init__(self, Resource): <NEW_LINE> <INDENT> self.api = api <NEW_LINE> <DEDENT> @api.doc(description='Get Cve by cve id. \n\n ' '* `cveId` format: CVE-0000-0... | CVE with cveId | 6259906921bff66bcd72442f |
class TupelTest(unittest.TestCase): <NEW_LINE> <INDENT> def testCreate(self): <NEW_LINE> <INDENT> a = ('a', 'beh', 1, False, None, 'z') <NEW_LINE> self.assertEqual(6, len(a)) <NEW_LINE> self.assertEqual('a', a[0]) <NEW_LINE> self.assertEqual(0, a[3]) <NEW_LINE> self.assertEqual('z', a[-1]) <NEW_LINE> self.assertEqual((... | Tupel sind read-only Listen | 6259906916aa5153ce401ca2 |
class CardsEnoughTurn(PlayerTurn): <NEW_LINE> <INDENT> pass | Карт достаточно. | 62599069435de62698e9d5d4 |
class Material(object): <NEW_LINE> <INDENT> def __init__(self, description, fu, fy, E, poisson_ratio = 0.3): <NEW_LINE> <INDENT> self.description = description <NEW_LINE> self.fu = fu <NEW_LINE> self.fy = fy <NEW_LINE> self.E = E <NEW_LINE> self.poisson_ratio = poisson_ratio <NEW_LINE> <DEDENT> def __str__(self): <NEW_... | Class describes steel material properties. | 62599069167d2b6e312b8172 |
class JournalEntryParser(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def entry_to_log_event(entry): <NEW_LINE> <INDENT> time = entry['_SOURCE_REALTIME_TIMESTAMP'].timestamp() <NEW_LINE> hw_id = "" if snowflake.snowflake() is None else snowflake.snowflake() <NEW_LINE> int_map = {'exit_status': entry['EXIT_STAT... | Utility class for parsing journalctl entries into log events for scribe | 625990697c178a314d78e7d0 |
class Dpad(InputDevice): <NEW_LINE> <INDENT> def __init__(self, name, up, down, left, right): <NEW_LINE> <INDENT> super(Dpad, self).__init__(name) <NEW_LINE> self.last_direction = 1, 0 <NEW_LINE> self.default = 0, 0, 0, 0 <NEW_LINE> self.up = up <NEW_LINE> self.down = down <NEW_LINE> self.left = left <NEW_LINE> self.ri... | A Dpad object represents an input device that can input 8 discrete directions through
a combination of four individual buttons, one for up, down, left, and right. | 62599069ac7a0e7691f73cb0 |
class InstrumentModelImpl(ResourceSimpleImpl): <NEW_LINE> <INDENT> def on_simpl_init(self): <NEW_LINE> <INDENT> self.instrument_agent = InstrumentAgentImpl(self.clients) <NEW_LINE> self.instrument_device = InstrumentDeviceImpl(self.clients) <NEW_LINE> self.policy = ModelPolicy(self.clients) <NEW_LINE> self.add_lce_prec... | @brief resource management for InstrumentModel resources | 62599069cb5e8a47e493cd68 |
class Collections(enum.Enum): <NEW_LINE> <INDENT> OPERATIONS = ( 'operations', 'operations/{operationsId}', {}, [u'operationsId'] ) <NEW_LINE> ORGANIZATIONS = ( 'organizations', 'organizations/{organizationsId}', {}, [u'organizationsId'] ) <NEW_LINE> PROJECTS = ( 'projects', 'projects/{projectId}', {}, [u'projectId'] )... | Collections for all supported apis. | 625990697047854f46340b7e |
class CheckConfigNoReplace(GenericCheckBase): <NEW_LINE> <INDENT> def __init__(self, base): <NEW_LINE> <INDENT> GenericCheckBase.__init__(self, base) <NEW_LINE> self.url = 'http://fedoraproject.org/wiki/' 'Packaging/Guidelines#Configuration_files' <NEW_LINE> self.text = '%config files are marked norep... | '%config files are marked noreplace or reason justified. | 625990697047854f46340b7f |
class Concat(AtomicFunction): <NEW_LINE> <INDENT> def __init__(self, dim=0, **kwargs): <NEW_LINE> <INDENT> self.__dim = dim <NEW_LINE> super(Concat, self).__init__(Out=1, **kwargs) <NEW_LINE> <DEDENT> def fn(self, *args): <NEW_LINE> <INDENT> return torch.cat(args, dim=self.__dim) | A wrapper around torch.cat | 625990693539df3088ecda69 |
class GroupSerializer(serializers.HyperlinkedModelSerializer): <NEW_LINE> <INDENT> name = serializers.SerializerMethodField('get_group_name') <NEW_LINE> type = serializers.SerializerMethodField('get_group_type') <NEW_LINE> data = serializers.SerializerMethodField('get_group_data') <NEW_LINE> def get_group_name(self, gr... | Serializer for model interactions | 625990691f5feb6acb1643b7 |
class LogInForm(wtf.Form): <NEW_LINE> <INDENT> username = wtf.TextField('Username: ',[validators.Required()]) <NEW_LINE> password = wtf.PasswordField('Password: ',[validators.Required()]) | This is the Log In form
.. method:: LogInForm(username, password)
:param username: Username of user
:type username: unicode
:param password: Password of user
:type password: unicode
:rtype: Form instance | 625990695fdd1c0f98e5f74f |
class AppOnboardingRequest(Model): <NEW_LINE> <INDENT> def __init__(self, name: str=None, version: str=None, provider: str=None, checksum: str=None, app_package_path: str=None, user_defined_data: UserDefinedDatadef=None): <NEW_LINE> <INDENT> self.swagger_types = { 'name': str, 'version': str, 'provider': str, 'checksum... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 625990698e7ae83300eea858 |
class TestAdd2UsersWithSameUsername(testLib.RestTestCase): <NEW_LINE> <INDENT> def assertResponse(self, respData, count = None, errCode = testLib.RestTestCase.SUCCESS): <NEW_LINE> <INDENT> expected = { 'errCode' : errCode } <NEW_LINE> if count is not None: <NEW_LINE> <INDENT> expected['count'] = count <NEW_LINE> <DEDE... | Tests that adding a duplicate user name fails | 62599069be8e80087fbc0855 |
class NamesTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_first_last_name(self): <NEW_LINE> <INDENT> formatted_name = get_formatted_name('sam', 'chia') <NEW_LINE> self.assertEqual(formatted_name, 'Sam Chia') <NEW_LINE> <DEDENT> def test_first_last_middle_name(self): <NEW_LINE> <INDENT> formatted_name = get_f... | Tests for 'name_function.py' | 625990692c8b7c6e89bd4fb0 |
class Flake8Isort5(Flake8IsortBase): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> if self.filename is not self.stdin_display_name: <NEW_LINE> <INDENT> file_path = Path(self.filename) <NEW_LINE> isort_config = isort.settings.Config( settings_path=file_path.parent) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> ... | class for isort >=5 | 625990690a50d4780f7069a5 |
class MonitoredException(Exception): <NEW_LINE> <INDENT> pass | Thrown when a Handler finds an Exception from a monitored log | 6259906932920d7e50bc7811 |
class Cmd: <NEW_LINE> <INDENT> _index = "setup" <NEW_LINE> def __init__(self, args: dict): <NEW_LINE> <INDENT> self._url = args.config <NEW_LINE> self._args = args.args <NEW_LINE> self._cluster_conf = args.cluster_conf <NEW_LINE> <DEDENT> @property <NEW_LINE> def args(self) -> str: <NEW_LINE> <INDENT> return self._args... | Setup Command | 625990694e4d562566373bd1 |
class BuildRequestHandler(SocketServer.StreamRequestHandler): <NEW_LINE> <INDENT> def build(self, repo, subsystem, subcommand): <NEW_LINE> <INDENT> configuration = { "application" : "application" } <NEW_LINE> exception_config = ConfigParser.ConfigParser() <NEW_LINE> exception_config.read("%s/exceptions.ini"%self.server... | Handles incoming TCP connections and executes a build on the proper
project using Werkzeug. | 625990697d847024c075dba4 |
class WorkItemUpdate(WorkItemTrackingResourceReference): <NEW_LINE> <INDENT> _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, 'fields': {'key': 'fields', 'type': '{WorkItemFieldUpdate}'}, 'id': {'key': 'id', 'type': 'int'}, 'relations': {'key': 'relations', 'type': 'WorkItemRelationUpdates'}, 'rev': {'key': 're... | WorkItemUpdate.
:param url:
:type url: str
:param fields:
:type fields: dict
:param id:
:type id: int
:param relations:
:type relations: :class:`WorkItemRelationUpdates <work-item-tracking.v4_0.models.WorkItemRelationUpdates>`
:param rev:
:type rev: int
:param revised_by:
:type revised_by: :class:`IdentityReference <w... | 62599069fff4ab517ebcefe5 |
class Simulator(Container): <NEW_LINE> <INDENT> def simulate(self, basetime=0, ticks=1): <NEW_LINE> <INDENT> t = basetime <NEW_LINE> while t < (basetime + ticks): <NEW_LINE> <INDENT> self.execute(t) <NEW_LINE> t += 1 | A container intended to be the starting point for implementing or
holding gates for interfaces.
Does not act as a gate. | 625990694428ac0f6e659cfd |
class FakePropertyFactory(BaseFake): <NEW_LINE> <INDENT> def __init__(self, organization=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.organization = organization <NEW_LINE> <DEDENT> def get_property(self, organization=None, **kw): <NEW_LINE> <INDENT> property_details = { 'organization': self._get_attr(... | Factory Class for producing Property instances. | 6259906921bff66bcd724431 |
class LogProgressThread(threading.Thread): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(LogProgressThread, self).__init__() <NEW_LINE> self.setDaemon(True) <NEW_LINE> self.finished = False <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> global tracker <NEW_LINE> if not globals.dry_run and gl... | Background thread that reports progress to the log,
every --progress-rate seconds | 6259906997e22403b383c6d8 |
class StatusReporter(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._latest_result = None <NEW_LINE> self._last_result = None <NEW_LINE> self._lock = threading.Lock() <NEW_LINE> self._error = None <NEW_LINE> self._done = False <NEW_LINE> <DEDENT> def __call__(self, **kwargs): <NEW_LINE> <INDE... | Object passed into your main() that you can report status through.
Example:
>>> reporter = StatusReporter()
>>> reporter(timesteps_total=1) | 6259906916aa5153ce401ca4 |
class MpiPool(object): <NEW_LINE> <INDENT> def __init__(self, mapFunction): <NEW_LINE> <INDENT> self.rank = MPI.COMM_WORLD.Get_rank() <NEW_LINE> self.size = MPI.COMM_WORLD.Get_size() <NEW_LINE> self.mapFunction = mapFunction <NEW_LINE> <DEDENT> def map(self, function, sequence): <NEW_LINE> <INDENT> sequence = mpiBCast(... | Implementation of a mpi based pool. Currently it supports only the map function.
:param mapFunction: the map function to apply on the mpi nodes | 625990693617ad0b5ee0791f |
@configure.adapter( for_=IResource, provides=IRolePermissionManager, trusted=True) <NEW_LINE> class PloneRolePermissionManager(PloneSecurityMap): <NEW_LINE> <INDENT> key = 'roleperm' <NEW_LINE> def grant_permission_to_role(self, permission_id, role_id): <NEW_LINE> <INDENT> PloneSecurityMap.add_cell(self, permission_id,... | Provide adapter that manages role permission data in an object attribute
| 625990697d847024c075dba5 |
class PrivateUserApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = create_user( email='test@gmail.com', password='testpassword', name='test', ) <NEW_LINE> self.client = APIClient() <NEW_LINE> self.client.force_authenticate(user=self.user) <NEW_LINE> <DEDENT> def test_retrive_profi... | Test API requests that require authentication | 62599069167d2b6e312b8173 |
class SceneMouseEvent(SceneEvent): <NEW_LINE> <INDENT> def __init__(self, event, canvas, **kwds): <NEW_LINE> <INDENT> self.mouse_event = event <NEW_LINE> super(SceneMouseEvent, self).__init__(type=event.type, canvas=canvas, **kwds) <NEW_LINE> <DEDENT> @property <NEW_LINE> def pos(self): <NEW_LINE> <INDENT> return self.... | Represents a mouse event that occurred on a SceneCanvas. This event is
delivered to all entities whose mouse interaction area is under the event. | 62599069097d151d1a2c2839 |
class _TempPopup(Frame): <NEW_LINE> <INDENT> def __init__(self, screen, parent, x, y, w, h): <NEW_LINE> <INDENT> self.palette = defaultdict(lambda: parent.frame.palette["focus_field"]) <NEW_LINE> self.palette["selected_field"] = parent.frame.palette["selected_field"] <NEW_LINE> self.palette["selected_focus_field"] = pa... | An internal Frame for creating a temporary pop-up for a Widget in another Frame. | 6259906967a9b606de547687 |
class V1Stage(object): <NEW_LINE> <INDENT> openapi_types = { 'uuid': 'str', 'stage': 'V1Stages', 'stage_conditions': 'list[V1StageCondition]' } <NEW_LINE> attribute_map = { 'uuid': 'uuid', 'stage': 'stage', 'stage_conditions': 'stage_conditions' } <NEW_LINE> def __init__(self, uuid=None, stage=None, stage_conditions=No... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 625990697c178a314d78e7d1 |
class ListDeletedEventRequest(Request): <NEW_LINE> <INDENT> deserialized_types = { 'object_type': 'str', 'request_id': 'str', 'timestamp': 'datetime', 'locale': 'str', 'body': 'ask_sdk_model.services.list_management.list_body.ListBody' } <NEW_LINE> attribute_map = { 'object_type': 'type', 'request_id': 'requestId', 'ti... | :param request_id: Represents the unique identifier for the specific request.
:type request_id: (optional) str
:param timestamp: Provides the date and time when Alexa sent the request as an ISO 8601 formatted string. Used to verify the request when hosting your skill as a web service.
:type timestamp: (optional) dateti... | 625990692ae34c7f260ac8b3 |
class WaitForCompletion(AuthView): <NEW_LINE> <INDENT> def handle(self, request: Request, helper) -> Response: <NEW_LINE> <INDENT> if "continue_setup" in request.POST: <NEW_LINE> <INDENT> return helper.next_step() <NEW_LINE> <DEDENT> return self.respond("sentry_auth_rippling/wait-for-completion.html") | Rippling provides the Metadata URL during initial application setup, before
configuration values have been saved, thus we cannot immediately attempt to
create an identity for the setting up the SSO.
This is simply an extra step to wait for them to complete that. | 62599069ac7a0e7691f73cb2 |
class MandelTileProvider(DynamicTileProvider): <NEW_LINE> <INDENT> def __init__(self, tilecache): <NEW_LINE> <INDENT> DynamicTileProvider.__init__(self, tilecache) <NEW_LINE> <DEDENT> filext = 'png' <NEW_LINE> tilesize = 256 <NEW_LINE> aspect_ratio = 1.0 <NEW_LINE> def _load_dynamic(self, tile_id, outfile): <NEW_LINE> ... | MandelTileProvider objects are used for generating tiles of the
Mandelbrot set using jrMandel (<http://freshmeat.net/projects/jrmandel/>).
Constructor: MandelTileProvider(TileCache) | 625990691b99ca400229011b |
class SmallerSetJsonField(serializers.JSONField): <NEW_LINE> <INDENT> def to_representation(self, value): <NEW_LINE> <INDENT> limited_dict = {} <NEW_LINE> if 'profile_image_url_https' in value: <NEW_LINE> <INDENT> limited_dict['profile_image_url'] = value['profile_image_url_https'] <NEW_LINE> <DEDENT> limited_dict['url... | Class to expose Smaller set of JSON fields. | 6259906971ff763f4b5e8f71 |
class QNetwork(nn.Module): <NEW_LINE> <INDENT> def __init__(self, state_size, action_size, seed, fc1_units=64, fc2_units=32): <NEW_LINE> <INDENT> super(QNetwork, self).__init__() <NEW_LINE> self.seed = torch.manual_seed(seed) <NEW_LINE> self.fc1 = nn.Linear(state_size, fc1_units) <NEW_LINE> self.fc2 = nn.Linear(fc1_uni... | Actor (Policy) Model. | 62599069d486a94d0ba2d78a |
class SnippetViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Snippet.objects.all() <NEW_LINE> serializer_class = SnippetSerializer <NEW_LINE> permission_classes = ( permissions.IsAuthenticatedOrReadOnly, IsOwnerOrReadOnly,) <NEW_LINE> @action(detail=True, renderer_classes=[renderers.StaticHTMLRenderer]) ... | This viewset automatically provides `list`, `create`, `retrieve`,
`update` and `destroy` actions.
Additionally we also provide an extra `highlight` action. | 62599069cb5e8a47e493cd69 |
class DevConfig(Config): <NEW_LINE> <INDENT> SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://gitu_m:sqlpass@localhost/blogger' <NEW_LINE> DEBUG = True | child configuration class for development | 62599069a8370b77170f1b90 |
class Table: <NEW_LINE> <INDENT> def __init__(self, header, body): <NEW_LINE> <INDENT> header_length = len(header) <NEW_LINE> self._check_body_length(body, header_length) <NEW_LINE> self._header = header <NEW_LINE> self._body = body <NEW_LINE> <DEDENT> @property <NEW_LINE> def header(self): <NEW_LINE> <INDENT> return c... | Simple implementation of a table. The Table class helps with accessing table structured data. | 625990697047854f46340b80 |
class TestXmlNs0BrowserSearchRequest(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 testXmlNs0BrowserSearchRequest(self): <NEW_LINE> <INDENT> pass | XmlNs0BrowserSearchRequest unit test stubs | 62599069f548e778e596cd57 |
class Client(Iface): <NEW_LINE> <INDENT> def __init__(self, iprot, oprot=None): <NEW_LINE> <INDENT> self._iprot = self._oprot = iprot <NEW_LINE> if oprot is not None: <NEW_LINE> <INDENT> self._oprot = oprot <NEW_LINE> <DEDENT> self._seqid = 0 <NEW_LINE> <DEDENT> def is_healthy(self, request): <NEW_LINE> <INDENT> self.s... | The base for any baseplate-based service.
Your service should inherit from this one so that common tools can interact
with any expected interfaces. | 6259906926068e7796d4e105 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.