code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class TestForEmployee(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.test_employee = Employee('john', 'doe', 70000) <NEW_LINE> <DEDENT> def test_give_default_raise(self): <NEW_LINE> <INDENT> self.test_employee.give_raise() <NEW_LINE> self.assertEqual(self.test_employee.salary, 75000) ...
Test for 'Employee' class.
6259905b004d5f362081faed
class NaN(with_metaclass(Singleton, Number)): <NEW_LINE> <INDENT> is_commutative = True <NEW_LINE> is_extended_real = None <NEW_LINE> is_real = None <NEW_LINE> is_rational = None <NEW_LINE> is_algebraic = None <NEW_LINE> is_transcendental = None <NEW_LINE> is_integer = None <NEW_LINE> is_comparable = False <NEW_LINE> i...
Not a Number. This serves as a place holder for numeric values that are indeterminate. Most operations on NaN, produce another NaN. Most indeterminate forms, such as ``0/0`` or ``oo - oo` produce NaN. Two exceptions are ``0**0`` and ``oo**0``, which all produce ``1`` (this is consistent with Python's float). NaN is...
6259905b442bda511e95d859
class Boss(Wasp, Hornet): <NEW_LINE> <INDENT> name = 'Boss' <NEW_LINE> damage_cap = 8 <NEW_LINE> action = Wasp.action <NEW_LINE> def reduce_armor(self, amount): <NEW_LINE> <INDENT> super().reduce_armor(self.damage_modifier(amount)) <NEW_LINE> <DEDENT> def damage_modifier(self, amount): <NEW_LINE> <INDENT> return amount...
The leader of the bees. Combines the high damage of the Wasp along with status immunity of Hornets. Damage to the boss is capped up to 8 damage by a single attack.
6259905b21bff66bcd724263
class Zone(models.Model): <NEW_LINE> <INDENT> id = models.TextField(primary_key=True) <NEW_LINE> name = models.TextField(blank=True) <NEW_LINE> image = models.TextField() <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> def get_absolute_url(self): <NEW_LINE> <INDENT> return reverse...
Object representing the zone that each mob resides in
6259905ba219f33f346c7e04
class ObjectViewSet(viewsets.ViewSet): <NEW_LINE> <INDENT> @cls_cached_result(prefix="times", timeout=3600) <NEW_LINE> def _times(self, model, identity): <NEW_LINE> <INDENT> query = TimesQuery(model, identity) <NEW_LINE> times = query.fetch() <NEW_LINE> return times <NEW_LINE> <DEDENT> @list_route(methods=['post']) <NE...
View set for searching, viewing objects.
6259905b32920d7e50bc7645
class Dimensions(HasTraits): <NEW_LINE> <INDENT> dimension_dict = Dict(Str, Float) <NEW_LINE> expansion = Property(String, depends_on='dimension_dict') <NEW_LINE> def __init__(self, dimension_dict, **kwargs): <NEW_LINE> <INDENT> dimension_dict = {k: v for k, v in dimension_dict.items() if v} <NEW_LINE> super( self.__cl...
The dimensions of a physical quantity. This is essentially a thin wrapper around a dictionary which we perform certain operations on. Example ------- >>> m = Dimensions({'mass': 1.0}) >>> a = Dimensions({'length': 1.0, 'time': -2.0}) >>> f = Dimensions({'length': 1.0, 'mass': 1.0, 'time': -2.0}) >>> f == m*a True >>>...
6259905b38b623060ffaa34e
class PointCloud2Publisher(ROSPublisherTF): <NEW_LINE> <INDENT> ros_class = PointCloud2 <NEW_LINE> def default(self, ci='unused'): <NEW_LINE> <INDENT> points = self.data['point_list'] <NEW_LINE> size = len(points) <NEW_LINE> pc2 = PointCloud2() <NEW_LINE> pc2.header = self.get_ros_header() <NEW_LINE> pc2.height = 1 <NE...
Publish the ``point_list`` of the laser scanner.
6259905bd268445f2663a65c
class Period(BaseModel): <NEW_LINE> <INDENT> _schema = PeriodSchema() <NEW_LINE> period_from = None <NEW_LINE> period_to = None <NEW_LINE> delta = None <NEW_LINE> uom = None
Period object.
6259905ba17c0f6771d5d6a2
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 not attrs: <NEW_LINE> <INDENT> return self.__dict_...
Represents a Student.
6259905b507cdc57c63a63a6
class PacketBuffer: <NEW_LINE> <INDENT> def __init__(self, characteristic: Characteristic, *, buffer_size: int): <NEW_LINE> <INDENT> self._queue = queue.Queue(buffer_size) <NEW_LINE> self._characteristic = characteristic <NEW_LINE> characteristic._add_notify_callback(self._notify_callback) <NEW_LINE> <DEDENT> def _noti...
Accumulates a Characteristic's incoming packets in a FIFO buffer and facilitates packet aware outgoing writes. A packet's size is either the characteristic length or the maximum transmission unit (MTU) minus overhead, whichever is smaller. The MTU can change so check `incoming_packet_length` and `outgoing_packet_length...
6259905bfff4ab517ebcee25
class ExternalDataWorkflow( Workflow[_ExternalDataWorkflowGetStageContext, _ExternalDataWorkflowSetStageContext] ): <NEW_LINE> <INDENT> def __init__(self, name: str, stages: List[WorkflowStage]) -> None: <NEW_LINE> <INDENT> manager = _ExternalDataWorkflowStageManager(name, stages) <NEW_LINE> super().__init__(name, stag...
A workflow that saves state in the external data of a task. :param name: The name of the workflow. :param stages: The list of stages for the workflow.
6259905b45492302aabfdad8
class population_structure_algorithm(AutoRepr): <NEW_LINE> <INDENT> def __init__(self, population_structure_algorithm): <NEW_LINE> <INDENT> self.a = population_structure_algorithm
Population Structure Algorithm class .. _population_structure_algorithm_class: Args: population_structure_algorithm (str): *required.* human-readable name for algorithm Returns: Population_Structure_Altgorithm: instance of a population structure algorithm
6259905b99cbb53fe68324e0
class Utils(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def sparkline(cls, values): <NEW_LINE> <INDENT> bar = '▁▂▃▄▅▆▇█' <NEW_LINE> barcount = len(bar) - 1 <NEW_LINE> values = list(map(float, values)) <NEW_LINE> mn, mx = min(values), max(values) <NEW_LINE> extent = mx - mn <NEW_LINE> if extent == 0: <NEW_LINE>...
Some handy utils for datagrepper visualization.
6259905b30dc7b76659a0d80
class TweakArea(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "wm.tweak_area" <NEW_LINE> bl_label = "Tweak Area" <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> min_x = bpy.props.IntProperty() <NEW_LINE> min_y = bpy.props.IntProperty() <NEW_LINE> def...
Join the current area with the selected (by clicking)
6259905b097d151d1a2c266d
class FileDataFile(FileDataObject): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_json(cls, fdapi, json_data): <NEW_LINE> <INDENT> return cls(fdapi, json_data) <NEW_LINE> <DEDENT> def __init__(self, fdapi, json_data): <NEW_LINE> <INDENT> FileDataObject.__init__(self, fdapi, json_data) <NEW_LINE> <DEDENT> def __r...
Provide access to a file and its metadata in the filedata store
6259905b3539df3088ecd89c
class FdnFilterTypes(enum.IntEnum): <NEW_LINE> <INDENT> disabled = 0 <NEW_LINE> lowpass = 1 <NEW_LINE> highpass = 2
Possible filter types for a feedback delay network's feedback path.
6259905b4e4d562566373a08
@enum.unique <NEW_LINE> class ObjectiveSense(enum.Enum): <NEW_LINE> <INDENT> Minimize = -1 <NEW_LINE> Maximize = 1
Enumeration of objective sense values
6259905bd7e4931a7ef3d67f
class Schema(Row): <NEW_LINE> <INDENT> __slots__ = ("catalog", "name", "default_character_set", "default_collation", "sql_path", "default_encryption")
Information Schema SCHEMA Table
6259905be64d504609df9ecf
class tdTestGuestCtrlBase(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.oTest = None; <NEW_LINE> self.oCreds = None; <NEW_LINE> self.timeoutMS = 30 * 1000; <NEW_LINE> self.oGuestSession = None; <NEW_LINE> <DEDENT> def setEnvironment(self, oSession, oTxsSession, oTestVm): <NEW_LINE> <INDENT>...
Base class for all guest control tests. Note: This test ASSUMES that working Guest Additions were installed and running on the guest to be tested.
6259905b442bda511e95d85a
class AuthRequired(Exception): <NEW_LINE> <INDENT> def __init__(self, msg = ""): <NEW_LINE> <INDENT> self.msg = msg <NEW_LINE> super(AuthRequired, self).__init__() <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "Authorization Required: " + self.msg
Raised on HTTP 401 - Authentication Required error. Service requires authentication, pass user credentials in CLAMClient constructor.
6259905b8e71fb1e983bd0ca
class OAuth2MockMixin(object): <NEW_LINE> <INDENT> oauth2_mock_scope = None <NEW_LINE> oauth_response = { 'code': 'ih2o4ibvirjxipejc19cevcp6b0939', 'scope': 'channel.subscribers', 'state': 'FakeState' } <NEW_LINE> auth_response = { 'access_token': '1e84e29qi5u2gozvoqaoebauwnd90n', 'expires_in': 13048, 'refresh_token': ...
All oauth2 token initiate process looks almost the same from one platform for another. So basically this settings is template for any oauth2 backend test cases
6259905b0fa83653e46f64e6
class Libemos(CMakePackage): <NEW_LINE> <INDENT> homepage = "https://software.ecmwf.int/wiki/display/EMOS/Emoslib" <NEW_LINE> url = "https://software.ecmwf.int/wiki/download/attachments/3473472/libemos-4.4.2-Source.tar.gz" <NEW_LINE> version('4.4.7', '395dcf21cf06872f772fb6b73d8e67b9') <NEW_LINE> version('4.4.2', ...
The Interpolation library (EMOSLIB) includes Interpolation software and BUFR & CREX encoding/decoding routines.
6259905b21bff66bcd724265
class BaseDataset(ABC, Dataset): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def __len__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def __getitem__(self, index): <NEW_LINE> <INDENT> pass <N...
Base class for datasets.
6259905b8da39b475be047e7
class LogsManager(models.Manager): <NEW_LINE> <INDENT> def add_log_bulk(self, data): <NEW_LINE> <INDENT> http_method = data["request_method"].lower() <NEW_LINE> if http_method not in dict(REQUEST_METHODS_CHOICES): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> log_entry = Logs( ip=data["ip"], tms=format_date(data...
Logs manager add methods to model
6259905badb09d7d5dc0bb6b
class LogitRelaxedBernoulli(Distribution): <NEW_LINE> <INDENT> arg_constraints = {'probs': constraints.unit_interval, 'logits': constraints.real} <NEW_LINE> support = constraints.real <NEW_LINE> def __init__(self, temperature, probs=None, logits=None, validate_args=None): <NEW_LINE> <INDENT> self.temperature = temperat...
Creates a LogitRelaxedBernoulli distribution parameterized by :attr:`probs` or :attr:`logits` (but not both), which is the logit of a RelaxedBernoulli distribution. Samples are logits of values in (0, 1). See [1] for more details. Args: temperature (Tensor): relaxation temperature probs (Number, Tensor): the ...
6259905b99cbb53fe68324e1
class CoercedDict(CoercedCollectionMixin, dict): <NEW_LINE> <INDENT> def _coerce_dict(self, d): <NEW_LINE> <INDENT> res = {} <NEW_LINE> for key, element in six.iteritems(d): <NEW_LINE> <INDENT> res[key] = self._coerce_item(key, element) <NEW_LINE> <DEDENT> return res <NEW_LINE> <DEDENT> def _coerce_item(self, key, item...
Dict which coerces its values Dict implementation which overrides all element-adding methods and coercing the element(s) being added to the required element type
6259905b24f1403a926863cf
class AddFormEditable(object): <NEW_LINE> <INDENT> implements(IAddForm) <NEW_LINE> adapts(IPage) <NEW_LINE> def __init__(self, context): <NEW_LINE> <INDENT> self.context = context <NEW_LINE> <DEDENT> @property <NEW_LINE> def title(self): <NEW_LINE> <INDENT> return getattr(self.context, 'title', u"") <NEW_LINE> <DEDENT>...
Form adapter to make IAddForm work
6259905b3eb6a72ae038bc61
class Match(object): <NEW_LINE> <INDENT> def __init__(self, string, start, end=None): <NEW_LINE> <INDENT> self.string = string <NEW_LINE> self.start = start <NEW_LINE> self.end = end <NEW_LINE> self.captures = [] <NEW_LINE> self.context = None <NEW_LINE> <DEDENT> def _setEnd(self, end): <NEW_LINE> <INDENT> s...
The ``Match`` object tracks the text that was matched by a PEG pattern, and provides access to any match captures. :ivar string: The original string that was matched. :ivar start: The location in the string where the pattern match starts. :ivar end: The location in the string where the pattern match ends. :ivar captur...
6259905b56ac1b37e63037e8
class ScheduleModuleTest(ModuleCase): <NEW_LINE> <INDENT> def test_schedule_list(self): <NEW_LINE> <INDENT> expected = {'schedule': {}} <NEW_LINE> ret = self.run_function('schedule.list') <NEW_LINE> self.assertEqual(ret, expected) <NEW_LINE> <DEDENT> def test_schedule_reload(self): <NEW_LINE> <INDENT> expected = {'comm...
Test the schedule module
6259905bf548e778e596cb94
class BusinessError(SystemError): <NEW_LINE> <INDENT> pass
Error when in normal business
6259905ba79ad1619776b5be
class TagViewSet(BaseRecipeAttrViewSet): <NEW_LINE> <INDENT> queryset = Tag.objects.all() <NEW_LINE> serializer_class = serializers.TagSerializer
Manages tags in the database
6259905b30dc7b76659a0d81
class Object(Schema): <NEW_LINE> <INDENT> def __init__(self, properties: Dict[str, BaseType]=None, additional_properties: Union[bool, BaseType]=True, required: List[str]=None, min_properties: int=None, max_properties: int=None, dependencies: Dict[str, Union[List[str], Schema]]=None, pattern_properties: Dict[str, BaseTy...
Objects are the mapping type in JSON. They map “keys” to “values”. In JSON, the “keys” must always be strings. Each of these pairs is conventionally referred to as a “property”.
6259905bac7a0e7691f73ae4
class RegexTree: <NEW_LINE> <INDENT> def __init__(self: 'RegexTree', symbol: str, children: list) -> None: <NEW_LINE> <INDENT> self.symbol, self.children = symbol, children[:] <NEW_LINE> <DEDENT> def __repr__(self: 'RegexTree') -> str: <NEW_LINE> <INDENT> return 'RegexTree({}, {})'.format( repr(self.symbol), repr(self....
Root of a regular expression tree
6259905b91f36d47f2231990
class MinCommonNNNeighborsBR(BondRule): <NEW_LINE> <INDENT> def __init__(self, num_neighbors, invert=False): <NEW_LINE> <INDENT> super(MinCommonNNNeighborsBR, self).__init__(invert=invert) <NEW_LINE> self.num_neighbors = num_neighbors <NEW_LINE> <DEDENT> def _check_percolating(self, percolator, site1, site2): <NEW_LINE...
This rule is True when two sites have at least a specified number of common neighbors that are percolating, and those common neighbors are themselves nearest neighbors.
6259905bcb5e8a47e493cc87
class Frame_extractor(): <NEW_LINE> <INDENT> def __init__( self, pickle_output = None): <NEW_LINE> <INDENT> self.appropriate_udeprels = [ "nsubj", "csubj", "obj", "iobj", "ccomp", "xcomp", "expl" ] <NEW_LINE> self.appropriate_deprels = [ "obl:arg", "obl:agent" ] <NEW_LINE> self.verb_record_class = Verb_r...
tool used by frame_aligner to extract frames from each verb node may be overloaded with language-specific extractors redefining appropropriate (u)deprels and genereal classes in __init__ the rest of extractor is designed language-independent to remain untouched
6259905bb7558d5895464a2d
class ApplicationWithConfig(Application): <NEW_LINE> <INDENT> def __init__(self, description): <NEW_LINE> <INDENT> self.config = None <NEW_LINE> super().__init__(description) <NEW_LINE> <DEDENT> def _add_arguments(self, arg_parser): <NEW_LINE> <INDENT> super()._add_arguments(arg_parser) <NEW_LINE> arg_parser.add_argume...
A base class for applications expecting the path to the configuration file as a command line argument.
6259905b3cc13d1c6d466d43
class Registry(Components, dict): <NEW_LINE> <INDENT> has_listeners = False <NEW_LINE> _settings = None <NEW_LINE> def registerSubscriptionAdapter(self, *arg, **kw): <NEW_LINE> <INDENT> result = Components.registerSubscriptionAdapter(self, *arg, **kw) <NEW_LINE> self.has_listeners = True <NEW_LINE> return result <NEW_L...
A registry object is an :term:`application registry`. The existence of a registry implementation detail of :app:`pyramid`. It is used by the framework itself to perform mappings of URLs to view callables, as well as servicing other various duties. Despite being an implementation detail of the framework, it has a numb...
6259905b097d151d1a2c2670
class DeleteJobOp(ResourceOp): <NEW_LINE> <INDENT> def __init__(self, name: str = None, k8s_name: str = None, job_name: str = None): <NEW_LINE> <INDENT> k8s_name = k8s_name or job_name <NEW_LINE> if not k8s_name: <NEW_LINE> <INDENT> raise ValueError("You need to provide a k8s_name or a job_name.") <NEW_LINE> <DEDENT> s...
Represents an Op which will be translated into a Databricks Spark Job deletion resource template. Example: import databricks databricks.DeleteJobOp( name = "deletejob", job_name = "test-job" )
6259905b498bea3a75a590fe
class Player(Deck): <NEW_LINE> <INDENT> def __init__(self, name=''): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.cards = [] <NEW_LINE> <DEDENT> def get_winining_value(self): <NEW_LINE> <INDENT> winining_value = 0 <NEW_LINE> suite_number = [4, 3, 2, 1] <NEW_LINE> for i in range(len(self.cards)): <NEW_LINE> <IND...
represents a hand of playing cards
6259905b3539df3088ecd89f
class FakeUcsDriver(base.BaseDriver): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> if not importutils.try_import('UcsSdk'): <NEW_LINE> <INDENT> raise exception.DriverLoadError( driver=self.__class__.__name__, reason=_("Unable to import UcsSdk library")) <NEW_LINE> <DEDENT> self.power = ucs_power.Power() ...
Fake UCS driver.
6259905b7b25080760ed87e1
class Embedding(Layer): <NEW_LINE> <INDENT> def __init__(self, input_dim, output_dim, init='uniform', weights=None): <NEW_LINE> <INDENT> self.init = initializations.get(init) <NEW_LINE> self.input_dim = input_dim <NEW_LINE> self.output_dim = output_dim <NEW_LINE> self.normalize = normalize <NEW_LINE> self.input = T.ima...
Turn a list of integers >=0 into a dense vector of fixed size. eg. [4, 50, 123, 26] -> [0.25, 0.1] @input_dim: size of vocabulary (highest input integer + 1) @out_dim: size of dense representation
6259905b1b99ca4002290039
class Location(db.Model): <NEW_LINE> <INDENT> __tablename__ = "gb_map_locations" <NEW_LINE> marker_id = db.Column(db.Integer, autoincrement=True, primary_key=True) <NEW_LINE> gb_lat = db.Column(db.String(20), nullable=True) <NEW_LINE> gb_long = db.Column(db.String(20), nullable=True) <NEW_LINE> gb_id = db.Column(db.Int...
ghost bike location model
6259905b16aa5153ce401ae7
class TestDbQuotaDriver(base.BaseTestCase): <NEW_LINE> <INDENT> def test_get_tenant_quotas_arg(self): <NEW_LINE> <INDENT> driver = quota_db.DbQuotaDriver() <NEW_LINE> ctx = context.Context('', 'bar') <NEW_LINE> foo_quotas = {'network': 5} <NEW_LINE> default_quotas = {'network': 10} <NEW_LINE> target_tenant = 'foo' <NEW...
Test for neutron.db.quota_db.DbQuotaDriver.
6259905b3617ad0b5ee0774e
class IrmaError(Exception): <NEW_LINE> <INDENT> pass
Error on cli script
6259905b8e7ae83300eea691
class GLView(ViewBase, Component, GLContext): <NEW_LINE> <INDENT> _default_size = (100, 100) <NEW_LINE> def __init__(self, **kwds): <NEW_LINE> <INDENT> Component.__init__(self, **kwds) <NEW_LINE> ViewBase.__init__(self) <NEW_LINE> <DEDENT> def destroy(self): <NEW_LINE> <INDENT> ViewBase.destroy(self) <NEW_LINE> Compone...
A GLView is a Component providing an OpenGL 3D display area. Constructors: GLView(config_attr = value..., share = None) GLView(config, share = None)
6259905b55399d3f05627b23
class Input_fun(threading.Thread): <NEW_LINE> <INDENT> message = '' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(Input_fun, self).__init__() <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> while True: <NEW_LINE> <INDENT> event.clear() <NEW_LINE> info = input("input something:").strip() <NEW_LINE> if ...
这个继承式调用类用来跟第一个类进行交互的:此线程类专为得到管理用户的输入命令。 使用了单独的线程得到用户的命令,并与主机交互
6259905b7047854f463409c3
class VirtualHostLocationBase(AppConfigBase): <NEW_LINE> <INDENT> MODES = [ 'exact', 'regex', ] <NEW_LINE> uri = '' <NEW_LINE> mode = ''
Virtual host location object.
6259905b1f037a2d8b9e536d
class BastionHostListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[BastionHost]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, value: Optional[List["BastionHost"]] = None, next_link: Optional[str] = None, **kwargs ...
Response for ListBastionHosts API service call. :param value: List of Bastion Hosts in a resource group. :type value: list[~azure.mgmt.network.v2020_06_01.models.BastionHost] :param next_link: URL to get the next set of results. :type next_link: str
6259905b99cbb53fe68324e4
class _IteratorInitHook(tf.estimator.SessionRunHook): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(_IteratorInitHook, self).__init__() <NEW_LINE> self.iterator_initializer_fn = None <NEW_LINE> <DEDENT> def after_create_session(self, session, coord): <NEW_LINE> <INDENT> del coord <NEW_LINE> self.ite...
Hook to initialize data iterator after session is created.
6259905bb5575c28eb7137ce
class AccountSer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Account <NEW_LINE> fields = '__all__'
Serializer account
6259905bfff4ab517ebcee29
class Config: <NEW_LINE> <INDENT> APP_TITLE = os.environ.get("APP_TITLE", "FastAPI template") <NEW_LINE> APP_DESCRIPTION = os.environ.get("APP_DESCRIPTION", "A template for FastAPI.") <NEW_LINE> VERSION = os.environ.get("VERSION", "0.0.0") <NEW_LINE> OPENAPI_URL = os.environ.get("OPENAPI_URL", "/openapi.json") <NEW_LIN...
Service configurations
6259905b7cff6e4e811b7048
class _PortMapping(CFObject): <NEW_LINE> <INDENT> external = CFField('external').kind(int).name_field() <NEW_LINE> container = CFField('container').kind(int).value_field() <NEW_LINE> kind = CFField('kind').default('tcp') <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(_PortMapping, self).__init__('Port Mapping...
A port mapping of an internal container port to the outside world.
6259905bbe8e80087fbc0688
class Menu(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=100) <NEW_LINE> location = models.ForeignKey(MenuLocation, related_name='menus') <NEW_LINE> active = models.BooleanField('Always Use For Location') <NEW_LINE> url = models.CharField(max_length=100, null=True, blank=True) <NEW_LINE> content...
A collection of MenuItems that can be rendered in a given MenuLocation based on a certain criteria and the page being rendered.
6259905b91f36d47f2231991
class ComputeTargetTcpProxiesDeleteRequest(_messages.Message): <NEW_LINE> <INDENT> project = _messages.StringField(1, required=True) <NEW_LINE> requestId = _messages.StringField(2) <NEW_LINE> targetTcpProxy = _messages.StringField(3, required=True)
A ComputeTargetTcpProxiesDeleteRequest object. Fields: project: Project ID for this request. requestId: An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example,...
6259905b004d5f362081faf0
class ApplyAnnotation(base.Command): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> concept_parsers.ConceptParser( [flags.CreateAssetResourceArg(positional=True), flags.CreateAnnotationResourceArg()]).AddToParser(parser) <NEW_LINE> flags.AddSubAssetFlag(parser) <NEW_LINE> <DEDENT> de...
Apply an annotation to a given asset.
6259905b8a43f66fc4bf3792
@modify_settings(MIDDLEWARE_CLASSES={ 'append': 'django.middleware.cache.FetchFromCacheMiddleware', 'prepend': 'django.middleware.cache.UpdateCacheMiddleware', }) <NEW_LINE> class MiddlewareTestCase(TestCase): <NEW_LINE> <INDENT> @modify_settings(MIDDLEWARE_CLASSES={ 'append': 'django.middleware.cache.FetchFromCacheMid...
Performing middleware load tests
6259905b38b623060ffaa351
@dataclass <NEW_LINE> class DeviceRequestParameter(BackboneElement): <NEW_LINE> <INDENT> resource_type: ClassVar[str] = "DeviceRequestParameter" <NEW_LINE> code: Optional[CodeableConcept] = None <NEW_LINE> valueCodeableConcept: Optional[CodeableConcept] = field(default=None, metadata=dict(one_of_many='value',)) <NEW_LI...
Device details. Specific parameters for the ordered item. For example, the prism value for lenses.
6259905b16aa5153ce401ae8
class HasExpectedFormat(object): <NEW_LINE> <INDENT> def __init__(self, load_type): <NEW_LINE> <INDENT> results = sfv_util.get_source_target_column_values_from_ref_column_mapping( Constants.UDL2_JSON_LZ_TABLE, load_type) if None is None else [] <NEW_LINE> self.mapping = dict([(row[0], row[1].split('.')) for row in resu...
Make sure the JSON file is formatted to our standards
6259905b99cbb53fe68324e5
class OutStream(object): <NEW_LINE> <INDENT> flush_interval = 0.05 <NEW_LINE> topic=None <NEW_LINE> def __init__(self, session, pub_socket, name): <NEW_LINE> <INDENT> self.session = session <NEW_LINE> self.pub_socket = pub_socket <NEW_LINE> self.name = name <NEW_LINE> self.parent_header = {} <NEW_LINE> self._new_buffer...
A file like object that publishes the stream to a 0MQ PUB socket.
6259905b0a50d4780f7068c1
class UserSchema(Schema): <NEW_LINE> <INDENT> id = fields.Integer() <NEW_LINE> username = fields.String( required=True, error_messages={'required': 'Username is required.'}, validate=UserError.validate_username) <NEW_LINE> email = fields.Email( required=True, error_messages={'required': 'Email is required.'}, validate=...
User Schema
6259905b76e4537e8c3f0b92
class RollingEarning: <NEW_LINE> <INDENT> def __init__(self,df:pd.DataFrame,interval:int): <NEW_LINE> <INDENT> self.df=df <NEW_LINE> self.interval=interval <NEW_LINE> <DEDENT> def getData(self): <NEW_LINE> <INDENT> data=self.df.copy()[['net_value']] <NEW_LINE> data['interavalReturn']=(data['net_value'].shift(-1*self.in...
RollingEarning 滚动计算持有固定时间的收益率分布
6259905ba17c0f6771d5d6a5
class GroupedRowTransform(Factor): <NEW_LINE> <INDENT> window_length = 0 <NEW_LINE> def __new__(cls, transform, transform_args, factor, groupby, dtype, missing_value, mask, **kwargs): <NEW_LINE> <INDENT> if mask is NotSpecified: <NEW_LINE> <INDENT> mask = factor.mask <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> mask =...
A Factor that transforms an input factor by applying a row-wise shape-preserving transformation on classifier-defined groups of that Factor. This is most often useful for normalization operators like ``zscore`` or ``demean`` or for performing ranking using ``rank``. Parameters ---------- transform : function[ndarray[...
6259905b507cdc57c63a63ab
class BLFParseError(Exception): <NEW_LINE> <INDENT> pass
BLF file could not be parsed correctly.
6259905bd53ae8145f919a68
class TldClient(base.DnsClientV2Base): <NEW_LINE> <INDENT> @base.handle_errors <NEW_LINE> def create_tld(self, tld_name=None, description=None, params=None): <NEW_LINE> <INDENT> tld = { "name": tld_name or data_utils.rand_name(name="tld"), "description": description or data_utils.rand_name( name="description") } <NEW_L...
API V2 Tempest REST client for Designate Tld API
6259905b2ae34c7f260ac6ed
class BlogPostAdmin(DisplayableAdmin, OwnableAdmin): <NEW_LINE> <INDENT> fieldsets = blogpost_fieldsets <NEW_LINE> list_display = ("title", "user", "status", "admin_link") <NEW_LINE> radio_fields = blogpost_radio_fields <NEW_LINE> def save_form(self, request, form, change): <NEW_LINE> <INDENT> OwnableAdmin.save_form(se...
Admin class for blog posts.
6259905bb5575c28eb7137cf
class PluginGithubRepos(GithubRepos): <NEW_LINE> <INDENT> _TABLE_NAME = 'plugin_github_repos' <NEW_LINE> _ROW_SCHEMA = dict(GithubRepos._ROW_SCHEMA, **{ 'is_fork': False, 'from_vim_scripts': [], 'from_submission': None, }) <NEW_LINE> _BLACKLISTED_GITHUB_REPOS = set([ 'github/gitignore', 'kablamo/dotfiles', 'aemoncannon...
GitHub repositories of Vim plugins.
6259905b097d151d1a2c2673
class ReactPageSerializer(PageSerializer): <NEW_LINE> <INDENT> excerpt = ExcerptField(read_only=True) <NEW_LINE> published_at = PublishedAtField(read_only=True) <NEW_LINE> parent = PageParentIdField(read_only=True) <NEW_LINE> url_path = PagePathField(read_only=True) <NEW_LINE> image = ImageField(read_only=True)
Serializes a Page.
6259905b0c0af96317c57862
class Tip(Node): <NEW_LINE> <INDENT> pass
A member of the syntax tree which doesn't have any children.
6259905b4a966d76dd5f04f8
class Guard: <NEW_LINE> <INDENT> def __call__(self, func): <NEW_LINE> <INDENT> @functools.wraps(func) <NEW_LINE> def guarded(*args, **kwargs): <NEW_LINE> <INDENT> res = self.allowed(*args, **kwargs) <NEW_LINE> if res: <NEW_LINE> <INDENT> return func(*args, **kwargs) <NEW_LINE> <DEDENT> <DEDENT> return guarded <NEW_LINE...
Prevent execution of a function unless arguments pass self.allowed() >>> class OnlyInts(Guard): ... def allowed(self, *args, **kwargs): ... return all(isinstance(arg, int) for arg in args) >>> @OnlyInts() ... def the_func(val): ... print(val) >>> the_func(1) 1 >>> the_func('1') >>> the_func(1, '1') is ...
6259905bdd821e528d6da483
class DescribeProxyStatisticsRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ProxyId = None <NEW_LINE> self.StartTime = None <NEW_LINE> self.EndTime = None <NEW_LINE> self.MetricNames = None <NEW_LINE> self.Granularity = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <...
DescribeProxyStatistics request structure.
6259905b29b78933be26abc7
class MaxSizeDeferredQueue(MaxSizeQueue): <NEW_LINE> <INDENT> def __init__(self, maxSize, backlog = 0): <NEW_LINE> <INDENT> MaxSizeQueue.__init__(self, maxSize) <NEW_LINE> self.__backlogSize = backlog <NEW_LINE> self.__backlog = deque() <NEW_LINE> <DEDENT> def push(self, *items): <NEW_LINE> <INDENT> result = MaxSizeQue...
A queue with a maximum size and the ability to wait for items.
6259905be5267d203ee6cec3
class OrderItemForm(Form): <NEW_LINE> <INDENT> dish_id = SelectField("Dish") <NEW_LINE> comment = StringField("Comment") <NEW_LINE> submit_button = SubmitField("Submit") <NEW_LINE> def populate(self, location: Location) -> None: <NEW_LINE> <INDENT> self.dish_id.choices = [(dish.id, dish.name) for dish in location.dishe...
New Item in an Order
6259905b91af0d3eaad3b42f
class DownloadDataException(Exception): <NEW_LINE> <INDENT> pass
raised when data cannot be downloaded
6259905b8da39b475be047ed
class Message(models.Model): <NEW_LINE> <INDENT> created = models.DateTimeField(auto_now_add=True) <NEW_LINE> text = HTMLField() <NEW_LINE> sender = models.ForeignKey(User, verbose_name="sending django authentication user", related_name='sent_messages') <NEW_LINE> receiver = models.ForeignKey(User, verbose_name="receiv...
Message between two users
6259905b097d151d1a2c2674
class Detect(Function): <NEW_LINE> <INDENT> def __init__(self, cfg): <NEW_LINE> <INDENT> self.num_classes = cfg.NUM_CLASSES <NEW_LINE> self.top_k = cfg.TOP_K <NEW_LINE> self.nms_thresh = cfg.NMS_THRESH <NEW_LINE> self.conf_thresh = cfg.CONF_THRESH <NEW_LINE> self.variance = cfg.VARIANCE <NEW_LINE> <DEDENT> def forward(...
At test time, Detect is the final layer of SSD. Decode location preds, apply non-maximum suppression to location predictions based on conf scores and threshold to a top_k number of output predictions for both confidence score and locations.
6259905b462c4b4f79dbd00d
class Group(MultiCommand): <NEW_LINE> <INDENT> def __init__(self, name=None, commands=None, **attrs): <NEW_LINE> <INDENT> MultiCommand.__init__(self, name, **attrs) <NEW_LINE> self.commands = commands or {} <NEW_LINE> <DEDENT> def add_command(self, cmd, name=None): <NEW_LINE> <INDENT> name = name or cmd.name <NEW_LINE>...
A group allows a command to have subcommands attached. This is the most common way to implement nesting in Click. :param commands: a dictionary of commands.
6259905b7d43ff2487427f13
class ModuleLoader(object): <NEW_LINE> <INDENT> def _findPluginFilePaths(self, namespace): <NEW_LINE> <INDENT> already_seen = set() <NEW_LINE> for path in sys.path: <NEW_LINE> <INDENT> namespace_rel_path = namespace.replace(".", os.path.sep) <NEW_LINE> namespace_path = os.path.join(path, namespace_rel_path) <NEW_LINE> ...
Performs the work of locating and loading straight plugins. This looks for plugins in every location in the import path.
6259905bd6c5a102081e3728
class RunwithNoData(RenderRunbooksIntegrationTest): <NEW_LINE> <INDENT> def runTest(self): <NEW_LINE> <INDENT> self.runbooks = "" <NEW_LINE> self.facts = "" <NEW_LINE> self.assertIsNone(render_runbooks(self.runbooks, self.facts))
Test when given no data
6259905b3c8af77a43b68a44
class AccessKey(db.Model): <NEW_LINE> <INDENT> id = db.Column( UUID(as_uuid=True), primary_key=True, default=uuid.uuid4, unique=True, nullable=False, ) <NEW_LINE> access_key = db.Column(db.String(128)) <NEW_LINE> secret_key = db.Column(db.String(128)) <NEW_LINE> customer_id = db.Column(UUID(as_uuid=True), db.ForeignKey...
Access credentials Access and secret key pairs for using the API
6259905b10dbd63aa1c7217e
class TrapezoidalChannelTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_practice_problem_9(self): <NEW_LINE> <INDENT> s = sections.Trapezoid(l_slope=1/3, b_width=6.0, r_slope=1/3, n=0.013) <NEW_LINE> channel = links.Reach(section=s, slope=0.002) <NEW_LINE> produced = channel.normal_flow(depth=2.0) <NEW_LINE> expe...
From Practice Problems for the Civil Engineering PE Exam by Michael R. Lindeburg, PE: Chapter 19
6259905bcc0a2c111447c5d2
class Worm: <NEW_LINE> <INDENT> def __init__(self, start): <NEW_LINE> <INDENT> self.nodes = [start] <NEW_LINE> self.head = start <NEW_LINE> start.owner = self <NEW_LINE> self.edges = [] <NEW_LINE> self.tabu = [] <NEW_LINE> self.length = 0 <NEW_LINE> self.dead = False <NEW_LINE> self.dirs = np.zeros(len(Direction)) <NEW...
Manages adding/removing segments to a worm Also generates likelihood scores for potential segments
6259905b2ae34c7f260ac6ee
class ElementMaker(object): <NEW_LINE> <INDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __getattribute__(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __getattr__(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __init__(se...
ElementMaker(self, namespace=None, nsmap=None, annotate=True, makeelement=None) An ElementMaker that can be used for constructing trees. Example:: >>> M = ElementMaker(annotate=False) >>> attributes = {'class': 'par'} >>> html = M.html( M.body( M.p('hello', attributes, M.br, 'objectify', st...
6259905b21a7993f00c67574
class LockingError(ConnectorError): <NEW_LINE> <INDENT> pass
Raised when trying to lock an already locked resource.
6259905b8e7ae83300eea695
class RedactionEngine(object): <NEW_LINE> <INDENT> def __init__(self, rules=None): <NEW_LINE> <INDENT> if rules is None: <NEW_LINE> <INDENT> rules = [] <NEW_LINE> <DEDENT> self.rules = rules <NEW_LINE> <DEDENT> def add_rule(self, rule): <NEW_LINE> <INDENT> self.rules.append(rule) <NEW_LINE> <DEDENT> def add_rules(self,...
`RedactionEngine` applies a list of `RedactionRule`s to redact a string.
6259905b7047854f463409c7
class SubscriptionsWidget(AddBreadcrumbOnShowMixin, QWidget): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> QWidget.__init__(self, parent) <NEW_LINE> self.subscribe_button = None <NEW_LINE> self.initialized = False <NEW_LINE> self.contents_widget = None <NEW_LINE> self.channel_rating_label = None ...
This widget shows a favorite button and the number of subscriptions that a specific channel has.
6259905b24f1403a926863d2
class PrivateIngredientApiTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> self.user = get_user_model().objects.create_user( 'test@g.com', 'testpass' ) <NEW_LINE> self.client.force_authenticate(self.user) <NEW_LINE> <DEDENT> def test_retrieve_ingredient_list(...
Test the private ingredients API
6259905b3eb6a72ae038bc67
class SpeechRecognitionAlternative(_messages.Message): <NEW_LINE> <INDENT> confidence = _messages.FloatField(1, variant=_messages.Variant.FLOAT) <NEW_LINE> transcript = _messages.StringField(2) <NEW_LINE> words = _messages.MessageField('WordInfo', 3, repeated=True)
Alternative hypotheses (a.k.a. n-best list). Fields: confidence: Output only. The confidence estimate between 0.0 and 1.0. A higher number indicates an estimated greater likelihood that the recognized words are correct. This field is set only for the top alternative of a non-streaming result or, of a str...
6259905b67a9b606de5475a5
class MigrationDataNormalPersistenceTestCase(TestCase): <NEW_LINE> <INDENT> def test_persistence(self): <NEW_LINE> <INDENT> self.assertEqual( Book.objects.count(), 1, )
Data loaded in migrations is available on TestCase
6259905b9c8ee82313040c8e
class SshPublicKey(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'certificate_data': {'key': 'certificateData', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(SshPublicKey, self).__init__(**kwargs) <NEW_LINE> self.certificate_data = kwargs.get('certificate_d...
The SSH public key for the cluster nodes. :param certificate_data: The certificate for SSH. :type certificate_data: str
6259905b8a43f66fc4bf3796
class Event(object): <NEW_LINE> <INDENT> def __init__(self, elapsed_time, name, total_hot_dogs_eaten): <NEW_LINE> <INDENT> self.elapsed_time = elapsed_time <NEW_LINE> self.name = name <NEW_LINE> self.total_hot_dogs_eaten = total_hot_dogs_eaten <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return 'Event(el...
An Event should be generated whenever a hot dog is eaten by a competitor, and at the end of the competition for each competitor.
6259905b379a373c97d9a62d
class TableDefWeightsPage(CoClass): <NEW_LINE> <INDENT> _reg_clsid_ = GUID('{F64D9CE1-1F15-11D3-9C05-00C04F5B951E}') <NEW_LINE> _idlflags_ = [] <NEW_LINE> _typelib_path_ = typelib_path <NEW_LINE> _reg_typelib_ = ('{C0FC1503-7E6F-11D2-AABF-00C04FA375F1}', 10, 2)
Esri feature class weights association page.
6259905b8e71fb1e983bd0d2
class UptimeSensor(Entity): <NEW_LINE> <INDENT> def __init__(self, name, unit): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._unit = unit <NEW_LINE> self.initial = dt_util.now() <NEW_LINE> self._state = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self._name <NEW_LIN...
Representation of an uptime sensor.
6259905b8da39b475be047ef
class QuerySet(ControllerView, query.QuerySet): <NEW_LINE> <INDENT> pass
View- and Controller-aware QuerySet
6259905b442bda511e95d85e
class TimeSetter: <NEW_LINE> <INDENT> def __init__(self, utcDelay): <NEW_LINE> <INDENT> self.utcDelay=utcDelay <NEW_LINE> self.verbose = False <NEW_LINE> <DEDENT> def set_verbose(self, verbose): <NEW_LINE> <INDENT> self.verbose = verbose <NEW_LINE> <DEDENT> def process(self): <NEW_LINE> <INDENT> if self.verbose: <NEW_L...
class to reset time Args: utc_delay: delay in hours form utc timezone Attributes: verbose (bool): activate verbose output utc_delay (int): time delay from utc (for Berlin: +1)
6259905b01c39578d7f1423b
class DogForm(ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Dog <NEW_LINE> exclude = ('id', 'owner',) <NEW_LINE> widgets = { 'id' : forms.HiddenInput(), 'owner' : forms.HiddenInput() } <NEW_LINE> help_texts = { 'birthday': _('Format YYYY-MM-DD') }
Form for adding/editing a dog profile.
6259905b16aa5153ce401aec
class DiagnosticDetectorResponse(ProxyOnlyResource): <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'}, 'kind': {'key': 'kind', 'type': 'str'}, '...
Class representing Response from Diagnostic Detectors. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. :vartype name: str :ivar kind: Kind of resource. :vartype kind: str :ivar type: Resource type. :vartype type...
6259905b2c8b7c6e89bd4df7
class iPerfUDPReverseTestWLAN(iPerfUDPReverseTest): <NEW_LINE> <INDENT> def runTest(self): <NEW_LINE> <INDENT> if not wlan: <NEW_LINE> <INDENT> self.skipTest("skipping test no wlan") <NEW_LINE> <DEDENT> wlan.sendline('iwconfig') <NEW_LINE> wlan.expect(prompt) <NEW_LINE> super(iPerfReverseTestWLAN, self).runTest(client=...
iPerf from WAN to LAN over Wifi
6259905b4428ac0f6e659b45
class Checker(ACVE): <NEW_LINE> <INDENT> def __init__(self, request, logger): <NEW_LINE> <INDENT> self.logger = logger <NEW_LINE> <DEDENT> def run(self, version): <NEW_LINE> <INDENT> self.logger.handle("\n[*] Checker not available for this CVE", None)
This class checks if the given target is vulnerable to the CVE-2018-7600.
6259905b460517430c432b57
class Bricks(Enum): <NEW_LINE> <INDENT> def repeat(pattern, capture=True): <NEW_LINE> <INDENT> return (r"(" if capture else r"(?:") + pattern + r")+" <NEW_LINE> <DEDENT> def getItem(enum, index): <NEW_LINE> <INDENT> return enum[list(enum.__members__)[index]] <NEW_LINE> <DEDENT> def flatten(parsed): <NEW_LINE> <INDENT> ...
Base building blocks and utility methods used by the other classes.
6259905b07f4c71912bb0a45
class SelectionItem(MenuItem): <NEW_LINE> <INDENT> def __init__(self, text, index, menu=None): <NEW_LINE> <INDENT> super(SelectionItem, self).__init__(text=text, menu=menu, should_exit=True) <NEW_LINE> self.index = index <NEW_LINE> <DEDENT> def get_return(self): <NEW_LINE> <INDENT> return self.index
The item type used in :class:`consolemenu.SelectionMenu`
6259905b3539df3088ecd8a5