code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class SaltRaetSetupMatcher(ioflo.base.deeding.Deed): <NEW_LINE> <INDENT> Ioinits = {'opts': salt.utils.stringutils.to_str('.salt.opts'), 'modules': salt.utils.stringutils.to_str('.salt.loader.modules'), 'matcher': salt.utils.stringutils.to_str('.salt.matcher')} <NEW_LINE> def action(self): <NEW_LINE> <INDENT> self.matc... | Make the matcher object | 6259902fd4950a0f3b111679 |
class ScalePreprocessing(Preprocessing): <NEW_LINE> <INDENT> def __init__(self, scale: float): <NEW_LINE> <INDENT> self.scale = scale <NEW_LINE> <DEDENT> def normalize(self, data): <NEW_LINE> <INDENT> return data * self.scale <NEW_LINE> <DEDENT> def denormalize(self, data): <NEW_LINE> <INDENT> return data / self.scale | Data preprocessing that scales (multiplies) the data by the given value. | 6259902f6e29344779b016c7 |
class WebCacheThread(threading.Thread): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.execute_queue = queue.Queue() <NEW_LINE> self.exception_queue = collections.defaultdict(functools.partial(queue.Queue, maxsize=1)) <NEW_LINE> self.result_queue = collections.defaultdict(functools.partial(queue.Queue... | Thread executing all sqlite3 calls for the ThreadedWebCache class. | 6259902f8e05c05ec3f6f697 |
class LoginHandler: <NEW_LINE> <INDENT> def __init__(self, header:dict, credentials:dict, targetUrl:str, filterTag:str, httpHandler:httplib2.Http, httpRequestType:str, debugPrint:bool): <NEW_LINE> <INDENT> self.header=header <NEW_LINE> self.credentials=credentials <NEW_LINE> self.targetUrl=targetUrl <NEW_LINE> self.fil... | classdocs
This class does not do any I/O operations
It does not create a html file output. This can be done somewhere else
It's focus is on request handling
it's also designed to handle multiple request to the same target.
This can be defined in the "run" method. | 6259902f5e10d32532ce413f |
class EB_Gurobi(Tarball): <NEW_LINE> <INDENT> def install_step(self): <NEW_LINE> <INDENT> if self.cfg['license_file'] is None or not os.path.exists(self.cfg['license_file']): <NEW_LINE> <INDENT> raise EasyBuildError("No existing license file specified: %s", self.cfg['license_file']) <NEW_LINE> <DEDENT> super(EB_Gurobi,... | Support for installing linux64 version of Gurobi. | 6259902f8c3a8732951f75d0 |
class AudioObjectEditForm(forms.Form): <NEW_LINE> <INDENT> collection = CollectionSuggestionField(required=True) <NEW_LINE> error_css_class = 'has-error' <NEW_LINE> required_css_class = 'required' <NEW_LINE> def __init__(self, data=None, instance=None, initial={}, **kwargs): <NEW_LINE> <INDENT> if instance is None: <NE... | :class:`~django.forms.Form` for metadata on an
:class:`~keep.audio.models.AudioObject`.
Takes an :class:`~keep.audio.models.AudioObject`. This stands in contrast
to a regular :class:`~eulxml.forms.XmlObjectForm`, which would
take an :class:`~eulxml.xmlmap.XmlObject`. This form edits a whole
:class:`~keep.audio.models.... | 6259902f287bf620b6272c60 |
class Formats: <NEW_LINE> <INDENT> ISO_8601_DATETIME = '%Y-%m-%dT%H:%M:%S%z' <NEW_LINE> ISO_8601_DATE = '%Y-%m-%d' | Abstract data type containing commonly used datetime format strings | 6259902f66673b3332c31469 |
class BatchDeleteEntitiesRequest(proto.Message): <NEW_LINE> <INDENT> parent = proto.Field(proto.STRING, number=1,) <NEW_LINE> entity_values = proto.RepeatedField(proto.STRING, number=2,) <NEW_LINE> language_code = proto.Field(proto.STRING, number=3,) | The request message for
[EntityTypes.BatchDeleteEntities][google.cloud.dialogflow.v2beta1.EntityTypes.BatchDeleteEntities].
Attributes:
parent (str):
Required. The name of the entity type to delete entries for.
Supported formats:
- ``projects/<Project ID>/agent/entityTypes/<Entity Type ID... | 6259902f9b70327d1c57fdfd |
class Subprocess: <NEW_LINE> <INDENT> def is_running(self): <NEW_LINE> <INDENT> return ( self.is_external() or hasattr(self, 'process') and self.process.returncode is None ) <NEW_LINE> <DEDENT> def is_external(self): <NEW_LINE> <INDENT> return getattr(self, 'external', False) <NEW_LINE> <DEDENT> def stop(self): <NEW_LI... | Mix-in to handle common subprocess handling | 6259902f4e696a045264e65e |
class NumberRange(ISTNode): <NEW_LINE> <INDENT> __type__ = 'Range' <NEW_LINE> __name_field__ = '' <NEW_LINE> __value_field__ = '' <NEW_LINE> def __init__(self, always_visible=True): <NEW_LINE> <INDENT> super(NumberRange, self).__init__() <NEW_LINE> self.min = self.max = '' <NEW_LINE> self.always_visible = always_visibl... | Class representing simple number range | 6259902f1d351010ab8f4b91 |
class rand_int32_t(rand_int_t): <NEW_LINE> <INDENT> def __init__(self, i=0): <NEW_LINE> <INDENT> super().__init__(32, i) | Creates a random signed 32-bit attribute | 6259902f30c21e258be99885 |
class WidgetConnector(QObject): <NEW_LINE> <INDENT> dataChanged = pyqtSignal(bool) <NEW_LINE> def __init__(self, form, adaptor, prefix=""): <NEW_LINE> <INDENT> QObject.__init__(self) <NEW_LINE> self._adaptor = None <NEW_LINE> self._form = form <NEW_LINE> self._widget_prefix = prefix <NEW_LINE> self._object = None <NEW_... | Mixin class for a widget to provide automatic connection with an
ORM base class from SqlAlchemy.
Interrogates the object to determine the field names, then attempts
to link each field with a child widget of the form with the same
name.
The LoadEntity function and SaveEntity functions provide the main
connection betwe... | 6259902f8e05c05ec3f6f698 |
class WriteTenantNestedSerializer(object): <NEW_LINE> <INDENT> def __init__(self, name=None, slug=None): <NEW_LINE> <INDENT> self.swagger_types = { 'name': 'str', 'slug': 'str' } <NEW_LINE> self.attribute_map = { 'name': 'name', 'slug': 'slug' } <NEW_LINE> self._name = name <NEW_LINE> self._slug = slug <NEW_LINE> <DEDE... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 6259902f30c21e258be99886 |
class EditScheduleStepTestCase(WgerEditTestCase): <NEW_LINE> <INDENT> object_class = ScheduleStep <NEW_LINE> url = 'manager:step:edit' <NEW_LINE> pk = 2 <NEW_LINE> data = {'workout': 1, 'duration': 8} | Tests editing a schedule | 6259902fc432627299fa406f |
class ThreadGenerateGarbage(ThreadBase): <NEW_LINE> <INDENT> def gen_key(self): <NEW_LINE> <INDENT> chars = string.ascii_lowercase + string.digits <NEW_LINE> return ''.join(random.choice(chars) for x in range(8)) <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> while self.run: <NEW_LINE> <INDENT> time.sleep(1) <N... | stat, value, type
c = counter, t = timer, g = gauge
(stat, x, type) | 6259902f8c3a8732951f75d2 |
class RecordingSampler(Sampler): <NEW_LINE> <INDENT> def __init__(self, metadata, random_state=None): <NEW_LINE> <INDENT> self.metadata = metadata <NEW_LINE> self.info = self._init_info(metadata) <NEW_LINE> self.rng = check_random_state(random_state) <NEW_LINE> <DEDENT> def _init_info(self, metadata, required_keys=None... | Base sampler simplifying sampling from recordings.
Parameters
----------
metadata : pd.DataFrame
DataFrame with at least one of {subject, session, run} columns for each
window in the BaseConcatDataset to sample examples from. Normally
obtained with `BaseConcatDataset.get_metadata()`. For instance,
`met... | 6259902f3eb6a72ae038b6e1 |
class LakeShore336Device(Device): <NEW_LINE> <INDENT> loop1 = FormattedComponent( LakeShore336_LoopControl, "{self.prefix}", loop_number=1 ) <NEW_LINE> loop2 = FormattedComponent( LakeShore336_LoopControl, "{self.prefix}", loop_number=2 ) <NEW_LINE> loop3 = FormattedComponent( LakeShore336_LoopRO, "{self.prefix}", loop... | LakeShore 336 temperature controller.
- loop 1: temperature positioner AND heater, PID, & ramp controls
- loop 2: temperature positioner AND heater, PID, & ramp controls
- loop 3: temperature positioner
- loop 4: temperature positioner | 6259902f66673b3332c3146b |
class RemediationLevel(BaseEnum): <NEW_LINE> <INDENT> OFFICIAL_FIX = D("0.87") <NEW_LINE> TEMPORARY_FIX = D("0.90") <NEW_LINE> WORKAROUND = D("0.95") <NEW_LINE> UNAVAILABLE = D("1") <NEW_LINE> NOT_DEFINED = NotDefined(D("1")) <NEW_LINE> _vectors = { "of": "OFFICIAL_FIX", "tf": "TEMPORARY_FIX" } | Vector: RL | 6259902f1d351010ab8f4b92 |
class StructureDefinitionDifferential(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_type = "StructureDefinitionDifferential" <NEW_LINE> def __init__(self, jsondict=None, strict=True): <NEW_LINE> <INDENT> self.element = None <NEW_LINE> super(StructureDefinitionDifferential, self).__init__(jsondict=jsond... | Differential view of the structure.
A differential view is expressed relative to the base StructureDefinition -
a statement of differences that it applies. | 6259902f50485f2cf55dbff8 |
class MSVSProject: <NEW_LINE> <INDENT> def __init__(self, path, name = None, dependencies = None, guid = None, spec = None, build_file = None, config_platform_overrides = None, fixpath_prefix = None): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.guid = guid <NEW_LINE> self.spec = spec <NEW_LINE> self.build_file... | Visual Studio project. | 6259902fbe8e80087fbc00f7 |
class ModelEmbeddings(nn.Module): <NEW_LINE> <INDENT> def __init__(self, embed_size, vocab): <NEW_LINE> <INDENT> super(ModelEmbeddings, self).__init__() <NEW_LINE> self.embed_size = embed_size <NEW_LINE> self.source = None <NEW_LINE> self.target = None <NEW_LINE> src_pad_token_idx = vocab.src['<pad>'] <NEW_LINE> tgt_pa... | Class that converts input words to their embeddings. | 6259902f8a349b6b436872b7 |
class ICompetitionDetail(Interface): <NEW_LINE> <INDENT> pass | Detail view of one competition | 6259902f73bcbd0ca4bcb30d |
class Field(object): <NEW_LINE> <INDENT> __slots__ = ('json_name', 'default', 'omitempty', 'fdec', 'fenc') <NEW_LINE> def __init__(self, json_name, default=None, omitempty=False, decoder=None, encoder=None): <NEW_LINE> <INDENT> self.json_name = json_name <NEW_LINE> self.default = default <NEW_LINE> self.omitempty = omi... | JSON object field.
:class:`Field` is meant to be used together with
:class:`JSONObjectWithFields`.
``encoder`` (``decoder``) is a callable that accepts a single
parameter, i.e. a value to be encoded (decoded), and returns the
serialized (deserialized) value. In case of errors it should raise
:class:`~acme.jose.errors... | 6259902f287bf620b6272c63 |
@implementer(IEncodableRecord) <NEW_LINE> class Record_TSIG(tputil.FancyEqMixin, tputil.FancyStrMixin): <NEW_LINE> <INDENT> fancybasename = "TSIG" <NEW_LINE> compareAttributes = ('algorithm', 'timeSigned', 'fudge', 'MAC', 'originalID', 'error', 'otherData', 'ttl') <NEW_LINE> showAttributes = ['algorithm', 'timeSigned',... | A transaction signature, encapsulated in a RR, as described
in U{RFC 2845 <https://tools.ietf.org/html/rfc2845>}.
@type algorithm: L{Name}
@ivar algorithm: The name of the signature or MAC algorithm.
@type timeSigned: L{int}
@ivar timeSigned: Signing time, as seconds from the POSIX epoch.
@type fudge: L{int}
@ivar f... | 6259902f56b00c62f0fb393e |
class UserChangeForm(forms.ModelForm): <NEW_LINE> <INDENT> password = ReadOnlyPasswordHashField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = UserProfile <NEW_LINE> <DEDENT> def clean_password(self): <NEW_LINE> <INDENT> return self.initial["password"] | A form for updating users. Includes all the fields on
the user, but replaces the password field with admin's
password hash display field. | 6259902fa4f1c619b294f672 |
class AbstractRecombiner(abc.ABC): <NEW_LINE> <INDENT> def __init__(self, parent_count, crossover_probability): <NEW_LINE> <INDENT> self.parent_count = parent_count <NEW_LINE> self.crossover_probability = crossover_probability <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def recombine(self, parents): <NEW_LINE> <... | Abstract interface for a Recombiner yielding a method to recombine parent-chromosomes to new chromosomes | 6259902fa8ecb0332587229b |
class MITMDSet(MITRelaxSet): <NEW_LINE> <INDENT> def __init__( self, structure, start_temp, end_temp, nsteps, time_step=2, spin_polarized=False, **kwargs ): <NEW_LINE> <INDENT> defaults = { "TEBEG": start_temp, "TEEND": end_temp, "NSW": nsteps, "EDIFF_PER_ATOM": 0.000001, "LSCALU": False, "LCHARG": False, "LPLANE": Fal... | Class for writing a vasp md run. This DOES NOT do multiple stage
runs. | 6259902fcad5886f8bdc58ba |
class Regex(Expression): <NEW_LINE> <INDENT> __slots__ = ['re'] <NEW_LINE> def __init__(self, pattern, name='', ignore_case=False, locale=False, multiline=False, dot_all=False, str=False, verbose=False): <NEW_LINE> <INDENT> super(Regex, self).__init__(name) <NEW_LINE> self.re = re.compile(pattern, (ignore_case and re.I... | An expression that matches what a regex does.
Use these as much as you can and jam as much into each one as you can;
they're fast. | 6259902f15baa72349463016 |
class SubsAreaSerializer(ModelSerializer): <NEW_LINE> <INDENT> subs = AreasSerializer(many=True, read_only=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Area <NEW_LINE> fields =['id','name','subs'] | 查询详细地址 | 6259902fd10714528d69eeca |
class ResourceDeletionStrategy(ResourceHandlingStrategy): <NEW_LINE> <INDENT> pass | This class contains the logic for deleting resources. | 6259902f0a366e3fb87dda66 |
class TagContentConverter(Converter): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> async def convert(ctx: Context, tag_content: str) -> str: <NEW_LINE> <INDENT> tag_content = tag_content.strip() <NEW_LINE> if not tag_content: <NEW_LINE> <INDENT> raise BadArgument("Tag contents should not be empty, or filled with whites... | Ensure proposed tag content is not empty and contains at least one non-whitespace character. | 6259902f50485f2cf55dbffb |
class AirInfiltrationTest(BSElement): <NEW_LINE> <INDENT> element_type = "xs:string" <NEW_LINE> element_enumerations = ["Blower door", "Tracer gas", "Checklist", "Other"] | Type of air infiltration test performed on the building. | 6259902f23e79379d538d589 |
class WorkflowStatus(Enum): <NEW_LINE> <INDENT> PAUSED = "paused" <NEW_LINE> RUNNING = "running" <NEW_LINE> STOPPING = "stopping" <NEW_LINE> STOPPED = "stopped" | The possible statuses of a workflow. | 6259902f63f4b57ef00865b2 |
class NeuralynxRecordingExtractor(NeoBaseRecordingExtractor): <NEW_LINE> <INDENT> mode = 'folder' <NEW_LINE> NeoRawIOClass = 'NeuralynxRawIO' <NEW_LINE> def __init__(self, folder_path, stream_id=None): <NEW_LINE> <INDENT> neo_kwargs = {'dirname': folder_path} <NEW_LINE> NeoBaseRecordingExtractor.__init__(self, stream_i... | Class for reading neuralynx folder
Based on neo.rawio.NeuralynxRawIO
Parameters
----------
folder_path: str
The xml file.
stream_id: str or None | 6259902fcad5886f8bdc58bb |
class csc(ReciprocalTrigonometricFunction): <NEW_LINE> <INDENT> _reciprocal_of = sin <NEW_LINE> _is_odd = True <NEW_LINE> def period(self, symbol=None): <NEW_LINE> <INDENT> return self._period(symbol) <NEW_LINE> <DEDENT> def _eval_rewrite_as_sin(self, arg, **kwargs): <NEW_LINE> <INDENT> return (1/sin(arg)) <NEW_LINE> <... | The cosecant function.
Returns the cosecant of x (measured in radians).
Notes
=====
See :func:`sin` for notes about automatic evaluation.
Examples
========
>>> from sympy import csc
>>> from sympy.abc import x
>>> csc(x**2).diff(x)
-2*x*cot(x**2)*csc(x**2)
>>> csc(1).diff(x)
0
See Also
========
sin, cos, sec, ta... | 6259902fd99f1b3c44d06723 |
class ConfigTypeField(BaseField): <NEW_LINE> <INDENT> def __init__(self, config_type: Type["ConfigType"], key: str = None, name: str = None): <NEW_LINE> <INDENT> super().__init__(key=key, name=name) <NEW_LINE> self.config_type = config_type <NEW_LINE> <DEDENT> def __setdefault__(self, cfg: 'Config') -> None: <NEW_LINE>... | A field that wraps a :class:`ConfigType` object, created by the :meth:`~cincoconfig.make_type`
method. | 6259902f5166f23b2e244456 |
class system_update_keyspace_result(object): <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.STRING, 'success', None, None, ), (1, TType.STRUCT, 'ire', (InvalidRequestException, InvalidRequestException.thrift_spec), None, ), (2, TType.STRUCT, 'sde', (SchemaDisagreementException, SchemaDisagreementException.thrift_spec), ... | Attributes:
- success
- ire
- sde | 6259902f30c21e258be9988c |
class GOTerm: <NEW_LINE> <INDENT> def __init__(self, id, name, namespace, parent_ids): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.parent_ids = parent_ids <NEW_LINE> self.name = name <NEW_LINE> self.namespace = namespace | Represents a GO term | 6259902fe76e3b2f99fd9a8d |
class UpdaterClient: <NEW_LINE> <INDENT> firmware = None <NEW_LINE> portnum = -1 <NEW_LINE> url = "" <NEW_LINE> sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) <NEW_LINE> sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) <NEW_LINE> def __init__(self, url, portnum): <NEW_LINE> <INDENT> self.url = url <N... | Firmware Updater client | 6259902fd6c5a102081e31a6 |
class AuctionBidDelForm(forms.Form): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> item = kwargs.pop('item') <NEW_LINE> super (AuctionBidDelForm, self).__init__(*args, **kwargs) <NEW_LINE> self.fields['bids'] = forms.ModelMultipleChoiceField( queryset = AuctionBid.objects.filter(item=item... | Form to delete existing Bids for an item | 6259902f8c3a8732951f75d9 |
class Calculator(object): <NEW_LINE> <INDENT> def add(self, number1, number2): <NEW_LINE> <INDENT> return number1 + number2 <NEW_LINE> <DEDENT> def double(self, number): <NEW_LINE> <INDENT> return 2 * number | A simple calculator class. | 6259902fa8ecb0332587229f |
class UnitGameData: <NEW_LINE> <INDENT> _game_data = None <NEW_LINE> _bot_object = None | Populated by sc2/main.py on game launch.
Used in PassengerUnit, Unit, Units and UnitOrder. | 6259902f96565a6dacd2d7cf |
class SquaredError(Loss): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(SquareLoss, self).__init__() <NEW_LINE> self.err = None <NEW_LINE> <DEDENT> def forward(self, flag, x, y): <NEW_LINE> <INDENT> self.err = x - y <NEW_LINE> return tensor.square(self.err) * 0.5 <NEW_LINE> <DEDENT> def backward(sel... | This loss evaluates the squared error between the prediction and the
truth values.
It is implemented using Python Tensor operations. | 625990305e10d32532ce4144 |
class PersonalityInsightsV3(BaseService): <NEW_LINE> <INDENT> DEFAULT_SERVICE_URL = 'https://gateway.watsonplatform.net/personality-insights/api' <NEW_LINE> DEFAULT_SERVICE_NAME = 'personality_insights' <NEW_LINE> def __init__( self, version: str, authenticator: Authenticator = None, service_name: str = DEFAULT_SERVICE... | The Personality Insights V3 service. | 6259902fcad5886f8bdc58bc |
class UDSHTTPConnection(httplib.HTTPConnection): <NEW_LINE> <INDENT> def connect(self): <NEW_LINE> <INDENT> path = self.host.replace("_", "/") <NEW_LINE> self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) <NEW_LINE> self.sock.connect(path) | HTTPConnection subclass to allow HTTP over Unix domain sockets. | 6259903023e79379d538d58d |
class TestClientApi50(TestClientApi): <NEW_LINE> <INDENT> server_version = '5.0' <NEW_LINE> def _skip(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> test_execute_kw = test_render_report = _skip <NEW_LINE> def _module_upgrade(self, button='upgrade'): <NEW_LINE> <INDENT> self.service.object.execute.side_effect = [ [... | Test the Client API for OpenERP 5. | 625990304e696a045264e663 |
class DenseModel(): <NEW_LINE> <INDENT> def __init__(self, path, p=0.8, input_shape=(512, 14, 14)): <NEW_LINE> <INDENT> dense_layers = self.dense_layers(p, input_shape) <NEW_LINE> self.path = path <NEW_LINE> self.model = self.dense_model(dense_layers) <NEW_LINE> self.model_path = path + 'models/conv_weights.h5' <NEW_LI... | Dense layer with batch norm.
Feed convolution features as input | 625990306fece00bbaccca33 |
@remove_namedtuple_defaultdoc <NEW_LINE> class LimitingSet(NamedTuple): <NEW_LINE> <INDENT> id: str <NEW_LINE> name: str <NEW_LINE> max_vms: int = 0 <NEW_LINE> max_cores: int = 0 | LimitingSet restrictions. | 62599030d99f1b3c44d06727 |
class DeleteUserQuoteVote(graphene.Mutation): <NEW_LINE> <INDENT> class Arguments: <NEW_LINE> <INDENT> quote_id = graphene.ID(required=True) <NEW_LINE> <DEDENT> found = graphene.Boolean() <NEW_LINE> quote_sum = graphene.Int() <NEW_LINE> def mutate(self, info, quote_id): <NEW_LINE> <INDENT> _, django_quote_id = from_glo... | Since a QuoteVote has a unique constraint for 'caster' and 'quote' there can only exist
one quote vote object with the same caster and quote. Given this, a delete mutation with
quote_id + the user sending the request should give us a single quote vote object. The main
motivation behind this approach is that we do not n... | 625990306e29344779b016d3 |
class AddJobseekerForm(FlaskForm): <NEW_LINE> <INDENT> first_name = StringField("First Name", validators=[DataRequired()]) <NEW_LINE> last_name = StringField("Last Name", validators=[DataRequired()]) <NEW_LINE> username = StringField("Username", validators=[DataRequired()]) <NEW_LINE> email = EmailField("E-mail", valid... | Add a User. | 6259903091af0d3eaad3aeb0 |
class ISYLightDevice(ISYDevice, Light): <NEW_LINE> <INDENT> @property <NEW_LINE> def is_on(self) -> bool: <NEW_LINE> <INDENT> if self.is_unknown(): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> return self.value != 0 <NEW_LINE> <DEDENT> @property <NEW_LINE> def brightness(self) -> float: <NEW_LINE> <INDENT> retu... | Representation of an ISY994 light device. | 6259903066673b3332c31475 |
class Services: <NEW_LINE> <INDENT> AOL = 'aol' <NEW_LINE> GMAIL = 'gmail' <NEW_LINE> FACEBOOK = 'facebook' <NEW_LINE> MAILRU = 'mailru' <NEW_LINE> VK = 'vk' <NEW_LINE> CLASSMATES = 'classmates' <NEW_LINE> TWITTER = 'twitter' <NEW_LINE> MAMBA = 'mamba' <NEW_LINE> UBER = 'uber' <NEW_LINE> TELEGRAM = 'telegram' <NEW_LINE... | List of services | 62599030d18da76e235b7990 |
class test_fastqFromSRA_multi(test_fastqFromSRA): <NEW_LINE> <INDENT> NCPUS = 2 | Like `test_fastqFromSRA` but multiple CPUs. | 62599030b57a9660fecd2b08 |
class Wheat(Crop): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__(1,3,6) <NEW_LINE> self._type = "Wheat" <NEW_LINE> <DEDENT> def grow(self,light,water): <NEW_LINE> <INDENT> if light >= self._light_need and water >= self._water_need: <NEW_LINE> <INDENT> if self._status == "Seedling": <NEW_L... | A Wheat Crop | 62599030a4f1c619b294f67a |
class BaseElement: <NEW_LINE> <INDENT> pass | The Base element class for all elements | 62599030ac7a0e7691f7356d |
class Char(Word): <NEW_LINE> <INDENT> def __init__(self, charset): <NEW_LINE> <INDENT> super(Char, self).__init__(charset, exact=1) <NEW_LINE> self.reString = "[%s]" % _escapeRegexRangeChars(self.initCharsOrig) <NEW_LINE> self.re = re.compile( self.reString ) | A short-cut class for defining C{Word(characters, exact=1)},
when defining a match of any single character in a string of characters. | 625990306fece00bbaccca35 |
class HealthMonitorResponse(BaseHealthMonitorType): <NEW_LINE> <INDENT> id = wtypes.wsattr(wtypes.UuidType()) <NEW_LINE> name = wtypes.wsattr(wtypes.StringType()) <NEW_LINE> type = wtypes.wsattr(wtypes.text) <NEW_LINE> delay = wtypes.wsattr(wtypes.IntegerType()) <NEW_LINE> timeout = wtypes.wsattr(wtypes.IntegerType()) ... | Defines which attributes are to be shown on any response. | 625990306e29344779b016d5 |
class MovieComparator(StringComparator): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.a_year, self.b_year = None, None <NEW_LINE> self.a_quality, self.b_quality = qualities.UNKNOWN, qualities.UNKNOWN <NEW_LINE> self.parser = MovieParser() <NEW_LINE> super(MovieComparator, self).__init__(cutoff=0.9) ... | Compares two strings for similarity based on extracted movie title, year and quality. | 6259903015baa7234946301e |
class CircleMarkerWithXYZGeoContext(ipyleaflet.CircleMarker): <NEW_LINE> <INDENT> map = traitlets.Instance(ipyleaflet.Map, allow_none=True) <NEW_LINE> geoctx = traitlets.Instance(GeoContext, allow_none=True, read_only=True) <NEW_LINE> xy_3857 = traitlets.Tuple(allow_none=True, read_only=True) <NEW_LINE> @traitlets.obse... | CircleMarker that offers an XYZ-tile GeoContext containing its current location.
Just used as a place to cache the GeoContext so each InspectorRowGenerator
doesn't have to recompute it. | 62599030d99f1b3c44d06729 |
class HandleAllCode(object): <NEW_LINE> <INDENT> def process_request(self, request, spider): <NEW_LINE> <INDENT> request.meta.setdefault("handle_httpstatus_all", True) | handle all code | 625990305e10d32532ce4146 |
class XmlRpcInit(Environment): <NEW_LINE> <INDENT> def __init__(self, ticket, site=None): <NEW_LINE> <INDENT> super(XmlRpcInit,self).__init__() <NEW_LINE> if not site: <NEW_LINE> <INDENT> site = Site.get_site() <NEW_LINE> <DEDENT> self.set_app_server("xmlrpc") <NEW_LINE> self.ticket = ticket <NEW_LINE> Environment.set_... | Used to authenticate using a ticket from an xmlrpc client | 62599030c432627299fa407b |
class GhStatus: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> api_request = requests.get(GH_STATUS_API) <NEW_LINE> api_request.raise_for_status() <NEW_LINE> <DEDENT> except requests.exceptions.RequestException: <NEW_LINE> <INDENT> logger.error('Failed to get github:status api') <N... | Methods for getting current GitHub status. | 62599030d53ae8145f9194e9 |
class HasSettings(Protocol): <NEW_LINE> <INDENT> settings: typing.Dict[str, typing.Any] | Something that quacks like a tornado.web.Application. | 62599030d18da76e235b7991 |
class Providesb(Recipe): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Providesb, self).__init__() <NEW_LINE> self.homepage = 'dummy' <NEW_LINE> self.repos = { 'stable': Dummy() } <NEW_LINE> <DEDENT> def build(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def verify(self): <NEW_LINE> <INDENT> ... | Dummy recipe does nothing special but have dependency. | 6259903066673b3332c31477 |
class Style(object): <NEW_LINE> <INDENT> __slots__ = ("fg", "bg", "attrs") <NEW_LINE> COLORNAMES = { "black": COLOR_BLACK, "red": COLOR_RED, "green": COLOR_GREEN, "yellow": COLOR_YELLOW, "blue": COLOR_BLUE, "magenta": COLOR_MAGENTA, "cyan": COLOR_CYAN, "white": COLOR_WHITE, } <NEW_LINE> ATTRNAMES = { "blink": A_BLINK, ... | Store foreground color, background color and attribute (bold, underlined
etc.). | 6259903026238365f5fadbd9 |
class Flavor_disabled(extensions.ExtensionDescriptor): <NEW_LINE> <INDENT> name = "FlavorDisabled" <NEW_LINE> alias = "OS-FLV-DISABLED" <NEW_LINE> namespace = ("http://docs.openstack.org/compute/ext/" "flavor_disabled/api/v1.1") <NEW_LINE> updated = "2012-08-29T00:00:00+00:00" <NEW_LINE> def get_controller_extensions(s... | Support to show the disabled status of a flavor | 62599030be8e80087fbc0103 |
class BookViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Books.objects.all().order_by('id') <NEW_LINE> serializer_class = BookSerializer <NEW_LINE> permission_classes = [permissions.IsAuthenticatedOrReadOnly] <NEW_LINE> def get_paginated_response(self, data): <NEW_LINE> <INDENT> return Response(data) | API endpoint that allows books to be viewed or edited. | 62599030d4950a0f3b111681 |
class ATTEventHook(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def att_response_hook(self, received_packet, our_response_packet): <NEW_LINE> <INDENT> send_packet = True <NEW_LINE> log.debug("ATT response hook triggered. Received packet: %s Send packet: %s packet: %s" % ... | ATTEventHook is used by blesuite.pybt.att to allow the user to hook ATT operations triggered by a peer
ATT request. These hooks allow the user to view and/or modify outgoing ATT responses, incoming write requests,
and incoming long write requests (prepared write and execute write). | 62599030d6c5a102081e31ac |
class AnnualSurveyFolderView(OrgnizationsView): <NEW_LINE> <INDENT> grok.context(IAnnualSurveyFolder) <NEW_LINE> grok.template('annual_survey_folder') <NEW_LINE> grok.name('members_view') <NEW_LINE> grok.require('zope2.View') <NEW_LINE> def getLastYear(self): <NEW_LINE> <INDENT> id = (datetime.datetime.today() + dateti... | 信息公开,年检公告 | 62599030a8ecb033258722a5 |
class HacsRepositoryInfo(HacsBaseException): <NEW_LINE> <INDENT> pass | Raise this when repository info is missing/wrong. | 62599030d10714528d69eecf |
class WebSocketServer(tornado.websocket.WebSocketHandler): <NEW_LINE> <INDENT> def _get_ack(self, message_obj): <NEW_LINE> <INDENT> message = {"event": "ack", "data": message_obj['data']} <NEW_LINE> return json.dumps(message) <NEW_LINE> <DEDENT> def check_origin(self, origin): <NEW_LINE> <INDENT> return True <NEW_LINE>... | Tornado WebSocket server listening for Websocket messages. This class
consists of a reference to WebSocketHandler that gets called for each new
message. | 62599030d53ae8145f9194eb |
class choice(HyperoptProxy): <NEW_LINE> <INDENT> def __init__(self, options: list): <NEW_LINE> <INDENT> super().__init__(hyperopt_func=hyperopt.hp.choice, options=options) | :func:`hyperopt.hp.choice` proxy. | 62599030d18da76e235b7992 |
class TestSaltStackIntegration(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 testSaltStackIntegration(self): <NEW_LINE> <INDENT> pass | SaltStackIntegration unit test stubs | 6259903066673b3332c31479 |
class InternalObject(object): <NEW_LINE> <INDENT> is_binx_internal = True <NEW_LINE> registered_colls = set() <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.__dict__.update(kwargs) | a namespace class for instance checking for an internally used model object
It is otherwise a normal python object. _Internals are used as medium for
serialization and deserialization and their declarations bound with Collections and enforced by Serializers.
It can be inherited from or used as a Mixin. | 62599030b57a9660fecd2b0c |
class ProductNameField(PillarNameField): <NEW_LINE> <INDENT> @property <NEW_LINE> def _content_iface(self): <NEW_LINE> <INDENT> from lp.registry.interfaces.product import IProduct <NEW_LINE> return IProduct | Field used by IProduct.name. | 6259903056b00c62f0fb394a |
class Rcpod485(device.OpenedRcpod): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> device.OpenedRcpod.__init__(self, *args, **kwargs) <NEW_LINE> self.led1 = self.rc2 <NEW_LINE> self.led2 = self.rc1 <NEW_LINE> self.led1.output().assert_() <NEW_LINE> self.led2.output().assert_() <NEW_LINE> s... | Implements the special features of the rcpod-485 board.
This board includes two LEDs and an RS-485 transceiver. | 625990306e29344779b016d9 |
class Screen(object): <NEW_LINE> <INDENT> @property <NEW_LINE> def width(self): <NEW_LINE> <INDENT> return self._width <NEW_LINE> <DEDENT> @width.setter <NEW_LINE> def width(self, value): <NEW_LINE> <INDENT> self._width = value <NEW_LINE> <DEDENT> @property <NEW_LINE> def height(self): <NEW_LINE> <INDENT> return self._... | docstring for Screen. | 62599030796e427e5384f806 |
class BlockReference(object): <NEW_LINE> <INDENT> def __init__(self, name, context, stack, depth): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self._context = context <NEW_LINE> self._stack = stack <NEW_LINE> self._depth = depth <NEW_LINE> <DEDENT> @property <NEW_LINE> def super(self): <NEW_LINE> <INDENT> if self._... | One block on a template reference. | 62599030d53ae8145f9194ed |
class ErrorHandler(BaseCGIHandler): <NEW_LINE> <INDENT> os_environ = dict(list(os.environ.items())) <NEW_LINE> def __init__(self,**kw): <NEW_LINE> <INDENT> setup_testing_defaults(kw) <NEW_LINE> BaseCGIHandler.__init__( self, StringIO(''), StringIO(), StringIO(), kw, multithread=True, multiprocess=True ) | Simple handler subclass for testing BaseHandler | 6259903021bff66bcd723cef |
@attr.s(auto_attribs=True, frozen=True, slots=True) <NEW_LINE> class TraceRequestEndParams: <NEW_LINE> <INDENT> method: str <NEW_LINE> url: URL <NEW_LINE> headers: "CIMultiDict[str]" <NEW_LINE> response: ClientResponse | Parameters sent by the `on_request_end` signal | 625990301d351010ab8f4ba3 |
class AdbSmartSocketClient(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def connect(self, port=5037): <NEW_LINE> <INDENT> sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) <NEW_LINE> sock.connect(('127.0.0.1', port)) <NEW_LINE> self.sock = sock <NEW_LINE> <DEDENT>... | Implements the smartsockets system defined by:
https://android.googlesource.com/platform/system/core/+/master/adb/protocol.txt | 62599030711fe17d825e14e0 |
class DeleteMiembro(MiembroMixin, DeleteView): <NEW_LINE> <INDENT> template_name = 'miembros/delete_confirm.html' <NEW_LINE> @method_decorator(login_required) <NEW_LINE> def dispatch(self, *args, **kwargs): <NEW_LINE> <INDENT> return super(DeleteMiembro, self).dispatch(*args, **kwargs) <NEW_LINE> <DEDENT> def get_conte... | *Vista Basada en Clase para eliminar clientes*:
+ *template_name*: nombre del template a ser rendirizado
+ *success_url: url a ser redireccionada en caso de exito* | 62599030ec188e330fdf991e |
class FlowProperty(db.Property): <NEW_LINE> <INDENT> data_type = Flow <NEW_LINE> def get_value_for_datastore(self, model_instance): <NEW_LINE> <INDENT> flow = super(FlowProperty, self).get_value_for_datastore(model_instance) <NEW_LINE> return db.Blob(pickle.dumps(flow)) <NEW_LINE> <DEDENT> def make_value_from_datastore... | App Engine datastore Property for Flow.
Utility property that allows easy storage and retreival of an
oauth2client.Flow | 62599030a8ecb033258722a9 |
class SparseCoefMixin: <NEW_LINE> <INDENT> def densify(self): <NEW_LINE> <INDENT> msg = "Estimator, %(name)s, must be fitted before densifying." <NEW_LINE> check_is_fitted(self, msg=msg) <NEW_LINE> if sp.issparse(self.coef_): <NEW_LINE> <INDENT> self.coef_ = self.coef_.toarray() <NEW_LINE> <DEDENT> return self <NEW_LIN... | Mixin for converting coef_ to and from CSR format.
L1-regularizing estimators should inherit this. | 625990308e05c05ec3f6f6a1 |
class ShaderProgram(): <NEW_LINE> <INDENT> def __init__(self, context, modules): <NEW_LINE> <INDENT> self.stages = [] <NEW_LINE> for stage, spirv in modules.items(): <NEW_LINE> <INDENT> if not isinstance(spirv, bytes): <NEW_LINE> <INDENT> raise TypeError("shader must be a bytes object") <NEW_LINE> <DEDENT> module = Sha... | ShaderProgram
A `ShaderProgram` embed all `ShaderModule` of a `Pipeline`. | 62599030d164cc6175821ffe |
class QueriesMixinFactory(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def extend(cls, client, querybuilders): <NEW_LINE> <INDENT> class QueriesMixin(object): <NEW_LINE> <INDENT> builders = {} <NEW_LINE> def _getqueries(self): <NEW_LINE> <INDENT> if not hasattr(self, '_queries'): <NEW_LINE> <INDENT> self._queri... | Creates a QueriesMixin from a list of queries. | 6259903030c21e258be99898 |
class TestV1ObjectFieldSelector(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 testV1ObjectFieldSelector(self): <NEW_LINE> <INDENT> model = k8sv1.models.v1_object_field_selector.V1ObjectFieldSelec... | V1ObjectFieldSelector unit test stubs | 62599030287bf620b6272c73 |
class GetContactsWithQueryResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None) <NEW_LINE> <DEDENT> def get_AccessToken(self): <NEW_LINE> <INDENT> re... | A ResultSet with methods tailored to the values returned by the GetContactsWithQuery Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution. | 625990308c3a8732951f75e4 |
class Change(BaseHandler): <NEW_LINE> <INDENT> _validator_fields = [ Field('shopname', T_STR), Field('location', T_STR), Field('address', T_STR), Field('telephone', T_STR), Field('longitude', T_FLOAT), Field('latitude', T_FLOAT), Field('logo_url', T_STR), Field('head_img', T_STR), Field('city', T_STR), Field('province'... | 修改用户信息 | 62599030be8e80087fbc0109 |
class HKVError(Exception): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def for_name(cls, name): <NEW_LINE> <INDENT> desc = ERRORS[name] <NEW_LINE> return cls(desc[0], name, desc[1]) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def for_code(cls, code): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> name, description = ERRO... | HKVError(code, name, message) -> new instance
General exception for this module.
code is a numeric error code; name is a symbolic name for the error;
message is a human-readable description of the error; the three are
combined into the final exception message by the constructor. Users are
encouraged to use the factor... | 625990304e696a045264e668 |
class ISolgemaFullcalendarEvents(Interface): <NEW_LINE> <INDENT> pass | Solgema Fullcalendar update view interface | 6259903030c21e258be99899 |
class Person: <NEW_LINE> <INDENT> def __init__(self, fname, lname, birthyr): <NEW_LINE> <INDENT> self.fname = fname <NEW_LINE> self.lname = lname <NEW_LINE> self.birthyr = birthyr <NEW_LINE> <DEDENT> def greetings(self): <NEW_LINE> <INDENT> greet = "Hello and Welcom, " + self.fname + "." <NEW_LINE> return greet <NEW_LI... | A model of a person | 62599030ac7a0e7691f73575 |
class ISettlement(Interface): <NEW_LINE> <INDENT> pass | Settlement Type
| 6259903096565a6dacd2d7d5 |
class ArchiveHeader(NetAppObject): <NEW_LINE> <INDENT> _data = None <NEW_LINE> @property <NEW_LINE> def data(self): <NEW_LINE> <INDENT> return self._data <NEW_LINE> <DEDENT> @data.setter <NEW_LINE> def data(self, val): <NEW_LINE> <INDENT> if val != None: <NEW_LINE> <INDENT> self.validate('data', val) <NEW_LINE> <DEDENT... | Header that describes information about instances of sampled data.
If the requested timestamp is greater/newer than available in the archives,
we will return the most recent header. | 62599030d18da76e235b7995 |
class ManageUserView(generics.RetrieveUpdateAPIView): <NEW_LINE> <INDENT> serializer_class = UserSerializer <NEW_LINE> authentication_classes = (authentication.TokenAuthentication,) <NEW_LINE> permission_classes = (permissions.IsAuthenticated,) <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> return self.request.us... | Manage the authenticated user. | 625990301d351010ab8f4ba7 |
class PhotoGalleryView(ListView): <NEW_LINE> <INDENT> model = ImagerProfile <NEW_LINE> template_name = 'imager_images/photo_gallery.html' <NEW_LINE> context_object_name = 'data' <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super(PhotoGalleryView, self).get_context_data(**kwargs) <NEW_L... | All photos view. | 625990306fece00bbaccca3e |
class ServerUpdateParameters(Model): <NEW_LINE> <INDENT> _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, 'storage_profile': {'key': 'properties.storageProfile', 'type': 'StorageProfile'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, 'version': {'key': 'proper... | Parameters allowd to update for a server.
:param sku: The SKU (pricing tier) of the server.
:type sku: ~azure.mgmt.rdbms.mariadb.models.Sku
:param storage_profile: Storage profile of a server.
:type storage_profile: ~azure.mgmt.rdbms.mariadb.models.StorageProfile
:param administrator_login_password: The password of th... | 625990308a43f66fc4bf3215 |
class JWTCookieAuthentication(authentication.BaseAuthentication): <NEW_LINE> <INDENT> User = get_user_model() <NEW_LINE> def authenticate(self, request): <NEW_LINE> <INDENT> if not self.validate_csrf_header(request): <NEW_LINE> <INDENT> raise AuthenticationFailed("Custom header against CSRF attacks is not set") <NEW_LI... | A Django rest authentication class that will:
- Check that requests contains the anti-CSRF custom header
- Validate the JWT token received
- Returns the user | 6259903063f4b57ef00865ba |
class DomesticMelonOrder(AbstractMelonOrder): <NEW_LINE> <INDENT> def __init__(self, species, qty): <NEW_LINE> <INDENT> super(DomesticMelonOrder, self).__init__(species, qty, "domestic", 0.08) | A melon order within the USA. | 62599030d99f1b3c44d06733 |
class linkObj: <NEW_LINE> <INDENT> def __init__(self, link, name): <NEW_LINE> <INDENT> self.url = link <NEW_LINE> self.name = name | A container for relative links and their paired names | 6259903096565a6dacd2d7d6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.