code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class AptRemoteViewSet(RemoteViewSet): <NEW_LINE> <INDENT> endpoint_name = "apt" <NEW_LINE> queryset = models.AptRemote.objects.all() <NEW_LINE> serializer_class = serializers.AptRemoteSerializer | An AptRemote represents an external APT repository content source.
It contains the location of the upstream APT repository, as well as the user options that are
applied when using the remote to synchronize the upstream repository to Pulp. | 62599079be7bc26dc9252b3b |
class SearchView(APIView): <NEW_LINE> <INDENT> def get(self, request, format=None): <NEW_LINE> <INDENT> queryset = Area.objects.all() <NEW_LINE> point_string = request.query_params.get('point', None) <NEW_LINE> if point_string: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> (x, y) = (float(n) for n in point_string.split(... | Поиск по услуге и точке на карте
Формат поисковой строки: ?service=1&point=12,20
(id услуги и широта,долгота точки в которой ищем поставщиков) | 6259907991f36d47f2231b75 |
class DBManager: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.path = os.environ.get("DATABASE_URL") <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self.conn = psycopg2.connect(self.path, sslmode="prefer") <NEW_LINE> self.cur = self.conn.cursor() <NEW_LINE> return self.cur <NEW_LINE> <D... | Контекстный менеджер, который открывает, закрывает соединение с бд, коммитит изменения | 625990793317a56b869bf22c |
class SlavedIdTracker(AbstractStreamIdTracker): <NEW_LINE> <INDENT> def __init__( self, db_conn: LoggingDatabaseConnection, table: str, column: str, extra_tables: Optional[List[Tuple[str, str]]] = None, step: int = 1, ): <NEW_LINE> <INDENT> self.step = step <NEW_LINE> self._current = _load_current_id(db_conn, table, co... | Tracks the "current" stream ID of a stream with a single writer.
See `AbstractStreamIdTracker` for more details.
Note that this class does not work correctly when there are multiple
writers. | 6259907932920d7e50bc7a15 |
class ObjectWithSlugMixin: <NEW_LINE> <INDENT> pass | This class is obsolete but required because referenced in migrations. | 6259907901c39578d7f1441b |
class Rates(BaseModel): <NEW_LINE> <INDENT> HKD: confloat(gt=0) = None <NEW_LINE> ISK: confloat(gt=0) = None <NEW_LINE> PHP: confloat(gt=0) = None <NEW_LINE> DKK: confloat(gt=0) = None <NEW_LINE> HUF: confloat(gt=0) = None <NEW_LINE> CZK: confloat(gt=0) = None <NEW_LINE> GBP: confloat(gt=0) = None <NEW_LINE> RON: confl... | Pydantic model to store conversion rates in
| 62599079a05bb46b3848be10 |
class cloudapi_disks(j.tools.code.classGetBase()): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> self._te={} <NEW_LINE> self.actorname="disks" <NEW_LINE> self.appname="cloudapi" <NEW_LINE> <DEDENT> def create(self, accountId, locationId, name, description, iops, size=10, type='B', ssdSize=... | API Actor api, this actor is the final api a enduser uses to manage his resources | 625990794428ac0f6e659efd |
class SecondModule(object): <NEW_LINE> <INDENT> def __init__(self, name, age): <NEW_LINE> <INDENT> self._logger = logging.getLogger(__name__) <NEW_LINE> self._name = name <NEW_LINE> if not isinstance(age, int): <NEW_LINE> <INDENT> raise TypeError('age must be an integer') <NEW_LINE> <DEDENT> self._age = age <NEW_LINE> ... | Python basic class | 62599079009cb60464d02f0b |
class Function(Element): <NEW_LINE> <INDENT> def stretch(self, *stretches): <NEW_LINE> <INDENT> return stretch(self, *stretches) <NEW_LINE> <DEDENT> def shift(self, *amounts): <NEW_LINE> <INDENT> return shift(self, *amounts) <NEW_LINE> <DEDENT> def select(self, *dims): <NEW_LINE> <INDENT> return select(self, *dims) <NE... | A elements. | 625990794f88993c371f1208 |
class ListParser(Parser): <NEW_LINE> <INDENT> def __init__(self, grammar, source): <NEW_LINE> <INDENT> super(ListParser, self).__init__(grammar, source) <NEW_LINE> self._result = [] <NEW_LINE> <DEDENT> @property <NEW_LINE> def result(self): <NEW_LINE> <INDENT> return self._result <NEW_LINE> <DEDENT> def operate(self, o... | Parse the input text and print the words | 625990795fcc89381b266e41 |
class SearchedContent(object): <NEW_LINE> <INDENT> def __init__( self, content_namespace: str, content_id: int, label: str, slug: str, status: str, content_type: str, workspace: SearchedDigestWorkspace, path: List[SearchedDigestContent], comments: List[SearchedDigestComment], comment_count: int, author: SearchedDigestU... | Content-Like object return by LibSearch.
This class does not contain any logic, it's just needed to
store data. | 62599079dc8b845886d54f88 |
class PyqueryMiddleware: <NEW_LINE> <INDENT> def process_response(self, request, response, spider): <NEW_LINE> <INDENT> response.dom = PyQuery(response.text).make_links_absolute( 'https://www.ptt.cc/bbs/') <NEW_LINE> return response | Inject pyquery object into Scrapy `response`. | 625990797cff6e4e811b740d |
class imageos(object): <NEW_LINE> <INDENT> creds = get_keystone_creds() <NEW_LINE> keystone = ksclient.Client(**creds) <NEW_LINE> creds1 = get_nova_creds() <NEW_LINE> nova = nvclient.Client(**creds1) <NEW_LINE> def add(self,x,y): <NEW_LINE> <INDENT> return x+y <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def create_imag... | docstring for imageos | 625990799c8ee82313040e6e |
class GetMessagesViews(TLObject): <NEW_LINE> <INDENT> __slots__: List[str] = ["peer", "id", "increment"] <NEW_LINE> ID = 0x5784d3e1 <NEW_LINE> QUALNAME = "functions.messages.GetMessagesViews" <NEW_LINE> def __init__(self, *, peer: "raw.base.InputPeer", id: List[int], increment: bool) -> None: <NEW_LINE> <INDENT> self.p... | Telegram API method.
Details:
- Layer: ``122``
- ID: ``0x5784d3e1``
Parameters:
peer: :obj:`InputPeer <pyrogram.raw.base.InputPeer>`
id: List of ``int`` ``32-bit``
increment: ``bool``
Returns:
:obj:`messages.MessageViews <pyrogram.raw.base.messages.MessageViews>` | 62599079283ffb24f3cf526e |
@implementer(ILocalRoleProvider) <NEW_LINE> @adapter(IFactoryTempFolder) <NEW_LINE> class FactoryTempFolderProvider(object): <NEW_LINE> <INDENT> def __init__(self, obj): <NEW_LINE> <INDENT> self.folder = obj <NEW_LINE> <DEDENT> def getRoles(self, principal_id): <NEW_LINE> <INDENT> uf = aq_inner(getToolByName(self.folde... | A simple local role provider which just gathers the roles from
the desired context::
>>> from zope.component import provideAdapter
>>> from zope.interface import Interface, implementer, directlyProvides
>>> from borg.localrole.workspace import WorkspaceLocalRoleManager
>>> rm = WorkspaceLocalRoleManage... | 62599079627d3e7fe0e08855 |
class Tag(models.Model): <NEW_LINE> <INDENT> name = models.CharField('标签名', max_length=100) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = '标签' <NEW_LINE> verbose_name_plural = verbose_name <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.name | 标签tag | 625990792c8b7c6e89bd51b9 |
class GraphLRUEdgeCache: <NEW_LINE> <INDENT> class Node: <NEW_LINE> <INDENT> def __init__(self, key, val): <NEW_LINE> <INDENT> self.key = key <NEW_LINE> self.val = val <NEW_LINE> self.prev = None <NEW_LINE> self.next = None <NEW_LINE> <DEDENT> <DEDENT> def __init__(self): <NEW_LINE> <INDENT> self.cache = {} <NEW_LINE> ... | Store graph edges with LRU (least recently used) algorithm.
Implement LRU algorithm with HashMap and Double LinkedList.
The key of the HashMap is a hashtag_pair (e.g. ('#apache', '#hadoop')),
while the value is a doubly LinkedList Node which contains the same hashtag_pair,
the datetime of the tweet and the two linke... | 62599079bf627c535bcb2e9d |
class NameNodeMaster(NameNode, SSHRelation): <NEW_LINE> <INDENT> relation_name = 'datanode' <NEW_LINE> ssh_user = 'hdfs' <NEW_LINE> require_slave = False | Alternate NameNode relation for DataNodes. | 625990797d43ff24874280fc |
class TextNode(Node): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> s = self.value.replace('\n', '\\n') <NEW_LINE> if len(s) < 20: <NEW_LINE> <INDENT> return '\'' + s + '\'\n' <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT>... | thisText = TextNode("Value of the thisText")
thisText.evaluate() | 62599079796e427e53850149 |
class AdvertAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> inlines = [AdvertImage, ] <NEW_LINE> fieldsets = ( (None, { 'fields': ('title', 'description', 'location', 'type', 'estate', 'size', 'plot_size', 'price', 'tags') }), ('Więcej', { 'classes': ('collapse',), 'fields': ('heating', 'windows', 'furniture', 'balcony') ... | Advert models admin | 625990793539df3088ecdc66 |
@with_metaclass(utils.MetaClassForClassesWithEnums) <NEW_LINE> class DataType(object): <NEW_LINE> <INDENT> BOOL = internals.DATATYPE_BOOL <NEW_LINE> CHAR = internals.DATATYPE_CHAR <NEW_LINE> BYTE = internals.DATATYPE_BYTE <NEW_LINE> INT32 = internals.DATATYPE_INT32 <NEW_LINE> INT64 = internals.DATATYPE_INT64 <NEW_LINE>... | Contains the possible data types which can be represented in an Element.
Class attributes:
BOOL Boolean
CHAR Char
BYTE Unsigned 8 bit value
INT32 32 bit Integer
INT64 64 bit Integer
FLOAT32 32 bit Floating point
FLOAT64 64... | 62599079a8370b77170f1d9c |
class DutyCycleCorrection(ivi.IviContainer): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self._channel_count = 1 <NEW_LINE> super(DutyCycleCorrection, self).__init__(*args, **kwargs) <NEW_LINE> cls = 'IviPwrMeter' <NEW_LINE> grp = 'DutyCycleCorrection' <NEW_LINE> ivi.add_group_capabilit... | Extension IVI methods for RF power meters supporting duty cycle correction of pulse modulated signals | 62599079460517430c432d41 |
class BaseGeoAdmin(BaseAdmin, GeoModelAdmin): <NEW_LINE> <INDENT> if GEODJANGO_IMPROVED_WIDGETS: <NEW_LINE> <INDENT> lat, lng = _get_geodjango_map_coords() <NEW_LINE> options = { 'layers': [ 'osm.mapnik', 'google.streets', 'google.physical', 'google.satellite', 'google.hybrid', ], 'default_lat': lat, 'default_lon': lng... | BaseAdmin + Geodjango support | 6259907932920d7e50bc7a17 |
class JsonResponse(HttpResponse): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> super(JsonResponse, self).__init__(content=simplejson.dumps(data,ensure_ascii=False, cls = MyJSONEncoder), mimetype='application/json') | HttpResponse descendant, which return response with ``application/json`` mimetype. | 62599079d486a94d0ba2d986 |
class VSFlags: <NEW_LINE> <INDENT> UserValue = "UserValue" <NEW_LINE> UserIgnored = "UserIgnored" <NEW_LINE> UserRequired = "UserRequired" <NEW_LINE> Continue = "Continue" <NEW_LINE> SemicolonAppendable = "SemicolonAppendable" <NEW_LINE> UserFollowing = "UserFollowing" <NEW_LINE> CaseInsensitive = "CaseInsensitive" <NE... | Flags corresponding to cmIDEFlagTable. | 6259907960cbc95b06365a55 |
class MaterialHiddenInput(MaterialComponent, widgets.HiddenInput): <NEW_LINE> <INDENT> template_name = 'material_widgets/widgets/material_hidden.html' | Material HiddenInput
Parameters
----------
initial : varies depending on field, optional
Initial value to populate the hidden input in the form.
Examples
--------
>>> hidden_input = forms.CharField(
>>> initial='hidden_value',
>>> widget=widgets.HiddenInput(),
>>> ) | 62599079627d3e7fe0e08857 |
class Variant(object): <NEW_LINE> <INDENT> Text, Pattern, VarRef, VarDef, Separator = range(5) | Supported language constructs. | 625990795166f23b2e244da7 |
class FormulaPropertiesFromVm(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'lab_vm_id': {'key': 'labVmId', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, lab_vm_id: Optional[str] = None, **kwargs ): <NEW_LINE> <INDENT> super(FormulaPropertiesFromVm, self).__init__(**kwargs) <NEW_LINE> self.l... | Information about a VM from which a formula is to be created.
:param lab_vm_id: The identifier of the VM from which a formula is to be created.
:type lab_vm_id: str | 6259907976e4537e8c3f0f4f |
class WorkerTest(IonTestCase): <NEW_LINE> <INDENT> @defer.inlineCallbacks <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> yield self._start_container() <NEW_LINE> <DEDENT> @defer.inlineCallbacks <NEW_LINE> def tearDown(self): <NEW_LINE> <INDENT> yield self._stop_container() <NEW_LINE> <DEDENT> @defer.inlineCallbacks <N... | Testing worker processes | 625990798a349b6b43687c2b |
class Component(ApplicationSession): <NEW_LINE> <INDENT> @inlineCallbacks <NEW_LINE> def onJoin(self, details): <NEW_LINE> <INDENT> res = yield self.call('com.myapp.add_complex', 2, 3, 4, 5) <NEW_LINE> print("Result: {} + {}i".format(res.kwresults['c'], res.kwresults['ci'])) <NEW_LINE> res = yield self.call('com.myapp.... | Application component that calls procedures which
produce complex results and showing how to access those. | 625990797047854f46340d8b |
class lazyT(object): <NEW_LINE> <INDENT> m = s = T = f = t = None <NEW_LINE> M = is_copy = False <NEW_LINE> def __init__( self, message, symbols={}, T=None, filter=None, ftag=None, M=False ): <NEW_LINE> <INDENT> if isinstance(message, lazyT): <NEW_LINE> <INDENT> self.m = message.m <NEW_LINE> self.s = message.s <NEW_LIN... | Never to be called explicitly, returned by
translator.__call__() or translator.M() | 6259907992d797404e389844 |
class VirtualWanVpnProfileParameters(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'vpn_server_configuration_resource_id': {'key': 'vpnServerConfigurationResourceId', 'type': 'str'}, 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ... | Virtual Wan Vpn profile parameters Vpn profile generation.
:param vpn_server_configuration_resource_id: VpnServerConfiguration partial resource uri with
which VirtualWan is associated to.
:type vpn_server_configuration_resource_id: str
:param authentication_method: VPN client authentication method. Possible values in... | 6259907901c39578d7f1441d |
@navigator.register(ProvisioningTemplateEntity, 'New') <NEW_LINE> class AddNewProvisioningTemplate(NavigateStep): <NEW_LINE> <INDENT> VIEW = ProvisioningTemplateCreateView <NEW_LINE> prerequisite = NavigateToSibling('All') <NEW_LINE> def step(self, *args, **kwargs): <NEW_LINE> <INDENT> self.parent.new.click() | Navigate to Create new Provisioning Template screen. | 6259907967a9b606de54778e |
class WriteFileCommand(Command): <NEW_LINE> <INDENT> def __init__(self, filename = None, tmpl_list = None, srcloc = None): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> if tmpl_list is None: <NEW_LINE> <INDENT> self.tmpl_list = [] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> Command.__init__(self, srcloc) <N... | WriteFileCommand
filename This is the name of the file that will be written to
when the command is executed.
tmpl_list This is the contents of what will be written to the file.
Text strings are often simple strings, however more
generally, they can be strings which include other vari... | 625990792c8b7c6e89bd51bc |
class XSSSS_ice(XSMultiplicativeModel): <NEW_LINE> <INDENT> __function__ = "xssssi" <NEW_LINE> def __init__(self, name='sss_ice'): <NEW_LINE> <INDENT> self.clumps = Parameter(name, 'clumps', 0.0, 0., 10., 0.0, hugeval) <NEW_LINE> XSMultiplicativeModel.__init__(self, name, (self.clumps,)) | The XSPEC sss_ice model: Einstein SSS ice absorption.
The model is described at [1]_.
Attributes
----------
clumps
The ice thickness parameter.
References
----------
.. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/XSmodelSssice.html | 62599079627d3e7fe0e08859 |
class PullAudioInputStreamCallback(impl.PullAudioInputStreamCallback): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> <DEDENT> def read(self, buffer: memoryview) -> int: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> def close(self) -> None: <NEW_LINE> <INDENT> pass | An interface that defines callback methods for an audio input stream.
Derive from this class and implement its function to provide your own
data as an audio input stream. | 62599079be8e80087fbc0a67 |
class ATMClient(object): <NEW_LINE> <INDENT> def __init__(self, host, port): <NEW_LINE> <INDENT> address = (host, port) <NEW_LINE> self.server = socket(AF_INET, SOCK_STREAM) <NEW_LINE> self.server.connect(address) <NEW_LINE> message = decode(self.server.recv(BUFSIZE), CODE) <NEW_LINE> <DEDENT> def get(self, name, pin):... | Represents the client for a bank ATM. Behaves like a Bank with the
get method and an account with the getBalance, deposit, and withdraw
methods. | 6259907926068e7796d4e310 |
class SlackWebhook(base_notification.BaseNotification): <NEW_LINE> <INDENT> def _dump_slack_output(self, data, indent=0): <NEW_LINE> <INDENT> output = '' <NEW_LINE> if not isinstance(data, dict): <NEW_LINE> <INDENT> LOGGER.debug('Violation data is not a dictionary type. ' f'Violation data: {data}') <NEW_LINE> return '\... | Slack webhook notifier to perform notifications | 6259907921bff66bcd72463b |
class Decorator(DecoratorBase): <NEW_LINE> <INDENT> def add_scale( self, color_def, font=None, size=None, fill="black", outline=None, outline_width=1, bg="white", extend=False, unit="", margins=None, minortick=0.0, nan_color=(0, 0, 0), nan_check_color=(1, 1, 1), nan_check_size=0, ): <NEW_LINE> <INDENT> self._add_scale(... | PIL-based image decoration class. | 62599079a8370b77170f1da0 |
class ComponentConfig: <NEW_LINE> <INDENT> def __init__(self, realm = None, extra = None): <NEW_LINE> <INDENT> if six.PY2 and type(realm) == str: <NEW_LINE> <INDENT> realm = six.u(realm) <NEW_LINE> <DEDENT> self.realm = realm <NEW_LINE> self.extra = extra <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> retur... | WAMP application component configuration. An instance of this class is
provided to the constructor of :class:`autobahn.wamp.protocol.ApplicationSession`. | 6259907971ff763f4b5e917e |
class Flanks(object): <NEW_LINE> <INDENT> flank_re = re.compile(r"(\s*)(.*\S)(\s*)\Z", flags=re.DOTALL) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.left, self.right = None, None <NEW_LINE> <DEDENT> def split_flanks(self, _, result): <NEW_LINE> <INDENT> if not result.strip(): <NEW_LINE> <INDENT> self.left, s... | A pair of processors that split and rejoin flanking whitespace.
| 6259907916aa5153ce401eac |
class Wavefront(object): <NEW_LINE> <INDENT> def __init__(self, file_name): <NEW_LINE> <INDENT> self.file_name = file_name <NEW_LINE> self.materials = {} <NEW_LINE> self.meshes = {} <NEW_LINE> self.mesh_list = [] <NEW_LINE> self.group = None <NEW_LINE> ObjParser(self, self.file_name) <NEW_LINE> <DEDENT> def draw(self):... | Import a wavefront .obj file. | 6259907997e22403b383c8d4 |
class coverageAnalysis(IonPlugin): <NEW_LINE> <INDENT> version = "4.4.2.2" <NEW_LINE> major_block = True <NEW_LINE> runtypes = [ RunType.FULLCHIP, RunType.THUMB, RunType.COMPOSITE ] <NEW_LINE> runlevels = [ RunLevel.DEFAULT ] <NEW_LINE> def launch(self,data=None): <NEW_LINE> <INDENT> plugin = Popen([ '%s/coverageAnalys... | Genome and Targeted Re-sequencing Coverage Analysis. (Ion supprted) | 6259907997e22403b383c8d5 |
class CombatCmdSet(CmdSet): <NEW_LINE> <INDENT> key = "combatcmdset" <NEW_LINE> mergetype = "Merge" <NEW_LINE> priority = 10 <NEW_LINE> no_exits = True <NEW_LINE> def at_cmdset_creation(self): <NEW_LINE> <INDENT> self.add(self.CmdFlee()) <NEW_LINE> <DEDENT> class CmdFlee(COMMAND_DEFAULT_CLASS): <NEW_LINE> <INDENT> key ... | Contains response commands | 62599079009cb60464d02f11 |
class GoogleCalendarData(object): <NEW_LINE> <INDENT> def __init__(self, calendar_service, calendar_id, search, ignore_availability): <NEW_LINE> <INDENT> self.calendar_service = calendar_service <NEW_LINE> self.calendar_id = calendar_id <NEW_LINE> self.search = search <NEW_LINE> self.ignore_availability = ignore_availa... | Class to utilize calendar service object to get next event. | 625990794f88993c371f120b |
class TrainingMonitor(object): <NEW_LINE> <INDENT> def __init__(self, loss_key='loss', max_epochs=float('inf'), patience=20): <NEW_LINE> <INDENT> self.loss_key = loss_key <NEW_LINE> self.best_loss = float('inf') <NEW_LINE> self.best_epoch = None <NEW_LINE> self.max_epochs = max_epochs <NEW_LINE> self.epoch = 0 <NEW_LIN... | Utility class to monitor training progress.
Usage
-----
monitor = TrainingMonitor('nll')
while not train_monitor.converged:
nll, train_error, valid_error = train_step(net, train_data, valid_data)
train_monitor.observe(nll=nll, train_error=train_error, valid_error=valid_error) | 62599079baa26c4b54d50c85 |
class OveruseDetector: <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> self.hypothesis = BandwidthUsage.NORMAL <NEW_LINE> self.last_update_ms: Optional[int] = None <NEW_LINE> self.k_up = 0.0087 <NEW_LINE> self.k_down = 0.039 <NEW_LINE> self.overuse_counter = 0 <NEW_LINE> self.overuse_time: Optional[... | Bandwidth overuse detector.
Adapted from the webrtc.org codebase. | 62599079627d3e7fe0e0885b |
class DataSort(object): <NEW_LINE> <INDENT> def __init__(self,survey_id,uuid,aggregate): <NEW_LINE> <INDENT> self.sid= survey_id <NEW_LINE> self.uuid= uuid <NEW_LINE> self.agg= aggregate <NEW_LINE> <DEDENT> def get_survey(self): <NEW_LINE> <INDENT> survey= db.survey.find({"_id":ObjectId(self.sid)}) <NEW_LINE> return d(... | docstring for DataSort | 62599079ec188e330fdfa27b |
class Error(GlazierError): <NEW_LINE> <INDENT> def __init__(self, exception: Optional[Exception] = None, replacements: Optional[List[Union[bool, int, str]]] = None): <NEW_LINE> <INDENT> super().__init__(exception, replacements) <NEW_LINE> self.code: int = code <NEW_LINE> if message and replacements: <NEW_LINE> <INDENT>... | Stores error information used in GlazierError. | 62599079097d151d1a2c2a4b |
class NicSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Nic <NEW_LINE> fields = "__all__" | 网卡序列化类 | 62599079f9cc0f698b1c5fb6 |
class MLField(object): <NEW_LINE> <INDENT> _role_types = dict((str(e.name).upper(), e) for e in FieldRole) <NEW_LINE> def __init__(self, name, field_type, role, continuity=None, is_append=False, is_partition=False, kv_config=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.type = field_type.lower() <NEW_LINE... | Represent table field definition
:type continuity: FieldContinuity | None | 625990798a349b6b43687c2f |
@keras_export('keras.utils.OrderedEnqueuer') <NEW_LINE> class OrderedEnqueuer(SequenceEnqueuer): <NEW_LINE> <INDENT> def __init__(self, sequence, use_multiprocessing=False, shuffle=False): <NEW_LINE> <INDENT> super(OrderedEnqueuer, self).__init__(sequence, use_multiprocessing) <NEW_LINE> self.shuffle = shuffle <NEW_LIN... | Builds a Enqueuer from a Sequence.
Used in `fit_generator`, `evaluate_generator`, `predict_generator`.
Arguments:
sequence: A `tf.keras.utils.data_utils.Sequence` object.
use_multiprocessing: use multiprocessing if True, otherwise threading
shuffle: whether to shuffle the data at the beginning of each epo... | 6259907926068e7796d4e312 |
@Seq2SeqEncoder.register("feedforward") <NEW_LINE> class FeedForwardEncoder(Seq2SeqEncoder): <NEW_LINE> <INDENT> def __init__(self, feedforward: FeedForward) -> None: <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._feedforward = feedforward <NEW_LINE> <DEDENT> @overrides <NEW_LINE> def get_input_dim(self) -> in... | This class applies the `FeedForward` to each item in sequences. | 625990792c8b7c6e89bd51bf |
class TextsListScreen(Screen): <NEW_LINE> <INDENT> cards_list: list <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.cards_list = [] <NEW_LINE> <DEDENT> def clear_texts(self) -> None: <NEW_LINE> <INDENT> self.ids.texts_layout.clear_widgets() <NEW_LINE... | Главный экран со списком всех карточек (текстов). | 625990797d43ff24874280ff |
class Properties(util.ComparableMixin): <NEW_LINE> <INDENT> compare_attrs = ('properties',) <NEW_LINE> implements(IProperties) <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.properties = {} <NEW_LINE> self.runtime = set() <NEW_LINE> self.build = None <NEW_LINE> if kwargs: self.update(kwargs, "TEST") ... | I represent a set of properties that can be interpolated into various
strings in buildsteps.
@ivar properties: dictionary mapping property values to tuples
(value, source), where source is a string identifing the source
of the property.
Objects of this class can be read like a dictionary -- in this case,
onl... | 6259907932920d7e50bc7a1c |
class DatabaseIDManager(models.Manager): <NEW_LINE> <INDENT> def create(self, **kwargs): <NEW_LINE> <INDENT> with transaction.atomic(): <NEW_LINE> <INDENT> DatabaseIDModel.objects.update(current=False) <NEW_LINE> return super(DatabaseIDManager, self).create(**kwargs) | We override ``model.Manager`` in order to wrap creating a new database ID model within a transaction. With the
creation of a new database ID model, we set all previously created models current flag to False. | 6259907944b2445a339b7648 |
class VerifyLoginHandler(BaseHandler): <NEW_LINE> <INDENT> def check_xsrf_cookie(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> async def post(self): <NEW_LINE> <INDENT> if 'error' in self.request.arguments: <NEW_LINE> <INDENT> error = self.get_argument('error') <NEW_LINE> description = self.get_argument('error_de... | Handlers for portier verification. | 625990797d847024c075ddb2 |
class ResourceSchema(colander.MappingSchema): <NEW_LINE> <INDENT> class Options: <NEW_LINE> <INDENT> readonly_fields = tuple() <NEW_LINE> preserve_unknown = True <NEW_LINE> <DEDENT> def get_option(self, attr): <NEW_LINE> <INDENT> default_value = getattr(ResourceSchema.Options, attr) <NEW_LINE> return getattr(self.Optio... | Base resource schema, with *Cliquet* specific built-in options. | 625990794f6381625f19a197 |
class InputInlineQueryResult(Object): <NEW_LINE> <INDENT> ID = "inputInlineQueryResult" <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def read(q: dict, *args) -> "InputInlineQueryResultVideo or InputInlineQueryResultAudio or InputInlineQueryResultAnimated... | Represents a single result of an inline query; for bots only
No parameters required. | 62599079e1aae11d1e7cf4fb |
class ExploreHandler(AuthBaseHandler): <NEW_LINE> <INDENT> @tornado.web.authenticated <NEW_LINE> def get(self,*args,**kwargs): <NEW_LINE> <INDENT> os.chdir('static') <NEW_LINE> image_urls = photo.get_images("uploads/thumbs") <NEW_LINE> os.chdir("..") <NEW_LINE> self.render('explore.html',image_urls=image_urls) | Explore page,photo of other users 发现页-----发现或最近上传的图片页面 | 62599079f9cc0f698b1c5fb7 |
class Card: <NEW_LINE> <INDENT> def __init__(self, rank, color): <NEW_LINE> <INDENT> self.rank = rank <NEW_LINE> self.color = color <NEW_LINE> self.numrank = rank2int(self.rank) <NEW_LINE> if self.rank == '10': <NEW_LINE> <INDENT> self.filename = self.rank + self.color[0] + '.png' <NEW_LINE> <DEDENT> else: <NEW_LINE> <... | Card class represents an individual card in the deck and
has useful attributes of the cards themselves | 625990793d592f4c4edbc849 |
class Cot(TrigonometricUnary): <NEW_LINE> <INDENT> pass | Returns the cotangent of x | 62599079a8370b77170f1da4 |
class UC(BBIO, I2C, _1WIRE, RawWire, SPI, UART): <NEW_LINE> <INDENT> pass | This class brings together all of the modules under a single class, allowing you to switch
to other modules, do a function, and then switch back transparently. The class will keep track
of where you are and raise an Error if you do something wrong.
The variables bp_port, bp_dir, and bp_config store the values that it... | 625990795fdd1c0f98e5f955 |
class EmitterMeta(type): <NEW_LINE> <INDENT> def __init__(cls, name, bases, dict_): <NEW_LINE> <INDENT> super(EmitterMeta, cls).__init__(name, bases, dict_) <NEW_LINE> cls.__handlers__ = collections.defaultdict(set) <NEW_LINE> try: <NEW_LINE> <INDENT> propnames = set(prop.__name__ for prop in cls.property_list()) <NEW_... | Metaclass for :py:class:`Emitter` | 62599079d486a94d0ba2d98e |
class BasicCache(BaseCaching): <NEW_LINE> <INDENT> def put(self, key, item): <NEW_LINE> <INDENT> if key is not None and item is not None: <NEW_LINE> <INDENT> self.cache_data[key] = item <NEW_LINE> <DEDENT> <DEDENT> def get(self, key): <NEW_LINE> <INDENT> if key not in self.cache_data or not key: <NEW_LINE> <INDENT> ret... | BasicCache puts and gets items into a cache | 62599079009cb60464d02f15 |
@skipIf(not HAS_LIBNACL, 'skipping test_nacl, libnacl is unavailable') <NEW_LINE> class NaclTest(ModuleCase): <NEW_LINE> <INDENT> def test_keygen(self): <NEW_LINE> <INDENT> ret = self.run_function( 'nacl.keygen', ) <NEW_LINE> self.assertIn('pk', ret) <NEW_LINE> self.assertIn('sk', ret) <NEW_LINE> <DEDENT> def test_enc_... | Test the nacl runner | 62599079167d2b6e312b827e |
class Questions(Resource): <NEW_LINE> <INDENT> @jwt_required <NEW_LINE> def post(self): <NEW_LINE> <INDENT> current_user = get_jwt_identity() <NEW_LINE> user_data = request.get_json() <NEW_LINE> data = validate(user_data, required_fields=[ 'title', 'body', 'meetup_id']) <NEW_LINE> if type(data) == list: <NEW_LINE> <IND... | This class handles the questions endpoints | 6259907960cbc95b06365a59 |
class ToneAnalyzerV3(WatsonDeveloperCloudService): <NEW_LINE> <INDENT> default_url = 'https://gateway.watsonplatform.net/tone-analyzer/api' <NEW_LINE> latest_version = '2016-05-19' <NEW_LINE> def __init__(self, version, url=default_url, **kwargs): <NEW_LINE> <INDENT> WatsonDeveloperCloudService.__init__(self, 'tone_ana... | Client for the ToneAnalyzer service. | 6259907955399d3f05627eeb |
class Page(object): <NEW_LINE> <INDENT> bbs_url='https://www.hujiang.com' <NEW_LINE> def __init__(self,selenium_driver,base_url=bbs_url,parent=None): <NEW_LINE> <INDENT> self.base_url=base_url <NEW_LINE> self.driver=selenium_driver <NEW_LINE> self.timeout=30 <NEW_LINE> self.parent=parent <NEW_LINE> <DEDENT> def _open(s... | 页面基础类,用于所有页面的继承 | 62599079ec188e330fdfa27f |
@add_status_code(408) <NEW_LINE> class RequestTimeout(NecktieException): <NEW_LINE> <INDENT> pass | The Web server (running the Web site) thinks that there has been too
long an interval of time between 1) the establishment of an IP
connection (socket) between the client and the server and
2) the receipt of any data on that socket, so the server has dropped
the connection. The socket connection has actually been lost ... | 625990795fdd1c0f98e5f956 |
class RamsayE(RobustNorm): <NEW_LINE> <INDENT> def __init__(self, a = .3): <NEW_LINE> <INDENT> self.a = a <NEW_LINE> <DEDENT> def rho(self, z): <NEW_LINE> <INDENT> z = np.asarray(z) <NEW_LINE> return (1 - np.exp(-self.a * np.fabs(z)) * (1 + self.a * np.fabs(z))) / self.a**2 <NEW_LINE> <DEDENT> def psi(self, z): <NEW_LI... | Ramsay's Ea for M estimation.
Parameters
----------
a : float, optional
The tuning constant for Ramsay's Ea function. The default value is
0.3.
See also
--------
scikits.statsmodels.robust.norms.RobustNorm | 62599079ad47b63b2c5a9227 |
class BaseHitRecord(object): <NEW_LINE> <INDENT> HEADER_LEN = 10 <NEW_LINE> def __init__(self, base_time, hdr, data, offset): <NEW_LINE> <INDENT> self.__flags = hdr[2] <NEW_LINE> self.__chan_id = hdr[3] <NEW_LINE> self.__utime = base_time + hdr[4] <NEW_LINE> if hdr[0] == self.HEADER_LEN: <NEW_LINE> <INDENT> self.__data... | Generic hit record class | 62599079be7bc26dc9252b41 |
class Int8Bit(IntVal): <NEW_LINE> <INDENT> def __init__(self, value, signed=False): <NEW_LINE> <INDENT> super(Int8Bit, self).__init__(value, 8, signed) | Represent an 8-bit integer, unsigned by default | 6259907999cbb53fe68328be |
class SyncThruOutputTraySensor(SyncThruSensor): <NEW_LINE> <INDENT> def __init__(self, syncthru, name, number): <NEW_LINE> <INDENT> super().__init__(syncthru, name) <NEW_LINE> self._name = "{} Output Tray {}".format(name, number) <NEW_LINE> self._number = number <NEW_LINE> self._id_suffix = '_output_tray_{}'.format(num... | Implementation of a Samsung Printer input tray sensor platform. | 625990797b180e01f3e49d51 |
class TaskPanelOpPage(PathProfileGui.TaskPanelOpPage): <NEW_LINE> <INDENT> pass | Psuedo page controller class for Profile operation,
allowing for backward compatibility with pre-existing "Profile Edges" operations. | 6259907926068e7796d4e316 |
class BaseWeightedStrategy(MultiDecoderCombinationStrategy): <NEW_LINE> <INDENT> def __init__( self, out_embed_dims, vocab_size, vocab_reduction_module=None, fixed_weights=None, hidden_layer_size=32, activation_fn=torch.nn.ReLU, logit_fn=torch.exp, ): <NEW_LINE> <INDENT> super().__init__(out_embed_dims, vocab_size, voc... | Base class for strategies with explicitly learned weights. | 6259907921bff66bcd724641 |
class MaildirSource(MaildirService, util.ComparableMixin): <NEW_LINE> <INDENT> implements(IChangeSource) <NEW_LINE> compare_attrs = ["basedir", "pollinterval", "prefix"] <NEW_LINE> name = None <NEW_LINE> def __init__(self, maildir, prefix=None): <NEW_LINE> <INDENT> MaildirService.__init__(self, maildir) <NEW_LINE> self... | This source will watch a maildir that is subscribed to a FreshCVS
change-announcement mailing list. | 6259907916aa5153ce401eb2 |
class PiglowLight(Light): <NEW_LINE> <INDENT> def __init__(self, piglow, name): <NEW_LINE> <INDENT> self._piglow = piglow <NEW_LINE> self._name = name <NEW_LINE> self._is_on = False <NEW_LINE> self._brightness = 255 <NEW_LINE> self._hs_color = [0, 0] <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <... | Representation of an Piglow Light. | 6259907923849d37ff852a91 |
class CheckLogin(APIView): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> if request.user.is_authenticated: <NEW_LINE> <INDENT> student = StudentModel.objects.get(user=request.user) <NEW_LINE> read_serializer = StudentModelSerializer(student, context={'request': request}) <NEW_LINE> return Response( {'... | Request Type: GET
Allows you to check whether a token is still valid. Should be done at the time of the app being opened
Request:
Header: <Should contain authorization token>
Parameters: <None>
Response:
Error=True/False
isAuthenticated=True/False
Message=xxxxxxxxxxxxxxxxxxxxx | 625990797d847024c075ddb6 |
class CourseSummaryEnrollmentRecord(Record): <NEW_LINE> <INDENT> course_id = StringField(nullable=False, length=255, description='A unique identifier of the course') <NEW_LINE> catalog_course_title = StringField(nullable=True, length=255, normalize_whitespace=True, description='The name of the course') <NEW_LINE> catal... | Recent enrollment summary and metadata for a course. | 625990791f5feb6acb1645d0 |
class NeuralNetwork: <NEW_LINE> <INDENT> def __init__(self, nx, nodes): <NEW_LINE> <INDENT> if type(nx) is not int: <NEW_LINE> <INDENT> raise TypeError("nx must be an integer") <NEW_LINE> <DEDENT> if nx < 1: <NEW_LINE> <INDENT> raise ValueError("nx must be a positive integer") <NEW_LINE> <DEDENT> if type(nodes) is not ... | Class NeuralNetwork | 62599079ec188e330fdfa281 |
class ArchiveMenuItem(z3c.menu.ready2go.item.SiteMenuItem): <NEW_LINE> <INDENT> pass | Menu item for the archive tab in the site menu. | 62599079627d3e7fe0e08861 |
class GitSubmodulesConfig(AWSProperty): <NEW_LINE> <INDENT> props: PropsDictType = { "FetchSubmodules": (boolean, True), } | `GitSubmodulesConfig <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-gitsubmodulesconfig.html>`__ | 62599079be8e80087fbc0a6f |
class BSTreeNode(object): <NEW_LINE> <INDENT> def __init__(self, k, v, nil=None): <NEW_LINE> <INDENT> self.key = k <NEW_LINE> self.value = v <NEW_LINE> self.left = nil <NEW_LINE> self.right = nil <NEW_LINE> self.parent = nil | Abstract implementation of a binary search tree node. | 625990795fdd1c0f98e5f958 |
class Student: <NEW_LINE> <INDENT> def __init__(self, first_name, last_name, age): <NEW_LINE> <INDENT> self.first_name = first_name <NEW_LINE> self.last_name = last_name <NEW_LINE> self.age = age <NEW_LINE> <DEDENT> def to_json(self, attrs=None): <NEW_LINE> <INDENT> if (type(attrs) == list and all(type(ele) == str for ... | A class representation of a student.
| 62599079aad79263cf430193 |
class Q3Processor(processor.ProcessorABC): <NEW_LINE> <INDENT> def process(self, events): <NEW_LINE> <INDENT> return ( hist.Hist.new.Reg(100, 0, 200, name="ptj", label="Jet $p_{T}$ [GeV]") .Double() .fill(ak.flatten(events.Jet[abs(events.Jet.eta) < 1].pt)) ) <NEW_LINE> <DEDENT> def postprocess(self, accumulator): <NEW_... | Plot the <i>p</i><sub>T</sub> of jets with |<i>η</i>| < 1. | 6259907976e4537e8c3f0f59 |
class Argtable(AutotoolsPackage): <NEW_LINE> <INDENT> homepage = "http://argtable.sourceforge.net/" <NEW_LINE> url = "https://sourceforge.net/projects/argtable/files/argtable/argtable-2.13/argtable2-13.tar.gz/download" <NEW_LINE> version('2-13', sha256='8f77e8a7ced5301af6e22f47302fdbc3b1ff41f2b83c43c77ae5ca041771d... | Argtable is an ANSI C library for parsing GNU style command line
options with a minimum of fuss. | 625990795fc7496912d48f57 |
class DatasetSplit(DataBundleAdvanced): <NEW_LINE> <INDENT> def __init__(self, images: np.ndarray, labels: np.ndarray, bottlenecks=None, probability_distribution=None): <NEW_LINE> <INDENT> super(DatasetSplit, self).__init__(images, labels, bottlenecks) <NEW_LINE> self.set_probability_distribution(probability_distributi... | A DatasetSplit is a smaller portion of a larger Dataset object. | 625990797b180e01f3e49d52 |
class MediaCreator(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def create_media(cls, suggestion, team_reference, preferred_references=[]): <NEW_LINE> <INDENT> media_type_enum = suggestion.contents['media_type_enum'] <NEW_LINE> return Media( id=Media.render_key_name(media_type_enum, suggestion.contents['foreign... | Used to create a Media object from an accepted Suggestion | 6259907921bff66bcd724643 |
class TeslaSmart(Driver): <NEW_LINE> <INDENT> __SET_CHANNEL = b"\xAA\xBB\x03\x01%b\xEE" <NEW_LINE> def __init__(self, config: Dict[str, Any]): <NEW_LINE> <INDENT> super().__init__(config, 0) <NEW_LINE> validate_value("maxInputs" in self.config, "Missing `maxInputs` for Tesla-Smart switch") <NEW_LINE> validate_value("tt... | Tesla-Smart HDMI and SDI switch driver. | 625990797d43ff2487428102 |
class brect: <NEW_LINE> <INDENT> def __init__(self, l_pt, rsize, imsize): <NEW_LINE> <INDENT> self.Set_l_pt(l_pt) <NEW_LINE> self.Set_size(rsize) <NEW_LINE> self.image_size = imsize <NEW_LINE> <DEDENT> def Set_l_pt(self, l_pt): self.l_pt = TupleToList(l_pt) <NEW_LINE> def Set_size(self, rsize): self.size = TupleToList(... | This is rect | 62599079adb09d7d5dc0bf44 |
class FamaMacBethResults(PanelResults): <NEW_LINE> <INDENT> def __init__(self, res: AttrDict): <NEW_LINE> <INDENT> super().__init__(res) <NEW_LINE> self._all_params = res.all_params <NEW_LINE> <DEDENT> @property <NEW_LINE> def all_params(self) -> DataFrame: <NEW_LINE> <INDENT> return self._all_params | Results container for Fama MacBeth panel data models | 6259907923849d37ff852a93 |
class IPagesDirective(IBasicViewInformation): <NEW_LINE> <INDENT> for_ = GlobalObject( title=u"The interface or class this view is for.", required=False ) <NEW_LINE> permission = Permission( title=u"Permission", description=u"The permission needed to use the view.", required=True ) | Define multiple pages without repeating all of the parameters.
The pages directive allows multiple page views to be defined
without repeating the 'for', 'permission', 'class', 'layer',
'allowed_attributes', and 'allowed_interface' attributes. | 62599079009cb60464d02f19 |
class ZslJwtInvalidAudienceError(ZslJwtError): <NEW_LINE> <INDENT> pass | When the audience of the token does not match the
audience of the profile used to decode the token. | 6259907966673b3332c31dda |
class Node(): <NEW_LINE> <INDENT> def __init__(self, port, version, color): <NEW_LINE> <INDENT> key = Key() <NEW_LINE> self.pri_key = key.private_key <NEW_LINE> self.pub_key = key.public_key <NEW_LINE> self.port = port <NEW_LINE> self.version = version <NEW_LINE> self.color = color <NEW_LINE> self.peers = {} <NEW_LINE>... | Generic node class | 62599079f9cc0f698b1c5fba |
class ProcessRequestItem(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_type = Field("ProcessRequestItem", const=True) <NEW_LINE> sequenceLinkId: fhirtypes.Integer = Field( None, alias="sequenceLinkId", title="Service instance", description="A service line number.", element_property=True, element_requir... | Disclaimer: Any field name ends with ``__ext`` doesn't part of
Resource StructureDefinition, instead used to enable Extensibility feature
for FHIR Primitive Data Types.
Items to re-adjudicate.
List of top level items to be re-adjudicated, if none specified then the
entire submission is re-adjudicated. | 62599079aad79263cf430195 |
class CodeDict(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.code_dict = {} <NEW_LINE> self.schema = Schema({Extra: dict}) <NEW_LINE> self.schema(self.code_dict) <NEW_LINE> <DEDENT> def update(self,arg): <NEW_LINE> <INDENT> self.schema(arg.code_dict) <NEW_LINE> self.code_dict.update(arg.code_dict)... | Class for handling code lists
>>> code_list = {'Country': {'FR': 'France'}}
>>> print(code_list)
{'Country': {'FR': 'France'}} | 6259907992d797404e38984a |
class Response(object): <NEW_LINE> <INDENT> STATUS_ACK = (1 << 0) <NEW_LINE> STATUS_WAIT = (1 << 1) <NEW_LINE> STATUS_FAULT = (1 << 2) <NEW_LINE> STATUS_INVALID = -1 <NEW_LINE> def __init__(self, status, data=None): <NEW_LINE> <INDENT> self.status = status <NEW_LINE> self.data = data <NEW_LINE> <DEDENT> def ack(self): ... | Response class to hold the response from the send of a SWD request. | 625990795fdd1c0f98e5f95b |
class getCritChance(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.pkmn = BuildPokemonBattleWrapper() <NEW_LINE> self.crit = CritDelegate(0) <NEW_LINE> <DEDENT> def checkMods(self): <NEW_LINE> <INDENT> self.crit = CritDelegate(0) <NEW_LINE> for mod in range(0, len(CritDelegate.critMo... | Test cases of getCritChance | 625990793317a56b869bf234 |
class User(namedtuple('User', ( 'id', 'slug', 'name', ))): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def from_api_object(obj): <NEW_LINE> <INDENT> user = User(id=obj['id'], name=obj['name'], slug=obj['slug']) <NEW_LINE> django_cache.set(('wp_user_by_id', user.id), user, _CACHE_TTL) <NEW_LINE> return user | Represents a WordPress user, i.e. the author of a post. | 6259907932920d7e50bc7a25 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.