code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Footer(HTML5Element): <NEW_LINE> <INDENT> pass | Element corresponding to the ``<footer>`` tag | 62598efc2ae34c7f260a9a4d |
class NewGameForm(messages.Message): <NEW_LINE> <INDENT> user_name = messages.StringField(1, required=True) <NEW_LINE> user_tic = messages.StringField(2, required=True, default="O") <NEW_LINE> opponent_name = messages.StringField(3, required=True, default="computer") <NEW_LINE> opponent_tic = messages.StringField(4, re... | Used to create a new game | 62598efd283ffb24f3cf2216 |
class AppCommands(cli_utils.CommandsBase): <NEW_LINE> <INDENT> def create(self): <NEW_LINE> <INDENT> self.parser.add_argument('plan_file', help="Plan file") <NEW_LINE> args = self.parser.parse_args() <NEW_LINE> with open(args.plan_file) as definition_file: <NEW_LINE> <INDENT> definition = definition_file.read() <NEW_LI... | Application targets. | 62598efd5166f23b2e241d48 |
class ZEIJEMOLNotRaterIndexView(IndexView): <NEW_LINE> <INDENT> __regid__ = "index" <NEW_LINE> __select__ = authenticated_user() & ~match_user_groups( "managers", "moderators") <NEW_LINE> title = _("Index") <NEW_LINE> def call(self, **kwargs): <NEW_LINE> <INDENT> template = self._cw.vreg.template_env.get_template("star... | Class that defines the index view.
| 62598efd796e427e5384d106 |
class TransformFunctionSerializer(object): <NEW_LINE> <INDENT> def __init__(self, ctx, serializer, gateway=None): <NEW_LINE> <INDENT> self.ctx = ctx <NEW_LINE> self.serializer = serializer <NEW_LINE> self.gateway = gateway or self.ctx._gateway <NEW_LINE> self.gateway.jvm.PythonDStream.registerSerializer(self) <NEW_LINE... | This class implements a serializer for PythonTransformFunction Java
objects.
This is necessary because the Java PythonTransformFunction objects are
actually Py4J references to Python objects and thus are not directly
serializable. When Java needs to serialize a PythonTransformFunction,
it uses this class to invoke Pyt... | 62598efd7c178a314d78be06 |
class Parser(object): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def next(self): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def close(self): <NEW_LINE> <INDENT> pass <N... | Abstract class that must be implemented by each RBL/FBL parser. | 62598efd3317a56b869bda1a |
class JobValidationError(Exception): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> self.message = message | Indicates that the validation of a build job failed.
This exception is raised by the reconfigure_*_job functions
if validation fails, e.g. because the requested package
is not available in the specified index.yaml | 62598efdfff4ab517ebcc13e |
class Command(BaseCommand): <NEW_LINE> <INDENT> help = "Starts the billing server" <NEW_LINE> def handle(self, *args, **options): <NEW_LINE> <INDENT> self.stderr.write( "NOTE: This command is deprecated. Use twistd and" " go.billing.api.billing_api_resource to start the billing API.") <NEW_LINE> def connection_establis... | Custom Django management command to start the billing server | 62598efd379a373c97d97965 |
class CompressImage(ProcessBase): <NEW_LINE> <INDENT> def __init__(self, basewidth): <NEW_LINE> <INDENT> ProcessBase.__init__(self) <NEW_LINE> self.extensions = ['jpg', 'jpeg', 'png'] <NEW_LINE> self.basewidth = basewidth <NEW_LINE> <DEDENT> def processfile(self, filename): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> ... | Processor which attempts to reduce image file size. | 62598efd4f6381625f198972 |
class KeyAuthentication(Authentication): <NEW_LINE> <INDENT> def __init__(self, key: str = None, **kwargs) -> None: <NEW_LINE> <INDENT> super().__init__(AuthenticationScheme.KEY, **kwargs) <NEW_LINE> self.key = key | Key authentication representation. | 62598efd2c8b7c6e89bd212e |
class ApplicationGatewaySslPolicy(Model): <NEW_LINE> <INDENT> _attribute_map = { 'disabled_ssl_protocols': {'key': 'disabledSslProtocols', 'type': '[str]'}, } <NEW_LINE> def __init__(self, disabled_ssl_protocols=None): <NEW_LINE> <INDENT> self.disabled_ssl_protocols = disabled_ssl_protocols | Application gateway SSL policy.
:param disabled_ssl_protocols: SSL protocols to be disabled on application
gateway.
:type disabled_ssl_protocols: list of str or
:class:`ApplicationGatewaySslProtocol
<azure.mgmt.network.v2017_03_01.models.ApplicationGatewaySslProtocol>` | 62598efd3d592f4c4edb985a |
class SequenceElement(XmlElement): <NEW_LINE> <INDENT> def __init__(self, att): <NEW_LINE> <INDENT> super().__init__(None) <NEW_LINE> self.elementName = "SEQUENCE" <NEW_LINE> self.useAttributes = att <NEW_LINE> self.possibleAttributes= {'id':None,'maxOccurs':None, 'minOccurs':None} <NEW_LINE> self.parentElement = ['gro... | SequenceElement is instance of XmlElement.
SequenceElement implement XML Schema sequence Element.
http://www.w3schools.com/schema/el_sequence.asp
@author Jakub Pelikan
@version 1.0
@package xmlParser | 62598efd3617ad0b5ee04a96 |
@deconstructible <NEW_LINE> class F(Combinable): <NEW_LINE> <INDENT> filterable = True <NEW_LINE> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "{}({})".format(self.__class__.__name__, self.name) <NEW_LINE> <DEDENT> def resolve_expressi... | An object capable of resolving references to existing query objects. | 62598efd55399d3f05624e92 |
class ICML07DataSet(DenseDesignMatrix): <NEW_LINE> <INDENT> def __init__(self, npy_filename, which_set, one_hot, split): <NEW_LINE> <INDENT> assert which_set in ['train', 'valid', 'test'] <NEW_LINE> self.one_hot = one_hot <NEW_LINE> self.split = split <NEW_LINE> npy_filename_root = os.path.join(preprocess('${PYLEARN2_D... | Base class for ICML07 datasets.
All these datasets can be displayed as 28x28 pixel datapoints. | 62598efd442bda511e95adcd |
class Pseudonym(Base, UserTags): <NEW_LINE> <INDENT> __tablename__ = "pseudonyms" <NEW_LINE> person_id = db.Column(db.Integer, db.ForeignKey("contributors.id", name="pseudonym_book_person_fk1", ondelete="CASCADE"), primary_key=True) <NEW_LINE> book_id = db.Column(db.Integer, db.ForeignKey("books.id", name="pseudonym_bo... | Copied from original schema:
Is this table ever going into any use? | 62598efd3d592f4c4edb985b |
class ScopeStatus(QtGui.QGroupBox): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> QtGui.QWidget.__init__(self, parent) <NEW_LINE> self.parent = parent <NEW_LINE> self.setTitle('Oscilloscope Status') <NEW_LINE> self.setAlignment(QtCore.Qt.AlignLeft) <NEW_LINE> self.setCheckable(True) <NEW_LINE> sel... | Oscilloscope (PCI card) status display | 62598efd56ac1b37e6300b5a |
class GlyphsToDesignspaceRT(test_helpers.AssertUFORoundtrip): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def add_tests(cls, testable): <NEW_LINE> <INDENT> files = test_helpers.glyphs_files(directory(testable)) <NEW_LINE> for index, filename in enumerate(sorted(files)): <NEW_LINE> <INDENT> def test_method(self, filenam... | Test the whole chain from .glyphs to designspace + UFOs and back | 62598efd7047854f4633dd34 |
class TestPNN(unittest.TestCase): <NEW_LINE> <INDENT> def test_run(self): <NEW_LINE> <INDENT> pass | Tests for the PNN model class. | 62598efd099cdd3c6367488d |
class DefaultConfig: <NEW_LINE> <INDENT> PORT = 3978 <NEW_LINE> SLACK_VERIFICATION_TOKEN = os.environ.get("SlackVerificationToken", "") <NEW_LINE> SLACK_BOT_TOKEN = os.environ.get("SlackBotToken", "") <NEW_LINE> SLACK_CLIENT_SIGNING_SECRET = os.environ.get("SlackClientSigningSecret", "") | Bot Configuration | 62598efd23849d37ff84fa2c |
class UnicodeDictWriter(UnicodeWriter): <NEW_LINE> <INDENT> def __init__(self, filename, fieldnames, encoding='utf-8', **kw): <NEW_LINE> <INDENT> self.fieldnames = fieldnames <NEW_LINE> super(UnicodeDictWriter, self).__init__(filename, encoding, **kw) <NEW_LINE> <DEDENT> def writerow(self, row): <NEW_LINE> <INDENT> for... | This class provides functionality for writing CSV file rows from dicts
in a given encoding, python 2 and 3 compatible | 62598efd4f88993c371ef99f |
class TaskPopupMenu(wx.Menu): <NEW_LINE> <INDENT> MENU_TITLES = OrderedDict([ ("output", show_task_main_output), ("log", show_task_log), ("main events", show_task_main_events), ("log events", show_task_log_events), ("browse indir", browse_indir), ("browse outdir", browse_outdir), ("browse tmpdir", browse_tmpdir), ("hi... | A `TaskPopupMenu` has a list of callback functions indexed by the menu title.
The signature of the callback function is func(parent, task) where parent is
the wx Window that will become the parent of the new frame created by the callback.
and task is a `Task` instance. | 62598efdff9c53063f518fcf |
class ParamTab(Tab, param_tab_class): <NEW_LINE> <INDENT> paramUpdatedSignal = pyqtSignal(str, str) <NEW_LINE> connectionDoneSignal = pyqtSignal(str) <NEW_LINE> disconnectedSignal = pyqtSignal(str) <NEW_LINE> def __init__(self, tabWidget, helper, *args): <NEW_LINE> <INDENT> super(ParamTab, self).__init__(*args) <NEW_LI... | Show all the parameters in the TOC and give the user the ability to edit
them | 62598efd5fcc89381b2655e0 |
class UidManagerMixin(object): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> return UidQuerySet(self.model, using=self._db) | Mix in Uid capabilities for a Manager.
A Model can use a custom manager with this mixin to gain uid capabilities. | 62598efd3539df3088ecac1a |
class ChangeProjectLeaderForm(forms2.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Proyecto <NEW_LINE> fields = ('nombre', 'fecha_inicio', 'fecha_fin', 'descripcion', 'observaciones') <NEW_LINE> widgets = { 'nombre': forms2.TextInput(attrs={'class': 'form-control', }), 'fecha_inicio': forms2.D... | *Formulario para la modificación de proyectos creados en el sistema. Utilizamos el modelo de* ``Proyecto``
*definido del cual filtramos los campos de tal manera a que solo se habiliten los
campos disponibles para la modificación de un proyecto en el sistema.*
Opción válida solo para usuarios con rol de ``Lider``.
:p... | 62598efd956e5f7376df4b32 |
class Bib77x(db.Model): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> __tablename__ = 'bib77x' <NEW_LINE> id = db.Column(db.MediumInteger(8, unsigned=True), primary_key=True, autoincrement=True) <NEW_LINE> tag = db.Column(db.String(6), nullable=False, index=True, server_default=''... | Represents a Bib77x record. | 62598efd7b180e01f3e484fe |
class LilUCBHeuristicCollaborative(MABCollaborativeFixedTimeBAILearner): <NEW_LINE> <INDENT> def __init__(self, num_agents: int, arm_num: int, rounds: int, horizon: int, name: Optional[str] = None): <NEW_LINE> <INDENT> if arm_num <= 1: <NEW_LINE> <INDENT> raise ValueError('Number of arms is expected at least 2. Got %d.... | Colaborative learner using lilucb heuristic as centralized policy
:param int num_agents: number of agents
:param int arm_num: number of arms of the bandit
:param int rounds: number of total rounds allowed
:param int horizon: maximum number of pulls the agent can make
(over all rounds combined)
:param Optional[str] n... | 62598efdaad79263cf42d17f |
class Url(BaseType): <NEW_LINE> <INDENT> def to_py(self, value: _StrUnset) -> Union[_UnsetNone, QUrl]: <NEW_LINE> <INDENT> self._basic_py_validation(value, str) <NEW_LINE> if isinstance(value, usertypes.Unset): <NEW_LINE> <INDENT> return value <NEW_LINE> <DEDENT> elif not value: <NEW_LINE> <INDENT> return None <NEW_LIN... | A URL as a string. | 62598efd3317a56b869bda1c |
class Constants(object): <NEW_LINE> <INDENT> @Attribute <NEW_LINE> def g(self): <NEW_LINE> <INDENT> return g <NEW_LINE> <DEDENT> @Attribute <NEW_LINE> def rho(self): <NEW_LINE> <INDENT> return rho <NEW_LINE> <DEDENT> @Attribute <NEW_LINE> def temperature(self): <NEW_LINE> <INDENT> return T_inf <NEW_LINE> <DEDENT> @Attr... | An OOP Version of the above constants to use for the following part of this assignment, supporting lazy
evaluation where not every attribute or property will be triggered at run-time, thus increasing performance | 62598efd5fdd1c0f98e5c915 |
class Buffer: <NEW_LINE> <INDENT> def __init__(self, source): <NEW_LINE> <INDENT> self.index = 0 <NEW_LINE> self.source = source <NEW_LINE> <DEDENT> def remove_front(self): <NEW_LINE> <INDENT> current = self.current() <NEW_LINE> self.index += 1 <NEW_LINE> return current <NEW_LINE> <DEDENT> def current(self): <NEW_LINE>... | A Buffer provides a way of accessing a sequence one at a time.
Its constructor takes a sequence, called the "source".
The Buffer supplies elements from source one at a time through its remove_front()
method. In addition, Buffer provides a current() method to look at the
next item to be supplied, without moving past it.... | 62598efd97e22403b3839856 |
class FinalSubtrajectorySelectMover(SubtrajectorySelectMover): <NEW_LINE> <INDENT> def _choose(self, trajectory_list): <NEW_LINE> <INDENT> return trajectory_list[-1], {} | Samples the final subtrajectory satifying the given subensemble.
If there are no subtrajectories which satisfy the ensemble, this returns
the zero-length trajectory.
Attributes
----------
ensemble : openpathsampling.Ensemble
the set of allows samples to chose from
sub_ensemble : openpathsampling.Ensemble
the ... | 62598efda8370b77170eed54 |
class HouseDotGovDemsOnlyPipeline(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.dem_count = 0 <NEW_LINE> self.repub_count = 0 <NEW_LINE> self.other_count = 0 <NEW_LINE> <DEDENT> def process_item(self, item, spider): <NEW_LINE> <INDENT> if item.get("party") == "D": <NEW_LINE> <INDENT> self.de... | Pipeline to only return democratic
representatives. | 62598efd379a373c97d97969 |
class EmptyVideoTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.video = VideoFactory() <NEW_LINE> <DEDENT> def test_extension(self): <NEW_LINE> <INDENT> assert self.video.extension() == "" <NEW_LINE> <DEDENT> def test_tahoe_file(self): <NEW_LINE> <INDENT> assert self.video.tahoe_file() is ... | test the behavior for a video that doesn't have any files associated
with it | 62598efd2c8b7c6e89bd2132 |
class MockTestSuite(TestSuite): <NEW_LINE> <INDENT> __test__ = False | Mock test suite, will contain a sequence of tests. | 62598efd099cdd3c6367488f |
class BaseEnvironmentProvider: <NEW_LINE> <INDENT> def get_environment(self, atoms): <NEW_LINE> <INDENT> raise NotImplementedError | Environment Providers are supposed to collect neighboring atoms within
local, atom-centered environments. All environment providers should inherit
from this class. | 62598efd76e4537e8c3edf2c |
class MovementArrivalEvent(ArrivalEvent): <NEW_LINE> <INDENT> def __init__(self, thing, origin=None, direction=None): <NEW_LINE> <INDENT> self.thing = thing <NEW_LINE> self.origin = origin <NEW_LINE> self.direction = direction <NEW_LINE> self.location = self.thing.location <NEW_LINE> <DEDENT> def conceptFor(self, obser... | An event representing the arrival of an object at a location from an
origin. | 62598efd5166f23b2e241d4e |
class PicklableDtype(object): <NEW_LINE> <INDENT> def __init__(self, dtype, target=None): <NEW_LINE> <INDENT> assert not isinstance(dtype, PicklableDtype) <NEW_LINE> if dtype is None: <NEW_LINE> <INDENT> raise TypeError("may not pass None to construct PicklableDtype") <NEW_LINE> <DEDENT> self.target = target <NEW_LINE>... | This object works around several issues with pickling :class:`numpy.dtype`
objects. It does so by serving as a picklable wrapper around the original
dtype.
The issues are the following
- :class:`numpy.dtype` objects for custom types in :mod:`loopy` are usually
registered in the target's dtype registry. This registr... | 62598efd23849d37ff84fa30 |
class Link(models.Model): <NEW_LINE> <INDENT> display_text = models.CharField(max_length=200) <NEW_LINE> url = models.URLField() <NEW_LINE> linkroll = models.ForeignKey( LinkRoll, on_delete=models.CASCADE ) | An individual link for a LinkRoll. | 62598efdff9c53063f518fd3 |
class RoadSegDataLayer(caffe.Layer): <NEW_LINE> <INDENT> def setup(self, bottom, top): <NEW_LINE> <INDENT> params = eval(self.param_str) <NEW_LINE> self.dir = R.dir <NEW_LINE> self.mean = np.array(params['mean']) <NEW_LINE> self.seed = params.get('seed', None) <NEW_LINE> if len(top) != 2: <NEW_LINE> <INDENT> raise Exce... | Load (input image, label image) pairs from Kitti
one-at-a-time while reshaping the net to preserve dimensions.
Use this to feed data to a fully convolutional network. | 62598efd97e22403b3839858 |
class MsgTrackingStateDepB(SBP): <NEW_LINE> <INDENT> _parser = construct.Struct( construct.GreedyRange('states' / construct.Struct(TrackingChannelStateDepB._parser)),) <NEW_LINE> __slots__ = [ 'states', ] <NEW_LINE> def __init__(self, sbp=None, **kwargs): <NEW_LINE> <INDENT> if sbp: <NEW_LINE> <INDENT> super( MsgTracki... | SBP class for message MSG_TRACKING_STATE_DEP_B (0x0013).
You can have MSG_TRACKING_STATE_DEP_B inherit its fields directly
from an inherited SBP object, or construct it inline using a dict
of its fields.
Deprecated.
Parameters
----------
sbp : SBP
SBP parent object to inherit from.
states : array
Signal trackin... | 62598efd9f28863672817166 |
class ActivationTemplateResponse(object): <NEW_LINE> <INDENT> template_id = None <NEW_LINE> def __init__(self, template_id): <NEW_LINE> <INDENT> self.template_id = template_id | An instance of this class might the returned by the overriden ``process_request`` method
of your :py:class:`connect.resources.FulfillmentAutomation` or
:py:class:`connect.resources.TierConfigAutomation` subclass to approve the request being
processed, showing a tile with the specified template id.
:param str template_... | 62598efda219f33f346c51a0 |
class EntryPageViewMixin(object): <NEW_LINE> <INDENT> def get_object(self, queryset=None): <NEW_LINE> <INDENT> obj = super(EntryPageViewMixin, self).get_object(queryset) <NEW_LINE> obj.page_view += 1 <NEW_LINE> obj.save(update_fields=['page_view']) <NEW_LINE> return obj | Mixin implementing the page views of Entries. | 62598efd4f6381625f198975 |
class LabelSmoothingLoss(nn.Module): <NEW_LINE> <INDENT> one_hot: torch.Tensor <NEW_LINE> def __init__(self, label_confidence, tgt_vocab_size, ignore_index=0): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.ignore_index = ignore_index <NEW_LINE> self.tgt_vocab_size = tgt_vocab_size <NEW_LINE> label_smoothing = ... | With label smoothing,
KL-divergence between q_{smoothed ground truth prob.}(w)
and p_{prob. computed by model}(w) is minimized.
Args:
label_confidence: the confidence weight on the ground truth label.
tgt_vocab_size: the size of the final classification.
ignore_index: The index in the vocabulary to ignore ... | 62598efd2c8b7c6e89bd2134 |
class cm_cd: <NEW_LINE> <INDENT> def __init__(self, p_new_path): <NEW_LINE> <INDENT> self.m_new_path = os.path.expanduser(p_new_path) <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self.m_saved_path = os.getcwd() <NEW_LINE> os.chdir(self.m_new_path) <NEW_LINE> <DEDENT> def __exit__(self, etype, value, tra... | Context manager for changing the current working directory
| 62598efd3539df3088ecac1e |
class StorageProtocolClean(clean.clean): <NEW_LINE> <INDENT> description = "clean up files generated by protobuf-compiler" <NEW_LINE> def run(self): <NEW_LINE> <INDENT> for source in glob.glob("magicicadaprotocol/*_pb2.py"): <NEW_LINE> <INDENT> os.unlink(source) <NEW_LINE> <DEDENT> clean.clean.run(self) | Class to clean up the built protobuf files. | 62598efddc8b845886d51f39 |
class Concat(Dataset): <NEW_LINE> <INDENT> def __init__(self, *datasets): <NEW_LINE> <INDENT> if len(datasets) == 0: <NEW_LINE> <INDENT> raise TypeError('Concat() requires at least 1 dataset.') <NEW_LINE> <DEDENT> self.lens = tuple(len(d) for d in datasets) <NEW_LINE> self.datasets = datasets <NEW_LINE> <DEDENT> def __... | Combines the rows of many datasets into one.
| 62598efd851cf427c66b6c3a |
class QSound(__PyQt5_QtCore.QObject): <NEW_LINE> <INDENT> def childEvent(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def connectNotify(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def customEvent(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def di... | QSound(str, parent: QObject = None) | 62598efd3d592f4c4edb9861 |
class Spawn: <NEW_LINE> <INDENT> names = [] <NEW_LINE> searches = {} <NEW_LINE> trees = {} <NEW_LINE> tree_kwargs = {} <NEW_LINE> @classmethod <NEW_LINE> def get_agent(cls, name, search=None, tree=None, tree_kwargs=()): <NEW_LINE> <INDENT> search = cls.get_search(name, search, tree, tree_kwargs) <NEW_LINE> return Agent... | Creates agent instances. Some predefined agent types stored by name (str).
Agents are routinely created. Spawn stores common agent types by name for
easy retrieval. Also allows for custom agents given other parameters.
Search parameter is tree, tree parameter is kwargs. Attributes are dict
maps from name (str) to eit... | 62598efd99fddb7c1ca622bb |
class Worker(Thread): <NEW_LINE> <INDENT> def __init__(self, tasks): <NEW_LINE> <INDENT> super(Worker, self).__init__() <NEW_LINE> self.tasks = tasks <NEW_LINE> self.daemon = True <NEW_LINE> self.start() <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> while True: <NEW_LINE> <INDENT> func, arg, kwd, attempt = sel... | docstring for Worker | 62598efd283ffb24f3cf221d |
class TermsOfService: <NEW_LINE> <INDENT> QUALNAME = "pyrogram.raw.base.help.TermsOfService" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> raise TypeError("Base types can only be used for type checking purposes: " "you tried to use a base type instance as argument, " "but you need to instantiate one of its constru... | This base type has 1 constructor available.
Constructors:
.. hlist::
:columns: 2
- :obj:`help.TermsOfService <pyrogram.raw.types.help.TermsOfService>` | 62598efd66673b3332c2ed23 |
class RegisteView(View): <NEW_LINE> <INDENT> def get(self,request): <NEW_LINE> <INDENT> return render(request,'register.html') <NEW_LINE> <DEDENT> def post(self,request): <NEW_LINE> <INDENT> username = request.POST.get('username') <NEW_LINE> password=request.POST.get('password') <NEW_LINE> password2=request.POST.get('p... | 注册 | 62598efdfff4ab517ebcc146 |
class MissesRegistration(Exception): <NEW_LINE> <INDENT> pass | store_releasefile requires pre-existing release metadata. | 62598efde5267d203ee6a276 |
class YelpDatabase(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.data = {} <NEW_LINE> <DEDENT> def save(self, file_name): <NEW_LINE> <INDENT> if not exists(file_name): <NEW_LINE> <INDENT> f = open(file_name, 'w') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> f = open(file_name, 'r+') <NEW_LI... | A class that contains yelp information for specific queries. Contains a data member self.data, which is a dictionary mapping from (term, location) to a response | 62598efdbe383301e0252155 |
class UploadSessionFinishBatchResultEntry(bb.Union): <NEW_LINE> <INDENT> _catch_all = None <NEW_LINE> @classmethod <NEW_LINE> def success(cls, val): <NEW_LINE> <INDENT> return cls('success', val) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def failure(cls, val): <NEW_LINE> <INDENT> return cls('failure', val) <NEW_LINE>... | This class acts as a tagged union. Only one of the ``is_*`` methods will
return true. To get the associated value of a tag (if one exists), use the
corresponding ``get_*`` method. | 62598efd55399d3f05624e9a |
class RPMOSTreeConfigurationData(DBusData): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._osname = "" <NEW_LINE> self._remote = "" <NEW_LINE> self._url = "" <NEW_LINE> self._ref = "" <NEW_LINE> self._gpg_verification_enabled = True <NEW_LINE> <DEDENT> @property <NEW_LINE> def osname(self) -> Str: <N... | Structure to hold RPM OSTree configuration. | 62598efd851cf427c66b6c3c |
class EnsureNetworkSpeed(config.WithLocalAddress, config.WithSSHCredentials, stage.ParallelStage): <NEW_LINE> <INDENT> def __init__(self, poolsize=3, minimum=150, time=5): <NEW_LINE> <INDENT> stage.ParallelStage.__init__(self, poolsize) <NEW_LINE> self.minimum = minimum <NEW_LINE> self.time = time <NEW_LINE> self.serve... | ensure sufficient throughput of network interface | 62598efd21bff66bcd7215ca |
class NotesParser(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def parse(notes): <NEW_LINE> <INDENT> if isinstance(notes, Note): <NEW_LINE> <INDENT> return [notes.clone()] <NEW_LINE> <DEDENT> elif isinstance(notes, NoteGroup): <NEW_LINE> <INDENT> return notes.clone().notes <NEW_LINE> <DEDENT> elif isinstance(n... | Parse notes of any type into a list of notes.
Valid notes are: Note, NoteGroup, int, str, list, tuple, set. | 62598efd44b2445a339b5e29 |
class AverageMeter(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.reset() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self.val = 0 <NEW_LINE> self.avg = 0 <NEW_LINE> self.sum = 0 <NEW_LINE> self.count = 0 <NEW_LINE> <DEDENT> def update(self, val, n=1): <NEW_LINE> <INDENT> self.va... | Computes and stores the average and current value | 62598efd377c676e912f621e |
class QNet(nn.Module): <NEW_LINE> <INDENT> def __init__(self, state_size, num_actions, h1_size=20, h2_size=15, seed=888): <NEW_LINE> <INDENT> super(QNet, self).__init__() <NEW_LINE> self.seed = torch.manual_seed(seed) <NEW_LINE> self.h1 = nn.Linear(state_size, h1_size) <NEW_LINE> self.h2 = nn.Linear(h1_size, h2_size) <... | Basic actor feed forward network policy model | 62598efdcc0a2c1114479977 |
class JsonConfigurationParseError(ConfigurationError): <NEW_LINE> <INDENT> pass | Settings parse JSON error. | 62598efd71ff763f4b5e60d6 |
class InterchangeTrailer(Segment): <NEW_LINE> <INDENT> SEGMENT_KEY = "UNZ" <NEW_LINE> def __init__(self, number_of_messages, sequence_number): <NEW_LINE> <INDENT> segment_value = f"{number_of_messages}+{sequence_number}" <NEW_LINE> super().__init__(key=self.SEGMENT_KEY, value=segment_value) | A specialisation of a segment for the specific use case of an interchange trailer
takes in specific values required to generate an interchange trailer
example: UNZ+1+00000002' | 62598efd67a9b606de544944 |
class ArticleSearchTest(SteamTestCase): <NEW_LINE> <INDENT> __interfaceName__ = "/operation-manage/media/queryMedias" <NEW_LINE> @initAdminInputService(services = [], curser = ArticleSearchService) <NEW_LINE> def __init__(self, methodName='runTest', param=None): <NEW_LINE> <INDENT> super(ArticleSearchTest,self).__ini... | admin删除分类 | 62598efdbf627c535bcafde9 |
class NumberField(BaseField): <NEW_LINE> <INDENT> types = (int, float) <NEW_LINE> json_schema_draft4 = {'type': 'number'} | Number type field. | 62598efd92d797404e388035 |
class LatexBoolean(object): <NEW_LINE> <INDENT> def __init__(self, boolean_name, boolean_value): <NEW_LINE> <INDENT> self._boolean_name = process_for_latex(boolean_name) <NEW_LINE> self._boolean_value = boolean_value <NEW_LINE> <DEDENT> def get_string(self): <NEW_LINE> <INDENT> boolean_value_string = str(bool(self._boo... | This is the class representing a LaTeX boolean.
The boolean is represented by a string, and holds a 'true' or 'false' value.
Attributes:
boolean_name: a string by which the LaTeX boolean can be invoked
boolean_value: the value of the boolean | 62598efd099cdd3c63674891 |
class ModelChoiceField(forms.ModelChoiceField): <NEW_LINE> <INDENT> widget = AutoCompleteWidget <NEW_LINE> def __init__(self, ac_name, reverse_label=True, view=autocomplete, widget=None, **kwargs): <NEW_LINE> <INDENT> self.ac_name = ac_name <NEW_LINE> self.view = view <NEW_LINE> if widget is None: <NEW_LINE> <INDENT> w... | A ModelChoiceField which uses an autocomplete widget, instead of an html
select tag, to render its choices. | 62598efd7c178a314d78be10 |
class Selector(Frame): <NEW_LINE> <INDENT> def set_segment_state(self, segment, state): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def get_segment_state(self, segment): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def set_segments_code(self, code): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def get_segments_code(se... | Selector interface | 62598efd76e4537e8c3edf30 |
class caja(models.Model): <NEW_LINE> <INDENT> _name = 'caja' <NEW_LINE> _rec_name = 'nombre' <NEW_LINE> peldano_id = fields.Many2one('peldano', 'Peldaño', required=True, help='Nombre del Peldaño') <NEW_LINE> codigo = fields.Integer('Código', size=12, required=True, help='Código de la Caja') <NEW_LINE> nombre = fields.C... | Tabla Cajas | 62598efd26068e7796d4b2cf |
class IntValueError(ValidationError): <NEW_LINE> <INDENT> def __init__( self, device_config_param_name, value_given, device_config_param_constraints): <NEW_LINE> <INDENT> self.msg = 'An int value is required for the given Device configuration parameter that meets the specified constraints' <NEW_LINE> self.device_config... | Exception raised for errors when an int was expected for the settings
parameter value.
Attributes:
device_config_param_name -- The name of the Device configuration parameter that has the error.
value_given -- the value read from the experiment configuration file.
device_config_param_constraints -- the se... | 62598efd796e427e5384d110 |
class ModifyInstanceParamResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.AsyncRequestId = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.AsyncRequestId = params.get("AsyncRequestId") <NEW_LINE> self.RequestId =... | ModifyInstanceParam返回参数结构体
| 62598efd9f2886367281716a |
class PositiveIntegerAction(argparse.Action): <NEW_LINE> <INDENT> def __call__(self, parser, namespace, values, option_string=None): <NEW_LINE> <INDENT> if values <= 0: <NEW_LINE> <INDENT> parser.error("{0} must be a non-zero positive integer.".format(option_string)) <NEW_LINE> <DEDENT> setattr(namespace, self.dest, va... | Custom action for ensuring positive integers in number of trials. | 62598efd8a349b6b43684bb8 |
@gin.configurable <NEW_LINE> class WaveGram(tf.keras.Model): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.pre_conv0 = tf.keras.layers.Conv1D( filters=64, kernel_size=11, strides=5, padding='SAME', use_bias=False, ) <NEW_LINE> self.pre_bn0 = tf.keras.layers.BatchNormaliz... | WaveGram frontend from PANN (https://arxiv.org/abs/1912.10211). | 62598efdadb09d7d5dc08f2c |
class DateFmt: <NEW_LINE> <INDENT> DEFAULT = "default" <NEW_LINE> US_12H = "US-AM-PM" <NEW_LINE> US_24H = "US-24H" | Date logging formats | 62598efdfff4ab517ebcc148 |
class ExtensionsProperty(DictionaryProperty): <NEW_LINE> <INDENT> def __init__(self, spec_version=DEFAULT_VERSION, required=False): <NEW_LINE> <INDENT> super(ExtensionsProperty, self).__init__(spec_version=spec_version, required=required) <NEW_LINE> <DEDENT> def clean(self, value, allow_custom): <NEW_LINE> <INDENT> try... | Property for representing extensions on Observable objects.
| 62598efd50812a4eaa6200a5 |
class _SelfCheckError(Exception): <NEW_LINE> <INDENT> pass | Self-check failed | 62598efd4527f215b58e8872 |
class XmlRpcBroker(base.Broker, xmlrpc.XMLRPC): <NEW_LINE> <INDENT> def __init__(self, obj, router=None, allow_none=True): <NEW_LINE> <INDENT> super(XmlRpcBroker, self).__init__(obj, router=router, allowNone=allow_none) <NEW_LINE> self._patch_xmlrpclib() <NEW_LINE> <DEDENT> def _patch_xmlrpclib(self): <NEW_LINE> <INDEN... | A Broker specialization for XMLRPC based communication.
Extends the xmlrpc.XMLRPC class to provide a smaclib compatible broking
interface and patches the stdlib to handle structures through custom
dictionary types for compatibility with thrift.
Additionally wraps thrift errors in fault objects with a proper error cod... | 62598efdbe383301e0252157 |
class Error(object): <NEW_LINE> <INDENT> def __init__(self, debug=None, logger=None): <NEW_LINE> <INDENT> self.debug = debug <NEW_LINE> self.logger = logger <NEW_LINE> <DEDENT> def _acme_errormessage(self, message): <NEW_LINE> <INDENT> self.logger.debug('Error.acme_errormessage({0})'.format(message)) <NEW_LINE> error_d... | error messages | 62598efd97e22403b383985d |
class Rectangle: <NEW_LINE> <INDENT> def __init__(self, width=0, height=0): <NEW_LINE> <INDENT> self.width = width <NEW_LINE> self.height = height <NEW_LINE> <DEDENT> @property <NEW_LINE> def width(self): <NEW_LINE> <INDENT> return self.__width <NEW_LINE> <DEDENT> @width.setter <NEW_LINE> def width(self, value): <NEW_L... | Rectangle Class
Attributes:
width (int): width of rectangle
height (int): height of rectangle | 62598efd7cff6e4e811b435b |
class TestTlsPublicCertChain(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 testTlsPublicCertChain(self): <NEW_LINE> <INDENT> pass | TlsPublicCertChain unit test stubs | 62598efd2ae34c7f260a9a59 |
class IdentifierGenerationError(SuperdeskError): <NEW_LINE> <INDENT> status_code = 500 <NEW_LINE> payload = {'unique_id': 1} <NEW_LINE> message = "Failed to generate unique_id" | Exception raised if failed to generate unique_id. | 62598efd56ac1b37e6300b63 |
class BaseTsCallback(object): <NEW_LINE> <INDENT> callback_map = dict((rpm.__dict__[k], k[12:].lower()) for k in rpm.__dict__ if k.startswith('RPMCALLBACK_')) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._openfds = dict() <NEW_LINE> self.log = logging.getLogger(__package__+".rpm") <NEW_LINE> <DEDENT> def cal... | Basic RPMTransaction Callback class. You need one of these to actually
make a transaction work.
If you subclass it, make sure you preserve the behavior of
inst_open_file and inst_close_file, or nothing will actually happen. | 62598efdcc0a2c1114479979 |
class FtpServiceStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.Reset = channel.unary_unary( '/mavsdk.rpc.ftp.FtpService/Reset', request_serializer=ftp_dot_ftp__pb2.ResetRequest.SerializeToString, response_deserializer=ftp_dot_ftp__pb2.ResetResponse.FromString, ) <NEW_LINE> self.... | Implements file transfer functionality using MAVLink FTP. | 62598efd71ff763f4b5e60d8 |
class myTubeFilter(ScriptedConfigModuleMixin, ModuleBase): <NEW_LINE> <INDENT> def __init__(self, module_manager): <NEW_LINE> <INDENT> ModuleBase.__init__(self, module_manager) <NEW_LINE> self._tubeFilter = vtk.vtkTubeFilter() <NEW_LINE> module_utils.setup_vtk_object_progress(self, self._tubeFilter, 'Generating tubes.'... | Simple demonstration of ScriptedConfigModuleMixin-based
wrapping of a single VTK object.
It would of course be even easier using simpleVTKClassModuleBase.
$Revision: 1.1 $ | 62598efd56ac1b37e6300b64 |
class Table(ATDocumentBase): <NEW_LINE> <INDENT> implements(ITable, ISimpleLayoutBlock) <NEW_LINE> portal_type = "Table" <NEW_LINE> schema = table_schema <NEW_LINE> def getTable(self): <NEW_LINE> <INDENT> return generator.TableGenerator(self).render() <NEW_LINE> <DEDENT> def convert_to_int(self, value): <NEW_LINE> <IND... | A Table for ftw.book | 62598efd5fdd1c0f98e5c91c |
class UserServiceUpdateView(UserServiceMixin, UpdateView): <NEW_LINE> <INDENT> fields = ['username', 'password', 'client_secret', 'client_id', 'host', 'token'] <NEW_LINE> template_name = "services/edit_service.html" <NEW_LINE> def get_success_url(self): <NEW_LINE> <INDENT> return reverse("user_services", args=["edited"... | Form to edit a service | 62598efdaad79263cf42d186 |
class APITokenAuthentication(TokenAuthentication): <NEW_LINE> <INDENT> model = APIToken <NEW_LINE> def authenticate_credentials(self, key): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> token = self.model.objects.get(is_active=True, key=key) <NEW_LINE> <DEDENT> except self.model.DoesNotExist: <NEW_LINE> <INDENT> raise e... | Simple token based authentication.
Clients should authenticate by passing the token key in the "Authorization"
HTTP header, prepended with the string "Token ". For example:
Authorization: Token 401f7ac837da42b97f613d789819ff93537bee6a | 62598efd3346ee7daa336b22 |
class TransportContext(object): <NEW_LINE> <INDENT> def __init__(self, parent, transport, type=None): <NEW_LINE> <INDENT> self.parent = parent <NEW_LINE> self.itself = transport <NEW_LINE> self.type = type <NEW_LINE> self.app = transport.app <NEW_LINE> self.request_encoding = None <NEW_LINE> self.remote_addr = None <NE... | Generic object that holds transport-specific context information | 62598efd23849d37ff84fa36 |
@Packet(type='response') <NEW_LINE> class PacketGroupEntry(NamedTuple): <NEW_LINE> <INDENT> name: str <NEW_LINE> gid: i64 <NEW_LINE> members: list[str] | This packet is used to return information about a group. | 62598efd26068e7796d4b2d2 |
class room_profit_list(BaseModels.room_profit_list): <NEW_LINE> <INDENT> pass | Quest's reward list | 62598efd379a373c97d97971 |
class Index: <NEW_LINE> <INDENT> def before_first(self, search_key): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def next(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def get_data_rid(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def ins... | This interface contains methods to traverse an index. | 62598efda8370b77170eed5c |
class NoResourcesError(Exception): <NEW_LINE> <INDENT> pass | Raise this when we could not find any resources for the requested service | 62598efd60cbc95b06362ca8 |
class DummyDevice: <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.start_state = self.state.copy() <NEW_LINE> self._protocol = DummyMiIOProtocol(self) <NEW_LINE> self._info = None <NEW_LINE> if getattr(self, "_model", None) is None: <NEW_LINE> <INDENT> self._model = "dummy.model" <NEW_... | DummyDevice base class, you should inherit from this and call
`super().__init__(args, kwargs)` to save the original state.
This class provides helpers to test simple devices, for more complex
ones you will want to extend the `return_values` accordingly.
The basic idea is that the overloaded send() will read a wanted r... | 62598efda219f33f346c51a6 |
class ReplaceLDFields(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(ReplaceLDFields, self).__init__(*args, **kwargs) <NEW_LINE> for field in list(self.fields): <NEW_LINE> <INDENT> if field.startswith('hydra_'): <NEW_LINE> <INDENT> hydra_name = field.replace('hydra_', 'hydra... | Mixin to rename fields with reserved characters.
* jsonld_{FIELD} => @{FIELD}
* hydra_{FIELD} => hydra:FIELD | 62598efdadb09d7d5dc08f2e |
class Importation(Definition): <NEW_LINE> <INDENT> def __init__(self, name, source): <NEW_LINE> <INDENT> self.fullName = name <NEW_LINE> self.redefined = [] <NEW_LINE> name = name.split('.')[0] <NEW_LINE> super(Importation, self).__init__(name, source) <NEW_LINE> <DEDENT> def redefines(self, other): <NEW_LINE> <INDENT>... | A binding created by an import statement.
@ivar fullName: The complete name given to the import statement,
possibly including multiple dotted components.
@type fullName: C{str} | 62598efde5267d203ee6a27a |
class Callback(object): <NEW_LINE> <INDENT> def __init__(self, callback, callback_time, io_loop): <NEW_LINE> <INDENT> self.callback = callback <NEW_LINE> self.callback_time = callback_time <NEW_LINE> self.io_loop = io_loop <NEW_LINE> self._running = False <NEW_LINE> self.next_run = None <NEW_LINE> <DEDENT> def calculat... | Custom implementation of the Tornado.Callback with support
of callback delays. | 62598efd5fc7496912d4772e |
class Translator(object): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> def __init__(self, config, translator_type): <NEW_LINE> <INDENT> self.config = config <NEW_LINE> self.log = multiprocessing.get_logger() <NEW_LINE> self.translator_type = translator_type <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def r... | A generic pSIMS translator
Attributes:
config: A YAMLConfiguration object that contains all config info | 62598efd4527f215b58e8874 |
class Wallet: <NEW_LINE> <INDENT> def __init__(self, node_id): <NEW_LINE> <INDENT> self.private_key = None <NEW_LINE> self.public_key = None <NEW_LINE> self.node_id = node_id <NEW_LINE> <DEDENT> def create_keys(self): <NEW_LINE> <INDENT> private_key, public_key = self.generate_keys() <NEW_LINE> self.private_key = priva... | Creates, loads and holds private and public keys. Manages transaction signing and verification. | 62598efd97e22403b383985f |
class Message(dict): <NEW_LINE> <INDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> if name in self: <NEW_LINE> <INDENT> return self[name] <NEW_LINE> <DEDENT> raise AttributeError('Attribute %s does not exist' % name) | !
@brief A Kafka event message. | 62598efd4428ac0f6e656ec5 |
class Solution: <NEW_LINE> <INDENT> def integerBreak(self, n: int) -> int: <NEW_LINE> <INDENT> if n == 2: <NEW_LINE> <INDENT> return 1 <NEW_LINE> <DEDENT> if n == 3: <NEW_LINE> <INDENT> return 2 <NEW_LINE> <DEDENT> tmp1 = n // 3 <NEW_LINE> tmp2 = n % 3 <NEW_LINE> if tmp2 == 0: <NEW_LINE> <INDENT> result = 3 ** tmp1 <NE... | 还可以使用动态规划。 | 62598efd283ffb24f3cf2223 |
class ExecutionResult(object): <NEW_LINE> <INDENT> __slots__ = 'data', 'errors', 'invalid' <NEW_LINE> def __init__(self, data=None, errors=None, invalid=False): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.errors = errors <NEW_LINE> if invalid: <NEW_LINE> <INDENT> assert data is None <NEW_LINE> <DEDENT> self.in... | The result of execution. `data` is the result of executing the
query, `errors` is null if no errors occurred, and is a
non-empty array if an error occurred. | 62598efd3d592f4c4edb9866 |
class ActivityParameter(models.Model): <NEW_LINE> <INDENT> uuid = UUIDField(editable=False) <NEW_LINE> activity = models.ForeignKey(Activity) <NEW_LINE> parameter = models.ForeignKey(Parameter) <NEW_LINE> number = models.IntegerField(null=True) <NEW_LINE> min = models.FloatField(null=True) <NEW_LINE> max = models.Float... | Association class pairing Parameters that have been loaded for an Activity | 62598efdcc0a2c111447997b |
class SuiteAlias(Base): <NEW_LINE> <INDENT> __tablename__ = "suites_aliases" <NEW_LINE> alias = Column(String, primary_key=True) <NEW_LINE> suite = Column(String, ForeignKey("suites_info.name", ondelete="CASCADE")) | Aliases for suites (ie: unstable for sid) | 62598efd63d6d428bbee1148 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.