code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class MetroSPSensor(Entity): <NEW_LINE> <INDENT> def __init__(self,name): <NEW_LINE> <INDENT> from metrosaopaulo import metrosaopaulo <NEW_LINE> self._state = None <NEW_LINE> self._name = name <NEW_LINE> self._metrosaopaulo = metrosaopaulo.MetroSaoPaulo() <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LI... | Representation of a Sensor. | 62598ee9796e427e5384ce8c |
class CT_ApplicationNonVisualDrawingProps(BaseElement): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(CT_ApplicationNonVisualDrawingProps, self).__init__() <NEW_LINE> self._element = Element(qtag('p:nvPr'), nsmap=nsmap) | Wrapper for ``<p:nvPr>`` element | 62598ee9d268445f26638f08 |
class UILoadableTestCase(unittest.TestCase): <NEW_LINE> <INDENT> pass | Test cases for UILoadable decorator | 62598ee976e4537e8c3edcad |
class UserDetail(generics.RetrieveAPIView): <NEW_LINE> <INDENT> serializer_class = UserSerializer <NEW_LINE> permission_classes = (permissions.IsAuthenticated,) <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return get_user_model().objects.filter(email=self.request.user.email) | Retrieve a user. | 62598ee976e4537e8c3edcae |
class PhaseTDSGStatistic(PhaseTDStatistic): <NEW_LINE> <INDENT> def __init__(self, files=None, ifos=None, **kwargs): <NEW_LINE> <INDENT> PhaseTDStatistic.__init__(self, files=files, ifos=ifos, **kwargs) <NEW_LINE> self.get_newsnr = ranking.get_newsnr_sgveto | PhaseTDStatistic but with sine-Gaussian veto added to the
single-detector ranking | 62598ee91f037a2d8b9e27fd |
class ApplicationVersionHandler(CreatingMixin, UpdatingMixin, DeletionMixin, DetailMixin, ModelFormHandler): <NEW_LINE> <INDENT> slug_url_kwarg = 'version' <NEW_LINE> slug_field = 'app_version' <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> kwargs = dict(app_name=self.path_kwargs['name']) <NEW_LINE> queryset = ... | Multiple operations with application versions. | 62598ee926068e7796d4b051 |
class ObjectConflictError(IndigoClientError): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return "Object already exists at {0}".format(self.msg) | Indigo object already exists Exception. | 62598ee966656f66f7d58ad5 |
class State(enum.IntEnum): <NEW_LINE> <INDENT> NoState = 0 <NEW_LINE> Running = 1 <NEW_LINE> Pending = 2 <NEW_LINE> Invalidated = 4 <NEW_LINE> NotReady = 8 | A workflow node's runtime state flags | 62598ee9a8370b77170eead8 |
class P2SHAddrEncoder(IAddrEncoder): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def EncodeKey(pub_key: Union[bytes, IPublicKey], **kwargs: Any) -> str: <NEW_LINE> <INDENT> net_ver_bytes = kwargs["net_ver"] <NEW_LINE> pub_key_obj = AddrKeyValidator.ValidateAndGetSecp256k1Key(pub_key) <NEW_LINE> return Base58Encoder.Ch... | P2SH address encoder class.
It allows the Pay-to-Script-Hash address encoding. | 62598ee9e5267d203ee69ffb |
class TasksAssignResource(Resource): <NEW_LINE> <INDENT> @jwt_required <NEW_LINE> def put(self, person_id): <NEW_LINE> <INDENT> (task_ids) = self.get_arguments() <NEW_LINE> if len(task_ids) > 0: <NEW_LINE> <INDENT> task = tasks_service.get_task(task_ids[0]) <NEW_LINE> user_service.check_manager_project_access(task["pro... | Assign given task lists to given person. If a given task ID is wrong,
it ignores it. | 62598ee9d7e4931a7ef3a795 |
class Invoice(BaseModel, Base): <NEW_LINE> <INDENT> __tablename__ = 'invoices' <NEW_LINE> invoice_number = Column(String(10), nullable=False) <NEW_LINE> date = Column(Date, nullable=True) <NEW_LINE> client_id = Column(String(60), ForeignKey('clients.id'), nullable=False) <NEW_LINE> client_name = Column(String(60), null... | Class Invoice | 62598ee9a8370b77170eead9 |
class miterlimit(attr.exclusiveattr, strokestyle): <NEW_LINE> <INDENT> def __init__(self, value=10.0): <NEW_LINE> <INDENT> attr.exclusiveattr.__init__(self, miterlimit) <NEW_LINE> self.value = value <NEW_LINE> <DEDENT> def processPS(self, file, writer, context, registry, bbox): <NEW_LINE> <INDENT> file.write("%f setmit... | miterlimit of paths | 62598ee966673b3332c2ea9d |
class ScriptDeployment(Deployment): <NEW_LINE> <INDENT> def __init__(self, script, name=None, delete=False): <NEW_LINE> <INDENT> script = self._get_string_value(argument_name='script', argument_value=script) <NEW_LINE> self.script = script <NEW_LINE> self.stdout = None <NEW_LINE> self.stderr = None <NEW_LINE> self.exit... | Runs an arbitrary Shell Script task. | 62598ee991f36d47f223021e |
class Verbose_action(argparse.Action): <NEW_LINE> <INDENT> def __call__(self, parser, namespace, values, option_string=None): <NEW_LINE> <INDENT> if values is None: <NEW_LINE> <INDENT> verbosity_level = 1 <NEW_LINE> <DEDENT> elif values.isdigit(): <NEW_LINE> <INDENT> verbosity_level = int(values) <NEW_LINE> <DEDENT> el... | Argparse action: Cumulative verbose switch '-v' counter | 62598ee963d6d428bbee0ec3 |
class Lab6(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.generator1 = lambda: normal(loc=5, scale=1) <NEW_LINE> self.generator2 = lambda: triangular(left=3, right=8, mode=(3 + 8) / 2.0) <NEW_LINE> self.generator3 = lambda: normal(loc=7, scale=2) <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> ... | Variant 13 | 62598ee9851cf427c66b69c6 |
class MIESPatchClamp(PatchClamp): <NEW_LINE> <INDENT> def __init__(self, manager, config, name): <NEW_LINE> <INDENT> self._headstage = config.pop('headstage') <NEW_LINE> self.mies = MIES.getBridge(True) <NEW_LINE> PatchClamp.__init__(self, manager, config, name) <NEW_LINE> <DEDENT> def autoPipetteOffset(self): <NEW_LIN... | PatchClamp device implemented over MIES bridge
| 62598ee9adb09d7d5dc08cbd |
class UserDetailsForm(Form): <NEW_LINE> <INDENT> name = TextField('Username', [validators.Required(),validators.Length(min=4, max=35)]) <NEW_LINE> email = TextField('Email', [validators.Required(),validators.Length(min=4, max=35)]) <NEW_LINE> institution = TextField('Institution', [validator... | 62598ee95fc7496912d475ed | |
class FishHistoryTest(test_lib.ParserTestCase): <NEW_LINE> <INDENT> def testParseFile(self): <NEW_LINE> <INDENT> parser = fish_history.FishHistoryParser() <NEW_LINE> storage_writer = self._ParseFile(['fish_history'], parser) <NEW_LINE> number_of_events = storage_writer.GetNumberOfAttributeContainers('event') <NEW_LINE>... | Tests for Fish History file parser. | 62598ee945492302aabfaba3 |
class Converter(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def convert(self, from_filename, to_filename): <NEW_LINE> <INDENT> if not isinstance(from_filename, str): <NEW_LINE> <INDENT> raise TypeError("Expecting the 'from_filename' to be a str, but got instead: " "{}".... | Converter
This converts one world / robot file to another one. | 62598ee9627d3e7fe0e0557f |
class RegularEvents(FitnessFunc): <NEW_LINE> <INDENT> def __init__(self, dt, p0=0.05, gamma=None): <NEW_LINE> <INDENT> self.dt = dt <NEW_LINE> self.p0 = p0 <NEW_LINE> self.gamma = gamma <NEW_LINE> <DEDENT> def validate_input(self, t, x, sigma): <NEW_LINE> <INDENT> unique_x = np.unique(x) <NEW_LINE> if list(unique_x) no... | Fitness for regular events
This is for data which has a fundamental "tick" length, so that all
measured values are multiples of this tick length. In each tick, there
are either zero or one counts.
Parameters
----------
dt : float
tick rate for data
gamma : float
specifies the prior on the number of bins: p ~ g... | 62598ee9fff4ab517ebcbecd |
class Fragment(_IkePayload): <NEW_LINE> <INDENT> def parse(self, data): <NEW_LINE> <INDENT> self._data = data[const.PAYLOAD_HEADER.size:self.length] <NEW_LINE> <DEDENT> def __init__(self, data=None, next_payload=Type.no_next_payload, critical=False, fragment=None): <NEW_LINE> <INDENT> super(Fragment, self).__init__(dat... | `Fragment Payload` | 62598ee9a219f33f346c4f30 |
class ReadPostsInputSet(InputSet): <NEW_LINE> <INDENT> def set_AccessToken(self, value): <NEW_LINE> <INDENT> super(ReadPostsInputSet, self)._set_input('AccessToken', value) <NEW_LINE> <DEDENT> def set_ActionID(self, value): <NEW_LINE> <INDENT> super(ReadPostsInputSet, self)._set_input('ActionID', value) <NEW_LINE> <DED... | An InputSet with methods appropriate for specifying the inputs to the ReadPosts
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 62598ee9097d151d1a2bf711 |
class Softmax(function.Function): <NEW_LINE> <INDENT> def __init__(self, use_cudnn=True): <NEW_LINE> <INDENT> self.use_cudnn = use_cudnn <NEW_LINE> <DEDENT> def check_type_forward(self, in_types): <NEW_LINE> <INDENT> type_check.expect(in_types.size() == 1) <NEW_LINE> x_type, = in_types <NEW_LINE> type_check.expect( x_t... | Softmax activation function. | 62598ee9b7558d5895461d3b |
class InscricaoManager(models.Manager): <NEW_LINE> <INDENT> def usuario_inscrito_curso(self, usuario, curso): <NEW_LINE> <INDENT> inscricao = self.filter( usuario=usuario, curso=curso, curso__publicado=True ) <NEW_LINE> if inscricao.count() == 1: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> return False <NEW_LIN... | Manager associado ao modelo UsuarioVideo | 62598ee938b623060ffa7790 |
class SensorBridgeCmdFirmwareUpdateBase(ShdlcCommand): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(SensorBridgeCmdFirmwareUpdateBase, self).__init__( 0xF3, *args, **kwargs) | SHDLC command 0xF3: "Firmware Update". | 62598ee997e22403b38395e6 |
class Command(BaseCommand): <NEW_LINE> <INDENT> def remove_save_signals(self): <NEW_LINE> <INDENT> signals.pre_save.receivers = [] <NEW_LINE> signals.post_save.receivers = [] <NEW_LINE> <DEDENT> def handle(self, *arguments, **options): <NEW_LINE> <INDENT> self.remove_save_signals() <NEW_LINE> fix_revisionless_posts(mod... | Command class for "fix_answer_counts"
| 62598ee95fdd1c0f98e5c698 |
class TimestampingMiddleware(object): <NEW_LINE> <INDENT> def process_request(self, request): <NEW_LINE> <INDENT> if 'admin_time' in request.session: <NEW_LINE> <INDENT> request.timestamp = request.session['admin_time'] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> request.timestamp = timezone.now() | Middleware which adds an attribute ``timestamp`` to each ``request``
object, representing the request time as :cls:`datetime.datetime`
instance.
It should be placed as close to the begging of the list of middlewares
as possible. | 62598ee9cad5886f8bdc39f8 |
class Viewport(object): <NEW_LINE> <INDENT> pass | TODO | 62598ee9f9cc0f698b1c4649 |
class QuaternionGroup(DiCyclicGroup): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> DiCyclicGroup.__init__(self, 2) <NEW_LINE> <DEDENT> def _repr_(self): <NEW_LINE> <INDENT> return "Quaternion group of order 8 as a permutation group" | The quaternion group of order 8.
OUTPUT:
The quaternion group of order 8, as a permutation group.
See the ``DiCyclicGroup`` class for a generalization of this
construction.
.. note::
This group is also available via ``groups.permutation.Quaternion()``.
EXAMPLES:
The quaternion group is one of two non-abelian ... | 62598ee9cc0a2c11144796fa |
class RequireOneFormSet(models_forms.BaseInlineFormSet): <NEW_LINE> <INDENT> def clean(self): <NEW_LINE> <INDENT> super(RequireOneFormSet, self).clean() <NEW_LINE> if not self.is_valid(): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> completed = 0 <NEW_LINE> for cleaned_data in self.cleaned_data: <NEW_LINE> <INDENT> i... | "
Requires at least one form in the formset to be completed. | 62598ee9d6c5a102081e0827 |
@admin.register(Questions) <NEW_LINE> class QuestionsAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ("question_text","pub_date") <NEW_LINE> search_fields = ("questions_text",) <NEW_LINE> inlines = [ChoiceInline] <NEW_LINE> pass | 创建 question 模型后台 | 62598ee9435de62698e9a4cd |
class BAGElevationGeoArray(compass_model.GeoArray): <NEW_LINE> <INDENT> class_kind = "BAG Elevation [geo array]" <NEW_LINE> @staticmethod <NEW_LINE> def can_handle(store, key): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> import cartopy.crs as ccrs <NEW_LINE> <DEDENT> except (ImportError, OSError): <NEW_LINE> <INDENT> ... | Represents a BAG elevation. | 62598ee9a8370b77170eeada |
class Embeddings(nn.Module): <NEW_LINE> <INDENT> def __init__(self, config, img_size, in_channels=3): <NEW_LINE> <INDENT> super(Embeddings, self).__init__() <NEW_LINE> self.hybrid = None <NEW_LINE> self.config = config <NEW_LINE> img_size = _pair(img_size) <NEW_LINE> if config.patches.get("grid") is not None: <NEW_LINE... | Construct the embeddings from patch, position embeddings.
| 62598ee9d7e4931a7ef3a796 |
class FilePackager(object): <NEW_LINE> <INDENT> fileCollection = None <NEW_LINE> ARCHIVE_PATH = 'cloud.archive/' <NEW_LINE> def __init__(self, path_infos=None): <NEW_LINE> <INDENT> self.fileCollection = {} <NEW_LINE> if path_infos: <NEW_LINE> <INDENT> for relPath, archive in path_infos: <NEW_LINE> <INDENT> if archive: ... | This class is responsible for the packaging of files | 62598ee971ff763f4b5e5e52 |
class CreateSolidBlock_result(object): <NEW_LINE> <INDENT> def __init__(self, success=None, e=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> self.e = e <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTranspor... | Attributes:
- success
- e | 62598ee999cbb53fe682f5a8 |
class ValThread(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, train_net, epoch): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self._train_net = train_net <NEW_LINE> self._epoch = epoch <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> tnet = self._train_net <NEW_LINE> vnet = tnet._val... | This subclass is needed to run the validation in a separate thread.
Hence, it's whole purpose is to create a validation session, restore
the latest weights and sweep through the validation batch. | 62598ee9442bda511e95ab58 |
class ImportMDBGR2(bpy.types.Operator, ImportHelper): <NEW_LINE> <INDENT> bl_idname = "import_scene.nwn2mdk" <NEW_LINE> bl_label = "Import MDB/GR2" <NEW_LINE> bl_options = {'UNDO', 'PRESET'} <NEW_LINE> filter_glob: StringProperty(default="*.mdb;*.gr2", options={'HIDDEN'}) <NEW_LINE> files: CollectionProperty( name="Fil... | Import MDB/GR2 | 62598ee94428ac0f6e656c49 |
class Invoice(models.Model): <NEW_LINE> <INDENT> product = models.ForeignKey("Product", on_delete=models.CASCADE, null=True) <NEW_LINE> user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) <NEW_LINE> class Status(models.TextChoices): <NEW_LINE> <INDENT> ISSUED = ( "ISSUED", "Issued", ) <NEW_LINE... | Invoice attributes | 62598ee991f36d47f223021f |
class StatusViewset(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = models.Status.objects.all() <NEW_LINE> serializer_class = serializers.StatusSerializer | API endpoint that allows statuses to be viewed or edited | 62598ee956b00c62f0fb0fc8 |
class FakeIniSection(object): <NEW_LINE> <INDENT> def __init__(self, fp): <NEW_LINE> <INDENT> self.fp = fp <NEW_LINE> self.sechead = '[header]\n' <NEW_LINE> <DEDENT> def readline(self): <NEW_LINE> <INDENT> if self.sechead: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return(self.sechead) <NEW_LINE> <DEDENT> finally: <N... | Wrapper to enable configparser to parse a file without sections. | 62598ee960cbc95b06362a36 |
class LinuxUserAccountsPluginTest(test_lib.ArtifactPreprocessorPluginTestCase): <NEW_LINE> <INDENT> _FILE_DATA = ( b'root:x:0:0:root:/root:/bin/bash\n' b'bin:x:1:1:bin:/bin:/sbin/nologin\n' b'daemon:x:2:2:daemon:/sbin:/sbin/nologin\n' b'adm:x:3:4:adm:/var/adm:/sbin/nologin\n' b'lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin\... | Tests for the Linux user accounts plugin. | 62598ee95fc7496912d475ee |
@admin.register(models.Room) <NEW_LINE> class RoomAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> inlines = (PhotoInline,) <NEW_LINE> fieldsets = ( ( "Basic Info", {"fields": ("name", "description", "country", "city", "address", "price")} ), ( "Times", {"fields": ("check_in", "check_out", "instant_book")} ), ( "Spaces", {... | Room Admin definition | 62598ee992d797404e387ef6 |
class RandomLocaleFaker: <NEW_LINE> <INDENT> def __init__(self, *locales): <NEW_LINE> <INDENT> self.fakers = [Faker(loc) for loc in locales] <NEW_LINE> <DEDENT> def __call__(self): <NEW_LINE> <INDENT> return random.choice(self.fakers) | Generate multiple fakers for different locales. | 62598ee9f548e778e5969c83 |
class scrape_meta: <NEW_LINE> <INDENT> def __init__(self, url): <NEW_LINE> <INDENT> self.url = url <NEW_LINE> <DEDENT> def scrape_url_meta(self): <NEW_LINE> <INDENT> scrape_url = self.url <NEW_LINE> html = requests.get(scrape_url) <NEW_LINE> soup = BeautifulSoup(html.text, "html.parser") <NEW_LINE> payload = {} <NEW_LI... | Class with methods and attributes to scarape meta information for a given url | 62598ee955399d3f05624c2c |
@six.add_metaclass(ABCMeta) <NEW_LINE> class StreamCollector(Plugin): <NEW_LINE> <INDENT> def __init__(self, name, version, **kwargs): <NEW_LINE> <INDENT> super(StreamCollector, self).__init__() <NEW_LINE> self.meta = Meta(PluginType.stream_collector, name, version, rpc_type=RPCType.grpc_stream, **kwargs) <NEW_LINE> se... | Abstract base class for 'stream_collector' plugins.
This class makes the creation of a snap 'stream_collector'
plugin as easy as possible. For instance, when a class inherits from
py:class:`snap_plugin.v1.stream_collector.StreamCollector` plugins can be created by
providing implementations for:
- :py:meth:`~snap... | 62598ee930dc7b766599df80 |
class LoggingServiceServicer(object): <NEW_LINE> <INDENT> def addLogEvent(self, request, context): <NEW_LINE> <INDENT> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!') <NEW_LINE> <DEDENT> def getLogE... | Missing associated documentation comment in .proto file. | 62598ee98e7ae83300ee7786 |
class ImageCreateView(generics.ListCreateAPIView): <NEW_LINE> <INDENT> queryset = Image.objects.all() <NEW_LINE> serializer_class = ImageSerializer <NEW_LINE> def perform_create(self, serializer): <NEW_LINE> <INDENT> serializer.save() | This class defines the create behavior of our rest api. | 62598ee94e4d562566370b11 |
class NodeDraftRegistrationsList(JSONAPIBaseView, generics.ListCreateAPIView, NodeMixin): <NEW_LINE> <INDENT> permission_classes = ( IsAdminContributor, drf_permissions.IsAuthenticatedOrReadOnly, base_permissions.TokenHasScope, ) <NEW_LINE> parser_classes = (JSONAPIMultipleRelationshipsParser, JSONAPIMultipleRelationsh... | The documentation for this endpoint can be found [here](https://developer.osf.io/#operation/nodes_draft_registrations_list).
| 62598ee9e76e3b2f99fd712e |
class WitchMatchingMultiTarget(WitchGradientMatching): <NEW_LINE> <INDENT> def _initialize_brew(self, victim, kettle): <NEW_LINE> <INDENT> super()._initialize_brew(victim, kettle) <NEW_LINE> self.target_grad, self.target_gnorm = [], [] <NEW_LINE> for target, intended_class in zip(self.targets, self.intended_classes): <... | Variant in which target gradients are matched separately. | 62598ee907f4c71912badb4d |
class joinGame_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'gameId', None, None, ), ) <NEW_LINE> def __init__(self, gameId=None,): <NEW_LINE> <INDENT> self.gameId = gameId <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerate... | Attributes:
- gameId | 62598ee997e22403b38395e8 |
class AbstractFileUnifier(AbstractUnifier, ABC): <NEW_LINE> <INDENT> __slots__ = ('output_filename', ) <NEW_LINE> file_extension: str = NotImplementedError <NEW_LINE> def __init__(self, schema: SCHEMAS, output_filename: str = None): <NEW_LINE> <INDENT> super().__init__(schema=schema) <NEW_LINE> self.output_filename = A... | Contains needed tools to unify provider data into a file.
:cvar file_extension: output file extension. | 62598ee9cad5886f8bdc39fa |
class KnowledgeBaseConfig(AppConfig): <NEW_LINE> <INDENT> name = 'resolwe_bio.kb' <NEW_LINE> label = 'resolwe_bio_kb' <NEW_LINE> verbose_name = 'Resolwe Bioinformatics Knowledge Base' | App configuration. | 62598ee92eb69b55b15a0706 |
class QubesNoTemplateError(QubesVMError): <NEW_LINE> <INDENT> pass | Cannot start domain, because there is no template | 62598ee956ac1b37e63008e5 |
class NodeForStack: <NEW_LINE> <INDENT> def __init__(self, item=None): <NEW_LINE> <INDENT> self.item = item <NEW_LINE> self.next = None | Вспомогательный класс
узел стека | 62598ee96aa9bd52df0d35aa |
class File(models.Model): <NEW_LINE> <INDENT> owner = models.ForeignKey(settings.AUTH_USER_MODEL, max_length=50, blank=True, null=True) <NEW_LINE> date = models.DateField(blank=True, null=True) <NEW_LINE> file = models.FileField(blank=True, null=True) <NEW_LINE> name = models.CharField(max_length=100, blank=True, null=... | Upload files | 62598ee9a17c0f6771d5a94c |
class DeviceViewerDeviceLocationSwitchPortGridRemote(RemoteModel): <NEW_LINE> <INDENT> properties = ("id", "DeviceID", "ifName", "VirtualNetworkMemberName", "VirtualNetworkID", "Network", "ifNameSort", "ifIndex", "macaddress", "switchname", "switchip", "peerid", "switchiface", "switchifaceSort", "peerintfindex", "peerD... | | ``id:`` none
| ``attribute type:`` string
| ``DeviceID:`` none
| ``attribute type:`` string
| ``ifName:`` none
| ``attribute type:`` string
| ``VirtualNetworkMemberName:`` none
| ``attribute type:`` string
| ``VirtualNetworkID:`` none
| ``attribute type:`` string
| ``Network:`` none
| ``attribute typ... | 62598ee90c0af96317c54a95 |
@dataclass <NEW_LINE> class ComplexCheckType: <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> name = "complexCheckType" <NEW_LINE> <DEDENT> check: List[CheckType] = field( default_factory=list, metadata={ "type": "Element", "namespace": XCCDF_1_1_NAMESPACE, } ) <NEW_LINE> complex_check: List["ComplexCheckType"] = f... | The type for an element that can contains a boolean expression based on
checks.
This element can have only
complex-check and check elements as children. It has two
attributes: operator and negate. The operator attribute
can have values "OR" or "AND", and the negate attribute is
boolean. See the specification docume... | 62598ee971ff763f4b5e5e54 |
class SyncMapPage(Page): <NEW_LINE> <INDENT> def __init__(self, version, response, solution): <NEW_LINE> <INDENT> super(SyncMapPage, self).__init__(version, response) <NEW_LINE> self._solution = solution <NEW_LINE> <DEDENT> def get_instance(self, payload): <NEW_LINE> <INDENT> return SyncMapInstance(self._version, paylo... | PLEASE NOTE that this class contains preview products that are subject
to change. Use them with caution. If you currently do not have developer
preview access, please contact help@twilio.com. | 62598ee930bbd7224646832c |
class UploaderError(STDError): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(UploaderError, self).__init__(*args, **kwargs) | Raised for Uploader exceptions | 62598ee999cbb53fe682f5aa |
class Solution: <NEW_LINE> <INDENT> def groupAnagrams(self, strs): <NEW_LINE> <INDENT> import collections <NEW_LINE> organization = collections.defaultdict(list) <NEW_LINE> for item in strs: <NEW_LINE> <INDENT> organization[''.join(sorted(item))].append(item) <NEW_LINE> <DEDENT> return [group for group in organization.... | Given an array of strings, group anagrams together.
Input: ["eat", "tea", "tan", "ate", "nat", "bat"],
Output:
[
["ate","eat","tea"],
["nat","tan"],
["bat"]
] | 62598ee9d7e4931a7ef3a799 |
class TargetValueStat(PmmlBinding): <NEW_LINE> <INDENT> def toPFA(self, options, context): <NEW_LINE> <INDENT> raise NotImplementedError | Represents a <TargetValueStat> tag and provides methods to convert to PFA. | 62598ee921bff66bcd72134c |
class RandomBrightness(object): <NEW_LINE> <INDENT> def __init__(self, p=0): <NEW_LINE> <INDENT> self.p = p <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def get_param(img, p): <NEW_LINE> <INDENT> if np.random.rand() > 0.5: <NEW_LINE> <INDENT> return img <NEW_LINE> <DEDENT> hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) <NE... | Randomly change the brightness, contrast and saturation of an image.
Args:
brightness (float or tuple of float (min, max)): How much to jitter brightness.
brightness_factor is chosen uniformly from [max(0, 1 - brightness), 1 + brightness]
or the given [min, max]. Should be non negative numbers.
... | 62598ee9be8e80087fbbd747 |
class Select(CloudFormationLintRule): <NEW_LINE> <INDENT> id = 'E1017' <NEW_LINE> shortdesc = 'Select validation of parameters' <NEW_LINE> description = 'Making sure the function not is of list' <NEW_LINE> source_url = 'https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-select.h... | Check if Select values are correct | 62598ee90c0af96317c54a96 |
class Port(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.required = [ "port_number","protocol"] <NEW_LINE> self.b_key = "port" <NEW_LINE> self.a10_url="/axapi/v3/slb/server/{name}/port/{port_number}+{protocol}/stats" <NEW_LINE> self.DeviceProxy ... | Class Description::
Statistics for the object port-diameter.
Class port supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param DeviceProxy: The device proxy for REST operations and session handling. Refer to `common/device_proxy.py`
URL for thi... | 62598ee999fddb7c1ca62181 |
class UniqueSetClassSimultaneities(featuresModule.FeatureExtractor): <NEW_LINE> <INDENT> id = 'CS2' <NEW_LINE> def __init__(self, dataOrStream=None, *arguments, **keywords): <NEW_LINE> <INDENT> featuresModule.FeatureExtractor.__init__(self, dataOrStream=dataOrStream, *arguments, **keywords) <NEW_LINE> self.name = 'Uniq... | Number of unique set class simultaneities.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.native.UniqueSetClassSimultaneities(s)
>>> fe.extract().vector
[12] | 62598ee9009cb60464cffc47 |
class OpenvswitchMechanismDriver(mech_agent.AgentMechanismDriverBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(OpenvswitchMechanismDriver, self).__init__( constants.AGENT_TYPE_OVS, portbindings.VIF_TYPE_OVS, True) <NEW_LINE> <DEDENT> def check_segment_for_agent(self, segment, agent): <NEW_LINE... | Attach to networks using openvswitch L2 agent.
The OpenvswitchMechanismDriver integrates the ml2 plugin with the
openvswitch L2 agent. Port binding with this driver requires the
openvswitch agent to be running on the port's host, and that agent
to have connectivity to at least one segment of the port's
network. | 62598ee9a79ad16197768715 |
class DictionaryWithBert(Dictionary): <NEW_LINE> <INDENT> def __init__(self, dic): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> for attr in ['unk_word', 'pad_word', 'eos_word', 'symbols', 'count', 'indices', 'bos_index', 'pad_index', 'eos_index', 'unk_index', 'nspecial', 'indices', ]: <NEW_LINE> <INDENT> setattr(s... | Dictionary for the BERT tokenizer.
This class does not append the EOS tokens at the end of sentences. | 62598ee966673b3332c2eaa1 |
class TestGetClusterhostLogHistories(ClusterTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestGetClusterhostLogHistories, self).setUp() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> super(TestGetClusterhostLogHistories, self).tearDown() <NEW_LINE> <DEDENT> def test_get_clusterh... | Test get clusterhost log histories. | 62598ee9851cf427c66b69ca |
class AndVariadicOperatorExpression(VariadicOperatorExpression): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(AndVariadicOperatorExpression, self).__init__( 'and', all, *args, **kwargs) | The boolean 'and' operator expression. | 62598ee960cbc95b06362a38 |
class HttpRequestInfo(object): <NEW_LINE> <INDENT> def __init__(self, client_info, method: str, requested_host: str, requested_port: int, requested_path: str, headers: list): <NEW_LINE> <INDENT> self.method = method <NEW_LINE> self.client_address_info = client_info <NEW_LINE> self.requested_host = requested_host <NEW_L... | Represents a HTTP request information | 62598ee9e1aae11d1e7cdbbc |
class TestNumBuses(unittest.TestCase): <NEW_LINE> <INDENT> def test_num_buses_example_1(self): <NEW_LINE> <INDENT> actual = a1.num_buses(0) <NEW_LINE> expected = 0 <NEW_LINE> self.assertEqual(expected, actual) <NEW_LINE> <DEDENT> def test_num_buses_example_2(self): <NEW_LINE> <INDENT> actual = a1.num_buses(49) <NEW_LIN... | Test class for function a1.num_buses. | 62598ee955399d3f05624c2e |
class EditorApiTests(APITestCase, _BaseSetting): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> _BaseSetting.setUp(self) <NEW_LINE> <DEDENT> def test_list(self): <NEW_LINE> <INDENT> url = rf_reverse('v1:editor:editors-list') <NEW_LINE> self.client.login(username='trump', password='CrookedHillary') <NEW_LINE> ... | Test Editor API | 62598ee992d797404e387ef7 |
class ErrorPage(TemplatePage): <NEW_LINE> <INDENT> _page_title="Error" <NEW_LINE> _template_label="error" <NEW_LINE> def __init__(self,server,exception): <NEW_LINE> <INDENT> self.exception=exception <NEW_LINE> TemplatePage.__init__(self,server) <NEW_LINE> <DEDENT> def get_context(self,request): <NEW_LINE> <INDENT> cont... | Generate an error page.
HTTP method accepted:
all, served by `self.get()`. | 62598ee97047854f4633dacd |
class DatasetDetails(DictCompatibleModel): <NEW_LINE> <INDENT> id: str <NEW_LINE> name: str <NEW_LINE> is_public: bool | Pydantic model to parse DatasetDetails response from JSON | 62598ee98e7ae83300ee7789 |
class PlatformValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> PLATFORM_UNSPECIFIED = 0 <NEW_LINE> GKE = 1 <NEW_LINE> FLEX = 2 <NEW_LINE> CUSTOM = 3 | Platform hosting this deployment.
Values:
PLATFORM_UNSPECIFIED: Unknown.
GKE: Google Container Engine.
FLEX: Google App Engine: Flexible Environment.
CUSTOM: Custom user-defined platform. | 62598ee94428ac0f6e656c4c |
class AmbiguousMove(Exception): <NEW_LINE> <INDENT> def __init__(self, moves, change): <NEW_LINE> <INDENT> self.moves = moves <NEW_LINE> self.change = change | Raised when move_to finds multiple possible moves | 62598ee91b99ca400228e88a |
class PrivateTagsApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = get_user_model().objects.create_user( 'test@kalalokia.com', 'pass1234' ) <NEW_LINE> self.client = APIClient() <NEW_LINE> self.client.force_authenticate(self.user) <NEW_LINE> <DEDENT> def test_retrieve_tags(self): <... | Test the authorized user tags API | 62598ee9097d151d1a2bf715 |
class ArrangedElementCollection(object,IList,ICollection,IEnumerable): <NEW_LINE> <INDENT> def CopyTo(self,array,index): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Equals(self,obj): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def GetEnumerator(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def GetHashCode(s... | Represents a collection of objects. | 62598ee9d7e4931a7ef3a79a |
class LogoutView(View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> if request.user.is_authenticated(): <NEW_LINE> <INDENT> django_logout(request) <NEW_LINE> <DEDENT> return redirect('home') | Vista basada en clase para el logout. Tendremos que definir los métodos del HTTP get y post | 62598ee901c39578d7f114a4 |
class ColorSelector(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._colors = {} <NEW_LINE> <DEDENT> def get(self, clu, cluster_ids=None, cluster_group=None, alpha=None): <NEW_LINE> <INDENT> alpha = alpha or .5 <NEW_LINE> if cluster_group in ('noise', 'mua'): <NEW_LINE> <INDENT> color = (.5,) ... | Return the color of a cluster.
If the cluster belongs to the selection, returns the colormap color.
Otherwise, return a random color and remember this color. | 62598ee97cff6e4e811b40e8 |
class BrepEdgeList(object,IEnumerable[BrepEdge],IEnumerable,IRhinoTable[BrepEdge]): <NEW_LINE> <INDENT> def Add(self,*__args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def GetEnumerator(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def SplitEdgeAtParameters(self,edgeIndex,edgeParameters): <NEW_LINE> <INDENT> ... | Provides access to all the Edges in a Brep object. | 62598ee91f037a2d8b9e2802 |
class GsLogByAuthorCommand(WindowCommand, GitCommand): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> sublime.set_timeout_async(self.run_async, 0) <NEW_LINE> <DEDENT> def run_async(self): <NEW_LINE> <INDENT> name = self.git("config", "user.name").strip() <NEW_LINE> email = self.git("config", "user.email").strip... | Open a quick panel containing all committers for the active
repository, ordered by most commits, Git name, and email.
Once selected, display a quick panel with all commits made
by the specified author. | 62598ee98e71fb1e983ba166 |
class Operator(object): <NEW_LINE> <INDENT> OPERATOR_UNSPECIFIED = 0 <NEW_LINE> AND = 1 | A composite filter operator.
Attributes:
OPERATOR_UNSPECIFIED (int): Unspecified. This value must not be used.
AND (int): The results are required to satisfy each of the combined filters. | 62598ee971ff763f4b5e5e57 |
class cmyk(color): <NEW_LINE> <INDENT> def __init__(self, c=0.0, m=0.0, y=0.0, k=0.0): <NEW_LINE> <INDENT> color.__init__(self) <NEW_LINE> if c<0 or c>1 or m<0 or m>1 or y<0 or y>1 or k<0 or k>1: raise ValueError <NEW_LINE> self.color = {"c": c, "m": m, "y": y, "k": k} <NEW_LINE> <DEDENT> def processPS(self, file, writ... | cmyk colors | 62598ee90c0af96317c54a97 |
class WebhookCreateParameters(Model): <NEW_LINE> <INDENT> _validation = { 'location': {'required': True}, 'service_uri': {'required': True}, 'actions': {'required': True}, } <NEW_LINE> _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'service_uri': {'key': 'pr... | The parameters for creating a webhook.
:param tags: The tags for the webhook.
:type tags: dict[str, str]
:param location: The location of the webhook. This cannot be changed after
the resource is created.
:type location: str
:param service_uri: The service URI for the webhook to post notifications.
:type service_uri:... | 62598ee930bbd7224646832e |
class abstractproperty(property): <NEW_LINE> <INDENT> __isabstractmethod__ = True | A decorator indicating abstract properties.
Requires that the metaclass is :py:class:`AbstractBase` or derived from
it. A class that has a metaclass derived from :py:class:`AbstractBase`
cannot be instantiated unless all of its abstract properties are
overridden. The abstract properties can be called using any of the ... | 62598ee9fff4ab517ebcbed2 |
class Solution: <NEW_LINE> <INDENT> def kSmallestPairs(self, nums1, nums2, k): <NEW_LINE> <INDENT> if not nums1 or not nums2 or k <= 0: <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> pq = [(nums1[0] + nums2[0], 0, 0)] <NEW_LINE> result = [] <NEW_LINE> while pq and k > 0: <NEW_LINE> <INDENT> val, col1, col2 = heapq.h... | @param nums1: List[int]
@param nums2: List[int]
@param k: an integer
@return: return List[List[int]] | 62598ee9796e427e5384ce93 |
class RegistrationForm(forms.Form): <NEW_LINE> <INDENT> username = fields.CharField(required=True) <NEW_LINE> email = fields.EmailField(required=True) <NEW_LINE> password = fields.CharField(widget=forms.PasswordInput) <NEW_LINE> password1 = fields.CharField(widget=forms.PasswordInput, label="Re-enter password") <NEW_LI... | A form for the first step of user registration.
User enters their desired username, along with their email address
for identity confirmation. | 62598ee9d58c6744b42db633 |
class frequency (A_Frequency) : <NEW_LINE> <INDENT> kind = Attr.Necessary <NEW_LINE> example = "2.412 GHz" | Center frequency of this channel | 62598ee92ae34c7f260a97e2 |
class I2CHatSwitch(ToggleEntity): <NEW_LINE> <INDENT> I2C_HATS_MANAGER = None <NEW_LINE> def __init__( self, board, address, channel, name, invert_logic, initial_state): <NEW_LINE> <INDENT> self._board = board <NEW_LINE> self._address = address <NEW_LINE> self._channel = channel <NEW_LINE> self._name = name or DEVICE_D... | Represents a switch that uses a I2C-HAT digital output. | 62598ee9e5267d203ee6a001 |
class Meta(object): <NEW_LINE> <INDENT> model = models.Category | Model meta class. | 62598ee9d6c5a102081e082c |
class OrgTypeList(APIView): <NEW_LINE> <INDENT> def get(self, request, format=None): <NEW_LINE> <INDENT> queryset = OrgType.objects.all() <NEW_LINE> pagination_class = ObjectPageNumberPagination <NEW_LINE> paginator = pagination_class() <NEW_LINE> if request.method == 'GET' and 'page' in request.GET: <NEW_LINE> <INDENT... | get: List all the org types (COA and COP). | 62598ee9435de62698e9a4d1 |
class OldIdentifier(str): <NEW_LINE> <INDENT> def __init__(self, o=None): <NEW_LINE> <INDENT> if not isinstance(o, str) or len(o) < 1 or len(o) > 55: <NEW_LINE> <INDENT> raise ValueError("OldIdentifier must be between 1 and 55 characters.") | The old identifier which will be replaced. | 62598ee9d486a94d0ba2a6c9 |
class TruncateToCylinderProcessor(ImageDataProcessor): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.handle = None <NEW_LINE> self.name = 'TruncateToCylindricalFOVImageProcessor' <NEW_LINE> self.handle = pystir.cSTIR_newObject(self.name) <NEW_LINE> check_status(self.handle) <NEW_LINE> <DEDENT> def __... | Class for the image filter that zeroes the image outside the cylinder
of the same xy-diameter and z-size as those of the image. | 62598ee93cc13d1c6d463e6b |
class StatsCollector(object): <NEW_LINE> <INDENT> def __init__(self, logger=None, debug=False): <NEW_LINE> <INDENT> if logger: <NEW_LINE> <INDENT> self.logger = logger <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.logger = logging <NEW_LINE> <DEDENT> self.debug = debug <NEW_LINE> self.config = configuration.GetCon... | Takes a list of files and makes sure they're put in a database. | 62598ee97b25080760ed5b94 |
class Get_Pixel_Array(object): <NEW_LINE> <INDENT> def __init__(self, indexable, pixelist): <NEW_LINE> <INDENT> self.indexable = indexable <NEW_LINE> self.pixelist = pixelist <NEW_LINE> try: <NEW_LINE> <INDENT> self.length = len(indexable) <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> self.length = indexable.length <... | Dec 16, 2015, Y.G.@CHX
a class to get intested pixels from a images sequence,
load ROI of all images into memory
get_data: to get a 2-D array, shape as (len(images), len(pixellist))
One example:
data_pixel = Get_Pixel_Array( imgsr, pixelist).get_data() | 62598ee910dbd63aa1c6f26f |
class AddCustomHeaderFilter(): <NEW_LINE> <INDENT> implements(IRequestFilter) <NEW_LINE> def filterRequest(self,request): <NEW_LINE> <INDENT> request.received_headers["Custom-Header"] = "Custom Header Value" | Implements just a request filter | 62598ee94428ac0f6e656c4e |
class Enemy: <NEW_LINE> <INDENT> def __init__(self, name, hp, damage): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.hp = hp <NEW_LINE> self.damage = damage <NEW_LINE> <DEDENT> def is_alive(self): <NEW_LINE> <INDENT> return self.hp > 0 | base class | 62598ee9097d151d1a2bf717 |
class ShuffleDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, input_dataset, buffer_size, seed=None, reshuffle_each_iteration=None): <NEW_LINE> <INDENT> super(ShuffleDataset, self).__init__() <NEW_LINE> self._input_dataset = input_dataset <NEW_LINE> self._buffer_size = ops.convert_to_tensor( buffer_size, dtype=... | A `Dataset` that randomly shuffles the elements of its input. | 62598ee97047854f4633dacf |
class BulkCampaignImageAdExtension(_BulkCampaignAdExtensionAssociation): <NEW_LINE> <INDENT> pass | Represents an campaign level image ad extension.
This class exposes properties that can be read and written
as fields of the Campaign Image Ad Extension record in a bulk file.
For more information, see Campaign Image Ad Extension at http://go.microsoft.com/fwlink/?LinkID=511836.
*See also:*
* :class:`.BulkServiceMa... | 62598ee9b7558d5895461d41 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.