code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Page11(ToughSchedulingCasesPage): <NEW_LINE> <INDENT> def __init__(self, page_set): <NEW_LINE> <INDENT> super(Page11, self).__init__( url='file://tough_scheduling_cases/touch_handler_scrolling.html?super_slow_handler', page_set=page_set) <NEW_LINE> self.synthetic_delays = {'blink.HandleInputEvent': {'target_durat... | Why: Super expensive touch handler causes browser to scroll after a
timeout. | 62598fa6498bea3a75a57a0f |
class Window: <NEW_LINE> <INDENT> _JAVA_MIN_LONG = -(1 << 63) <NEW_LINE> _JAVA_MAX_LONG = (1 << 63) - 1 <NEW_LINE> _PRECEDING_THRESHOLD = max(-sys.maxsize, _JAVA_MIN_LONG) <NEW_LINE> _FOLLOWING_THRESHOLD = min(sys.maxsize, _JAVA_MAX_LONG) <NEW_LINE> unboundedPreceding: int = _JAVA_MIN_LONG <NEW_LINE> unboundedFollowing... | Utility functions for defining window in DataFrames.
.. versionadded:: 1.4
Notes
-----
When ordering is not defined, an unbounded window frame (rowFrame,
unboundedPreceding, unboundedFollowing) is used by default. When ordering is defined,
a growing window frame (rangeFrame, unboundedPreceding, currentRow) is used by... | 62598fa61b99ca400228f4a6 |
class MeshParser(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> raise NotImplementedError("This function must be defined by an " + "inheriting class.") <NEW_LINE> <DEDENT> def savetxt(self): <NEW_LINE> <INDENT> np.savetxt("nodes.txt", self.nodes) <NEW_LINE> np.savetxt("elements.txt", self.elements... | Properties
----------
* elements : A numpy array listing the node numbers of every element;
for example,
print(t.elements)
=> [[ 1 9 4 10 11 8]
[ 1 2 9 5 12 10]
[ 2 3 9 6 13 12]
[ 3 4 9 7 11 13]]
for a quadratic mesh with four elements.
* nodes : a array of every node... | 62598fa6851cf427c66b81b6 |
class DescribeTextStatRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.AuditType = None <NEW_LINE> self.Filters = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.AuditType = params.get("AuditType") <NEW_LINE> if params.get("Filters") is not None:... | DescribeTextStat请求参数结构体
| 62598fa6d268445f26639afa |
class LocalClass: <NEW_LINE> <INDENT> def __init__(self, local_vars, columns=80): <NEW_LINE> <INDENT> self.var_names = list(local_vars.keys()) <NEW_LINE> self.types = [type(local_vars[key]).__name__ for key in self.var_names] <NEW_LINE> self.values = [str(local_vars[key]) for key in self.var_names] <NEW_LINE> self._add... | Formats the ``locale`` object for display in the tty.
Can handle any kind of object to format it in a
+-----+------+-------+
| KEY | TYPE | VALUE |
+-----+------+-------+
like table
Args
----
local_vars : object
Object to display in table. key will be one row
columns : int
Width (in columns) of the output ... | 62598fa645492302aabfc3bf |
class Category(BaseModel): <NEW_LINE> <INDENT> IdCategory = models.AutoField(_("ID city"), primary_key=True) <NEW_LINE> Description = models.CharField( _("Description"), max_length=255, blank=False, null=False, unique=True) <NEW_LINE> historical = HistoricalRecords() <NEW_LINE> @property <NEW_LINE> def _history_user(se... | Model definition for Category. | 62598fa6a8370b77170f02c9 |
class TestingConfig(Config): <NEW_LINE> <INDENT> TESTING = True <NEW_LINE> DEBUG = True | Configurations for Testing | 62598fa68e71fb1e983bb9a0 |
class NetworkRuleSet(Resource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'trusted_service_acces... | Description of topic resource.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
:... | 62598fa6435de62698e9bce4 |
class InfaError(Exception): <NEW_LINE> <INDENT> pass | Baseclass for all Infa errors. | 62598fa6b7558d589546351e |
class BindingWrapper(Binding): <NEW_LINE> <INDENT> def __init__(self, id, target): <NEW_LINE> <INDENT> self.target = target <NEW_LINE> super(BindingWrapper, self).__init__(id) <NEW_LINE> <DEDENT> def validateItemType(self, item, bindingConfig): <NEW_LINE> <INDENT> if hasattr(self.target, 'validateItemType'): <NEW_LINE>... | Wraps a binding implementation. The goal is to remove OSGI dependencies in
the binding implementation for easier testing. | 62598fa666656f66f7d5a2df |
class Pattern(object): <NEW_LINE> <INDENT> def __init__(self, config, config_global): <NEW_LINE> <INDENT> if not self.config_defaults: <NEW_LINE> <INDENT> self.config_defaults = {} <NEW_LINE> <DEDENT> self.config = config <NEW_LINE> configdict.extend_deep(self.config, self.config_defaults.copy()) <NEW_LINE> self.config... | Base Pattern Class. | 62598fa6d7e4931a7ef3bf89 |
class Category(models.Model): <NEW_LINE> <INDENT> title = models.CharField('Name Category', max_length=50) <NEW_LINE> slug = models.SlugField(unique=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = 'Category' <NEW_LINE> verbose_name_plural = 'Categories' <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> ... | Categories | 62598fa6e5267d203ee6b7fb |
class InsufficientStorageError(YaDiskError): <NEW_LINE> <INDENT> pass | Thrown when the server returns code 509. | 62598fa6f7d966606f747ed3 |
class TracedGreenlet(gevent.Greenlet): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self._active_span = tracer.active_span <NEW_LINE> super(TracedGreenlet, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def run(self, *args, **kwargs): <NEW_LINE> <INDENT> tracer.active_span_source.ma... | Helper class OpenTracing-aware, that ensures the context is propagated
from a parent greenlet to a child when a new greenlet is initialized. | 62598fa656ac1b37e63020dc |
class Piece(Marker): <NEW_LINE> <INDENT> def __init__(self,gui, x, y, fill, r, g, b, board, pid): <NEW_LINE> <INDENT> SIDE = 70 <NEW_LINE> self.board, self.fill, self.pid = board, fill, pid <NEW_LINE> self.red, self.green, self.blue = r,g,b <NEW_LINE> self.avatar = gui.image(href=REPO%fill, x=x ,y=y, width=SIDE,height=... | Represents the user choice when deployed insde the 3D open cube. :ref:`piece`
| 62598fa6cc0a2c111447aefe |
class Conv(nn.Module): <NEW_LINE> <INDENT> def __init__(self, n_in, filter_size, n_out, non_linearity=None, batch_norm=False, weight_norm=False, dropout=0., initialize='glorot_uniform'): <NEW_LINE> <INDENT> super(Conv, self).__init__() <NEW_LINE> self.conv = nn.Conv2d(n_in, n_out, filter_size, padding=int(np.ceil(filte... | Basic convolutional layer with optional batch normalization, non-linearity, weight normalization and dropout. | 62598fa6a8370b77170f02ca |
class StringMock(StringLike): <NEW_LINE> <INDENT> def __init__(self, string): <NEW_LINE> <INDENT> self.string = string <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.text_type(self.string) | A simple mock of built-in strings using the StringLike class. | 62598fa6cc0a2c111447aeff |
class Dframe(pd.DataFrame): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> return super().__getitem__(name) <NEW_LINE> <DEDENT> def __getitem__(self, arg): <NEW_LINE> <INDENT> if not isin... | A data frame that indexes like R. self[] takes two entries, rows and
columns. | 62598fa6aad79263cf42e6c4 |
class ProductsStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.GetRecord = channel.unary_unary( '/product.Products/GetRecord', request_serializer=Id.SerializeToString, response_deserializer=Record.FromString, ) <NEW_LINE> self.ListRecords = channel.unary_stream( '/product.Products... | Interface exported by the server.
| 62598fa6f548e778e596b494 |
class RTClientAPIError(Exception): <NEW_LINE> <INDENT> pass | To be raised on RT-related operation/communication failures. | 62598fa68c0ade5d55dc3608 |
class OpenWeather: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.dataset = None <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def read_openweather_to_xarray(cls, fn_openweather, date_start=None, date_end=None): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> dataset = cls.read_openweather_data(fn_openweat... | Class to load in an export OpenWeather history file at Hawarden Airport into
an xarray dataset. | 62598fa6090684286d593653 |
class GerritAccessor(object): <NEW_LINE> <INDENT> def __init__(self, host): <NEW_LINE> <INDENT> self.host = host <NEW_LINE> self.cache = {} <NEW_LINE> <DEDENT> def _FetchChangeDetail(self, issue): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return gerrit_util.GetChangeDetail( self.host, str(issue), ['ALL_REVISIONS', '... | Limited Gerrit functionality for canned presubmit checks to work.
To avoid excessive Gerrit calls, caches the results. | 62598fa62ae34c7f260aafd1 |
@inherit_doc <NEW_LINE> class _DecisionTreeClassifierParams(_DecisionTreeParams, _TreeClassifierParams): <NEW_LINE> <INDENT> pass | Params for :py:class:`DecisionTreeClassifier` and :py:class:`DecisionTreeClassificationModel`. | 62598fa6bd1bec0571e1503b |
class CacheError(Exception): <NEW_LINE> <INDENT> pass | Base exception for all cache related errors. | 62598fa645492302aabfc3c1 |
class InputThetvdbFavorites(object): <NEW_LINE> <INDENT> schema = { 'type': 'object', 'properties': { 'username': {'type': 'string'}, 'account_id': {'type': 'string'}, 'strip_dates': {'type': 'boolean'} }, 'required': ['username', 'account_id'], 'additionalProperties': False } <NEW_LINE> @cached('thetvdb_favorites') <N... | Creates a list of entries for your series marked as favorites at thetvdb.com for use in configure_series.
Example:
configure_series:
from:
thetvdb_favorites:
username: some_username
account_id: some_password | 62598fa64e4d562566372315 |
class ON(): <NEW_LINE> <INDENT> def __init__(self, x, y): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.onArg1Dic = {} <NEW_LINE> self.onArg2Dic = {} <NEW_LINE> <DEDENT> def display(self): <NEW_LINE> <INDENT> print(self.x) <NEW_LINE> print(self.y) <NEW_LINE> <DEDENT> def assign_values(self): <NEW... | ON Proposition | 62598fa6627d3e7fe0e06d9d |
class CtdpfCklWfpRecoveredMetadataParticle(CtdpfCklWfpMetadataParticle): <NEW_LINE> <INDENT> _data_particle_type = DataParticleType.RECOVERED_METADATA | Class for the recovered ctdpf_ckl_wfp metadata particle | 62598fa663d6d428bbee26a2 |
@metaclassify(ABCMeta) <NEW_LINE> class NonStringIterable: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def __subclasshook__(cls, C): <NEW_LINE> <INDENT> if cls is NonStringIterable: <NEW_LINE> <INDENT> if (not issubclass(C, (str, bytes)) and issubclass(C, Iterable)): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> ... | Allows isinstance check for iterable that is not a string
| 62598fa61f5feb6acb162b12 |
@admin.register(Hashtag) <NEW_LINE> class HashtagAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> raw_id_fields = ('documents', ) | Hashtag admin model | 62598fa64428ac0f6e658412 |
class MessageClientError(Exception): <NEW_LINE> <INDENT> pass | A class for message client exceptions | 62598fa6925a0f43d25e7f2e |
class SamplerBuilderSimpleFG(SamplerBuilder): <NEW_LINE> <INDENT> def build(self): <NEW_LINE> <INDENT> samplers = list() <NEW_LINE> agg_kernel = calc_avg_kernel(self.patch_size) <NEW_LINE> for orient in self._get_orients(): <NEW_LINE> <INDENT> patches = self._build_patches(orient) <NEW_LINE> w = self._calc_weights(patc... | Builds a :class:`sssrlib.sample.Sampler` to sample patches in foreground.
| 62598fa6097d151d1a2c0f18 |
class BaseError(Exception): <NEW_LINE> <INDENT> pass | Base error class for all things C{codec}. | 62598fa616aa5153ce4003f3 |
class GetFullUser(TLObject): <NEW_LINE> <INDENT> __slots__ = ["id"] <NEW_LINE> ID = 0xca30a5b1 <NEW_LINE> QUALNAME = "functions.users.GetFullUser" <NEW_LINE> def __init__(self, *, id): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def read(b: BytesIO, *args) -> "GetFullUser": <NEW_LINE> ... | Attributes:
LAYER: ``112``
Attributes:
ID: ``0xca30a5b1``
Parameters:
id: Either :obj:`InputUserEmpty <pyrogram.api.types.InputUserEmpty>`, :obj:`InputUserSelf <pyrogram.api.types.InputUserSelf>`, :obj:`InputUser <pyrogram.api.types.InputUser>` or :obj:`InputUserFromMessage <pyrogram.api.types.InputUserFr... | 62598fa68e7ae83300ee8f92 |
class FetcherInvalidPageError(ValueError): <NEW_LINE> <INDENT> pass | Raised when fetched page is not suitable for further parsing | 62598fa632920d7e50bc5f47 |
class TaskPolicy(object, metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> _schema = {} <NEW_LINE> def before_task_start(self, task): <NEW_LINE> <INDENT> utils.evaluate_object_fields(self, task.get_expression_context()) <NEW_LINE> self._validate() <NEW_LINE> <DEDENT> def after_task_complete(self, task): <NEW_LINE> <INDENT> u... | Task policy.
Provides interface to perform any work after a task has completed.
An example of task policy may be 'retry' policy that makes engine
to run a task repeatedly if it finishes with a failure. | 62598fa656ac1b37e63020dd |
class CoincidenceCoreReconstruction(object): <NEW_LINE> <INDENT> def __init__(self, cluster): <NEW_LINE> <INDENT> self.estimator = CenterMassAlgorithm <NEW_LINE> self.cluster = cluster <NEW_LINE> <DEDENT> def reconstruct_coincidence(self, coincidence, station_numbers=None, initial={}): <NEW_LINE> <INDENT> p, x, y, z = ... | Reconstruct core for coincidences
This class is aware of 'coincidences' and 'clusters'. Initialize
this class with a 'cluster' and you can reconstruct a coincidence
using :meth:`reconstruct_coincidence`.
:param cluster: :class:`sapphire.clusters.BaseCluster` object. | 62598fa6fff4ab517ebcd6d5 |
class TrainTestDiff(object): <NEW_LINE> <INDENT> def __init__(self, datasets): <NEW_LINE> <INDENT> self.datasets = datasets <NEW_LINE> <DEDENT> def plot_cont_diff(self, features, kind="box", col_wrap=3, size=4, aspect=1, title=None): <NEW_LINE> <INDENT> return plot_continuous_diff(self.datasets, features, kind, col_wra... | Helper class to ease distribution analysis on the same datasets | 62598fa6e76e3b2f99fd8927 |
class CreateCollectionIndexStatement(Statement): <NEW_LINE> <INDENT> def __init__(self, collection, index_name, is_unique): <NEW_LINE> <INDENT> super(CreateCollectionIndexStatement, self).__init__(target=collection) <NEW_LINE> self._index_name = index_name <NEW_LINE> self._is_unique = is_unique <NEW_LINE> self._fields ... | A statement that creates an index on a collection.
Args:
collection (mysqlx.Collection): Collection.
index_name (string): Index name.
is_unique (bool): `True` if the index is unique. | 62598fa6009cb60464d01410 |
class RubricList(AACOnlyMixin,ListView): <NEW_LINE> <INDENT> model = Rubric <NEW_LINE> template_name = "makeReports/Rubric/rubricList.html" <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return Rubric.objects.order_by("-date") | View to list rubrics in reverse chronological order | 62598fa6f548e778e596b495 |
class TokenSequence (ListReplacing, AbstractToken): <NEW_LINE> <INDENT> def __call__(self, parser, origCursor): <NEW_LINE> <INDENT> o = [] <NEW_LINE> only = False <NEW_LINE> onlyVal = None <NEW_LINE> for g in self.desc: <NEW_LINE> <INDENT> if g is Whitespace: <NEW_LINE> <INDENT> parser.skip(parser.whitespace) <NEW_LINE... | A class whose instances match a sequence of tokens. Returns a corresponding list of return values from L{ZestyParser.scan}.
Some special types, L{Skip}, L{Omit}, and L{Only}, are allowed in the sequence. These are wrappers for other token objects adding special behaviours. If it encounters a L{Skip} token, it will pro... | 62598fa6baa26c4b54d4f1a1 |
class RollbackRequest(proto.Message): <NEW_LINE> <INDENT> database = proto.Field(proto.STRING, number=1) <NEW_LINE> transaction = proto.Field(proto.BYTES, number=2) | The request for
[Firestore.Rollback][google.firestore.v1.Firestore.Rollback].
Attributes:
database (str):
Required. The database name. In the format:
``projects/{project_id}/databases/{database_id}``.
transaction (bytes):
Required. The transaction to roll back. | 62598fa64428ac0f6e658413 |
class DirectoryFetcher(Iterable[Story], Sized, Fetcher): <NEW_LINE> <INDENT> prefetch_meta = False <NEW_LINE> prefetch_data = False <NEW_LINE> def __init__( self, meta_path: Union[Path, str] = None, data_path: Union[Path, str] = None, flavors: Iterable[Flavor] = tuple(), ) -> None: <NEW_LINE> <INDENT> self.meta_path = ... | Fetches stories from file system. | 62598fa6090684286d593654 |
class TokenVarExtractor(object): <NEW_LINE> <INDENT> def __init__(self, token): <NEW_LINE> <INDENT> self.token_content = token.split_contents() <NEW_LINE> self.tag_name = self.token_content.pop(0) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def split(item): <NEW_LINE> <INDENT> key, sep, value = item.rpartition('=') <N... | Extracts variables from split content of the token.
Used to extract both positional and keyword arguments.
:param token: The token object, passed to template function | 62598fa663d6d428bbee26a3 |
class SessionStateSuccessSchema(BaseSchema): <NEW_LINE> <INDENT> level = fields.Int( required=True, description="User level", example=0, ) <NEW_LINE> picture_uri = fields.Str( required=False, description="User picture", example="https://c8.patreon.com/2/200/561356054", ) <NEW_LINE> name = fields.Str( required=False, de... | Schema for returning session data | 62598fa66aa9bd52df0d4dbb |
class FoilPresenterImport(SongImport): <NEW_LINE> <INDENT> def __init__(self, manager, **kwargs): <NEW_LINE> <INDENT> log.debug('initialise FoilPresenterImport') <NEW_LINE> SongImport.__init__(self, manager, **kwargs) <NEW_LINE> self.FoilPresenter = FoilPresenter(self.manager, self) <NEW_LINE> <DEDENT> def doImport(sel... | This provides the Foilpresenter import. | 62598fa6d486a94d0ba2bec0 |
class APIClientMetaclass(type): <NEW_LINE> <INDENT> config_class = ConfigClass <NEW_LINE> @staticmethod <NEW_LINE> def add_methods_for_endpoint(methods, name, endpoint, config): <NEW_LINE> <INDENT> methods[name] = classmethod(method_factory(endpoint, '_make_request')) <NEW_LINE> <DEDENT> def __new__(cls, name, bases, a... | Makes API call methods from APIEndpoint definitions on the APIClient class
(this 'metaclass magic' is similar to Django Model class where fields are
defined on the class, and transformed by the metaclass into usable attrs)
eg
class ThingServiceClient(APIClient):
class Config:
base_url = 'htt... | 62598fa62ae34c7f260aafd3 |
class PackageViewSet(viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> queryset = Package.objects.all().order_by("-id") <NEW_LINE> serializer_class = PackageSerializer <NEW_LINE> paginate_by = 20 | API endpoint that allows packages to be viewed or edited. | 62598fa6eab8aa0e5d30bc7c |
class DiscreteModule(torch.nn.Module): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> def __init__(self, probs=None, logits=None): <NEW_LINE> <INDENT> super(DiscreteModule, self).__init__() <NEW_LINE> if probs is None and logits is None: <NEW_LINE> <INDENT> raise ValueError("Expectingt the given 'probs' xor 'lo... | Discrete probability module.
Discrete probability module from which several discrete probability distributions (such as Bernoulli, Categorical,
and others) inherit from. | 62598fa6be8e80087fbbef54 |
class TestGetInboundEmailEventsByUuid(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 testGetInboundEmailEventsByUuid(self): <NEW_LINE> <INDENT> pass | GetInboundEmailEventsByUuid unit test stubs | 62598fa64428ac0f6e658414 |
class News(BaseModel, db.Model): <NEW_LINE> <INDENT> __tablename__ = "info_news" <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> title = db.Column(db.String(256), nullable=False) <NEW_LINE> source = db.Column(db.String(64), nullable=False) <NEW_LINE> digest = db.Column(db.String(512), nullable=False)... | 新闻 | 62598fa601c39578d7f12c72 |
class WebcastEncoder(models.Model): <NEW_LINE> <INDENT> name = models.CharField( max_length = 100, help_text = "Enter the stream type name", ) <NEW_LINE> description = models.CharField( max_length = 200, help_text = "Enter a short description", ) <NEW_LINE> vendor = models.ForeignKey( HardwareVendor, ) <NEW_LINE> ip_ad... | Model representing a stream type | 62598fa64f88993c371f0483 |
class Translate: <NEW_LINE> <INDENT> def __init__(self, bot): <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> <DEDENT> @commands.command() <NEW_LINE> async def sweet(self, input): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> priceUSD = result['data']['prices'][1]['price'] <NEW_LINE> await self.bot.say("BTC PRICE " + pric... | Translate to Sweetish for trigger | 62598fa6925a0f43d25e7f30 |
class State: <NEW_LINE> <INDENT> def __init__(self, jug_1: int, jug_2: int): <NEW_LINE> <INDENT> self._jug_1 = jug_1 <NEW_LINE> self._jug_2 = jug_2 <NEW_LINE> <DEDENT> def __eq__(self, other: object): <NEW_LINE> <INDENT> return self._jug_1 == other._jug_1 and self._jug_2 == other._jug_2 <NEW_LINE> <DEDENT> def __str__(... | State of the jugs | 62598fa68e7ae83300ee8f94 |
class Calculator: <NEW_LINE> <INDENT> def __init__(self, a, b=25): <NEW_LINE> <INDENT> self.a = a <NEW_LINE> self.b = b <NEW_LINE> <DEDENT> def addition(self): <NEW_LINE> <INDENT> return self.a + self.b <NEW_LINE> <DEDENT> def subtraction(self): <NEW_LINE> <INDENT> return self.a - self.b <NEW_LINE> <DEDENT> def multipl... | Do addition, subtraction, multiplication and division. | 62598fa6d7e4931a7ef3bf8d |
class IdentAlloc(object): <NEW_LINE> <INDENT> def __init__(self, idrange): <NEW_LINE> <INDENT> self.__used = [] <NEW_LINE> self.__free = [x for x in range(idrange)] <NEW_LINE> <DEDENT> def free(self, oldid): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> used_index = self.__used.index(oldid) <NEW_LINE> self.__free.append... | Manage unique identity numbers in range | 62598fa6cb5e8a47e493c0f1 |
class PlugnhackAPI(object): <NEW_LINE> <INDENT> def __init__(self,core): <NEW_LINE> <INDENT> self.Core = core <NEW_LINE> self.action_monitor = "monitor" <NEW_LINE> self.action_start_monitoring = "startMonitoring" <NEW_LINE> self.action_stop_monitoring = "stopMonitoring" <NEW_LINE> self.action_oracle = "oracle" <NEW_LIN... | PlugnhackAPI handles commands from user. | 62598fa676e4537e8c3ef49f |
class JRNLImporter(object): <NEW_LINE> <INDENT> names = ["jrnl"] <NEW_LINE> @staticmethod <NEW_LINE> def import_(journal, input=None): <NEW_LINE> <INDENT> old_cnt = len(journal.entries) <NEW_LINE> old_entries = journal.entries <NEW_LINE> if input: <NEW_LINE> <INDENT> with codecs.open(input, "r", "utf-8") as f: <NEW_LIN... | This plugin imports entries from other jrnl files. | 62598fa65fdd1c0f98e5de8a |
class SystemData(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'str'}, 'created_by_type': {'key': 'createdByType', 'type': 'str'}, 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, 'last_... | Metadata pertaining to creation and last modification of the resource.
:param created_by: The identity that created the resource.
:type created_by: str
:param created_by_type: The type of identity that created the resource. Possible values
include: "User", "Application", "ManagedIdentity", "Key".
:type created_by_typ... | 62598fa660cbc95b0636423f |
class PluginAdapterV3(PluginAdapterV2): <NEW_LINE> <INDENT> node_roles_config_name = 'node_roles.yaml' <NEW_LINE> volumes_config_name = 'volumes.yaml' <NEW_LINE> deployment_tasks_config_name = 'deployment_tasks.yaml' <NEW_LINE> network_roles_config_name = 'network_roles.yaml' <NEW_LINE> def sync_metadata_to_db(self): <... | Plugin wrapper class for package version >= 3.0.0
| 62598fa65166f23b2e2432ca |
class UnitMovable(UnitBird): <NEW_LINE> <INDENT> name_struct = "unit_movable" <NEW_LINE> name_struct_file = "unit" <NEW_LINE> struct_description = "adds attack and armor properties to units." <NEW_LINE> data_format = ( (dataformat.READ_EXPORT, None, dataformat.IncludeMembers(cls=UnitBird)), (dataformat.READ, "... | type_id >= 60 | 62598fa63617ad0b5ee06046 |
class AuthTool(cp.Tool): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> cp.Tool.__init__(self, 'before_handler', self._authenticate) <NEW_LINE> <DEDENT> def _authenticate(self): <NEW_LINE> <INDENT> if not self.get_user(): <NEW_LINE> <INDENT> raise cp.HTTPError(401, 'Unauthorized') <NEW_LINE> <DEDENT> <DEDE... | Auth tool for JSON requests.
User have to give us a token each time he ask for data. | 62598fa691af0d3eaad39d02 |
class Radius(Packet): <NEW_LINE> <INDENT> name = "RADIUS" <NEW_LINE> fields_desc = [ ByteEnumField("code", 1, _packet_codes), ByteField("id", 0), FieldLenField( "len", None, "attributes", "H", adjust=lambda pkt, x: len(pkt.attributes) + 20 ), XStrFixedLenField("authenticator", "", 16), _RADIUSAttrPacketListField( "attr... | Implements a RADIUS packet (RFC 2865). | 62598fa64428ac0f6e658415 |
class ClusterView(MapView): <NEW_LINE> <INDENT> template_name = 'map/map_clusters.html' <NEW_LINE> def format_centroids(self, centroids, num_points, sizes): <NEW_LINE> <INDENT> centroid_data_dict = {"type": "FeatureCollection", "features": []} <NEW_LINE> for centroid, num, size in zip(centroids, num_points, sizes): <NE... | Display points with cluster colors, and centroids | 62598fa64e4d562566372318 |
class PartTrackingList(generics.ListCreateAPIView): <NEW_LINE> <INDENT> queryset = PartTrackingInfo.objects.all() <NEW_LINE> serializer_class = PartTrackingInfoSerializer <NEW_LINE> permission_classes = (permissions.IsAuthenticatedOrReadOnly,) <NEW_LINE> filter_backends = (DjangoFilterBackend,) <NEW_LINE> filter_class ... | get:
Return a list of all PartTrackingInfo objects
(with optional query filter)
post:
Create a new PartTrackingInfo object | 62598fa68a43f66fc4bf2071 |
class ForbiddenError(RPCError): <NEW_LINE> <INDENT> code = 403 <NEW_LINE> message = 'FORBIDDEN' | Privacy violation. For example, an attempt to write a message to
someone who has blacklisted the current user. | 62598fa62ae34c7f260aafd5 |
class LogicAppReceiver(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'name': {'required': True}, 'resource_id': {'required': True}, 'callback_url': {'required': True}, } <NEW_LINE> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'callbac... | A logic app receiver.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the logic app receiver. Names must be unique across all
receivers within an action group.
:type name: str
:param resource_id: Required. The azure resource id of the logic app receiver.
:type ... | 62598fa624f1403a9268582d |
class Client: <NEW_LINE> <INDENT> m_Controller = Controller() <NEW_LINE> m_Controller.AddOperation(GoAhead(step=12)) <NEW_LINE> m_Controller.AddOperation(GoBack(step=4)) <NEW_LINE> m_Controller.AddOperation(GoLeft(step=3)) <NEW_LINE> m_Controller.AddOperation(GoRight(step=5)) <NEW_LINE> m_Controller.Execute() <NEW_LINE... | This class creates a ConcreteCommand object and sets its receiver.
| 62598fa657b8e32f52508095 |
class ProxyMiddleware(): <NEW_LINE> <INDENT> def __init__(self, orderno, secret, host, port): <NEW_LINE> <INDENT> self.logger = logging.getLogger(__name__) <NEW_LINE> self.orderno = orderno <NEW_LINE> self.secret =secret <NEW_LINE> self.host = host <NEW_LINE> self.port = port <NEW_LINE> <DEDENT> def get_proxy(self): <N... | 动态代理 | 62598fa6656771135c489576 |
class MRRamp(MRJob): <NEW_LINE> <INDENT> def mapper(self, _, line): <NEW_LINE> <INDENT> t = track.load_track(line) <NEW_LINE> if t and t['duration'] > 60 and len(t['segments']) > 20: <NEW_LINE> <INDENT> segments = t['segments'] <NEW_LINE> half_track = t['duration'] / 2 <NEW_LINE> first_half = 0 <NEW_LINE> second_half =... | A map-reduce job that calculates the ramp factor | 62598fa6d268445f26639afd |
class NeuronalStrengthDifferenceEnergyFunction: <NEW_LINE> <INDENT> def __call__(self, matrix: np.ndarray) -> float: <NEW_LINE> <INDENT> return np.mean(np.power(np.sum(matrix - matrix.T, axis=1), 2)) | Evaluate the network energy associated with the neural differences in
in- and out- strength of a given neuron. These two values are close to the
same for any given neuron. In order to preserve this nodal associativity
the difference between neuron in-strengths and out-strengths is taken.
If near zero, then it matches w... | 62598fa64428ac0f6e658416 |
class TestSandboxSetPositionBalanceRequest(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 testSandboxSetPositionBalanceRequest(self): <NEW_LINE> <INDENT> pass | SandboxSetPositionBalanceRequest unit test stubs | 62598fa68da39b475be030d6 |
class RaggedFloat(object): <NEW_LINE> <INDENT> def __init__(self, ragged: Union[str, _k2.RaggedFloat, _k2.RaggedShape], values: Optional[torch.Tensor] = None): <NEW_LINE> <INDENT> if isinstance(ragged, str): <NEW_LINE> <INDENT> ragged = _k2.RaggedFloat(ragged) <NEW_LINE> assert values is None <NEW_LINE> <DEDENT> elif i... | A ragged float tensor.
It is a wrapper of :class:`_k2.RaggedFloat`, whose purpose
is to implement autograd for :class:`_k2.RaggedFloat`.
Currently, it is used only in `k2.ragged.normalize_scores`. | 62598fa6435de62698e9bce9 |
class XYCoords(Generic[CoordType], metaclass=XYCoordMeta): <NEW_LINE> <INDENT> x: CoordType <NEW_LINE> y: CoordType <NEW_LINE> X: CoordType <NEW_LINE> Y: CoordType | Provides a x,y coordinate pair type for the type checker. | 62598fa61f5feb6acb162b16 |
class CeleryBzrsyncdJobLayer(AppServerLayer): <NEW_LINE> <INDENT> celeryd = None <NEW_LINE> @classmethod <NEW_LINE> @profiled <NEW_LINE> def setUp(cls): <NEW_LINE> <INDENT> cls.celeryd = celeryd('bzrsyncd_job') <NEW_LINE> cls.celeryd.__enter__() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> @profiled <NEW_LINE> def tearD... | Layer for tests that run jobs that read from branches via Celery. | 62598fa64f88993c371f0484 |
class DebugServer(StoppableThread): <NEW_LINE> <INDENT> def __init__(self, local=None, host="localhost", port=2000): <NEW_LINE> <INDENT> self.__server_socket = None <NEW_LINE> self.__connections = [] <NEW_LINE> self.__local = local <NEW_LINE> self.__host = host <NEW_LINE> self.__port = port <NEW_LINE> StoppableThread._... | A HTTP Server that accepts connections from local host to an interactive Python shell.
This can be used for debugging purposes. The interactive Python shell allows you to inspect the state
of the running Python process including global variables, etc.
This currently creates a new thread for every incoming connection... | 62598fa6435de62698e9bcea |
class EveryNthEpochExtension(TrainExtension): <NEW_LINE> <INDENT> def __init__(self, nth_epoch, including_zero=True): <NEW_LINE> <INDENT> self.nth_epoch = nth_epoch <NEW_LINE> self.including_zero = including_zero <NEW_LINE> self._count = 0 <NEW_LINE> <DEDENT> def on_monitor(self, model, dataset, algorithm): <NEW_LINE> ... | Apply some method every Nth epoch. Abstract base class. | 62598fa6d7e4931a7ef3bf90 |
class Profile(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField(User, on_delete=models.CASCADE) <NEW_LINE> nb_adv_played = models.IntegerField(blank=True) <NEW_LINE> nb_adv_created = models.IntegerField(blank=True) | Based on the user model, we extend it with new info | 62598fa69c8ee823130400ea |
class Find(ClientActionStub): <NEW_LINE> <INDENT> in_rdfvalue = rdf_client.FindSpec <NEW_LINE> out_rdfvalues = [rdf_client.FindSpec] | Recurses through a directory returning files which match conditions. | 62598fa6e5267d203ee6b801 |
class SerialReader(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, port, chunkSize=1024, chunks=5000): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.buffer = np.zeros(chunks*chunkSize, dtype=np.uint16) <NEW_LINE> self.chunks = chunks <NEW_LINE> self.chunkSize = chunkSize <NEW_LINE> self.... | Defines a thread for reading and buffering serial data.
By default, about 5MSamples are stored in the buffer.
Data can be retrieved from the buffer by calling get(N) | 62598fa64f6381625f199438 |
class OSMWay(object): <NEW_LINE> <INDENT> def __init__(self, way_id, nodes_id, attrs): <NEW_LINE> <INDENT> super(OSMWay, self).__init__() <NEW_LINE> if not isinstance(attrs, dict): <NEW_LINE> <INDENT> raise TypeError('attrs should be type of dict') <NEW_LINE> <DEDENT> self.id = way_id <NEW_LINE> self.nodes_id = nodes_i... | docstring for Way | 62598fa6fff4ab517ebcd6da |
class TestViewsDepends(ModuleTestCase): <NEW_LINE> <INDENT> module = 'sale_data_warehouse' | Test views and depends | 62598fa666673b3332c302bf |
class NotifyHandler(webapp2.RequestHandler): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> logging.info('Got a notification with payload %s', self.request.body) <NEW_LINE> data = json.loads(self.request.body) <NEW_LINE> userid = data['userToken'] <NEW_LINE> self.mirror_service = util.create_service( 'mirror',... | Request Handler for notification pings. | 62598fa6cc0a2c111447af04 |
class ResultsDialog(BaseDialog): <NEW_LINE> <INDENT> SELECTED = 4 <NEW_LINE> URL = 5 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(ResultsDialog, self).__init__('Results', ('Close', gtk.RESPONSE_CLOSE, 'Add selected torrents', gtk.RESPONSE_YES), ui_file='results.ui') <NEW_LINE> self.set_default_response(gtk.... | Torrent results dialog. | 62598fa60a50d4780f7052d2 |
class ConfigStub: <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> <DEDENT> def section(self, name): <NEW_LINE> <INDENT> return self.data[name] <NEW_LINE> <DEDENT> def get(self, sect, opt): <NEW_LINE> <INDENT> data = self.data[sect] <NEW_LINE> try: <NEW_LINE> <INDENT> return... | Stub for basekeyparser.config.
Attributes:
data: The config data to return. | 62598fa691f36d47f2230e1e |
class ApplicationGatewayAvailableWafRuleSetsResult(Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, } <NEW_LINE> def __init__(self, value=None): <NEW_LINE> <INDENT> self.value = value | Response for ApplicationGatewayAvailableWafRuleSets API service call.
:param value: The list of application gateway rule sets.
:type value: list of :class:`ApplicationGatewayFirewallRuleSet
<azure.mgmt.network.v2017_06_01.models.ApplicationGatewayFirewallRuleSet>` | 62598fa6d53ae8145f918382 |
class IAMUserMFAEnabledCheck(IAMUserCheck): <NEW_LINE> <INDENT> def test(self): <NEW_LINE> <INDENT> if self.user_dict['mfa_active'] == 'true': <NEW_LINE> <INDENT> self.status = common.CheckState.PASS <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.status = common.CheckState.FAIL | Checks if the account has MFA enabled. | 62598fa6bd1bec0571e1503e |
class AcceptOwnerEvent(ChainEvent): <NEW_LINE> <INDENT> pass | An event signaling that a message is accepted to the -owner address. | 62598fa6dd821e528d6d8e2b |
class LinearFeatureBaseline(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_size, reg_coeff=1e-5): <NEW_LINE> <INDENT> super(LinearFeatureBaseline, self).__init__() <NEW_LINE> self.input_size = input_size <NEW_LINE> self._reg_coeff = reg_coeff <NEW_LINE> self.linear = nn.Linear(self.feature_size, 1, bias=False... | Linear baseline based on handcrafted features, as described in [1]
(Supplementary Material 2).
[1] Yan Duan, Xi Chen, Rein Houthooft, John Schulman, Pieter Abbeel,
"Benchmarking Deep Reinforcement Learning for Continuous Control", 2016
(https://arxiv.org/abs/1604.06778) | 62598fa645492302aabfc3c7 |
class NullfallBaeumeStraeucher(Draw_Bodenbedeckung): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(NullfallBaeumeStraeucher, self).__init__() <NEW_LINE> self.bodenbedeckung = 4 <NEW_LINE> self.planfall = False | Implementation for rpc_tools.bewohner_schaetzen (Button) | 62598fa64e4d56256637231b |
class ListMeta(type): <NEW_LINE> <INDENT> def __new__(mcs, name, bases, attrs): <NEW_LINE> <INDENT> doc = attrs['__doc__'] <NEW_LINE> tab_size = 4 <NEW_LINE> min_indent = min([len(a) - len(b) for a, b in zip(doc.splitlines(), [l.lstrip() for l in doc.splitlines()])]) <NEW_LINE> doc = "".join([line[min_indent:] + '\n' f... | A meta class for PlotlyList class creation.
The sole purpose of this meta class is to properly create the __doc__
attribute so that running help(Obj), where Obj is a subclass of PlotlyList,
will return useful information for that object. | 62598fa6e5267d203ee6b802 |
class BackupOperationStatusesOperations(object): <NEW_LINE> <INDENT> models = _models <NEW_LINE> def __init__(self, client, config, serializer, deserializer): <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._serialize = serializer <NEW_LINE> self._deserialize = deserializer <NEW_LINE> self._config = config <N... | BackupOperationStatusesOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.recoveryservicesbackup.a... | 62598fa663d6d428bbee26a8 |
class UUIDModel(models.Model): <NEW_LINE> <INDENT> id = models.UUIDField( primary_key=True, default=uuid.uuid4, editable=False ) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = True | This abstract model automatically uses UUID fields for the models instead
of auto-incrementing integers. | 62598fa68e71fb1e983bb9a8 |
@python_2_unicode_compatible <NEW_LINE> class CourseVideoUploadsEnabledByDefault(ConfigurationModel): <NEW_LINE> <INDENT> KEY_FIELDS = ('course_id',) <NEW_LINE> course_id = CourseKeyField(max_length=255, db_index=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> not_en = "Not " <NEW_LINE> if self.enabled: <NEW_LI... | Enables video uploads for a specific course.
.. no_pii:
.. toggle_name: CourseVideoUploadsEnabledByDefault.course_id
.. toggle_implementation: ConfigurationModel
.. toggle_default: False
.. toggle_description: Allow video uploads for a specific course. This enables the
"Video Uploads" menu in the CMS.
.. toggle_use... | 62598fa68e7ae83300ee8f98 |
class TestIsWithinVisibleSpectrum(unittest.TestCase): <NEW_LINE> <INDENT> def test_is_within_visible_spectrum(self): <NEW_LINE> <INDENT> self.assertTrue( is_within_visible_spectrum(np.array([0.3205, 0.4131, 0.5100])) ) <NEW_LINE> self.assertFalse( is_within_visible_spectrum(np.array([-0.0005, 0.0031, 0.0010])) ) <NEW_L... | Define :func:`colour.volume.spectrum.is_within_visible_spectrum`
definition unit tests methods. | 62598fa6ac7a0e7691f72401 |
class IllegalArgumentError(ValueError): <NEW_LINE> <INDENT> pass | bad argument passed to function | 62598fa6cb5e8a47e493c0f3 |
class Permission(models.Model): <NEW_LINE> <INDENT> TYPE_CHOICES = ( (0,'菜单'), (1,'按钮'), (2,'接口'), ) <NEW_LINE> title = models.CharField(max_length=32,verbose_name='权限名称') <NEW_LINE> url = models.CharField(max_length=128,verbose_name='URL',blank=True,null=True,unique=True) <NEW_LINE> parent_id = models.IntegerField(ver... | 权限表 | 62598fa632920d7e50bc5f4d |
class T(): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def cat(cls): <NEW_LINE> <INDENT> print(cls.__module__) <NEW_LINE> print(cls.__doc__) | class doc | 62598fa638b623060ffa8f8d |
@python_2_unicode_compatible <NEW_LINE> class ContactPreference(models.Model): <NEW_LINE> <INDENT> name = models.CharField(_("name"), max_length=255) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = _("contact preference") <NEW_LINE> verbose_name_plural = _("contact preferences") <NEW_LINE> <DEDENT> @property ... | Contact preference for a profile, whether by email, telephone or snail mail. | 62598fa67d847024c075c2bb |
class SecondOrStepTimer(object): <NEW_LINE> <INDENT> def __init__(self, every_secs=None, every_steps=None): <NEW_LINE> <INDENT> self._every_secs = every_secs <NEW_LINE> self._every_steps = every_steps <NEW_LINE> self._last_triggered_step = None <NEW_LINE> self._last_triggered_time = None <NEW_LINE> if self._every_secs ... | Timer that triggers at most once every N seconds or once every N steps.
| 62598fa6167d2b6e312b6e67 |
class occupancy(tflAPI): <NEW_LINE> <INDENT> def getBikePointByIDs(self, ids): <NEW_LINE> <INDENT> return super(occupancy, self).sendRequestUnified( f"/Occupancy/BikePoints/{self.arrayToCSV(ids)}", {} ) <NEW_LINE> <DEDENT> def getCarParkByID(self, id): <NEW_LINE> <INDENT> return super(occupancy, self).sendRequestUnifie... | Occupancy from Unified API | 62598fa6f7d966606f747edb |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.