code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class editTrigger (AbstractView): <NEW_LINE> <INDENT> def __init__(self, PortService, TriggerService, AlertService): <NEW_LINE> <INDENT> super().__init__(PortService, TriggerService, AlertService) <NEW_LINE> <DEDENT> @cherrypy.expose <NEW_LINE> def index(self, triggerID): <NEW_LINE> <INDENT> trigger = self.TriggerServi... | Die API Klasse stellt Funktionen zur Verwalltung für Fremdsoftware zur Verfügung. | 62598f625e10d32532ce341b |
class AicNative(Dataset): <NEW_LINE> <INDENT> def __init__(self, data_path: Path, is_train: bool, **kwargs): <NEW_LINE> <INDENT> self.is_train = is_train <NEW_LINE> self.kwargs = kwargs <NEW_LINE> paths = dict() <NEW_LINE> paths[("train", "root")] = data_path / "ai_challenger_keypoint_train_20170909" <NEW_LINE> paths[(... | Basic AI Challenger dataset loads images and labels
Construct 'native_img' and 'native_label' | 62598f623eb6a72ae0389ca8 |
class CameraMovement(Enum): <NEW_LINE> <INDENT> FORWARD = auto() <NEW_LINE> BACKWARD = auto() <NEW_LINE> LEFT = auto() <NEW_LINE> RIGHT = auto() | Defines several possible options for camera movement.
Used as abstraction to stay away from window-system specific
input methods. | 62598f629b70327d1c57e40e |
class Platform(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, width, height ): <NEW_LINE> <INDENT> pygame.sprite.Sprite.__init__(self) <NEW_LINE> self.image = pygame.Surface([width, height]) <NEW_LINE> self.image.fill(GREEN) <NEW_LINE> self.rect = self.image.get_rect() | Platform the user can jump on | 62598f628c3a8732951f5bb8 |
class DescribeShareBandwidthPriceResponseSchema(schema.ResponseSchema): <NEW_LINE> <INDENT> fields = { "TotalPrice": fields.Int(required=False, load_from="TotalPrice"), } | DescribeShareBandwidthPrice - 获取共享带宽价格 | 62598f621d351010ab8f31ab |
class __Context(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.user = None <NEW_LINE> self.db = None <NEW_LINE> self.quitting = False | a singleton FSM for banking app | 62598f628c3a8732951f5bb9 |
class Unique(object, metaclass=Singleton): <NEW_LINE> <INDENT> pass | This class has only one instance | 62598f626e29344779affcc1 |
class YamlDocument(ParsedDocument): <NEW_LINE> <INDENT> def parse(self, path): <NEW_LINE> <INDENT> fp = open(path, "r", encoding="utf-8") <NEW_LINE> try: <NEW_LINE> <INDENT> data = yaml.safe_load(fp) <NEW_LINE> <DEDENT> except NameError: <NEW_LINE> <INDENT> raise RuntimeError("missing python-yaml library") <NEW_LINE> <... | A document parsed from a YAML file.
The file must contain only a single YAML document which in turn must
be a map. Use :class:`YamlDocumentList` for files with multiple
documents. | 62598f62d18da76e235b6c6a |
class PremiumAttributeOption(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=255) <NEW_LINE> attribute = models.ForeignKey(PremiumAttribute) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.name | Therese are the values for options, like Large, or Brown | 62598f62796e427e5384ddfd |
class SchulzeVote(WeightedVote): <NEW_LINE> <INDENT> def __init__(self, name, weight, ranking): <NEW_LINE> <INDENT> WeightedVote.__init__(self, name, weight) <NEW_LINE> self.ranking = ranking | Klasse für eine Stimme bei einer Schulze-Abstimmung. | 62598f621d351010ab8f31ad |
class BotData(DataDict[str, t.Any]): <NEW_LINE> <INDENT> id: int <NEW_LINE> username: str <NEW_LINE> discriminator: str <NEW_LINE> avatar: t.Optional[str] <NEW_LINE> def_avatar: str <NEW_LINE> prefix: str <NEW_LINE> shortdesc: str <NEW_LINE> longdesc: t.Optional[str] <NEW_LINE> tags: t.List[str] <NEW_LINE> website: t.O... | Model that contains information about a listed bot on top.gg. The data this model contains can be found `here
<https://docs.top.gg/api/bot/#bot-structure>`__. | 62598f62be8e80087fbbe6c4 |
class Test2(object): <NEW_LINE> <INDENT> def hello(self): <NEW_LINE> <INDENT> pass | like an interface test | 62598f62bf627c535bcb0aea |
class Command(Resource): <NEW_LINE> <INDENT> rest_entity_path = "commands" <NEW_LINE> @staticmethod <NEW_LINE> def is_done(status): <NEW_LINE> <INDENT> return status == "cancelled" or status == "done" or status == "error" <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def is_success(status): <NEW_LINE> <INDENT> return st... | qds_sdk.Command is the base Qubole command class. Different types of Qubole
commands can subclass this. | 62598f623eb6a72ae0389cac |
class XSMultiplicativeModel(XSModel): <NEW_LINE> <INDENT> pass | The base class for XSPEC multiplicative models.
The XSPEC multiplicative models are listed at [1]_.
References
----------
.. [1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/Multiplicative.html | 62598f62711fe17d825dfd61 |
class Sha0Hash(object): <NEW_LINE> <INDENT> name = 'python-sha0' <NEW_LINE> digest_size = 20 <NEW_LINE> block_size = 64 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._h = ( 0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0, ) <NEW_LINE> self._unprocessed = b'' <NEW_LINE> self._message_byte_length = 0... | A class that mimics that hashlib api and implements the SHA-1 algorithm. | 62598f6266673b3332c2fa27 |
class Policy: <NEW_LINE> <INDENT> model_args_fname = 'model_args.pkl' <NEW_LINE> model_fname = 'model' <NEW_LINE> annotations_fname = 'annotations.pkl' <NEW_LINE> def __init__(self, model_args): <NEW_LINE> <INDENT> self.model_args = model_args <NEW_LINE> self.model = Model(**model_args) <NEW_LINE> self.annotations = {}... | Lets us save, restore, and step a policy forward
Plausibly we'll want to start passing a SerializationContext argument
instead of save_dir, so that we can abstract out the handling of the
load/save logic, and ensuring that the relevant directories exist.
If we do that we'll have to intercept the Model's use of joblib... | 62598f6276d4e153a661c27e |
class ObjectOriented(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.edges = [] <NEW_LINE> self.nodes = [] <NEW_LINE> <DEDENT> def adjacent(self, node_1, node_2): <NEW_LINE> <INDENT> for edge in self.edges: <NEW_LINE> <INDENT> if(edge.from_node == node_1 and edge.to_node == node_2 or edge.from... | ObjectOriented defines the edges and nodes as both list | 62598f62796e427e5384ddff |
class alter_sentry_role_delete_groups_result(object): <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.STRUCT, 'success', (TAlterSentryRoleDeleteGroupsResponse, TAlterSentryRoleDeleteGroupsResponse.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> ... | Attributes:
- success | 62598f62be8e80087fbbe6c6 |
class RepoSearch(Resource): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> query = request.args.get('query') <NEW_LINE> searchIn = request.args.get('searchIn') <NEW_LINE> url = 'https://api.github.com/search/repositories?q=WTF+user:mahuahua' <NEW_LINE> url = url.replace("WTF", query) <NEW_LINE> if searchIn: <NE... | Custom git repository search | 62598f62bf627c535bcb0aec |
class MovingAverageHeuristic(Heuristic): <NEW_LINE> <INDENT> def __init__(self, m, n): <NEW_LINE> <INDENT> self.m = m <NEW_LINE> self.n = n <NEW_LINE> self.ppc_signals = MembershipBank([ PRICE_PERCENT_CHANGE_SIGNALS[amount] for amount in ['PositiveSmall', 'PositiveMedium', 'PositiveLarge', 'Negat... | Heuristic 1: A buy (sell) signal is generated if a shorter
moving average of the price is crossing a longer moving
average of the price from below (above). Usually, the larger the
difference between the two moving averages, the stronger the
buy (sell) signal. But, if the difference between the two moving
averages is to... | 62598f62d164cc61758205e5 |
class TripletLoss(mx.operator.CustomOp): <NEW_LINE> <INDENT> def __init__(self, grad_scale=1.0, threshd=0.5): <NEW_LINE> <INDENT> self.grad_scale = grad_scale <NEW_LINE> self.threshd = threshd <NEW_LINE> <DEDENT> def forward(self, is_train, req, in_data, out_data, aux): <NEW_LINE> <INDENT> x = in_data[0] <NEW_LINE> y =... | Triplet loss layer | 62598f624d74a7450cd58a0f |
class CreateCallMixin(Call): <NEW_LINE> <INDENT> def create(self): <NEW_LINE> <INDENT> created_id = self._post_request( data=self.element_to_string(self.encode()) ).headers.get('Location').split('/')[-1] <NEW_LINE> return self.get(created_id) | A mixin to retrieve a single object of a highrise endpoint | 62598f626e29344779affcc6 |
class DataSetSplit(LoaderSplitDataSet): <NEW_LINE> <INDENT> def __init__(self, dataset:AbsDataSet,test_ratio=0.2, batch_size=None): <NEW_LINE> <INDENT> super().__init__(dataset.train(), dataset.get_num_class(), test_ratio, batch_size) <NEW_LINE> self.realtest=dataset.test() <NEW_LINE> self.batch_size=dataset.get_batch_... | 将一个原有数据集的train部分分割为两部分 一部分用作训练一部分用作实时验证 同时提供一个最终的real验证集 | 62598f62796e427e5384de01 |
class ElasticNetFeatureSelection(SelectorMixin, ElasticNet): <NEW_LINE> <INDENT> def _get_support_mask(self): <NEW_LINE> <INDENT> mask = (self.coef_ != 0) <NEW_LINE> return mask | Class to extend elastic-net in case of classification.
In case in which n_jobs != 1 for GridSearchCV, the estimator class must be
pickable, therefore statically defined. | 62598f62c432627299fa2641 |
class RedisContext(DockerContext): <NEW_LINE> <INDENT> def get_commands(self): <NEW_LINE> <INDENT> return super(RedisContext, self).get_commands() + [ Cli, Info, ] | https://hub.docker.com/_/redis/ | 62598f62bf627c535bcb0aee |
class Hint(Cwl): <NEW_LINE> <INDENT> pass | Base class for all hints | 62598f62a4f1c619b294dc62 |
class LogStatement(object): <NEW_LINE> <INDENT> swagger_types = { 'log_statement': 'str', 'log_level': 'str' } <NEW_LINE> attribute_map = { 'log_statement': 'logStatement', 'log_level': 'logLevel' } <NEW_LINE> def __init__(self, log_statement=None, log_level=None): <NEW_LINE> <INDENT> self._log_statement = None <NEW_LI... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f6230c21e258be97e6b |
class SpeciesIngestor(Ingestor): <NEW_LINE> <INDENT> grok.context(ISpeciesFolder) <NEW_LINE> def getContainedObjectInterface(self): <NEW_LINE> <INDENT> return ISpecies | RDF ingestor for species. | 62598f629b70327d1c57e416 |
class Plotly(object): <NEW_LINE> <INDENT> def __init__(self, frame, feature=None, clear=True): <NEW_LINE> <INDENT> self.version = "0.1.0" <NEW_LINE> if not type(frame) == DataFrame: <NEW_LINE> <INDENT> raise TypeError("pandas.DataFrame is the only support type by this version:%s" % self.version) <NEW_LINE> <DEDENT> if ... | support
you can get more parameter with fingerPlot
Parameter:
---------
frame:
feature: array-like
clear: bool,default True | 62598f62711fe17d825dfd65 |
class Call(object): <NEW_LINE> <INDENT> DTMF_COMMAND_BASE = '+VTS=' <NEW_LINE> dtmfSupport = False <NEW_LINE> def __init__(self, gsmModem, callId, callType, number, callStatusUpdateCallbackFunc=None): <NEW_LINE> <INDENT> self._gsmModem = weakref.proxy(gsmModem) <NEW_LINE> self._callStatusUpdateCallbackFunc = callStatus... | A voice call | 62598f6221a7993f00c655e7 |
class Hslint(Linter): <NEW_LINE> <INDENT> cmd = None <NEW_LINE> regex = ( r'^(?:(?P<error>[E])|(?P<warning>[W])):' r'?:(?P<line>\d+):(?P<col>\d+):' r'(?P<message>.+)' ) <NEW_LINE> multiline = False <NEW_LINE> line_col_base = (1, 1) <NEW_LINE> tempfile_suffix = None <NEW_LINE> error_stream = util.STREAM_BOTH <NEW_LINE> ... | Provides an interface to hslint. | 62598f6276d4e153a661c282 |
class KartenInfo: <NEW_LINE> <INDENT> def __init__(self, spieler, position, seit=1): <NEW_LINE> <INDENT> self.spieler = spieler <NEW_LINE> self.position = position <NEW_LINE> self.seit = seit | Informationen über eine unbekannte Karte eines bestimmten Spielers | 62598f624d74a7450cd58a10 |
class ThreeLayerConvNet(object): <NEW_LINE> <INDENT> def __init__(self, input_dim=(3, 32, 32), num_filters=32, filter_size=7, hidden_dim=100, num_classes=10, weight_scale=1e-3, reg=0.0, dtype=np.float32): <NEW_LINE> <INDENT> self.params = {} <NEW_LINE> self.reg = reg <NEW_LINE> self.dtype = dtype <NEW_LINE> C, H, W = i... | A three-layer convolutional network with the following architecture:
conv - relu - 2x2 max pool - affine - relu - affine - softmax
The network operates on minibatches of data that have shape (N, C, H, W)
consisting of N images, each with height H and width W and with C input
channels. | 62598f62507cdc57c63a440c |
class BusinessUnit(models.Model): <NEW_LINE> <INDENT> parent_unit = models.ForeignKey('self', blank=True, null=True, related_name='parent_level',on_delete=models.CASCADE) <NEW_LINE> name = models.CharField('业务线', max_length=64, unique=True) <NEW_LINE> memo = models.CharField('备注', max_length=64, blank=True, null=True) ... | 业务线 | 62598f6330c21e258be97e6d |
@pytest.mark.components <NEW_LINE> @pytest.allure.story('Proximity_Zones') <NEW_LINE> @pytest.allure.feature('GET') <NEW_LINE> class Test_PFE_Components(object): <NEW_LINE> <INDENT> @pytest.allure.link('https://jira.qumu.com/browse/TC-43785') <NEW_LINE> @pytest.mark.Proximity_Zones <NEW_LINE> @pytest.mark.GET <NEW_LINE... | PFE Proximity_Zones test cases. | 62598f6356b00c62f0fb1f28 |
class Network(DataObject): <NEW_LINE> <INDENT> DHCP = namedtuple( "DHCP", ["pool"] ) <NEW_LINE> _defaults = [ ("name", None), ("href", None), ("type", None), ("defaultGateway", None), ("netmask", None), ("dhcp", None), ("dnsSuffix", None), ("dns", []), ] <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> supe... | The Network class represents a VMware network.
Here you can find the following:
* DNS rules
* DHCP configuration | 62598f633eb6a72ae0389cb2 |
class ProfileForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Profile <NEW_LINE> fields = ('avatar',) | Добавление аватара при регистрации | 62598f63711fe17d825dfd67 |
class LogoutSerializer(serializers.Serializer): <NEW_LINE> <INDENT> def destroy(self): <NEW_LINE> <INDENT> request = self.context['request'] <NEW_LINE> logout_user(request.user.username, 1, request) | Validate the data. | 62598f6321a7993f00c655e9 |
class WorkoutCacheTestCase(WorkoutManagerTestCase): <NEW_LINE> <INDENT> def test_canonical_form_cache(self): <NEW_LINE> <INDENT> self.assertFalse(cache.get(cache_mapper.get_workout_canonical(1))) <NEW_LINE> workout = Workout.objects.get(pk=1) <NEW_LINE> workout.canonical_representation <NEW_LINE> self.assertTrue(cache.... | Test case for the workout canonical representation | 62598f6330c21e258be97e6e |
class MissingReturnError(DarglintError): <NEW_LINE> <INDENT> error_code = 'DAR201' <NEW_LINE> description = 'The docstring is missing a return from definition.' <NEW_LINE> def __init__(self, function, line_numbers=None): <NEW_LINE> <INDENT> self.general_message = 'Missing "Returns" in Docstring' <NEW_LINE> self.terse_m... | Describes when a docstring is missing a return from definition. | 62598f63796e427e5384de05 |
class EventResource(resources.ModelResource): <NEW_LINE> <INDENT> total_attendees = Field() <NEW_LINE> available_place = Field() <NEW_LINE> total_attended = Field() <NEW_LINE> total_not_attended = Field() <NEW_LINE> total_sessions = Field() <NEW_LINE> total_draft_sessions = Field() <NEW_LINE> total_accepted_sessions = ... | ModelResource is Resource subclass for handling Django models. | 62598f63ff9c53063f519cc4 |
class ClaimRobot(WikidataBot): <NEW_LINE> <INDENT> use_from_page = None <NEW_LINE> def __init__(self, generator, claims, exists_arg=''): <NEW_LINE> <INDENT> self.availableOptions['always'] = True <NEW_LINE> super(ClaimRobot, self).__init__() <NEW_LINE> self.generator = generator <NEW_LINE> self.claims = claims <NEW_LIN... | A bot to add Wikidata claims. | 62598f63507cdc57c63a440e |
class Container(object): <NEW_LINE> <INDENT> def __init__(self, content): <NEW_LINE> <INDENT> self.content = content <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return repr(self.content) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return str(self.content) | Simple container object | 62598f631f5feb6acb1622ae |
class HTTPInvocationByMethodWithBody(object): <NEW_LINE> <INDENT> def __init__(self, resource, environ, parameters): <NEW_LINE> <INDENT> self.resource = resource <NEW_LINE> self.environ = environ <NEW_LINE> self.max_request_size = getattr( resource, 'max_request_size', parameters.max_request_size) <NEW_LINE> self.max_e... | Invoke methods on a resource. | 62598f63bf627c535bcb0af2 |
class PumpkinCaramelToffee(Candy): <NEW_LINE> <INDENT> class Flavour(Enum): <NEW_LINE> <INDENT> Sea_Salt = auto() <NEW_LINE> Regular = auto() <NEW_LINE> <DEDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> try: <NEW_LINE> <INDENT> self._flavour = self.Flavour[kwargs['variety'... | Halloween Candy.
• Has Lactose: True
• Contains nuts: True
• Two varieties: Sea Salt and Regular. | 62598f636fece00bbaccb007 |
class IRightListRelation (object) : <NEW_LINE> <INDENT> def right_elements (self) : <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def nb_right_elements (self) : <NEW_LINE> <INDENT> raise NotImplementedError | relation view as a collection of right elements | 62598f635166f23b2e242a4e |
class FidoSensor(Entity): <NEW_LINE> <INDENT> def __init__(self, fido_data, sensor_type, name, number): <NEW_LINE> <INDENT> self.client_name = name <NEW_LINE> self._number = number <NEW_LINE> self.type = sensor_type <NEW_LINE> self._name = SENSOR_TYPES[sensor_type][0] <NEW_LINE> self._unit_of_measurement = SENSOR_TYPES... | Implementation of a Fido sensor. | 62598f6321a7993f00c655eb |
class AutoMounter(object): <NEW_LINE> <INDENT> def __init__(self, mounter): <NEW_LINE> <INDENT> self.mounter = mounter <NEW_LINE> <DEDENT> def device_added(self, udevice): <NEW_LINE> <INDENT> self.mounter.add_device(udevice) <NEW_LINE> <DEDENT> def media_added(self, udevice): <NEW_LINE> <INDENT> self.mounter.add_device... | Automatically mount newly added media. | 62598f6326238365f5fac1ea |
class InvalidConfiguration(Exception): <NEW_LINE> <INDENT> pass | Used when a user configures bad paths | 62598f636e29344779affccd |
class KnownDensityRatio(DensityRatioMixin, BaseEstimator): <NEW_LINE> <INDENT> def __init__(self, numerator, denominator): <NEW_LINE> <INDENT> self.numerator = numerator <NEW_LINE> self.denominator = denominator <NEW_LINE> <DEDENT> def fit(self, X=None, y=None, numerator=None, denominator=None, n_samples=None, **kwargs... | Density ratio for known densities `p0` and `p1`.
This class cannot be used in the likelihood-free setup. It requires
numerator and denominator distributions to implement the `pdf` and `nll`
methods. | 62598f63c432627299fa2647 |
class TaggedItemTestCase(TestCase): <NEW_LINE> <INDENT> longMessage = True <NEW_LINE> def test_instantiation(self): <NEW_LINE> <INDENT> self.dummy = mixer.blend('test_app.DummyModel') <NEW_LINE> self.tag = mixer.blend('multilingual_tags.TagTranslation', language_code='en').master <NEW_LINE> taggeditem = mixer.blend( 'm... | Tests for the ``TaggedItem`` model class. | 62598f63a4f1c619b294dc67 |
class ExperimentTemplateBase(ABC, Generic[TTopology]): <NEW_LINE> <INDENT> @property <NEW_LINE> def experiment_name(self): <NEW_LINE> <INDENT> return self._experiment_name <NEW_LINE> <DEDENT> def __init__(self, experiment_name=None, **params): <NEW_LINE> <INDENT> self._experiment_name = experiment_name <NEW_LINE> self.... | A prescription for an experiment.
The template describes how a single experiment runs given some parameters, how the measurements are collected,
and how are they accumulated/published at the end. | 62598f630383005118f6cd7e |
class Log_Market_Cap_Cubed(CustomFactor): <NEW_LINE> <INDENT> inputs = [morningstar.valuation.market_cap] <NEW_LINE> window_length = 1 <NEW_LINE> def compute(self, today, assets, out, mc): <NEW_LINE> <INDENT> out[:] = np.log(mc[-1]**3) | Natural Logarithm of Market Capitalization Cubed:
Log of Market Cap Cubed.
https://www.math.nyu.edu/faculty/avellane/Lo13030.pdf
Notes:
High value for large companies, low value for small companies
Limits the outlier effect of very large companies through log transformation | 62598f635166f23b2e242a50 |
class DomesticHotWaterType(BSElement): <NEW_LINE> <INDENT> class Other(OtherType): <NEW_LINE> <INDENT> pass | Type of water heating equipment for hot running water. | 62598f6366673b3332c2fa31 |
class NontermNode(Node): <NEW_LINE> <INDENT> def __init__(self, cat, edge_label=None): <NEW_LINE> <INDENT> Node.__init__(self, cat) <NEW_LINE> self.edge_label = edge_label <NEW_LINE> self.attr = '--' <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> stuff = '' <NEW_LINE> if hasattr(self, 'xml_id'): <NEW_LINE>... | Node class for nonterminal node
The exact set of attributes for a nonterminal
is use-dependent, but the core set of these consists in
.. py:attribute:: cat
the node category (e.g. NP)
.. py:attribute:: edge_label
the grammatical function/edge label of this node
(e.g. subject, modifier)
.. py:attribute:: ... | 62598f63be8e80087fbbe6d0 |
class Stack: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.elements = deque() <NEW_LINE> <DEDENT> def push(self, elt): <NEW_LINE> <INDENT> self.elements.append(elt) <NEW_LINE> return self <NEW_LINE> <DEDENT> def top(self): <NEW_LINE> <INDENT> return self.elements[len(self.elements)-1] <NEW_LINE> <DED... | Simple class for LIFO (last-in-last-out) container. | 62598f6373bcbd0ca4bc98c8 |
@python_2_unicode_compatible <NEW_LINE> class Score(models.Model): <NEW_LINE> <INDENT> content_type = models.ForeignKey('contenttypes.ContentType') <NEW_LINE> object_id = models.PositiveIntegerField() <NEW_LINE> content_object = fields.GenericForeignKey('content_type', 'object_id') <NEW_LINE> key = models.CharField(max... | A score for a content object. | 62598f6391af0d3eaad3947f |
class InvalidJidError(Error): <NEW_LINE> <INDENT> pass | Error that indicates a request for an invalid JID. | 62598f63bf627c535bcb0af6 |
class Review(core_models.AbstractTimeStamped): <NEW_LINE> <INDENT> review = models.TextField() <NEW_LINE> accuracy = models.IntegerField() <NEW_LINE> communication = models.IntegerField() <NEW_LINE> cleanliness = models.IntegerField() <NEW_LINE> location = models.IntegerField() <NEW_LINE> check_in = models.IntegerField... | Review Model Definitions | 62598f636fece00bbaccb00b |
class LibraryManagementSystem: <NEW_LINE> <INDENT> def __init__(self, bookList): <NEW_LINE> <INDENT> self.bookList = bookList <NEW_LINE> <DEDENT> def book_list(self): <NEW_LINE> <INDENT> for i in self.bookList: <NEW_LINE> <INDENT> print("=>" + i) <NEW_LINE> sleep(0.5) <NEW_LINE> <DEDENT> <DEDENT> def book_borrow(self):... | this is our Library class | 62598f633eb6a72ae0389cb8 |
class EntityDoesNotExist(KeyError): <NEW_LINE> <INDENT> def __init__(self, extent_name, field_name=None, oid=None): <NEW_LINE> <INDENT> if field_name is not None: <NEW_LINE> <INDENT> message = ( 'Entity referenced in field %r does not exist in extent %r.' % (field_name, extent_name) ) <NEW_LINE> <DEDENT> elif oid is no... | An entity does not exist. | 62598f6330c21e258be97e74 |
class BaseState(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.done = False <NEW_LINE> self.quit = False <NEW_LINE> self.next_state = None <NEW_LINE> self.screen_rect = pg.display.get_surface().get_rect() <NEW_LINE> self.persist = {} <NEW_LINE> self.font = pg.font.Font(None, 24) <NEW_LINE> <D... | Parent class for individual game states to inherit from. | 62598f63d164cc61758205f0 |
class GateOpDeserializer: <NEW_LINE> <INDENT> def __init__( self, serialized_gate_id: str, gate_constructor: Callable, args: Sequence[DeserializingArg], num_qubits_param: Optional[str] = None, op_wrapper: Callable[ ['cirq.Operation', v2.program_pb2.Operation], 'cirq.Operation' ] = lambda x, y: x, deserialize_tokens: Op... | Describes how to deserialize a proto to a given Gate type.
Attributes:
serialized_gate_id: The id used when serializing the gate. | 62598f63ff9c53063f519cca |
class DPGP_integral_histogram(dp4gp.DPGP): <NEW_LINE> <INDENT> def __init__(self,sens,epsilon,delta): <NEW_LINE> <INDENT> super(DPGP_integral_histogram, self).__init__(None,sens,epsilon,delta) <NEW_LINE> <DEDENT> def prepare_model(self,Xtest,X,step,ys,variances=1.0,lengthscale=1): <NEW_LINE> <INDENT> bincounts, bintota... | Using the histogram method | 62598f636e29344779affcd0 |
class Reminder(AclMixin, models.Model): <NEW_LINE> <INDENT> days = models.IntegerField( default=7, unique=True, help_text=_("Delay between the email and the membership's end."), ) <NEW_LINE> message = models.TextField( default="", null=True, blank=True, help_text=_("Message displayed specifically for this reminder."), ... | Reminder of membership's end preferences: email messages, number of days
before sending emails.
Attributes:
days: the number of days before the membership's end to send the
reminder.
message: the content of the reminder. | 62598f6326238365f5fac1ef |
class Implementation(object): <NEW_LINE> <INDENT> file = None | Base class for representing Bokeh custom model implementations.
| 62598f6330c21e258be97e75 |
class DeleteHandler(webapp.RequestHandler): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> soundboard = Soundboard.get_by_id(long(self.request.get('soundboard_id'))) <NEW_LINE> if soundboard is None or soundboard.session_id is None or self.request.cookies.get('id') is None: <NEW_LINE> <INDENT> logging.error('t... | this class will allow users to delete a soundboard they're working on
it will only allow deletion of boards with the same session_id as the cookie,
so other saves of an existing soundboard will remain intact | 62598f63d18da76e235b6c72 |
class Condition(_TimeoutGarbageCollector): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Condition, self).__init__() <NEW_LINE> self.io_loop = ioloop.IOLoop.current() <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> result = '<%s' % (self.__class__.__name__, ) <NEW_LINE> if self._waiters:... | 允许一个或多个协程等待直到被通知的条件.
就像标准的 `threading.Condition`, 但是不需要一个被获取和释放的底层锁.
通过 `Condition`, 协程可以等待着被其他协程通知:
.. testcode::
from tornado import gen
from tornado.ioloop import IOLoop
from tornado.locks import Condition
condition = Condition()
@gen.coroutine
def waiter():
print("I'll wait rig... | 62598f636fece00bbaccb00d |
class IStandaloneVideoType(interface.Interface): <NEW_LINE> <INDENT> pass | standalone video content type | 62598f637c178a314d78cb18 |
class End(base.DetailsViewMixin, base.UndoViewMixin, base.CancelViewMixin, base.PerformViewMixin, base.Event): <NEW_LINE> <INDENT> task_type = 'END' <NEW_LINE> activation_cls = EndActivation <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(End, self).__init__() <NEW_LINE> <DEDENT> def _outgoing(self): <NEW_LINE... | Ends process event. | 62598f63925a0f43d25e76b0 |
class NightValeWeather(Function): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.help_name = "nightvale weather" <NEW_LINE> self.names = {"night vale weather", "nightvale weather", "nightvale"} <NEW_LINE> self.help_docs = ( "Returns the current weather in the style of the... | Returns the current weather, in the style of "welcome to night vale" | 62598f6366673b3332c2fa35 |
class Car(object): <NEW_LINE> <INDENT> cx = 0.37 <NEW_LINE> frontal_area = 1.95 <NEW_LINE> mass = 880 <NEW_LINE> rrc = 0.01355 <NEW_LINE> power = 40000 <NEW_LINE> max_speed = 100*1000/3600.0 <NEW_LINE> battery_pack_efficiency = 0.95 <NEW_LINE> controller_efficiency = 0.95 <NEW_LINE> motor_efficiency = 0.87 <NEW_LINE> g... | A Car class with example default properties of
Smart Fortwo W450. | 62598f63ff9c53063f519ccc |
class Alien(object): <NEW_LINE> <INDENT> def die(self): <NEW_LINE> <INDENT> print("The alien gasps and says, 'Oh, this is it. This is the big one.\n" "Yes, it's getting dark now. Tell my 1.6 million larvae that I loved them...\n" "Good-bye, cruel universe.'") | An alien in a shooter game. | 62598f639b70327d1c57e421 |
class PostArticleHandler(AdminHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> self.render( 'article_edit.html', title=u'发布文章', path='/article/post', article=None) <NEW_LINE> <DEDENT> def post(self): <NEW_LINE> <INDENT> author_id = self.get_user['uid'] <NEW_LINE> last_editor_id = self.get_user['uid'] <N... | 发布文章 | 62598f636fece00bbaccb00f |
class TestSuiteRunner(NoseTestSuiteRunner): <NEW_LINE> <INDENT> def run_suite(self, nose_argv): <NEW_LINE> <INDENT> django_plugin = DjangoPlugin(self) <NEW_LINE> result_plugin = ResultPlugin() <NEW_LINE> plugins_to_add = [django_plugin, result_plugin] <NEW_LINE> for plugin in _get_plugins_from_settings(): <NEW_LINE> <I... | NoseRunner which works with tddspry.
Basically the difference is that we remove DjangoSetUpPlugin as tddspry
does setup itself and add ``--with-django`` option. | 62598f6376d4e153a661c28f |
class GroupSemesterState(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=100) <NEW_LINE> group = models.ForeignKey(Group, related_name='states') <NEW_LINE> praepostor = models.ForeignKey('Student', blank=True, null=True) <NEW_LINE> semester = models.ForeignKey(Semester) <NEW_LINE> @property <NEW_L... | Chronology of group states
TODO Remove group when removing last state? | 62598f63c432627299fa264f |
class vec_diagrama_ojo2_f(gr.sync_block): <NEW_LINE> <INDENT> def __init__(self, N=16, samp_rate=32000): <NEW_LINE> <INDENT> gr.sync_block.__init__(self, name="vec_diagrama_ojo2_f", in_sig=[(np.float32, N)], out_sig=None) <NEW_LINE> self.Sps = N/2 <NEW_LINE> self.Tsamp=1./samp_rate <NEW_LINE> Tb=self.Sps*self.Tsamp <NE... | Diagrama de ojo. Hecho por Homero Ortega Boada. Universida Industrial de Santander.
N: es el numero de muestras que ocupara el ojo, se recomienda que N=Sps*2, donde Sps es el numero de muestras por simbolo.
samp_rate: es la frecuencia de muestreo de la senal.
| 62598f63d99f1b3c44d04d2f |
class TestJsonView(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 testJsonView(self): <NEW_LINE> <INDENT> pass | JsonView unit test stubs | 62598f63167d2b6e312b65f9 |
class CitationConfDirective(Directive): <NEW_LINE> <INDENT> has_content = False <NEW_LINE> required_arguments = 0 <NEW_LINE> optional_arguments = 1 <NEW_LINE> option_spec = { 'brackets': directives.unchanged, 'separator': directives.unchanged, 'style': directives.unchanged, 'sort': directives.flag, 'sort_compress': dir... | Allows the user to change the citation style on a per-page or
per-block basis. | 62598f63507cdc57c63a4418 |
class CollectionLanguageSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> collection = AsymetricRelatedField.from_serializer( CollectionSerializer, kwargs={'required': True}) <NEW_LINE> language = AsymetricRelatedField.from_serializer( LanguageSerializer, kwargs={'required': True}) <NEW_LINE> class Meta: <NE... | Common serializer for all CollectionLanguage actions | 62598f63bf627c535bcb0afc |
class UserViewSet(mixins.CreateModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> queryset = User.objects.all() <NEW_LINE> serializer_class = UserSerializer <NEW_LINE> def create(self, request, *args, **kwargs): <NEW_LINE> <INDENT> self.serializer_class = Creat... | Creates, Updates, and retrives User accounts | 62598f639b70327d1c57e423 |
class Net(object): <NEW_LINE> <INDENT> def __init__(self, num_elements, labels): <NEW_LINE> <INDENT> self.dim = num_elements <NEW_LINE> self.size = self.dim * self.dim <NEW_LINE> self.net = [[random.choice([True, False]) for _ in range(num_elements)] for _ in range(num_elements)] <NEW_LINE> self.labels = labels <NEW_LI... | Sets up a square net of boolean values. | 62598f63d164cc61758205f5 |
class TestTextTemplate(ATFSuite): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> super().setUpClass() <NEW_LINE> cls.run_browser(cls) <NEW_LINE> cls.browser.open(Config().SITE) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> super().tearDown() <NEW_LINE> self.browser.sw... | Проверка идентичности кода страницы шаблону | 62598f637c178a314d78cb1c |
class ObjectDocumenter(Documenter): <NEW_LINE> <INDENT> _DOC_ATTR = {'referent': 'the object being documented'} <NEW_LINE> def __init__(self, referent): <NEW_LINE> <INDENT> self.referent = referent <NEW_LINE> <DEDENT> def referentPackagesystemPath(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT>... | Base class for object documenting sub-classes. such as ClassDocumenter | 62598f6376d4e153a661c291 |
class ArticleNotInWikipedia(Exception): <NEW_LINE> <INDENT> pass | Another Exception class. | 62598f6363f4b57ef00858ae |
class MediaItemMixin(MediaItemListMixin): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> return self.add_media_item_detail(super().get_queryset()) | A mixin class for DRF generic views which has all of the specialisations necessary for
retrieving (and possibly updating) individual media items. Use this mixin with RetrieveAPIView
or RetrieveUpdateAPIView to form a concrete view class. | 62598f6391af0d3eaad39487 |
class FamilyAdmin(db.Model): <NEW_LINE> <INDENT> __tablename__ = "families_admins" <NEW_LINE> user_id: int = Column(Integer, ForeignKey("users.id"), primary_key=True, nullable=False) <NEW_LINE> family_id: int = Column(Integer, ForeignKey(Family.id), primary_key=True, nullable=False) <NEW_LINE> admin: bool = Column(Bool... | Specifies how user-family administration relationships are modeled in the database | 62598f6326238365f5fac1f5 |
class Job(models.Model): <NEW_LINE> <INDENT> id = models.AutoField(primary_key=True) <NEW_LINE> namespace = models.CharField(max_length=255, blank=False) <NEW_LINE> name = models.CharField(max_length=255, blank=False) <NEW_LINE> type = models.IntegerField(choices=JOB_TYPE_CHOICES, blank=False) <NEW_LINE> status = model... | This class represents the job model. | 62598f63d164cc61758205f7 |
class Receiver: <NEW_LINE> <INDENT> def __init__(self, name, function): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.function = function <NEW_LINE> <DEDENT> def execute(self, target, message): <NEW_LINE> <INDENT> self.function(target, message) | Wraps around a function that gets called for received messages. | 62598f63925a0f43d25e76b6 |
class TestEnvironment(object): <NEW_LINE> <INDENT> def __init__(self, dut): <NEW_LINE> <INDENT> clkdrv = ClockDriver(interface=Interface(clk=dut.clk), param_namespace=Namespace(clk=Namespace(period=(5,"ns")))) <NEW_LINE> rstdrv = ResetDriver(interface=Interface(rst=dut.rst), param_namespace=Namespace(rst=Namespace(acti... | Defines the test environment. | 62598f63be8e80087fbbe6d9 |
class TestPerformanceApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = isi_sdk_8_2_0.api.performance_api.PerformanceApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_create_performance_dataset(self): <NEW_LINE> <INDENT> pass <NE... | PerformanceApi unit test stubs | 62598f63796e427e5384de13 |
class FlatCosmologyMixin(metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> pass | Mixin class for flat cosmologies. Do NOT instantiate directly.
Note that all instances of ``FlatCosmologyMixin`` are flat, but not all
flat cosmologies are instances of ``FlatCosmologyMixin``. As example,
``LambdaCDM`` **may** be flat (for the a specific set of parameter values),
but ``FlatLambdaCDM`` **will** be flat. | 62598f631d351010ab8f31c3 |
class People(SQLAlchemyObjectType, PeopleAttribute): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = ModelPeople <NEW_LINE> interfaces = (graphene.relay.Node,) | People node. | 62598f638c3a8732951f5bd1 |
class ZamgData: <NEW_LINE> <INDENT> API_URL = 'http://www.zamg.ac.at/ogd/' <NEW_LINE> API_HEADERS = { USER_AGENT: '{} {}'.format('home-assistant.zamg/', __version__), } <NEW_LINE> def __init__(self, station_id): <NEW_LINE> <INDENT> self._station_id = station_id <NEW_LINE> self.data = {} <NEW_LINE> <DEDENT> @property <N... | The class for handling the data retrieval. | 62598f63167d2b6e312b65fd |
class OpTestDummy(OpCode): <NEW_LINE> <INDENT> OP_PARAMS = [ ("result", ht.NoDefault, ht.NoType, None), ("messages", ht.NoDefault, ht.NoType, None), ("fail", ht.NoDefault, ht.NoType, None), ("submit_jobs", None, ht.NoType, None), ] <NEW_LINE> WITH_LU = False | Utility opcode used by unittests.
| 62598f6326238365f5fac1f7 |
class PersistentObjectStoreTest(unittest.TestCase): <NEW_LINE> <INDENT> def testPersistence(self): <NEW_LINE> <INDENT> object_store = PersistentObjectStore('test') <NEW_LINE> object_store.Set('key', 'value') <NEW_LINE> self.assertEqual('value', object_store.Get('key').Get()) <NEW_LINE> another_object_store = Persistent... | Tests for PersistentObjectStore. These are all a bit contrived because
ultimately it comes down to our use of the appengine datastore API, and we
mock it out for tests anyway. Who knows whether it's correct. | 62598f6330c21e258be97e7d |
class TimeRecorder(): <NEW_LINE> <INDENT> def __init__(self, decay=0.9995, max_seconds=10): <NEW_LINE> <INDENT> self.moving_average = ThreadSafeMovingAverageRecorder(decay) <NEW_LINE> self.max_seconds = max_seconds <NEW_LINE> self.started = False <NEW_LINE> <DEDENT> @contextmanager <NEW_LINE> def time(self): <NEW_LINE>... | Records average of whatever context block it is recording
Don't call time in two threads | 62598f637c178a314d78cb20 |
class UserCreationAddForm(UserCreationForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ("username", "first_name", "last_name", "email") <NEW_LINE> field_classes = { 'username': UsernameField, 'first_name': FirstName, 'last_name': LastName, 'email': Email, } | Extended user creation from with first name, last name, email and phone | 62598f6366673b3332c2fa3d |
class BaseProducer(BaseProvider, Thread): <NEW_LINE> <INDENT> process_sequence = None <NEW_LINE> def __init__(self, thread=False, **kwargs): <NEW_LINE> <INDENT> Thread.__init__(self) <NEW_LINE> BaseProvider.__init__(self, **kwargs) <NEW_LINE> self.is_thread = boolstr(thread) <NEW_LINE> self._process_sequence = ProcessS... | All Consumer objects classes inherit from this | 62598f631d351010ab8f31c4 |
class Substitution(Defect): <NEW_LINE> <INDENT> @property <NEW_LINE> @lru_cache(1) <NEW_LINE> def defect_composition(self): <NEW_LINE> <INDENT> poss_deflist = sorted( self.bulk_structure.get_sites_in_sphere(self.site.coords, 0.1, include_index=True), key=lambda x: x[1], ) <NEW_LINE> defindex = poss_deflist[0][2] <NEW_L... | Subclass of Defect to capture essential information for a single Substitution defect structure. | 62598f63796e427e5384de15 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.