code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class SpaceTokenizer(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> sys.stderr.write("Using SpaceTokenizer.\n") <NEW_LINE> <DEDENT> def process(self, line): <NEW_LINE> <INDENT> return " ".join(line.split())
Fall-back is no tokenizer is available
62598f917d847024c075c011
class DistribBranchLevel(DistribMessage): <NEW_LINE> <INDENT> def __init__(self, conn, value=None): <NEW_LINE> <INDENT> self.conn = conn <NEW_LINE> self.value = value <NEW_LINE> <DEDENT> def make_network_message(self): <NEW_LINE> <INDENT> msg = bytearray() <NEW_LINE> msg.extend(self.pack_object(self.value)) <NEW_LINE> ...
Distrib code: 4
62598f91287bf620b62717fc
class Admins: <NEW_LINE> <INDENT> bot = None <NEW_LINE> def __init__(self, bot): <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> <DEDENT> async def __local_check(self, ctx): <NEW_LINE> <INDENT> return await self.bot.is_admin(ctx) <NEW_LINE> <DEDENT> @commands.command(name='addEmote', pass_context=True) <NEW_LINE> async d...
Admins only commands
62598f910c0af96317c55fc4
class Unregister(Message): <NEW_LINE> <INDENT> MESSAGE_TYPE = 66 <NEW_LINE> def __init__(self, request, registration): <NEW_LINE> <INDENT> assert (type(request) is int) <NEW_LINE> assert (type(registration) is int) <NEW_LINE> Message.__init__(self) <NEW_LINE> self.request = request <NEW_LINE> self.registration = regist...
A WAMP `UNREGISTER` message. Format: ``[UNREGISTER, Request|id, REGISTERED.Registration|id]``
62598f91b5575c28eb712aec
@unique <NEW_LINE> class ColorHSVPrime(Enum): <NEW_LINE> <INDENT> BLUE = [90, 70, 100], [115, 255, 255], False <NEW_LINE> RED = [15, 70, 100], [170, 255, 255], True <NEW_LINE> GREEN = [40, 70, 100], [85, 255, 255], False <NEW_LINE> ANY = [0, 70, 140], [179, 255, 255], False
MIN HSV, MAX HSV, Invert Hue (bool)
62598f91dd821e528d6d8b73
class alipay_batch_trans_notify_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.I16, 'success', None, None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProt...
Attributes: - success
62598f9124f1403a926856d0
class PriorityQueue: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.queue = [] <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self.queue) <NEW_LINE> <DEDENT> def append(self, key): <NEW_LINE> <INDENT> if key is None: <NEW_LINE> <INDENT> raise ValueError('Cannot insert None in th...
Heap-based priority queue implementation.
62598f91eab8aa0e5d30b9bf
class Filters(ConfigVar): <NEW_LINE> <INDENT> name = "filters" <NEW_LINE> known_values = ["ide", "edit", "ideonly", "editonly"] <NEW_LINE> def add_options(self, optparser): <NEW_LINE> <INDENT> optparser.add_option("-F", "--filter", dest="filters", action="append", help="specify one or more Komodo app names to include i...
Filter strings for limiting the doc set to parts relevant to the given Komodo applications. By default no filtering is done (empty filter list). If the '-f|--filter' option is used, then it is a list of app name strings to *include*. Filter strings are the set of Komodo app names: ide edit
62598f91be383301e0253443
class LC2CL(object): <NEW_LINE> <INDENT> def __call__(self, tensor): <NEW_LINE> <INDENT> return tensor.transpose(0, 1).contiguous() <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return self.__class__.__name__ + '()'
Permute a 2d tensor from samples (Length) x Channels to Channels x samples (Length)
62598f919b70327d1c57e9e1
class ConsumerForm(ServiceChoiceForm): <NEW_LINE> <INDENT> consumer = forms.ChoiceField() <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(ConsumerForm, self).__init__(*args, **kwargs) <NEW_LINE> self.fields['consumer'].choices = self.activated_services( self.initial['provider']) <NEW_LINE> sel...
Set some HTML class to the Consumer form
62598f9163d6d428bbee23fd
class DocumentSetFormEntry(forms_builder.forms.models.AbstractFormEntry): <NEW_LINE> <INDENT> form = models.ForeignKey("DocumentSetForm", related_name='entries') <NEW_LINE> document = models.ForeignKey('Document', related_name='form_entries', blank=True, null=True) <NEW_LINE> user = models.ForeignKey(User, blank=True, ...
A :class:`forms_builder.forms.models.AbstractFormEntry` plus foreign keys to the :class:`User` and filled the form and the :class:`Document` it belongs to
62598f91435de62698e9ba32
class QuestionnaireGroupQuestion(fhirelement.FHIRElement): <NEW_LINE> <INDENT> resource_name = "QuestionnaireGroupQuestion" <NEW_LINE> def __init__(self, jsondict=None): <NEW_LINE> <INDENT> self.concept = None <NEW_LINE> self.group = None <NEW_LINE> self.linkId = None <NEW_LINE> self.options = None <NEW_LINE> self.repe...
Questions in this group. Set of questions within this group. The order of questions within the group is relevant.
62598f91dc8b845886d531fe
class _CommandCfdSolver(CfdCommand): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(_CommandCfdSolver, self).__init__() <NEW_LINE> self.resources = {'Pixmap': 'cfd-solver-standard', 'MenuText': QtCore.QT_TRANSLATE_NOOP("Cfd_Solver", "Create CFD solver"), 'Accel': "C, S", 'ToolTip': QtCore.QT_TRANSLAT...
Command to create OpenFOAM solver for CFD anlysis
62598f918e71fb1e983bb6f5
class InterestViewSet(viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> queryset = Interest.objects.all() <NEW_LINE> serializer_class = InterestSerializer
An Interest is something I enjoy. Use this API to get access to some of my many Interests.
62598f91f7d966606f747c24
class Credentials(object): <NEW_LINE> <INDENT> def __init__(self, client_key, secret_key): <NEW_LINE> <INDENT> if client_key == '' or secret_key == '': <NEW_LINE> <INDENT> raise GeneralError('Emtpy credentials.', 'The credentials you have entered are invalid.') <NEW_LINE> <DEDENT> self.client_key = client_key <NEW_LINE...
An object that holds information about client and secret key.
62598f9110dbd63aa1c707fe
class BlasterProjectile(Projectile): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(BlasterProjectile, self).__init__(*args, **kwargs) <NEW_LINE> self.type = proto.blaster <NEW_LINE> <DEDENT> def on_hit(self, player=None, norm=0): <NEW_LINE> <INDENT> posx = self.center.x <NEW_LINE> p...
docstring for BlasterProjectile
62598f91507cdc57c63a49d4
class Commands(Items): <NEW_LINE> <INDENT> inner_class = Command
Class to manage all commands A command is an external command the poller module run to see if something is ok or not
62598f9107d97122c42168ef
class XBRLDocument(object): <NEW_LINE> <INDENT> def __init__(self, xbrl_url, gets_xbrl): <NEW_LINE> <INDENT> self._xbrl_url = xbrl_url <NEW_LINE> self._xbrl_dict_ = None <NEW_LINE> self._contexts = {} <NEW_LINE> self._get_xbrl = gets_xbrl <NEW_LINE> <DEDENT> @property <NEW_LINE> def _xbrl_dict(self): <NEW_LINE> <INDENT...
wrapper for XBRL documents, lazily downloads XBRL text.
62598f91d486a94d0ba2bc14
class PageTranslationsField(Field): <NEW_LINE> <INDENT> def get_attribute(self, instance): <NEW_LINE> <INDENT> return instance <NEW_LINE> <DEDENT> def to_representation(self, page): <NEW_LINE> <INDENT> serializer_class = get_serializer_class( Page, [ "id", "type", "detail_url", "html_url", "locale", "title", "admin_dis...
Serializes the page's translations. Example: "translations": [ { "id": 1, "meta": { "type": "home.HomePage", "detail_url": "/api/v1/pages/1/", "locale": "es" }, "title": "Casa" }, { "id": 2, "meta": { "type": "h...
62598f9176d4e153a661c85c
class TmpClass(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def all_reduce_worker(self, input, output): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def barrier_worker(self): <NEW_LINE> <INDENT> pass
dummy tmp class
62598f9163b5f9789fe84db6
class UsefulLife(BSElement): <NEW_LINE> <INDENT> element_type = "xs:decimal"
Productive life that can be expected of measure or a project. (yrs)
62598f91b7558d589546326f
class BaseWorker: <NEW_LINE> <INDENT> def __init__( self, task_sem: asyncio.Semaphore, result_q: Queue[RawResult], tasks: List[Tuple[str, Entry]], keymanager: KeyManager, ) -> None: <NEW_LINE> <INDENT> self.task_sem = task_sem <NEW_LINE> self.result_q = result_q <NEW_LINE> self.keymanager = keymanager <NEW_LINE> self.t...
The base class for defining `Worker` classes for source plugins. .. py:attribute:: task_sem :type: asyncio.Semaphore This is the rate-limiting semaphore. Workers should acquire it while doing one unit of work. .. py:attribute:: result_q :type: Queue[RawResult] Results should be put into this queue. ...
62598f91442bda511e95c0a4
class RegistrationForm(ModelForm): <NEW_LINE> <INDENT> first_name = forms.fields.CharField( max_length = 25, widget = forms.TextInput(attrs={'placeholder':'Victr'}), ) <NEW_LINE> last_name = forms.fields.CharField( max_length = 25, widget = forms.TextInput(attrs={'placeholder':'Appleseed'}), ) <NEW_LINE> email ...
Attributes defined here are found in RegistrationForm.fields It seems that the reason we have fields specified below as attributes is because this form has to gather information for both auth.User and victr.UserProfile
62598f9124f1403a926856d1
class Solution: <NEW_LINE> <INDENT> def sqrt(self, x): <NEW_LINE> <INDENT> i = 0 <NEW_LINE> j = x <NEW_LINE> if x == 1: <NEW_LINE> <INDENT> return 1 <NEW_LINE> <DEDENT> while j - i > 1: <NEW_LINE> <INDENT> m = int((i + j) / 2) <NEW_LINE> if m * m > x: <NEW_LINE> <INDENT> j = m <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDE...
@param x: An integer @return: The sqrt of x
62598f91009cb60464d01171
class CardFace(Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'type_line': {'key': 'type_line', 'type': 'str'}, 'oracle_text': {'key': 'oracle_text', 'type': 'str'}, 'mana_cost': {'key': 'mana_cost', 'type': 'str'}, 'colors': {'key': 'colors', 'type': '[Colors]'}, 'color_indicato...
CardFace. :param name: :type name: str :param type_line: :type type_line: str :param oracle_text: :type oracle_text: str :param mana_cost: :type mana_cost: str :param colors: :type colors: list[str or ~scryfall.models.Colors] :param color_indicator: :type color_indicator: list[str or ~scryfall.models.Colors] :param po...
62598f9138b623060ffa8ccc
class ByPoll(OrgPermsMixin, PollRunListMixin, smartmin.SmartListView): <NEW_LINE> <INDENT> fields = ('conducted_on', 'region', 'participants', 'responses') <NEW_LINE> link_fields = ('conducted_on', 'participants', 'responses') <NEW_LINE> @classmethod <NEW_LINE> def derive_url_pattern(cls, path, action): <NEW_LINE> <IND...
Poll Runs filtered by poll
62598f91596a8972361278be
class Subscribe(component): <NEW_LINE> <INDENT> Outboxes = { "outbox" : "", "signal" : "shutdown signalling", "_toService" : "request to service", } <NEW_LINE> def __init__(self, servicename, *requests): <NEW_LINE> <INDENT> super(Subscribe,self).__init__() <NEW_LINE> self.servicename = servicename <NEW_LINE> se...
Subscribes to a service, and forwards what it receives to its outbox. Also forwards anything that arrives at its inbox to its outbox. Unsubscribes when shutdown.
62598f912ae34c7f260aad2c
class Message(): <NEW_LINE> <INDENT> __slots__ = ["message", "prop_dict"] <NEW_LINE> def __init__(self, msg): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> temp = str(msg, config.CODING) <NEW_LINE> <DEDENT> except TypeError: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> msg.keys() <NEW_LINE> <DEDENT> except AttributeErro...
Класс сообщений, кодирует/декодирует для передачи м/у клиентом/сервером. Ожидает байты или словарь. Делает проверки, ошибка всегда в словаре сообщения. Если не может раскодировать до словаря, формирует ответ об ошибке.
62598f9116aa5153ce400142
class TerminologyCapabilitiesCodeSystemVersion(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_type = Field("TerminologyCapabilitiesCodeSystemVersion", const=True) <NEW_LINE> code: fhirtypes.String = Field( None, alias="code", title="Version identifier for this version", description=( "For version-less c...
Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Version of Code System supported. For the code system, a list of versions that are supported by the server.
62598f9173bcbd0ca4bc9e98
class Resource(object): <NEW_LINE> <INDENT> def __init__(self, controller, deserializer=None, serializer=None): <NEW_LINE> <INDENT> self.controller = controller <NEW_LINE> self.serializer = serializer or ResponseSerializer() <NEW_LINE> self.deserializer = deserializer or RequestDeserializer() <NEW_LINE> <DEDENT> @webob...
WSGI app that handles (de)serialization and controller dispatch. Reads routing information supplied by RoutesMiddleware and calls the requested action method upon its deserializer, controller, and serializer. Those three objects may implement any of the basic controller action methods (create, update, show, index, del...
62598f9199cbb53fe6830b1a
class StructReader: <NEW_LINE> <INDENT> def __init__(self, *structDef, size:int=None): <NEW_LINE> <INDENT> _checkSize = size <NEW_LINE> self.fields = {} <NEW_LINE> self.orderedFields = [] <NEW_LINE> offset = 0 <NEW_LINE> for field in structDef: <NEW_LINE> <INDENT> conv = None <NEW_LINE> if type(field) is tuple: <NEW_LI...
Reads a struct from a binary file or buffer, and returns a dict with named fields.
62598f9116aa5153ce400143
class MockElastic(object): <NEW_LINE> <INDENT> ingest = MockElasticIngest()
Mock of Elasticsearch client
62598f913617ad0b5ee05d8d
class FooterTile(Tile): <NEW_LINE> <INDENT> @property <NEW_LINE> def year(self): <NEW_LINE> <INDENT> return date.today().year
A footer tile
62598f91e76e3b2f99fd8679
class CouldNotBegin(DatabaseError): <NEW_LINE> <INDENT> pass
The database was unable to start the transaction.
62598f91b7558d5895463270
class NoSC(SourceControl): <NEW_LINE> <INDENT> def get_name(self): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> def get_version_label(self): <NEW_LINE> <INDENT> suffix = datetime.datetime.now().strftime("%y%m%d_%H%M%S") <NEW_LINE> return 'app-' + suffix <NEW_LINE> <DEDENT> def get_current_branch(self): <NEW_LINE...
No source control installed
62598f91a05bb46b3848a4c2
class ColorSchemeFileError(ChainableError): <NEW_LINE> <INDENT> pass
Error raised when Onboard can't comprehend color scheme definition file.
62598f9101c39578d7f129ca
class Topology(Model): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'created_date_time': {'readonly': True}, 'last_modified': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'created_date_time': {'key': 'createdDateTime', 'type': 'iso-8601'}, 'last_modified': {'k...
Topology of the specified resource group. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: GUID representing the operation id. :vartype id: str :ivar created_date_time: The datetime when the topology was initially created for the resource group. :vartype created_date_...
62598f91498bea3a75a5776c
class RestoreCommand(Command): <NEW_LINE> <INDENT> def __init__(self, **services: typing.Any) -> None: <NEW_LINE> <INDENT> super().__init__( "_restore", syntax="<STATIC> [pretty=<PRETTY>]", help_string="Set the hostname of the system.", file=__file__, **services ) <NEW_LINE> <DEDENT> def validate( self, location: Locat...
The _restore command.
62598f917d847024c075c015
class Quota(namedtuple('Quota', ['resource', 'units', 'allocated', 'used'])): <NEW_LINE> <INDENT> pass
Represents a quota available to a tenancy. Attributes: resource: The resource that the quota is for. units: The units of the quota. For a unit-less quota, use ``None``. allocated: The amount of the resource that has been allocated. used: The amount of the resource that has been used.
62598f918da39b475be02e24
class PlaylistsProvider(object): <NEW_LINE> <INDENT> pykka_traversable = True <NEW_LINE> def __init__(self, backend): <NEW_LINE> <INDENT> self.backend = backend <NEW_LINE> self._playlists = [] <NEW_LINE> <DEDENT> @property <NEW_LINE> def playlists(self): <NEW_LINE> <INDENT> return copy.copy(self._playlists) <NEW_LINE> ...
A playlist provider exposes a collection of playlists, methods to create/change/delete playlists in this collection, and lookup of any playlist the backend knows about. :param backend: backend the controller is a part of :type backend: :class:`mopidy.backend.Backend` instance
62598f91009cb60464d01173
class PlkActionsWidget(QtGui.QWidget): <NEW_LINE> <INDENT> def __init__(self, parent=None, **kwargs): <NEW_LINE> <INDENT> super(PlkActionsWidget, self).__init__(parent, **kwargs) <NEW_LINE> self.parent = parent <NEW_LINE> self.updatePlot = None <NEW_LINE> self.reFit_callback = None <NEW_LINE> self.hbox = QtGui.QHBoxLay...
A widget that shows some action items, like re-fit, write par, write tim, etc. These items are shown as buttons
62598f91cc0a2c111447ac56
class MetadataApplication(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'id': {'required': True}, 'resource_id': {'required': True}, 'name': {'required': True}, 'region': {'required': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'resource_id': {'key': 'resourceId', 'type...
Application Insights apps that were part of the metadata request and that the user has access to. All required parameters must be populated in order to send to Azure. :param id: Required. The ID of the Application Insights app. :type id: str :param resource_id: Required. The ARM resource ID of the Application Insight...
62598f9145492302aabfc11b
class JSONWebTokenAuthentication(BaseAuthentication): <NEW_LINE> <INDENT> www_authenticate_realm = 'api' <NEW_LINE> auth_header_prefix = 'JWT' <NEW_LINE> def get_jwt_value(self, request): <NEW_LINE> <INDENT> auth = get_authorization_header(request).split() <NEW_LINE> auth_header_prefix = self.auth_header_prefix.lower()...
Token based authentication using the JSON Web Token standard. Clients should authenticate by passing the token key in the "Authorization" HTTP header, prepended with the string "JWT". .. code-block:: Authorization: JWT eyJhbGciOiAiSFMyNTYiLCAidHlwIj...
62598f91596a8972361278bf
class ExportFormatSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> url = serializers.HyperlinkedIdentityField( view_name='api:formats-detail', lookup_field='slug' ) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = ExportFormat <NEW_LINE> fields = ('uid', 'url', 'slug', 'name', 'description')
Representation of ExportFormat.
62598f91d7e4931a7ef3bce5
class BlogAdvertPlacement(Orderable, models.Model): <NEW_LINE> <INDENT> blog_index_page = ParentalKey( "wagtailapp.BlogIndexPage", on_delete=models.CASCADE, related_name="advert_placements", ) <NEW_LINE> its_advert = models.ForeignKey( to='wagtailapp.AdvertSnippet', related_name = "+" ) <NEW_LINE> class Meta: <NEW_LINE...
WE ARE FORCED TO CREATE THIS CLASS because we do not want to relate the snippet itself directly with the blog index page
62598f910c0af96317c55fc9
class Named(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> <DEDENT> title = models.CharField(_("Title"), max_length=500) <NEW_LINE> description = models.TextField( "Description (135 Chars)", max_length=135, blank=True, default='') <NEW_LINE> reverse_name = None <NEW_LINE> ...
Todo: Should be a mixin that required some field be nominated as a title, a description and a slug. And, be able to supress the requirement if you don't want a field, like you want title adn slug, but no description. This could the basis for less classes.
62598f91e5267d203ee6b55f
class Architecture(sqlobject.SQLObject): <NEW_LINE> <INDENT> name = sqlobject.UnicodeCol(length=40, unique=True, notNone=True) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return u"Architecture: %s" % self.name
One of: 'sparc', 'x86'.
62598f9145492302aabfc11c
class open_channel(base.IOInstruction): <NEW_LINE> <INDENT> __slots__ = [] <NEW_LINE> code = base.opcodes['OPEN_CHANNEL'] <NEW_LINE> arg_format = ['rw','r']
OPEN_CHANNEL i j Opens channel number rj for reading/writing on the IO class. Channels are assumed to be bi-directional, i.e. can read and write. This is provided as some IO classes may require this to be called explicitly, the default one does not need this. The return value r_i *can* be some error code which the IO c...
62598f918c0ade5d55dc34af
class VersionsAndBuildsCommercial(VersionsAndBuilds): <NEW_LINE> <INDENT> def name(self): <NEW_LINE> <INDENT> return "versions_and_builds_commercial" <NEW_LINE> <DEDENT> def title(self): <NEW_LINE> <INDENT> return "Houdini Commercial Versions and Builds" <NEW_LINE> <DEDENT> def show_just_apprentice(self): <NEW_LINE> <I...
Houdini Commercial versions and builds. Pie Charts.
62598f9196565a6dacd2cd9c
class GmailService(): <NEW_LINE> <INDENT> def __init__(self, token) -> None: <NEW_LINE> <INDENT> self._token = token <NEW_LINE> self._gmail_service = None <NEW_LINE> <DEDENT> def load_gmail_resource(self) -> None: <NEW_LINE> <INDENT> logging.info('Getting an authenticated gmail resource') <NEW_LINE> res = None <NEW_LIN...
Fetches the resource object after authenticating with the Gmail service. Also provides member functions to search for and retrieve email messages. Attributes: _token: The authentication token _gmail_service: The authenticated gmail resource
62598f9116aa5153ce400145
class USStateSelect(Select): <NEW_LINE> <INDENT> def __init__(self, attrs=None): <NEW_LINE> <INDENT> from django.contrib.localflavor.us.us_states import STATE_CHOICES <NEW_LINE> super(USStateSelect, self).__init__(attrs, choices=STATE_CHOICES)
A Select widget that uses a list of U.S. states/territories as its choices.
62598f91925a0f43d25e7c80
class Action(object): <NEW_LINE> <INDENT> def __init__(self, caption, icon=None): <NEW_LINE> <INDENT> self._caption = caption <NEW_LINE> self._icon = icon <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return ((self._caption == other.getCaption()) and (self._icon == other.getIcon())) <NEW_LINE> <DEDEN...
Implements the action framework. This class contains subinterfaces for action handling and listing, and for action handler registrations and unregistration. @author: Vaadin Ltd. @author: Richard Lincoln @version: @VERSION@
62598f9107f4c71912baf08e
class Modem(LB2120): <NEW_LINE> <INDENT> pass
Class for any modem.
62598f91f7d966606f747c28
class UrlRewriteNyaa(object): <NEW_LINE> <INDENT> def validator(self): <NEW_LINE> <INDENT> from flexget import validator <NEW_LINE> root = validator.factory() <NEW_LINE> root.accept('choice').accept_choices(CATEGORIES) <NEW_LINE> advanced = root.accept('dict') <NEW_LINE> advanced.accept('choice', key='category').accept...
Nyaa urlrewriter and search plugin.
62598f91a8ecb03325870e4c
class Handler(BaseHTTPRequestHandler): <NEW_LINE> <INDENT> def _set_headers(self): <NEW_LINE> <INDENT> self.send_response(200) <NEW_LINE> self.send_header('Content-type', 'application/json') <NEW_LINE> self.end_headers() <NEW_LINE> <DEDENT> def do_GET(self): <NEW_LINE> <INDENT> self._set_headers() <NEW_LINE> uname = os...
This is the actual code called when GET/POST arrives
62598f9107f4c71912baf08f
class NotNullableAttribute(Exception): <NEW_LINE> <INDENT> pass
Raised when the attribute is not nullable and the user is trying to a None value.
62598f91d486a94d0ba2bc18
class Fixture(object): <NEW_LINE> <INDENT> def __init__(self, data, name, app_name, request_path, request_method, is_response=True): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.name = name <NEW_LINE> self.app_name = app_name <NEW_LINE> self.request_path = request_path <NEW_LINE> self.request_method = request_m...
The fixture object represents a single file containing the request or response payload. It also keeps track of additional metadata required to store itself in the generated fixture directory. TODO: - polymorph on mime type :param data: the fixture payload :param name: the name of the fixture (e.g. used as a filename)...
62598f9101c39578d7f129cc
class AvatarSupport(db.Model): <NEW_LINE> <INDENT> avatar_height = db.PositiveIntegerField(verbose_name=_("height"), default=None, blank=True, null=True, editable=False) <NEW_LINE> avatar_width = db.PositiveIntegerField(verbose_name=_("width"), default=None, blank=True, null=True, editable=False) <NEW_LINE> avatar_fiel...
Enables getting the user's gravatar by using the ``model.avatar_{size}`` attribute notation. Works in both code and templates. Possible values for `size`: * h{height} - scale to match the height given. Example: "h100" scales to 100px in height. Width is scaled proportionally, may exceed 10...
62598f91d99f1b3c44d052f2
class CargoViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Cargo.objects.all() <NEW_LINE> serializer_class = CargoSerializer <NEW_LINE> permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
list: Retorna uma lista com todos os cargos cadastrados no sistema. read: Retorna um cargo. create: Cria um novo cargo no banco do sistema. update: Atualiza todos os campos. partial_update: Atualizar somente os campos alterados. delete: Apaga um cargo do banco.
62598f91a79ad16197769ca4
class GuardedCircuitBuilder(CircuitBuilder): <NEW_LINE> <INDENT> def __init__(self, guards, *a, **kw): <NEW_LINE> <INDENT> super().__init__(*a, **kw) <NEW_LINE> self.guards = [stem_utils.fp_or_nick_to_relay(self.controller, g) for g in guards] <NEW_LINE> if len(self.guards) > len([g for g in self.guards if g]): <NEW_LI...
Like RandomCircuitBuilder, but the first hop will always be one of the specified relays chosen uniformally at random. There's no promise that the last hop will be an exit.
62598f91b57a9660fecd16c5
class VpnDownloadConfigView(BaseConfigView): <NEW_LINE> <INDENT> model = Vpn <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> vpn = self.get_object(*args, **kwargs) <NEW_LINE> bad_request = forbid_unallowed(request, 'GET', 'key', vpn.key) <NEW_LINE> if bad_request: <NEW_LINE> <INDENT> return bad_...
returns configuration archive as attachment
62598f91be8e80087fbbeca2
class AugmentorList(ImageAugmentor): <NEW_LINE> <INDENT> def __init__(self, augmentors): <NEW_LINE> <INDENT> self.augs = augmentors <NEW_LINE> super(AugmentorList, self).__init__() <NEW_LINE> <DEDENT> def _get_augment_params(self, img): <NEW_LINE> <INDENT> raise RuntimeError("Cannot simply get parameters of a Augmentor...
Augment by a list of augmentors
62598f91bde94217f370748b
class TestApiExperimentStorageState(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return ApiEx...
ApiExperimentStorageState unit test stubs
62598f91ec188e330fdf84e8
class StateUserMixin(AbstractStateUser): <NEW_LINE> <INDENT> state = foreign_key(StateMixin.state)
Mixin for user model that adds state support
62598f9138b623060ffa8cd0
class StringElement(RectangularElement): <NEW_LINE> <INDENT> def __init__(self, width, height, text, **kwargs): <NEW_LINE> <INDENT> self.text = text <NEW_LINE> super().__init__(width, height, **kwargs)
A string, geez
62598f917b25080760ed70f6
class _FileInFile(object): <NEW_LINE> <INDENT> def __init__(self, fileobj, offset, size, blockinfo=None): <NEW_LINE> <INDENT> self.fileobj = fileobj <NEW_LINE> self.offset = offset <NEW_LINE> self.size = size <NEW_LINE> self.position = 0 <NEW_LINE> if blockinfo is None: <NEW_LINE> <INDENT> blockinfo = [(0, size)] <NEW_...
A thin wrapper around an existing File object that provides a part of its data as an individual File object.
62598f9123e79379d538c14b
class Rectangle(Base): <NEW_LINE> <INDENT> def __init__(self, width, height, x=0, y=0, id=None): <NEW_LINE> <INDENT> super().__init__(id) <NEW_LINE> self.width = width <NEW_LINE> self.height = height <NEW_LINE> self.x = x <NEW_LINE> self.y = y <NEW_LINE> <DEDENT> def to_dictionary(self): <NEW_LINE> <INDENT> result = {}...
Circle
62598f916e29344779b0029e
class CliHashmapGroupCreate(command.Command): <NEW_LINE> <INDENT> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(CliHashmapGroupCreate, self).get_parser(prog_name) <NEW_LINE> parser.add_argument('-n', '--name', help='Group name.', required=True) <NEW_LINE> return parser <NEW_LINE> <DEDENT> def take...
Create a group.
62598f9107d97122c42168f4
class MessageModelTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> User.query.delete() <NEW_LINE> Message.query.delete() <NEW_LINE> Follows.query.delete() <NEW_LINE> self.client = app.test_client() <NEW_LINE> <DEDENT> def test_message_model(self): <NEW_LINE> <INDENT> u = User( email="test@te...
Test views for messages.
62598f9129b78933be269f00
class JiraLogout(JiraHookCommand): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.endpoint = '/rest/auth/1/session' <NEW_LINE> <DEDENT> def __call__(self, url, session): <NEW_LINE> <INDENT> result = session.delete(url + self.endpoint) <NEW_LINE> print(result.status_code)
Must be called to not leave the user logged in when the hook operation is finished!
62598f911f037a2d8b9e3d26
class WebsiteUser(HttpUser): <NEW_LINE> <INDENT> tasks = {GoodsTest:2} <NEW_LINE> @task <NEW_LINE> def index_page(self): <NEW_LINE> <INDENT> pass
Main class
62598f91cb5e8a47e493bf95
class ServerProxy(metaclass=ABCMeta): <NEW_LINE> <INDENT> @abstractclassmethod <NEW_LINE> def start_test(self, router_name, test_name) -> bool: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractclassmethod <NEW_LINE> def get_routers(self) -> List[Router]: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractclassm...
A proxy model for inter-process communication between the server runtime and clients like CLI and WebServer. Read the method description carefully! The behaviour may be different as expected. Normally the method will be executed remotely on the server and the return value is given by copy and not by reference!
62598f9173bcbd0ca4bc9e9c
class LogoutView(SuccessURLAllowedHostsMixin, TemplateView): <NEW_LINE> <INDENT> next_page = None <NEW_LINE> redirect_field_name = REDIRECT_FIELD_NAME <NEW_LINE> template_name = 'registration/logged_out.html' <NEW_LINE> extra_context = None <NEW_LINE> @method_decorator(never_cache) <NEW_LINE> def dispatch(self, request...
Logs out the user and displays 'You are logged out' message.
62598f9196565a6dacd2cd9d
class CashNote: <NEW_LINE> <INDENT> def __init__(self, value, used=0): <NEW_LINE> <INDENT> self.__value = value <NEW_LINE> self.__used = used <NEW_LINE> <DEDENT> def value(self): <NEW_LINE> <INDENT> return self.__value <NEW_LINE> <DEDENT> def used(self): <NEW_LINE> <INDENT> return self.__used <NEW_LINE> <DEDENT> def di...
Classe responsável por modelar uma nota específica.
62598f9107d97122c42168f5
class FileTestCase(AbstractTestCase): <NEW_LINE> <INDENT> def test_init(self): <NEW_LINE> <INDENT> kwargs = dict( bucket='bucket_id', hash='hash', mimetype='mimetype', filename='filename', frame='frame_id' ) <NEW_LINE> f = File(**kwargs) <NEW_LINE> assert f.bucket == Bucket(id=kwargs['bucket']) <NEW_LINE> assert f.hash...
Test case for the File class.
62598f91e76e3b2f99fd867d
class InfiniteCylinder(QuadricGM): <NEW_LINE> <INDENT> def __init__(self, diameter): <NEW_LINE> <INDENT> self._R = diameter/2. <NEW_LINE> QuadricGM.__init__(self) <NEW_LINE> <DEDENT> def _normals(self, verts, dirs): <NEW_LINE> <INDENT> hit = N.dot(N.linalg.inv(self._working_frame), N.vstack((verts.T, N.ones(verts.shape...
A cylindrical surface infinitely long on the Z axis.
62598f913c8af77a43b67d5d
class RESTfulDocConverter(object): <NEW_LINE> <INDENT> map = Mapper() <NEW_LINE> map.resource('doc', 'docs') <NEW_LINE> cache_manager = None <NEW_LINE> template_dir = os.path.join(os.path.dirname(__file__), 'templates') <NEW_LINE> def __init__(self, cache_dir=None): <NEW_LINE> <INDENT> self.cache_dir = cache_dir <NEW_L...
A WSGI app that caches and converts office documents via LibreOffice. It acts as a RESTful document store that supports HTTP actions to add/modify/retrieve converted documents. Accepted arguments: - `cache_dir`: Path to a directory, where cached files can be stored. The directory is created if it does not ex...
62598f913539df3088ecbf06
class Client(test.Client): <NEW_LINE> <INDENT> def post(self, url, data=None, **kw): <NEW_LINE> <INDENT> if data is None: <NEW_LINE> <INDENT> data = {} <NEW_LINE> <DEDENT> if hasattr(data, 'items'): <NEW_LINE> <INDENT> data = urllib.urlencode(data) <NEW_LINE> kw['content_type'] = URL_ENCODED <NEW_LINE> <DEDENT> return ...
Test client that uses form-urlencoded (like browsers).
62598f9101c39578d7f129ce
class ObservationData(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> app_label = 'signalbox' <NEW_LINE> verbose_name = "Supplementary data" <NEW_LINE> verbose_name_plural = "Supplementary data" <NEW_LINE> <DEDENT> observation = models.ForeignKey('signalbox.Observation') <NEW_LINE> key = models.CharF...
Log objects saved each time something happens for an Observation.
62598f9132920d7e50bc5ca6
@PROPOSAL_GENERATOR_REGISTRY.register() <NEW_LINE> class RPN(nn.Module): <NEW_LINE> <INDENT> def __init__(self, cfg, input_shape: Dict[str, ShapeSpec]): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.min_box_side_len = cfg.MODEL.PROPOSAL_GENERATOR.MIN_SIZE <NEW_LINE> self.in_features = cfg.MO...
Region Proposal Network, introduced by the Faster R-CNN paper.
62598f91851cf427c66b7f0b
@dataclass <NEW_LINE> class DataTrainingArguments: <NEW_LINE> <INDENT> dataset_name: str = field( default=None, metadata={"help": "The name of the dataset to use (via the datasets library)."} ) <NEW_LINE> dataset_config_name: Optional[str] = field( default=None, metadata={"help": "The configuration name of the dataset ...
Arguments pertaining to what data we are going to input our model for training and eval.
62598f914428ac0f6e658170
class _Self(object): <NEW_LINE> <INDENT> def __call__(self, referrer, environ): <NEW_LINE> <INDENT> if referrer is None: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> scheme, netloc, path, _params, _query, _fragment = urlparse(referrer) <NEW_LINE> if scheme != environ['wsgi.url_scheme']: return False <NEW_LINE> ...
Accept referrers that are part of the request url. http://localhost/foo/ for http://localhost/foo/bar.png
62598f9124f1403a926856d4
class threadsafe_iter: <NEW_LINE> <INDENT> def __init__(self, it): <NEW_LINE> <INDENT> self.it = it <NEW_LINE> self.lock = threading.Lock() <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def __next__(self): <NEW_LINE> <INDENT> return next(self.it)
Takes an iterator/generator and makes it thread-safe by serializing call to the `next` method of given iterator/generator.
62598f91be383301e025344b
class ColumnTreeTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_tree_delete_success(self): <NEW_LINE> <INDENT> tree = BinaryTree() <NEW_LINE> tree.insert('aa', 'xaxx') <NEW_LINE> tree.insert('ab', 'xbxx') <NEW_LINE> tree.insert('ac', 'xcxx') <NEW_LINE> tree.insert('ad', 'xdxx') <NEW_LINE> tree.insert('ae', 'xexx...
Quick and dirty tests for our BinaryTree implementation.
62598f91dd821e528d6d8b7c
class am_vehicle_miles_traveled_to_DDD(abstract_travel_time_variable_for_non_interaction_dataset): <NEW_LINE> <INDENT> _return_type = "float32" <NEW_LINE> default_value = 999 <NEW_LINE> origin_zone_id = 'zone.zone_id' <NEW_LINE> travel_data_attribute = 'travel_data.am_vehicle_miles_traveled' <NEW_LINE> def __init__(sel...
Calculate the vehicle miles traveled to the zone given by DDD.
62598f91a79ad16197769ca7
class RegistrationManager(models.Manager): <NEW_LINE> <INDENT> def activate_user(self, activation_key): <NEW_LINE> <INDENT> if SHA1_RE.search(activation_key): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> profile = self.get(activation_key=activation_key) <NEW_LINE> <DEDENT> except self.model.DoesNotExist: <NEW_LINE> <IN...
Custom manager for the ``RegistrationProfile`` model. The methods defined here provide shortcuts for account creation and activation (including generation and emailing of activation keys), and for cleaning out expired inactive accounts.
62598f919b70327d1c57e9e9
class ClientAuth: <NEW_LINE> <INDENT> def __init__(self, clientId=_CLIENT_ID, clientSecret=_CLIENT_SECRET, username=_USERNAME, password=_PASSWORD): <NEW_LINE> <INDENT> postParams = { 'grant_type': 'password', 'client_id': clientId, 'client_secret': clientSecret, 'username': username, 'password': password, 'scope': 'rea...
Request authentication and keep access token available through token method. Renew it automatically if necessary.
62598f91596a8972361278c4
class ExampleException(Exception): <NEW_LINE> <INDENT> pass
This is a demonstration exception docstring. It spreads across multiple lines.
62598f917cff6e4e811b5662
class RemoveMenuPopover(Gtk.PopoverMenu): <NEW_LINE> <INDENT> def __init__(self, rows): <NEW_LINE> <INDENT> Gtk.PopoverMenu.__init__(self) <NEW_LINE> self.__rows = rows <NEW_LINE> button = Gtk.ModelButton.new() <NEW_LINE> if len(rows) == 1: <NEW_LINE> <INDENT> button.set_label(_("Remove track")) <NEW_LINE> <DEDENT> els...
Contextual menu for removing Rows
62598f911f037a2d8b9e3d28
class TextTests(TestCase): <NEW_LINE> <INDENT> def test_not_text(self): <NEW_LINE> <INDENT> self.assertThat( format.text()(b'hello'), Is(None)) <NEW_LINE> <DEDENT> def test_text(self): <NEW_LINE> <INDENT> self.assertThat( format.text()(u'\N{SNOWMAN}'), ExactlyEquals(u'\N{SNOWMAN}'))
Tests for `eliottree.format.text`.
62598f910383005118f6d344
class Random: <NEW_LINE> <INDENT> def __init__(self, seed): <NEW_LINE> <INDENT> self.seed = seed <NEW_LINE> <DEDENT> def rand(self): <NEW_LINE> <INDENT> self.seed = (self.seed * 214013 + 2531011) & 0xffffffff <NEW_LINE> value = (self.seed >> 16) & 0x7fff <NEW_LINE> return value
MSVC's srand()/rand() like pseudorandom generator.
62598f9191af0d3eaad39a4d
class AggregateIoOpsFilter(IoOpsFilter): <NEW_LINE> <INDENT> def _get_max_io_ops_per_host(self, host_state, filter_properties): <NEW_LINE> <INDENT> aggregate_vals = utils.aggregate_values_from_db( filter_properties['context'], host_state.host, 'max_io_ops_per_host') <NEW_LINE> try: <NEW_LINE> <INDENT> value = utils.val...
AggregateIoOpsFilter with per-aggregate the max io operations. Fall back to global max_io_ops_per_host if no per-aggregate setting found.
62598f913c8af77a43b67d5e
class YamdlRouter(object): <NEW_LINE> <INDENT> DEFAULT_DB_ALIAS = "yamdl" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.yamdl_app = apps.get_app_config("yamdl") <NEW_LINE> <DEDENT> def _is_yamdl(self, obj): <NEW_LINE> <INDENT> return getattr(obj, "__yamdl__", False) <NEW_LINE> <DEDENT> def db_for_read(self, m...
Database router that intercepts models marked as being managed by us.
62598f91379a373c97d98c64
class JWKOctTest(unittest.TestCase, JWKTestBaseMixin): <NEW_LINE> <INDENT> thumbprint = (b"\xf3\xe7\xbe\xa8`\xd2\xdap\xe9}\x9c\xce>" b"\xd0\xfcI\xbe\xcd\x92'\xd4o\x0e\xf41\xea" b"\x8e(\x8a\xb2i\x1c") <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> from acme.jose.jwk import JWKOct <NEW_LINE> self.jwk = JWKOct(key=b'foo'...
Tests for acme.jose.jwk.JWKOct.
62598f91097d151d1a2c0c74
class PlanNestedRetrieveMixin(object): <NEW_LINE> <INDENT> def retrieve(self, request, pk=None, plan_pk=None, **kwargs): <NEW_LINE> <INDENT> comment = get_object_or_404(self.queryset, pk=pk, plan_id=int(plan_pk)) <NEW_LINE> serializer = self.get_serializer(comment) <NEW_LINE> return Response(serializer.data)
/plans/<plan_pk>/favs/<id>/ のようなネストされた要素の詳細をGETするmixin
62598f91a05bb46b3848a4c7
class ITorqueNodeInfo(IComponentInfo): <NEW_LINE> <INDENT> status = schema.Text(title=u"Status", group="Overview", readonly=True) <NEW_LINE> operStatus = schema.Text(title=u"Operational Status", group="Overview", readonly=True) <NEW_LINE> np = schema.Int(title=u"Processors", group="Details", readonly=True) <NEW_LINE> p...
Info adapter for ITorqueNodeInfo components.
62598f91cb5e8a47e493bf96
class WallPaper(TLObject): <NEW_LINE> <INDENT> __slots__: List[str] = ["id", "access_hash", "slug", "document", "creator", "default", "pattern", "dark", "settings"] <NEW_LINE> ID = 0xa437c3ed <NEW_LINE> QUALNAME = "types.WallPaper" <NEW_LINE> def __init__(self, *, id: int, access_hash: int, slug: str, document: "raw.ba...
This object is a constructor of the base type :obj:`~pyrogram.raw.base.WallPaper`. Details: - Layer: ``122`` - ID: ``0xa437c3ed`` Parameters: id: ``int`` ``64-bit`` access_hash: ``int`` ``64-bit`` slug: ``str`` document: :obj:`Document <pyrogram.raw.base.Document>` creator (optional): ``bo...
62598f91b830903b9686e298
class WinkRemote(WinkBinarySensorEntity): <NEW_LINE> <INDENT> @property <NEW_LINE> def extra_state_attributes(self): <NEW_LINE> <INDENT> _attributes = super().extra_state_attributes <NEW_LINE> _attributes["button_on_pressed"] = self.wink.button_on_pressed() <NEW_LINE> _attributes["button_off_pressed"] = self.wink.butto...
Representation of a Wink Lutron Connected bulb remote.
62598f9126068e7796d4c5aa
class EmailUserSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> email = serializers.EmailField() <NEW_LINE> name = serializers.CharField(max_length=1000) <NEW_LINE> is_staff = serializers.BooleanField(default=False)
Serializes an EmailUser...
62598f9101c39578d7f129d0
class EmailUserCreationForm(UserCreationForm): <NEW_LINE> <INDENT> email = forms.EmailField(label=_("Email"), max_length=75) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ("email",) <NEW_LINE> <DEDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(EmailUserCreationForm, se...
Override the default UserCreationForm to force email-as-username behavior.
62598f9132920d7e50bc5ca8