code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Container(LatexObject, UserList): <NEW_LINE> <INDENT> def __init__(self, data=None, packages=None): <NEW_LINE> <INDENT> if data is None: <NEW_LINE> <INDENT> data = [] <NEW_LINE> <DEDENT> elif not isinstance(data, list): <NEW_LINE> <INDENT> data = [data] <NEW_LINE> <DEDENT> self.data = data <NEW_LINE> self.real_da...
A base class that groups multiple LaTeX classes. This class should be subclassed when a LaTeX class has content that is variable of variable length. It subclasses UserList, so it holds a list of elements that can simply be accessed by using normal list functionality, like indexing or appending. :param data: LaTeX cod...
62598fad7d847024c075c3a9
class SettingsEditor(forms.BaseForm): <NEW_LINE> <INDENT> def __iter__(self): <NEW_LINE> <INDENT> for field in super(SettingsEditor, self).__iter__(): <NEW_LINE> <INDENT> yield self.specialize(field) <NEW_LINE> <DEDENT> <DEDENT> def __getitem__(self, name): <NEW_LINE> <INDENT> field = super(SettingsEditor, self).__geti...
Base editor, from which customized forms are created
62598fadcc0a2c111447aff7
class UserTester(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> conf.database_url = "sqlite://" <NEW_LINE> self.temp_config_folder = tempfile.mkdtemp() <NEW_LINE> self.temp_projects_folder = tempfile.mkdtemp() <NEW_LINE> os.environ["OYPROJECTMANAGER_PATH"] = self.temp_config_folder <NEW_LI...
tests the User class
62598fadf548e778e596b58a
class itkNumericTraitsVUC1(object): <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> __swig_destroy__ = _itkNumericTraitsPython.delete_itkNumericTraitsVUC1 <NEW_LINE> def __init__(self, *args): <NEW_LI...
Proxy of C++ itkNumericTraitsVUC1 class
62598fad32920d7e50bc603a
class TimelineArgs(rdf_structs.RDFProtoStruct): <NEW_LINE> <INDENT> protobuf = timeline_pb2.TimelineArgs <NEW_LINE> rdf_deps = []
An RDF wrapper class for the timeline arguments message.
62598fade5267d203ee6b8f0
class anisotropicsphericaldf(sphericaldf): <NEW_LINE> <INDENT> def __init__(self,pot=None,denspot=None,rmax=None, scale=None,ro=None,vo=None): <NEW_LINE> <INDENT> sphericaldf.__init__(self,pot=pot,denspot=denspot,rmax=rmax, scale=scale,ro=ro,vo=vo)
Superclass for anisotropic spherical distribution functions
62598fad99cbb53fe6830ebe
class ConditionAnd(TriggerBase): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.trigger_received = defaultdict(self.trigger_received_factory) <NEW_LINE> self.trigger_params = defaultdict(dict) <NEW_LINE> self.triggers = [] <NEW_LINE> for trigger in args: <NEW_LINE>...
This class is a trigger that can be used to combine multiple triggers. It will only trigger once all of the child triggers have triggered at least once. :param *args: Child triggers that this trigger will wait for.
62598fad38b623060ffa9080
class R1(object): <NEW_LINE> <INDENT> index = 1
Register 1, stack pointer.
62598fadf9cc0f698b1c52bc
class ApplicationTypeUpdateParameters(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(ApplicationTypeUpdateParameters, self).__init__(**kwargs) <NEW_LINE> self.tags = kwargs.get('tags', N...
Application type update request. :param tags: A set of tags. Application type update parameters. :type tags: dict[str, str]
62598fad4e4d56256637240c
class CPE(OnePort): <NEW_LINE> <INDENT> def __init__(self, K, alpha=0.5, **kwargs): <NEW_LINE> <INDENT> self.kwargs = kwargs <NEW_LINE> self.args = (K, alpha) <NEW_LINE> K = cexpr(K) <NEW_LINE> alpha = cexpr(alpha) <NEW_LINE> self.K = K <NEW_LINE> self.alpha = alpha <NEW_LINE> self._Z = impedance(1 / (s ** alpha * K), ...
Constant phase element This has an impedance 1 / (s**alpha * K). When alpha == 0, the CPE is equivalent to a resistor of resistance 1 / K. When alpha == 1, the CPE is equivalent to a capacitor of capacitance K. When alpha == 0.5 (default), the CPE is a Warburg element. The phase of the impedance is -pi * alpha / 2...
62598fadd486a94d0ba2bfb4
class UnprocessableException(BaseException): <NEW_LINE> <INDENT> pass
request param is unprocessable
62598fad32920d7e50bc603b
class CredentialsError(Exception): <NEW_LINE> <INDENT> pass
Generic credentials error.
62598fad2c8b7c6e89bd37ac
class MiniEnumSymbol(MiniAst): <NEW_LINE> <INDENT> def __init__(self, enumType, enumValue, low, high): <NEW_LINE> <INDENT> self.enumType = enumType <NEW_LINE> self.enumValue = enumValue <NEW_LINE> super(MiniEnumSymbol, self).__init__(low, high) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "MiniEnu...
Mini-AST element representing an enumeration symbol.
62598fadd58c6744b42dc2ca
class MyTicketsListFilter(SimpleListFilter): <NEW_LINE> <INDENT> title = 'Tickets' <NEW_LINE> parameter_name = 'my_tickets' <NEW_LINE> def lookups(self, request, model_admin): <NEW_LINE> <INDENT> return ( ('True', _("My Tickets")), ('False', _("All")), ) <NEW_LINE> <DEDENT> def queryset(self, request, queryset): <NEW_L...
Filter tickets by created_by according to request.user
62598fad6e29344779b00642
class SMSCodeView(APIView): <NEW_LINE> <INDENT> def get(self, request, mobile): <NEW_LINE> <INDENT> redis_conn = get_redis_connection('verify_codes') <NEW_LINE> send_flag = redis_conn.get('send_flag_%s' % mobile) <NEW_LINE> if send_flag: <NEW_LINE> <INDENT> return Response({'message': '请求过于频繁'}, status=status.HTTP_400_...
smscode
62598fad3346ee7daa33763b
class Login(Handler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> return self.render("login.html") <NEW_LINE> <DEDENT> def post(self): <NEW_LINE> <INDENT> username = self.request.get("username") <NEW_LINE> password = self.request.get("password") <NEW_LINE> user = User.login(username, password) <NEW_LINE> if ...
This class is a child of Handler and is for Login.
62598fad97e22403b383aef4
class IterRelevantCIFLines(object): <NEW_LINE> <INDENT> def __init__(self, f): <NEW_LINE> <INDENT> self.f = f <NEW_LINE> self.cache = [] <NEW_LINE> self.in_comment = False <NEW_LINE> <DEDENT> def iter(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def rewind(self, line): <NEW_LINE> <INDENT> self.cache.appen...
A wrapper that reads lines from the CIF file. Irrelevant lines are ignored and a rewind method is present such that one can easily 'undo' a line read.
62598fad167d2b6e312b6f59
class ProxyStatus(Enum): <NEW_LINE> <INDENT> disabled = None <NEW_LINE> enabled = None <NEW_LINE> def __init__(self, string): <NEW_LINE> <INDENT> Enum.__init__(string)
``Proxy.ProxyStatus`` class Defines state of proxy .. note:: This class represents an enumerated type in the interface language definition. The class contains class attributes which represent the values in the current version of the enumerated type. Newer versions of the enumerated type may contain new...
62598fad1f5feb6acb162c06
class BrownPaperBagLight(LightEntity, RestoreEntity): <NEW_LINE> <INDENT> def __init__(self, light_address, gate: BpbGate): <NEW_LINE> <INDENT> self._gate = gate <NEW_LINE> self._light_id = light_address <NEW_LINE> self._state = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def light_id(self): <NEW_LINE> <INDENT> retur...
Representation of an BrownPaperBag Light.
62598fad851cf427c66b82a3
class FluxLimitFlatFileParser( FlatFileParser ): <NEW_LINE> <INDENT> def __init__( self, delimiter='\t', comment='#' ): <NEW_LINE> <INDENT> FlatFileParser.__init__( self, delimiter, comment ) <NEW_LINE> self.setHeader( ["Flux", "Lower", "Upper"] ) <NEW_LINE> self.noLimit = ['None'] <NEW_LINE> self.posInf = 1e3 <NEW_LI...
@summary: parser for reaction limit flat file
62598fad4428ac0f6e65850c
class InitializeOAuthResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_AuthorizationURL(self): <NEW_LINE> <INDENT> return self._output.get('AuthorizationURL', None) <NEW_LINE> <DEDENT> def get_OAuthTokenSecret(self): <NEW_L...
A ResultSet with methods tailored to the values returned by the InitializeOAuth Choreo. The ResultSet object is used to retrieve the results of a Choreo execution.
62598fad460517430c432051
class PoolFull(PoolError): <NEW_LINE> <INDENT> pass
Raised when putting a resource when the pool is full.
62598fad8e7ae83300ee908a
class Motor(Projectile): <NEW_LINE> <INDENT> accel: int <NEW_LINE> delay: int
A missile motor.
62598fadf548e778e596b58c
class WorkloadMetadataConfig(_messages.Message): <NEW_LINE> <INDENT> class NodeMetadataValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> UNSPECIFIED = 0 <NEW_LINE> SECURE = 1 <NEW_LINE> EXPOSE = 2 <NEW_LINE> <DEDENT> nodeMetadata = _messages.EnumField('NodeMetadataValueValuesEnum', 1)
WorkloadMetadataConfig defines the metadata configuration to expose to workloads on the node pool. Enums: NodeMetadataValueValuesEnum: NodeMetadata is the configuration for if and how to expose the node metadata to the workload running on the node. Fields: nodeMetadata: NodeMetadata is the configuration for i...
62598fad2c8b7c6e89bd37ad
class OscMessage(object): <NEW_LINE> <INDENT> def __init__(self, dgram): <NEW_LINE> <INDENT> self._dgram = dgram <NEW_LINE> self.parameters = [] <NEW_LINE> self._parse_datagram() <NEW_LINE> <DEDENT> def _parse_datagram(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self._address_regexp, index = osc_types.get_strin...
Representation of a parsed datagram representing an OSC message. An OSC message consists of an OSC Address Pattern followed by an OSC Type Tag String followed by zero or more OSC Arguments.
62598fad23849d37ff85109c
class RedditContentObject(RedditObject): <NEW_LINE> <INDENT> def __init__(self, reddit_session, name=None, json_dict=None, fetch=True, info_url=None): <NEW_LINE> <INDENT> if name is None and json_dict is None: <NEW_LINE> <INDENT> raise TypeError("Either the name or json dict is required.") <NEW_LINE> <DEDENT> if info_u...
Base class for everything besides the Reddit class. Represents actual reddit objects (Comment, Redditor, etc.).
62598fade5267d203ee6b8f1
class BatchNorm3d(_BatchNorm): <NEW_LINE> <INDENT> def _check_input_dim(self, input): <NEW_LINE> <INDENT> if input.dim() != 5: <NEW_LINE> <INDENT> raise ValueError('expected 5D input (got {}D input)' .format(input.dim())) <NEW_LINE> <DEDENT> super(BatchNorm3d, self)._check_input_dim(input)
Applies Batch Normalization over a 5d input that is seen as a mini-batch of 4d inputs .. math:: y = \frac{x - mean[x]}{ \sqrt{Var[x]} + \epsilon} * gamma + beta The mean and standard-deviation are calculated per-dimension over the mini-batches and gamma and beta are learnable parameter vectors of size N (where N...
62598fadb7558d5895463612
class NoInventory(Exception): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return "The requested operation failed as no inventory is available."
When requesting nodes from Duffy and no inventory is available
62598fade5267d203ee6b8f2
class CharBasedFoldDetector(FoldDetector): <NEW_LINE> <INDENT> def __init__(self, open_chars=('{'), close_chars=('}')): <NEW_LINE> <INDENT> super(CharBasedFoldDetector, self).__init__() <NEW_LINE> self.open_chars = open_chars <NEW_LINE> self.close_chars = close_chars <NEW_LINE> <DEDENT> def detect_fold_level(self, prev...
Fold detector based on trigger charachters (e.g. a { increase fold level and } decrease fold level).
62598fad32920d7e50bc603c
class computechi2(object): <NEW_LINE> <INDENT> def __init__(self, bvec, sqivar, amatrix): <NEW_LINE> <INDENT> self.sqivar = sqivar <NEW_LINE> self.amatrix = amatrix <NEW_LINE> if len(amatrix.shape) > 1: <NEW_LINE> <INDENT> self.nstar = amatrix.shape[1] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.nstar = 1 <NEW_L...
Solve the linear set of equations :math:`A x = b` using SVD. The attributes of this class are all read-only properties, implemented with :class:`~astropy.utils.decorators.lazyproperty`. Parameters ---------- bvec : :class:`numpy.ndarray` The :math:`b` vector in :math:`A x = b`. This vector has length :math:`N...
62598fad7047854f4633f3c2
class I2c(_object): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, I2c, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, I2c, name) <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def __init_...
API to Inter-Integrated Circuit. An I2c object represents an i2c master and can talk multiple i2c slaves by selecting the correct addressIt is considered best practice to make sure the address is correct before doing any calls on i2c, in case another application or even thread changed the addres on that bus. Multiple ...
62598fadd486a94d0ba2bfb7
class Like(TimeStampedModel): <NEW_LINE> <INDENT> creator = models.ForeignKey(user_models.User, null=True) <NEW_LINE> image = models.ForeignKey(Image, null=True, related_name='likes') <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return 'User: {} - Image Caption: {}'.format(self.creator.username, self.image.captio...
Like Model
62598fadfff4ab517ebcd7ce
class BettingMachine(object): <NEW_LINE> <INDENT> def prepareTicket(self, BettingTicket, UserSession, betList, currentBet): <NEW_LINE> <INDENT> BettingTicket.updateWinnerChoices(betList, currentBet) <NEW_LINE> BettingTicket.updateBetAmount(UserSession) <NEW_LINE> BettingTicket.updateOdds(UserSession) <NEW_LINE> Betting...
Betting Machine for Neopets Food Club.
62598fad4527f215b58e9ec9
class IContentTypeScopeProfileItem(zope.interface.Interface): <NEW_LINE> <INDENT> name = zope.schema.ASCII( title=_(u'Permitted Views'), description=_(u'List of views identified by their name that are ' 'permitted for this content type.'), required=False, )
Fields for the scope profile edit form. This is for the individual items.
62598fad3539df3088ecc29b
@_py3_str_compat <NEW_LINE> class StringTable: <NEW_LINE> <INDENT> def __init__(self, name=None, kids=None): <NEW_LINE> <INDENT> self.name = name or u'' <NEW_LINE> self.kids = kids or [] <NEW_LINE> <DEDENT> def fromRaw(self, data, i, limit): <NEW_LINE> <INDENT> i, (cpsublen, cpwValueLength, cpwType, self.name) = parseC...
WORD wLength; WORD wValueLength; WORD wType; WCHAR szKey[]; String Children[]; // list of zero or more String structures.
62598fad442bda511e95c440
class CapsuleLayer(layers.Layer): <NEW_LINE> <INDENT> def __init__(self, num_capsule, dim_capsule, routings=3, kernel_initializer='glorot_uniform', **kwargs): <NEW_LINE> <INDENT> super(CapsuleLayer, self).__init__(**kwargs) <NEW_LINE> self.num_capsule = num_capsule <NEW_LINE> self.dim_capsule = dim_capsule <NEW_LINE> s...
:param num_capsule: number of capsules in this layer :param dim_capsule: dimension of the output vectors of the capsules in this layer :param routings: number of iterations for the routing algorithm
62598fad63d6d428bbee2794
class Command(BaseCommand): <NEW_LINE> <INDENT> def handle(self, *args, **options): <NEW_LINE> <INDENT> buckets = {} <NEW_LINE> types = ['Actor', 'Campaign', 'Certificate', 'Domain', 'Email', 'Event', 'Indicator', 'IP', 'PCAP', 'RawData', 'Signature', 'Sample', 'Target'] <NEW_LINE> for otype in types: <NEW_LINE> <INDEN...
Script Class.
62598fad76e4537e8c3ef596
class OaipmhForm(Form): <NEW_LINE> <INDENT> baseurl=CharField(max_length=150,required=True, widget=TextInput(attrs={"placeholder":_("baseUrl"),"type":"text", "class":"form-control"}))
OAI-PMH bidez itemak datu-baseratzeko formularioa kargatzen du
62598fadaad79263cf42e7bd
class HasPriorityFilter(BaseFilter): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> BaseFilter.__init__(self, 'Priorities') <NEW_LINE> <DEDENT> def isMatch(self, task): <NEW_LINE> <INDENT> return task.priority
Task list filter allowing only tasks with a priority set
62598fad97e22403b383aef6
class ContainerDevice(StorageDevice): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> _formatClassName = abc.abstractproperty(lambda s: None, doc="The type of member devices' required format") <NEW_LINE> _formatUUIDAttr = abc.abstractproperty(lambda s: None, doc="The container UUID attribute in the member fo...
A device that aggregates a set of member devices. The only interfaces provided by this class are for addition and removal of member devices -- one set for modifying the member set of the python objects, and one for writing the changes to disk. The member set of the instance can be manipulated using the methods :meth:...
62598fad5166f23b2e2433c2
class StandardPlotLogAnalyzer(StandardLogAnalyzer): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> StandardLogAnalyzer.__init__(self,progress=True,doTimelines=True,doFiles=False)
This analyzer checks the current residuals and generates timelines
62598fad66673b3332c303b5
class NodeSlice(NodeOpr): <NEW_LINE> <INDENT> tag = 'Slice' <NEW_LINE> def __init__(self, indent, lineno, expr, flags, lower, upper): <NEW_LINE> <INDENT> Node.__init__(self, indent, lineno) <NEW_LINE> self.expr = transform(indent, lineno, expr) <NEW_LINE> self.flags = transform(indent, lineno, flags) <NEW_LINE> self.lo...
A slice of a series.
62598fade1aae11d1e7ce818
class WorkflowSampleViewSet(viewsets.ModelViewSet, UpdateModelMixin): <NEW_LINE> <INDENT> serializer_class = serializers.WorkflowSampleSerializer <NEW_LINE> queryset = models.WorkflowSample.objects.all() <NEW_LINE> filter_backends = (filters.SearchFilter, DjangoFilterBackend,) <NEW_LINE> filterset_fields = { 'sample__s...
ViewSet for retrieving Sample objects from the database
62598fad56b00c62f0fb289e
class ClimateData(peewee.Model): <NEW_LINE> <INDENT> timestamp = peewee.DateTimeField() <NEW_LINE> temperature = peewee.IntegerField() <NEW_LINE> humidity = peewee.IntegerField()
ORM model of the ClimateData table
62598fad283ffb24f3cf3876
class PreRes(tf.keras.layers.Layer): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(PreRes, self).__init__(**kwargs) <NEW_LINE> self.conv1 = tf.keras.layers.Conv2D(filters=64, kernel_size=(7, 7), strides=2, padding='same') <NEW_LINE> self.batch_norm = tf.keras.layers.BatchNormalization() <N...
# Arguments input: the tensor you want to pass through the layer #### Usage: Use it as a keras layer, PreRes has all of the attributes of the Layer API. #### Description: Conv2D --> BatchNormalization --> RelU --> MaxPool2D
62598fadf548e778e596b58d
class Case(ExpressionNode): <NEW_LINE> <INDENT> template = 'CASE %(cases)s ELSE %(default)s END' <NEW_LINE> case_joiner = ' ' <NEW_LINE> def __init__(self, *cases, **extra): <NEW_LINE> <INDENT> if not all(isinstance(case, When) for case in cases): <NEW_LINE> <INDENT> raise TypeError("Positional arguments must all be Wh...
An SQL searched CASE expression: CASE WHEN n > 0 THEN 'positive' WHEN n < 0 THEN 'negative' ELSE 'zero' END
62598fadf7d966606f747fce
class MockSys(object): <NEW_LINE> <INDENT> def __init__(self, current_version): <NEW_LINE> <INDENT> version_info = current_version.split(".") <NEW_LINE> version_info = map(int, version_info) <NEW_LINE> self.version = current_version + " Version details." <NEW_LINE> self.version_info = version_info
A mock sys module for passing to version-checking methods.
62598fad851cf427c66b82a5
class Event(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._links = set() <NEW_LINE> self._todo = set() <NEW_LINE> self._flag = False <NEW_LINE> self.hub = get_hub() <NEW_LINE> self._notifier = None <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '<%s %s _links[%s]>' % (self...
A synchronization primitive that allows one greenlet to wake up one or more others. It has the same interface as :class:`threading.Event` but works across greenlets. An event object manages an internal flag that can be set to true with the :meth:`set` method and reset to false with the :meth:`clear` method. The :meth:...
62598fad7d847024c075c3ad
class SequenceItem(object): <NEW_LINE> <INDENT> def __init__(self, actor): <NEW_LINE> <INDENT> self.shiftoffset = None <NEW_LINE> self.actor = actor <NEW_LINE> self.is_active = False <NEW_LINE> self.position = None <NEW_LINE> self.start = None <NEW_LINE> self.end = None <NEW_LINE> self.player_box = None <NEW_LINE> self...
A single item that will be rendered in a sequence :param object: An actor object that will be rendered according to the other parameters provided :return: None
62598faef548e778e596b58e
class RelativeTime(Field): <NEW_LINE> <INDENT> MUTABLE = False <NEW_LINE> def _isotime_to_timedelta(self, value): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> obj_time = time.strptime(value, '%H:%M:%S') <NEW_LINE> <DEDENT> except ValueError as e: <NEW_LINE> <INDENT> raise ValueError( "Incorrect RelativeTime value {!r} ...
Field for start_time and end_time video module properties. It was decided, that python representation of start_time and end_time should be python datetime.timedelta object, to be consistent with common time representation. At the same time, serialized representation should be "HH:MM:SS" This format is convenient to u...
62598faebaa26c4b54d4f29d
class UserRepos(APIView): <NEW_LINE> <INDENT> keys = ['id', 'name', 'description', 'fork', 'html_url', 'ssh_url'] <NEW_LINE> def get_repos(self): <NEW_LINE> <INDENT> return self.gh.my_repos() <NEW_LINE> <DEDENT> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> self.gh = GithubClient(request.user.id) <NEW_LI...
Retrieve user's repos from github.
62598faeb7558d5895463614
class D: <NEW_LINE> <INDENT> def __init__(self, d): <NEW_LINE> <INDENT> self.kgperm3 = d <NEW_LINE> self.lbperft3 = 0.062428 * d
Density
62598fae009cb60464d0150a
class APP(BasePage): <NEW_LINE> <INDENT> _package = 'com.xueqiu.android' <NEW_LINE> _activity = '.view.WelcomeActivityAlias' <NEW_LINE> def start_app(self): <NEW_LINE> <INDENT> if self._driver is None: <NEW_LINE> <INDENT> caps = {} <NEW_LINE> caps['platformName'] = 'Android' <NEW_LINE> caps['platformVersion'] = '6.0' <...
封装app的方法,用于启动 打开 重启 停止APP
62598fae4e4d562566372410
class PollfdPrinter(object): <NEW_LINE> <INDENT> def __init__(self, val): <NEW_LINE> <INDENT> self.val = val <NEW_LINE> <DEDENT> def to_string(self): <NEW_LINE> <INDENT> return ( '\n' '\tfd: {:0d} e: 0x{:03x} r: 0x{:03x}' .format( int( self.val['fd'] ), int( self.val['events'] ), int( self.val['revents'] ) ) )
Print the peer poll array for debugging.
62598fae26068e7796d4c93f
class Solution: <NEW_LINE> <INDENT> def repeatedStringMatch(self, A, B): <NEW_LINE> <INDENT> count = 1 <NEW_LINE> originalA = A <NEW_LINE> if B in A: <NEW_LINE> <INDENT> return 1 <NEW_LINE> <DEDENT> while len(A) < 2 * len(B): <NEW_LINE> <INDENT> count += 1 <NEW_LINE> A += originalA <NEW_LINE> if B in A: <NEW_LINE> <IND...
@param A: a string @param B: a string @return: return an integer
62598fae6e29344779b00646
class DeathThreat(Exception): <NEW_LINE> <INDENT> pass
Greeting was insufficiently kind.
62598faea17c0f6771d5c220
class BankQuerySession(abc_assessment_sessions.BankQuerySession, osid_sessions.OsidSession): <NEW_LINE> <INDENT> _session_name = 'BankQuerySession' <NEW_LINE> def __init__(self, proxy=None, runtime=None, **kwargs): <NEW_LINE> <INDENT> OsidSession._init_catalog(self, proxy, runtime) <NEW_LINE> self._forms = dict() <NEW_...
This session provides methods for searching among ``Bank`` objects. The search query is constructed using the ``BankQuery``. Banks may have aquery record indicated by their respective record types. The query record is accessed via the ``BankQuery``.
62598fae01c39578d7f12d69
class RelationshipType(OwnerModel): <NEW_LINE> <INDENT> a_is_to_b = models.CharField(max_length=50) <NEW_LINE> b_is_to_a = models.CharField(max_length=50) <NEW_LINE> preffered = models.BooleanField(default=False) <NEW_LINE> dependent = models.BooleanField(default=False) <NEW_LINE> def __unicode__(self): <NEW_LINE> <IND...
try and defile the relationship between a user and another
62598fae4527f215b58e9eca
class Perforation(Enum): <NEW_LINE> <INDENT> SOLID = 0 <NEW_LINE> PUNCHED = 1 <NEW_LINE> def toggle(self) -> 'Perforation': <NEW_LINE> <INDENT> return (Perforation.PUNCHED, Perforation.SOLID)[self.value]
represents the state of a position in a `Mask`, `SOLID` or `PUNCHED`
62598fae627d3e7fe0e06e98
class DNSMethod(Method): <NEW_LINE> <INDENT> def __init__(self, hostname, port): <NEW_LINE> <INDENT> self.hostname = hostname <NEW_LINE> self.port = port <NEW_LINE> <DEDENT> def get_candidates(self): <NEW_LINE> <INDENT> candidates = [] <NEW_LINE> for (family, socktype, proto, canonname, sockaddr) in sock...
Checks a DNS RR for the registry Attributes ---------- hostname : str port : int
62598fae56ac1b37e63021d6
class ParserMeshSupplementalsTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.file = get_sample_file(mesh_file_type=EnumMeshFileSample.SUPP) <NEW_LINE> self.parser = ParserXmlMeshSupplementals() <NEW_LINE> self.file_xml = self.parser.open_xml_file(filename_xml=self.file.name) <NEW_...
Tests the `ParserXmlMeshSupplementals` class.
62598fae2ae34c7f260ab0cc
class ipyparallel_island_test_case(_ut.TestCase): <NEW_LINE> <INDENT> def __init__(self, level): <NEW_LINE> <INDENT> _ut.TestCase.__init__(self) <NEW_LINE> self._level = level <NEW_LINE> <DEDENT> def runTest(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> import ipyparallel <NEW_LINE> <DEDENT> except ImportError: <...
Test case for the :class:`~pygmo.ipyparallel` class.
62598fae76e4537e8c3ef598
class Comment(models.Model): <NEW_LINE> <INDENT> comment_content = models.CharField(max_length=255) <NEW_LINE> user_id = models.IntegerField() <NEW_LINE> user_name = models.CharField(max_length=50) <NEW_LINE> user_avatar = models.CharField(max_length=255) <NEW_LINE> create_date = models.DateTimeField(default=timezone.n...
评论
62598faeadb09d7d5dc0a575
class Stats(object): <NEW_LINE> <INDENT> __slots__ = ("total", "files") <NEW_LINE> def __init__(self, total, files): <NEW_LINE> <INDENT> self.total = total <NEW_LINE> self.files = files <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def _list_from_string(cls, repo, text): <NEW_LINE> <INDENT> hsh = {'total': {'insertions':...
Represents stat information as presented by git at the end of a merge. It is created from the output of a diff operation. ``Example``:: c = Commit( sha1 ) s = c.stats s.total # full-stat-dict s.files # dict( filepath : stat-dict ) ``stat-dict`` A dictionary with the following keys and values:: ...
62598faeaad79263cf42e7bf
class block_pos: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.modelInfo = [] <NEW_LINE> rospy.Subscriber('/gazebo/model_states', ModelStates, self.callback) <NEW_LINE> <DEDENT> def callback(self, data): <NEW_LINE> <INDENT> self.modelInfo = data
The class definition for getting the pose of models in Gazebo
62598fae8da39b475be031d0
class PortMixin(object): <NEW_LINE> <INDENT> def __init__( self, isBehavior=None, isConjugated=None, isService=None, protocol=None, provided=None, redefinedPort=None, required=None, ** kwargs): <NEW_LINE> <INDENT> super(PortMixin, self).__init__(**kwargs) <NEW_LINE> <DEDENT> def port_aggregation(self, diagnostics=None,...
User defined mixin class for Port.
62598fae4e4d562566372411
class SdpDataFileWriter: <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> self.filename = os.path.abspath(filename) <NEW_LINE> if not os.path.isfile(filename): <NEW_LINE> <INDENT> with open(self.filename, 'a') as file: <NEW_LINE> <INDENT> file.write('<sdp>\n') <NEW_LINE> file.write('</sdp>\n') <NEW...
A class to update (sdp) data xml files. The xml is supposed to be 'simple', more precisely it has - no attributes, and - the only meaningful text/tail is in the leafs. This form of xml can be captured by Python's 'dict' type, with values eiher None, string-representable objects, or dicts themselves. Such a dict shoul...
62598fae7cff6e4e811b5a18
class ZwaveActuator: <NEW_LINE> <INDENT> def __init__(self, network): <NEW_LINE> <INDENT> self.network = network.network <NEW_LINE> <DEDENT> def search_switch(self, node_id, label): <NEW_LINE> <INDENT> for val in self.network.nodes[node_id].get_switches(): <NEW_LINE> <INDENT> if self.network.nodes[node_id].values[val]....
Class of ZwaveActuator: the instance of this class is used to control zwave device in the contexual of a valid zwave network.
62598fae2ae34c7f260ab0cd
class AgnocompleteMixin: <NEW_LINE> <INDENT> widget = AgnocompleteSelect <NEW_LINE> def _setup_agnocomplete_widget(self): <NEW_LINE> <INDENT> self.widget.agnocomplete = self.agnocomplete <NEW_LINE> <DEDENT> def set_agnocomplete(self, klass_or_instance, user): <NEW_LINE> <INDENT> if isinstance(klass_or_instance, str): <...
Handles the Agnocomplete generic handling for fields.
62598fae57b8e32f52508111
class FeinCMSLoginRequiredMiddleware( LoginPermissionMiddlewareMixin, FeinCMSPermissionMiddleware ): <NEW_LINE> <INDENT> base_unauthorised_redirect_url = settings.LOGIN_URL
Middleware that requires a user to be authenticated to view any page with an access_state of STATE_AUTH_ONLY. Requires authentication middleware, template context processors, and FeinCMS's add_page_if_missing middleware to be loaded. You'll get an error if they aren't.
62598faee76e3b2f99fd8a22
class HostAgentNotifyAPI(object): <NEW_LINE> <INDENT> def __init__(self, topic=topics.AGENT): <NEW_LINE> <INDENT> target = oslo_messaging.Target(topic=topic, version='1.0') <NEW_LINE> self.topic = topic <NEW_LINE> self.client = n_rpc.get_client(target) <NEW_LINE> <DEDENT> def _notification_host(self, context, method, p...
API for plugin to notify agents of host state change.
62598fae8e7ae83300ee908d
class Good(models.Model): <NEW_LINE> <INDENT> good_id = models.AutoField(primary_key=True, verbose_name='商品ID') <NEW_LINE> good_sender_id = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name='卖家') <NEW_LINE> good_portrait = models.ImageField(upload_to='good_img', default='avatar/default.png', verbose_name='...
商品
62598fae30bbd7224646996e
class VirtualMachineScaleSetUpdateNetworkConfiguration(SubResource): <NEW_LINE> <INDENT> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'primary': {'key': 'properties.primary', 'type': 'bool'}, 'enable_accelerated_networking': {'key': 'properties.enableAcceleratedNetworki...
Describes a virtual machine scale set network profile's network configurations. :ivar id: Resource Id. :vartype id: str :ivar name: The network configuration name. :vartype name: str :ivar primary: Whether this is a primary NIC on a virtual machine. :vartype primary: bool :ivar enable_accelerated_networking: Specifies...
62598fae56ac1b37e63021d7
class updateAttributes(Handler): <NEW_LINE> <INDENT> def control(self): <NEW_LINE> <INDENT> self.is_valid(self.ras_ip, str) <NEW_LINE> self.is_valid_content(self.ras_ip, self.IP_PATTERN) <NEW_LINE> self.is_valid(self.attrs, dict) <NEW_LINE> <DEDENT> def setup(self, ras_ip, attrs): <NEW_LINE> <INDENT> self.ras_ip = ras_...
Update attributes method class.
62598faecb5e8a47e493c16f
class Rig( MasterControlChainBendyRig, SegmentedChainBendyRig, ConnectingChainBendyRig, AlignedChainBendyRig, ComplexChainBendyRig ): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def parameters_ui(self, layout, params): <NEW_LINE> <INDENT> box = layout.box() <NEW_LINE> self.master_control_ui(self, box, params) <NEW_LINE...
Bendy tentacle
62598faebd1bec0571e150b9
class Wave: <NEW_LINE> <INDENT> def __init__(self, enemies): <NEW_LINE> <INDENT> self.enemies = enemies <NEW_LINE> <DEDENT> def tick(self, speedadjust=1.0): <NEW_LINE> <INDENT> for enemy in self.enemies: <NEW_LINE> <INDENT> if enemy.dead: <NEW_LINE> <INDENT> self.enemies.remove(enemy) <NEW_LINE> <DEDENT> else: <NEW_LIN...
Definicao do objeto wave
62598fae4a966d76dd5eeec8
class DoctorContentView(AppTemplateView): <NEW_LINE> <INDENT> template_name = 'about/doctor.html' <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super(DoctorContentView, self).get_context_data(**kwargs) <NEW_LINE> doctor = get_object_or_404(Doctor, code=context['doctor_code']) <NEW_LINE>...
A view for displaying information about a doctor
62598fae66656f66f7d5a3db
class QMatrix4x2(): <NEW_LINE> <INDENT> def copyDataTo(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def data(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def fill(self, p_float): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def isIdentity(self): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> def set...
QMatrix4x2() QMatrix4x2(QMatrix4x2) QMatrix4x2(sequence-of-float)
62598fae44b2445a339b6966
class PrivateUserApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = create_user( email='test@c2c.com', password='testpassword', ) <NEW_LINE> self.client = APIClient() <NEW_LINE> self.client.force_authenticate(user=self.user) <NEW_LINE> <DEDENT> def test_retrieve_user(self): <NEW_LI...
Test user API requests that require authentication
62598faea219f33f346c6802
class PoolTimeout(Exception): <NEW_LINE> <INDENT> pass
Exception raised when getting a connection from the pool takes too long.
62598faeb7558d5895463616
@python_2_unicode_compatible <NEW_LINE> class Image(TimeStampModel): <NEW_LINE> <INDENT> file = models.ImageField() <NEW_LINE> location = models.CharField(max_length=140) <NEW_LINE> caption = models.TextField() <NEW_LINE> creator = models.ForeignKey(user_models.User, on_delete=models.CASCADE, null=True) <NEW_LINE> def ...
Image Model
62598faea8370b77170f03c8
class BdistAPK(Bdist): <NEW_LINE> <INDENT> description = 'Create an APK with python-for-android' <NEW_LINE> package_type = 'apk'
distutil command handler for 'apk'.
62598fae4e4d562566372412
class RouteFilterRuleListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[RouteFilterRule]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, value: Optional[List["RouteFilterRule"]] = None, next_link: Optional[str] = Non...
Response for the ListRouteFilterRules API service call. :param value: A list of RouteFilterRules in a resource group. :type value: list[~azure.mgmt.network.v2020_05_01.models.RouteFilterRule] :param next_link: The URL to get the next set of results. :type next_link: str
62598faed486a94d0ba2bfbb
class LeftSiblings(NodeSet): <NEW_LINE> <INDENT> def __init__(self, ns, w=1): <NEW_LINE> <INDENT> self.__dict__.update(ns.__dict__) <NEW_LINE> self.label = 'LEFT-OF-%s' % ns.label <NEW_LINE> self.xpath = '%s[1]/preceding-sibling::*[position() <= %s]' % (ns.xpath, w)
Gets preceding siblings
62598faebe8e80087fbbf050
class INamedDataPoint(INamedBase, IDataPoint): <NEW_LINE> <INDENT> pass
Data point with a series-unique categorical name
62598fae26068e7796d4c941
class EpochDataConsumer(el.AbstractHook): <NEW_LINE> <INDENT> def after_epoch(self, epoch_id: int, epoch_data: EpochData) -> None: <NEW_LINE> <INDENT> assert 'train' in epoch_data <NEW_LINE> assert 'my_variable' in epoch_data['train'] <NEW_LINE> assert epoch_data['train']['my_variable'] == _EPOCH_DATA_VAR_VALUE
Simple hook that asserts presence of my_variable in the train entry of the epoch_data.
62598faeaad79263cf42e7c0
class QuotientRing_generic(QuotientRing_nc, ring.CommutativeRing): <NEW_LINE> <INDENT> def __init__(self, R, I, names, category=None): <NEW_LINE> <INDENT> if not isinstance(R, ring.CommutativeRing): <NEW_LINE> <INDENT> raise TypeError("This class is for quotients of commutative rings only.\n For non-commutative ring...
Creates a quotient ring of a *commutative* ring `R` by the ideal `I`. EXAMPLES:: sage: R.<x> = PolynomialRing(ZZ) sage: I = R.ideal([4 + 3*x + x^2, 1 + x^2]) sage: S = R.quotient_ring(I); S Quotient of Univariate Polynomial Ring in x over Integer Ring by the ideal (x^2 + 3*x + 4, x^2 + 1)
62598fae627d3e7fe0e06e9a
class _BucketizedColumn(_DenseColumn, _CategoricalColumn, collections.namedtuple('_BucketizedColumn', [ 'source_column', 'boundaries'])): <NEW_LINE> <INDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return '{}_bucketized'.format(self.source_column.name) <NEW_LINE> <DEDENT> @property <NEW_LINE> def _pars...
See `bucketized_column`.
62598fae01c39578d7f12d6c
class LastFmApi(object): <NEW_LINE> <INDENT> def __init__(self, key): <NEW_LINE> <INDENT> self.__api_key = key <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> if name.startswith('__'): <NEW_LINE> <INDENT> raise AttributeError() <NEW_LINE> <DEDENT> def generic_request(*args, **kwargs): <NEW_LINE> <I...
An interface to the Last.fm api. This class dynamically resolves methods and their parameters. For instance, if you would like to access the album.getInfo method, you simply call album_getInfo on an instance of LastFmApi.
62598faea8370b77170f03c9
class Base(object): <NEW_LINE> <INDENT> def __init__(self, cls): <NEW_LINE> <INDENT> self.cls = cls <NEW_LINE> <DEDENT> def read_attr(self, fieldname): <NEW_LINE> <INDENT> result = self._read_dict(fieldname) <NEW_LINE> if result is not MISSING: <NEW_LINE> <INDENT> return result <NEW_LINE> <DEDENT> result = self.cls._re...
The base class that all of the object model classes inherit from.
62598fae4e4d562566372413
class DataMessage(AsyncMessage): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> AsyncMessage.__init__(self) <NEW_LINE> self.identity = None <NEW_LINE> self.operation = None
I am used to transport an operation that occured on a managed object or collection. This class of message is transmitted between clients subscribed to a remote destination as well as between server nodes within a cluster. The payload of this message describes all of the relevant details of the operation. This informat...
62598fae167d2b6e312b6f5f
class ApiGrrMessageRenderer(ApiRDFProtoStructRenderer): <NEW_LINE> <INDENT> value_class = rdfvalue.GrrMessage <NEW_LINE> def RenderPayload(self, result, value): <NEW_LINE> <INDENT> if "args_rdf_name" in result: <NEW_LINE> <INDENT> result["payload_type"] = result["args_rdf_name"] <NEW_LINE> del result["args_rdf_name"] <...
Renderer for GrrMessage objects.
62598fae3317a56b869be541
class Solution(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def separate_liquids_01(self, glass): <NEW_LINE> <INDENT> if not glass: <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> n_cols = len(glass[0]) <NEW_LINE> c = Counter(chain(*glass)) <NEW_LINE> liquids = list(c['O'] *...
https://www.codewars.com/kata/dont-drink-the-water Don't Drink the Water Given a two-dimensional array representation of a glass of mixed liquids, sort the array such that the liquids appear in the glass based on their density. (Lower density floats to the top) The width of the glass will not change from top to botto...
62598fae56b00c62f0fb28a2
class _PageComponents(record('navigation searchAggregator staticShellContent settings themes')): <NEW_LINE> <INDENT> pass
I encapsulate various plugin objects that have some say in determining the available functionality on a given page
62598fae55399d3f05626511
class InlineResponseDefault4(object): <NEW_LINE> <INDENT> openapi_types = { 'pagination': 'OffsetInfo', 'results': 'list[InlineResponseDefault4Results]' } <NEW_LINE> attribute_map = { 'pagination': 'pagination', 'results': 'results' } <NEW_LINE> def __init__(self, pagination=None, results=None, local_vars_configuration...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62598fae2ae34c7f260ab0cf
class DeviceStatusViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = DeviceStatus.objects.all() <NEW_LINE> permission_classes = (permissions.IsAuthenticatedOrReadOnly,) <NEW_LINE> serializer_class = DeviceStatusSerializer
This viewset automatically provides `list`, `create`, `retrieve`, `update` and `destroy` actions.
62598fae460517430c432054
class ShellItemFileEntryEventData(events.EventData): <NEW_LINE> <INDENT> DATA_TYPE = 'windows:shell_item:file_entry' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(ShellItemFileEntryEventData, self).__init__(data_type=self.DATA_TYPE) <NEW_LINE> self.file_reference = None <NEW_LINE> self.localized_name = None ...
Shell item file entry event data attribute container. Attributes: name (str): name of the file entry shell item. long_name (str): long name of the file entry shell item. localized_name (str): localized name of the file entry shell item. file_reference (str): NTFS file reference, in the format: "MTF entry...
62598fae8e7ae83300ee9090
class BooksInstanceInline(admin.TabularInline): <NEW_LINE> <INDENT> model = BookInstance <NEW_LINE> extra = 0
Дополнительная таблица, предоставляющая доступ к моделе (BookInstance) из другой модели (Book)
62598fae66656f66f7d5a3dd
class TestML(unittest.TestCase): <NEW_LINE> <INDENT> def test_ml(self): <NEW_LINE> <INDENT> self.assertEqual(0, 1)
General class for testing
62598fae2c8b7c6e89bd37b3
class WM_OT_owner_enable(Operator): <NEW_LINE> <INDENT> bl_idname = "wm.owner_enable" <NEW_LINE> bl_label = "Enable Add-on" <NEW_LINE> owner_id: StringProperty( name="UI Tag", ) <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> workspace = context.workspace <NEW_LINE> workspace.owner_ids.new(self.owner_id) <NE...
Enable workspace owner ID
62598faefff4ab517ebcd7d3