code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class ActionStoreUserDetails(Action): <NEW_LINE> <INDENT> def name(self) -> Text: <NEW_LINE> <INDENT> return "action_store_user_details" <NEW_LINE> <DEDENT> def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any]) -> List[Dict[Text, Any]]: <NEW_LINE> <INDENT> print("Storing User detail... | Stores user details in database | 62599063e76e3b2f99fda108 |
class RpmScanner(Actor): <NEW_LINE> <INDENT> name = 'rpm_scanner' <NEW_LINE> consumes = () <NEW_LINE> produces = (InstalledRPM,) <NEW_LINE> tags = (IPUWorkflowTag, FactsPhaseTag) <NEW_LINE> def process(self): <NEW_LINE> <INDENT> output = check_output([ '/bin/rpm', '-qa', '--queryformat', r'%{NAME}|%{VERSION}|%{RELEASE}... | Provides data about installed RPM Packages.
After collecting data from RPM query, a message with relevant data will be produced. | 6259906399cbb53fe68325eb |
class UnitSystem(object): <NEW_LINE> <INDENT> def __init__(self: object, name: str, temperature: str, length: str, volume: str, mass: str) -> None: <NEW_LINE> <INDENT> errors = ', '.join(UNIT_NOT_RECOGNIZED_TEMPLATE.format(unit, unit_type) for unit, unit_type in [ (temperature, TEMPERATURE), (length, LENGTH)... | A container for units of measure. | 625990633eb6a72ae038bd68 |
class PublicationTracker(models.Model): <NEW_LINE> <INDENT> created_by = CurrentUserField(editable=False, related_name="%(app_label)s_%(class)s") <NEW_LINE> publication_datetime = models.DateTimeField(verbose_name="Publication datetime", auto_now_add=True, editable=False) <NEW_LINE> update_datetime = models.DateTimeFie... | Stores the author, publication and update dates of entry. | 62599063be8e80087fbc0790 |
class InstitutionUser(CherryPyAPI): <NEW_LINE> <INDENT> uuid = UUIDField(primary_key=True, default=uuid.uuid4, index=True) <NEW_LINE> user = ForeignKeyField(Users, backref='institutions') <NEW_LINE> institution = ForeignKeyField(Institutions, backref='users') <NEW_LINE> relationship = ForeignKeyField(Relationships, bac... | Relates persons and institution objects.
Attributes:
+-------------------+-------------------------------------+
| Name | Description |
+===================+=====================================+
| user | Link to the Users model |
+-----... | 6259906345492302aabfdbe4 |
class FileTarget(Target): <NEW_LINE> <INDENT> def __init__( self, path: Path, recipe: Recipe, *prereqs: FileTargetLike, ) -> None: <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.prereqs = [file_target(p) for p in prereqs] <NEW_LINE> self._recipe = recipe <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self) -> ... | A file that must be newer than its prerequisite files. | 625990638e7ae83300eea796 |
class TestisCleanlib(test.MATTest): <NEW_LINE> <INDENT> def test_dirty(self): <NEW_LINE> <INDENT> for _, dirty in self.file_list: <NEW_LINE> <INDENT> current_file = MAT.mat.create_class_file(dirty, False, add2archive=True, low_pdf_quality=True) <NEW_LINE> self.assertFalse(current_file.is_clean()) <NEW_LINE> <DEDENT> <D... | test the is_clean() method | 625990638e7ae83300eea797 |
class Discoverable(MDNSDiscoverable): <NEW_LINE> <INDENT> def __init__(self, nd): <NEW_LINE> <INDENT> super(Discoverable, self).__init__(nd, '_miio._udp.local.') <NEW_LINE> <DEDENT> def info_from_entry(self, entry): <NEW_LINE> <INDENT> info = super().info_from_entry(entry) <NEW_LINE> if "poch" in info[ATTR_PROPERTIES]:... | Add support for discovering Xiaomi Gateway | 62599063cb5e8a47e493cd09 |
class House: <NEW_LINE> <INDENT> def __init__(self, x=0, y=0, ): <NEW_LINE> <INDENT> self.__x = x <NEW_LINE> <DEDENT> def __checkValue(x): <NEW_LINE> <INDENT> if isinstance(x, int) or isinstance(x, float): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> return False <NEW_LINE> <DEDENT> @property <NEW_LINE> def corX... | Класс существительное с большой буквы
x = 1 y = 1 атрибуты == данные
def fun() - методы == функции | 625990637cff6e4e811b714f |
class Error(Exception): <NEW_LINE> <INDENT> def __init__(self, err): <NEW_LINE> <INDENT> self.error = err <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return self.error | description:自定义异常类
param {str} err - [异常信息]
return {type}
author: Senkita | 62599063009cb60464d02c41 |
class Core(Interface): <NEW_LINE> <INDENT> name = "wl_core" <NEW_LINE> version = 1 <NEW_LINE> the_enum = enum.Enum("the_enum", { "zero": 0, "one": 1, "hex_two": 0x2, }) | Interface object
The interface object with the most basic content. | 62599063e5267d203ee6cf43 |
class _CreateDropBase(DDLElement): <NEW_LINE> <INDENT> def __init__(self, element, bind=None): <NEW_LINE> <INDENT> self.element = element <NEW_LINE> self.bind = bind <NEW_LINE> <DEDENT> def _create_rule_disable(self, compiler): <NEW_LINE> <INDENT> return False | Base class for DDL constructs that represent CREATE and DROP or
equivalents.
The common theme of _CreateDropBase is a single
``element`` attribute which refers to the element
to be created or dropped. | 6259906307f4c71912bb0b41 |
class IndyRequestedCredsRequestedPredSchema(Schema): <NEW_LINE> <INDENT> cred_id = fields.Str( example="3fa85f64-5717-4562-b3fc-2c963f66afa6", description=( "Wallet credential identifier (typically but not necessarily a UUID)" ), ) | Schema for requested predicates within indy requested credentials structure. | 625990634a966d76dd5f05ff |
class TXPower(IntEnum): <NEW_LINE> <INDENT> MIN = -127 <NEW_LINE> ULTRA_LOW = -21 <NEW_LINE> LOW = -15 <NEW_LINE> MEDIUM = -7 <NEW_LINE> MAX = 1 | Advertising transmission (TX) power level constants.
https://developer.android.com/reference/android/bluetooth/le/AdvertisingSetParameters#TX_POWER_HIGH | 625990637d847024c075dae0 |
class TestBasicScalingInstancePoolChooseInstances(googletest.TestCase): <NEW_LINE> <INDENT> class Instance(object): <NEW_LINE> <INDENT> def __init__(self, can_accept_requests): <NEW_LINE> <INDENT> self.can_accept_requests = can_accept_requests <NEW_LINE> <DEDENT> <DEDENT> def setUp(self): <NEW_LINE> <INDENT> stub_util.... | Tests for module.BasicScalingModule._choose_instance. | 625990633539df3088ecd9a8 |
class UnsuccessfulGetRequest(Exception): <NEW_LINE> <INDENT> def __init__(self, msg=None): <NEW_LINE> <INDENT> super().__init__(msg) | Exception to raise if a GET request to the API fails | 625990634f88993c371f10a4 |
class GdbProcess: <NEW_LINE> <INDENT> def __init__(self, env, cwd, testnum, path_to_exec, args_to_exec='', gdb_options='', timeout=15): <NEW_LINE> <INDENT> self._process = None <NEW_LINE> self._env = env <NEW_LINE> self.cwd = cwd <NEW_LINE> self.path_to_exec = path_to_exec <NEW_LINE> self.args_to_exec = args_to_exec <N... | Class for invoking gdb from python program
It writes and executes commands from a temporary gdb command file.
Attributes:
_process (CompletedProcess): finished process returned from run().
_env (dict): environment variables | 625990633cc13d1c6d466e4d |
class MaskedActionsMLP(DistributionalQModel, TFModelV2): <NEW_LINE> <INDENT> def __init__(self, obs_space, action_space, num_outputs, model_config, name, **kwargs): <NEW_LINE> <INDENT> super().__init__(obs_space, action_space, num_outputs, model_config, name, **kwargs) <NEW_LINE> orig_space = obs_space.original_space['... | Tensorflow model that supports policy gradient and DQN policies. | 6259906316aa5153ce401be7 |
class UnexpectedBasisException(Exception): <NEW_LINE> <INDENT> pass | A SkipList Exception to be used when basis can't be computed. | 625990634f6381625f19a029 |
class ServiceWebhooks(BaseModel): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> db_table = 'service_webhooks' <NEW_LINE> <DEDENT> service_id = models.CharField(max_length=32, help_text=u"组件id") <NEW_LINE> state = models.BooleanField(default=False, help_text=u"状态(开启,关闭)") <NEW_LINE> webhooks_type = models.CharFiel... | 组件的自动部署属性 | 62599063e64d504609df9f53 |
class Children(NodeSet): <NEW_LINE> <INDENT> def __init__(self, ns): <NEW_LINE> <INDENT> self.__dict__.update(ns.__dict__) <NEW_LINE> self.label = 'CHILDREN-OF-%s' % ns.label <NEW_LINE> self.xpath = ns.xpath + '[1]/*' | Gets children of the node set | 6259906321bff66bcd724370 |
class ReciprocalHyperbolicFunction(HyperbolicFunction): <NEW_LINE> <INDENT> _reciprocal_of = None <NEW_LINE> _is_even = None <NEW_LINE> _is_odd = None <NEW_LINE> @classmethod <NEW_LINE> def eval(cls, arg): <NEW_LINE> <INDENT> if arg.could_extract_minus_sign(): <NEW_LINE> <INDENT> if cls._is_even: <NEW_LINE> <INDENT> re... | Base class for reciprocal functions of hyperbolic functions. | 62599063627d3e7fe0e08596 |
class SVRExperimentConfiguration(ec.ExperimentConfiguration): <NEW_LINE> <INDENT> def __init__(self, campaign_configuration, hyperparameters, regression_inputs, prefix): <NEW_LINE> <INDENT> super().__init__(campaign_configuration, hyperparameters, regression_inputs, prefix) <NEW_LINE> self.technique = ec.Technique.SVR ... | Class representing a single experiment configuration for linear regression
Attributes
----------
_linear_regression : LinearRegression
The actual scikt object which performs the linear regression
Methods
-------
_train()
Performs the actual building of the linear model
compute_estimations()
Compute the e... | 62599063e76e3b2f99fda10b |
class File(object): <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> return 'File({abs}, {root})'.format(abs=repr(self.absolute), root=repr(self.root)) <NEW_LINE> <DEDENT> def __init__(self, abs_path, root): <NEW_LINE> <INDENT> if not abs_path.startswith(root): <NEW_LINE> <INDENT> raise ValueError('file absp... | Easily get properties for files
there was probably a library class like this already; things got out of
hand. | 6259906367a9b606de547628 |
class InvalidKeySignature(Exception): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Exception.__init__(self) | Exception to raise when we encounter an invalid key signature. | 625990639c8ee82313040d0e |
class Formula(object): <NEW_LINE> <INDENT> u <NEW_LINE> col_ind = '[A-Z]+' <NEW_LINE> row_ind = '[1-9][0-9]*' <NEW_LINE> cell_coord = '[$]?'.join(['', col_ind, row_ind]) <NEW_LINE> col_re = re.compile(col_ind) <NEW_LINE> row_re = re.compile(row_ind) <NEW_LINE> cell_coordinates_re = re.compile(cell_coord) <NEW_LINE> _ca... | Изменение формулы для последующего вывода | 62599063b7558d5895464ab4 |
class Transport(): <NEW_LINE> <INDENT> def __init__(self, que): <NEW_LINE> <INDENT> self.log = logging.getLogger("ChessLinkPyBlue") <NEW_LINE> self.que = que <NEW_LINE> self.init = True <NEW_LINE> self.is_open = False <NEW_LINE> self.log.debug("init ok") <NEW_LINE> <DEDENT> def search_board(self): <NEW_LINE> <INDENT> s... | non-functional frame | 625990635166f23b2e244adf |
class CarTypeSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = CarType <NEW_LINE> fields = '__all__' | 车型序列化器 | 625990634f88993c371f10a5 |
class BetGrouping: <NEW_LINE> <INDENT> GroupBets = 'true' <NEW_LINE> IndividualBets = 'false' <NEW_LINE> Default = IndividualBets | Group betting report to return average odds and total stake on runners or all bets individually.
:var true: group bets by runner and average odds, sum stakes
:var false: return all bets individually | 625990631f5feb6acb1642f7 |
class AuthMeta(models.Model): <NEW_LINE> <INDENT> def __unicode__(self): <NEW_LINE> <INDENT> return '%s - %s' % (self.user, self.provider) <NEW_LINE> <DEDENT> user = models.ForeignKey(User) <NEW_LINE> provider = models.CharField(max_length = 200) <NEW_LINE> provider_model = models.CharField(max_length=40) <NEW_LINE> pr... | Metadata for Authentication | 6259906399cbb53fe68325ef |
class Person: <NEW_LINE> <INDENT> population = 0 <NEW_LINE> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> Person.population += 1 <NEW_LINE> print("Person Instantiated.{}".format(self.name)) <NEW_LINE> <DEDENT> def say_hi(self, myname=None): <NEW_LINE> <INDENT> if not myname: <NEW_LINE> <INDE... | Represents the person class | 6259906356ac1b37e630386d |
class PageDetailView(DetailView): <NEW_LINE> <INDENT> model = Page <NEW_LINE> context_object_name = 'page' <NEW_LINE> template_name = 'pages/page_detail.html' <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super(PageDetailView, self).get_context_data(**kwargs) <NEW_LINE> if self.object.t... | simple static view.
can render markdown or reStructured text | 625990637d43ff2487427f96 |
class MockODBCCursor(mock.Mock): <NEW_LINE> <INDENT> def __init__(self, existing_update_ids): <NEW_LINE> <INDENT> super(MockODBCCursor, self).__init__() <NEW_LINE> self.existing = existing_update_ids <NEW_LINE> <DEDENT> def execute(self, query, params): <NEW_LINE> <INDENT> if query.startswith('SELECT 1 FROM table_updat... | Keeps state to simulate executing SELECT queries and fetching results. | 6259906366673b3332c31b09 |
class Testcase_210_50_port_administratively_down(base_tests.SimpleDataPlane): <NEW_LINE> <INDENT> def tearDown(self): <NEW_LINE> <INDENT> in_port, out_port = openflow_ports(2) <NEW_LINE> request = ofp.message.port_desc_stats_request() <NEW_LINE> port_stats = get_stats(self, req = request) <NEW_LINE> port_config_set(sel... | Purpose
Verify a port status change message is received, and the bitmap reflects the change in the port config.
Methodology
Configure and connect DUT to controller. After control channel establishment, install a table_miss flow entry to generate ofp_packet_in messages. Send an ofp_port_mod message that sets the all co... | 62599063be8e80087fbc0794 |
class VertAnimSprite(AnimSprite): <NEW_LINE> <INDENT> def __init__(self, image, init_pos, speed): <NEW_LINE> <INDENT> AnimSprite.__init__(self, image, init_pos, speed) <NEW_LINE> self.limit = self.image.get_width() <NEW_LINE> <DEDENT> def update(self, time_pass_sec): <NEW_LINE> <INDENT> AnimSprite.update(self, time_pas... | A vertical animated sprite. | 6259906345492302aabfdbe8 |
class merge(Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Module.__init__(self, "merge", MERGE) <NEW_LINE> self.conf.addArgument({"input": Argument.Required|Argument.List|typeId.Node, "name": "files", "description": "these files will be concatenated in the order they are provided", "parameters": ... | This module concatenates two or more files. | 625990634f6381625f19a02a |
class MagnetostaticFields(FieldDiagnostic): <NEW_LINE> <INDENT> def gatherfields(self): <NEW_LINE> <INDENT> if self.lparallel == 1: <NEW_LINE> <INDENT> self.bfield = self.solver.getb(bcast=0) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.bfield = [] <NEW_LINE> for dim in ['x', 'y', 'z']: <NEW_LINE> <INDENT> self.b... | Produce an HDF5 file with magnetic fields and vector potential.
File tree:
/data/meshes/
/mesh
/x
/y
/z
Note that the coordinates will be replaced as appropriate for different
solver geometries (e.g. xyz -> rtz for RZgeom).
/vector_potential
/x
/y
/z
... | 625990638e7ae83300eea79b |
class ApproximateQAgent(PacmanQAgent): <NEW_LINE> <INDENT> def __init__(self, extractor='IdentityExtractor', **args): <NEW_LINE> <INDENT> self.featExtractor = util.lookup(extractor, globals())() <NEW_LINE> PacmanQAgent.__init__(self, **args) <NEW_LINE> self.weights = util.Counter() <NEW_LINE> <DEDENT> def getWeights(se... | ApproximateQLearningAgent
You should only have to overwrite getQValue
and update. All other QLearningAgent functions
should work as is. | 62599063009cb60464d02c44 |
class TmpFileCleanup(object): <NEW_LINE> <INDENT> def __enter__(self): <NEW_LINE> <INDENT> self.tmp_files = [] <NEW_LINE> return self <NEW_LINE> <DEDENT> def __exit__(self, exc_type, exc_val, exc_tb): <NEW_LINE> <INDENT> for file_path in self.tmp_files: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> os.remove(file_path) ... | Used to clean up tmp files.
| 6259906391af0d3eaad3b536 |
class PasswordResetTokenGenerator(object): <NEW_LINE> <INDENT> def make_token(self, user): <NEW_LINE> <INDENT> return self._make_token_with_timestamp(user, self._num_days(self._today())) <NEW_LINE> <DEDENT> def check_token(self, user, token): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> ts_b36, hash = token.split("-") ... | Strategy object used to generate and check tokens for the password
reset mechanism. | 625990637d847024c075dae4 |
class RaspVariantsParser(object): <NEW_LINE> <INDENT> def __init__(self, current_time, redis_client=None, url=None): <NEW_LINE> <INDENT> self.tmp_rasp_variants = util.tree() <NEW_LINE> self.current_time = current_time <NEW_LINE> self.redis_client = redis_client <NEW_LINE> self.url = url <NEW_LINE> <DEDENT> def set(self... | Парсер запроса getRaspVariants | 6259906332920d7e50bc7754 |
class AbstractSelection(object): <NEW_LINE> <INDENT> def __init__(self, mutator, crossover, repairer = None): <NEW_LINE> <INDENT> self._mutator = mutator <NEW_LINE> self._crossover = crossover <NEW_LINE> self._repairer = repairer <NEW_LINE> <DEDENT> def mutate_and_crossover(self, org_1, org_2): <NEW_LINE> <INDENT> cros... | Base class for Selector classes.
This classes provides useful functions for different selector classes
and also defines the functions that all selector classes must
implement.
This class should not be used directly, but rather should be subclassed. | 625990633539df3088ecd9ab |
class ProductLabelPrintWizard(models.TransientModel): <NEW_LINE> <INDENT> _name = 'product.label.print.wizard' <NEW_LINE> _description = 'Wisaya Cetak Label Produk' <NEW_LINE> number_of_copy = fields.Integer(string="Jumlah Rangkap", default=1) <NEW_LINE> product_label_wizard = fields.One2many('product.label.wizard', 'p... | Wisaya Cetak Label Produk. | 62599063097d151d1a2c2779 |
class _Transaction(Transaction): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def addTransaction(cls): <NEW_LINE> <INDENT> cls._threadTransactionList().append(cls()) <NEW_LINE> return cls.transaction() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def removeTransaction(cls): <NEW_LINE> <INDENT> cls._threadTransactionList(... | Decorator-local transaction object providing actual transaction
capabilities. | 6259906392d797404e3896e4 |
class Node: <NEW_LINE> <INDENT> def __init__(self, data, next_node=None): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.next_node = next_node <NEW_LINE> <DEDENT> @property <NEW_LINE> def data(self): <NEW_LINE> <INDENT> return self.__data <NEW_LINE> <DEDENT> @data.setter <NEW_LINE> def data(self, value): <NEW_LIN... | Class Node singly linked | 6259906399cbb53fe68325f1 |
class Curation(models.Model): <NEW_LINE> <INDENT> curation_id = models.AutoField(primary_key=True) <NEW_LINE> TF_species = models.CharField(max_length=500) <NEW_LINE> site_species = models.CharField(max_length=500) <NEW_LINE> experimental_process = models.TextField(null=True, blank=True) <NEW_LINE> forms_complex = mode... | Curation model.
Contains all the details about the curation, such as reported TF and
species, followed experimental process, link to curator, publication,
etc. Also keeps some meta-information about the curation, such as whether
it requires revision, ready for NCBI submission, validation status, etc. | 625990632ae34c7f260ac7f6 |
class Context(_messages.Message): <NEW_LINE> <INDENT> rules = _messages.MessageField('ContextRule', 1, repeated=True) | `Context` defines which contexts an API requests. Example:
context: rules: - selector: "*" requested: -
google.rpc.context.ProjectContext - google.rpc.context.OriginContext
The above specifies that all methods in the API request
`google.rpc.context.ProjectContext` and `google.rpc.co... | 625990638e7ae83300eea79d |
class Bluewave(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def getDefaultManager(): <NEW_LINE> <INDENT> global defaultManager <NEW_LINE> if defaultManager == None: <NEW_LINE> <INDENT> defaultManager = BluewaveManager() <NEW_LINE> <DEDENT> return defaultManager | docstring for Bluewave | 625990638a43f66fc4bf389e |
class OpWrappedCache(Operator): <NEW_LINE> <INDENT> Input = InputSlot(level=1) <NEW_LINE> innerBlockShape = InputSlot() <NEW_LINE> outerBlockShape = InputSlot() <NEW_LINE> fixAtCurrent = InputSlot(value = False) <NEW_LINE> Output = OutputSlot(level=1) <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> ... | This quick hack is necessary because there's not currently a way to wrap an OperatorWrapper.
We need to double-wrap the cache, so we need this operator to provide the first level of wrapping. | 625990634e4d562566373b16 |
class NotesExtraZero(models.Model): <NEW_LINE> <INDENT> another_field = models.CharField( 'Note2', null=True, blank=True, max_length=255) <NEW_LINE> book = models.ForeignKey(SortableBook, null=True, on_delete=models.SET_NULL) <NEW_LINE> my_order = models.PositiveIntegerField(blank=False, null=True) <NEW_LINE> class Met... | various SortableInlineMixon modes (testing "extra" on admin.Meta) | 62599063627d3e7fe0e0859a |
class OAuth2(object): <NEW_LINE> <INDENT> def __init__(self, client_id, scopes): <NEW_LINE> <INDENT> self.client_id = client_id <NEW_LINE> self.scopes = scopes <NEW_LINE> <DEDENT> def _build_authorization_request_url( self, response_type, redirect_url, state=None ): <NEW_LINE> <INDENT> if response_type not in auth.VALI... | The parent class for all OAuth 2.0 grant types. | 62599063e76e3b2f99fda10f |
class GraspTorStruct(OrderedDict): <NEW_LINE> <INDENT> def __init__(self, tor_struct=None): <NEW_LINE> <INDENT> OrderedDict.__init__(self) <NEW_LINE> if tor_struct: <NEW_LINE> <INDENT> self.fill(tor_struct) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> <DEDENT> def __repr__(self): <NEW_LINE> <I... | A container for a GraspTorStruct, that has a number of members. Members are
stored as an OrderedDict. | 625990634428ac0f6e659c43 |
class Menu: <NEW_LINE> <INDENT> fps = 0.1 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.current = 0 <NEW_LINE> self.screens = NAV_SCREENS <NEW_LINE> self.screens.update(EXIT_SCREEN) <NEW_LINE> self.screen_names = list(self.screens.keys()) <NEW_LINE> self.number_of_screens = len(self.screens) - 1 <NEW_LINE> se... | Navigation/ Menu system for choosing a game | 62599063f548e778e596cc99 |
class DeleteBlockOff(DeleteView): <NEW_LINE> <INDENT> model = Appointment <NEW_LINE> template_name = 'HealthApps/confirm.html' <NEW_LINE> success_url = "/calView" <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super(DeleteView, self).get_context_data(**kwargs) <NEW_LINE> context['user_ty... | Deletes the block off | 6259906345492302aabfdbeb |
class MonthlyGenerator(Generator): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def get_name(prefix, date): <NEW_LINE> <INDENT> return monthly_name(prefix, date) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def get_day_delta(date): <NEW_LINE> <INDENT> days_in_month = calendar.monthrange(date.year, date.month)[1] <NEW_L... | Generator that generates monthly names. | 6259906329b78933be26ac4c |
class UserSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = get_user_model() <NEW_LINE> fields = ('email', 'password', 'name') <NEW_LINE> extra_kwargs = {'password': {'write_only': True, 'min_length': 5}} <NEW_LINE> <DEDENT> def create(self, validated_data): <NEW_LINE>... | Serializer for the users objects | 62599063d486a94d0ba2d6d9 |
class Node(object): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.next = None <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return 'Node({!r})'.format(self.data) | inherits from Python object class; this creates a node to be used in LinkedList | 62599063460517430c432bdc |
class MonitoredPath(object): <NEW_LINE> <INDENT> def __init__(self, path, event_mask, fsmonitor_ref=None): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.event_mask = event_mask <NEW_LINE> self.fsmonitor_ref = fsmonitor_ref <NEW_LINE> self.monitoring = False | A simple container for all metadata related to a monitored path | 625990634f88993c371f10a7 |
class SensitiveReScrubber(SensitiveStringScrubber): <NEW_LINE> <INDENT> def __init__(self, sensitive_res): <NEW_LINE> <INDENT> self.sensitive_res = [re.compile(r) for r in sensitive_res] <NEW_LINE> <DEDENT> def FindSensitiveStrings(self, text): <NEW_LINE> <INDENT> result = [] <NEW_LINE> for sensitive_re in self.sensiti... | Helper class to find sensitive regular expression matches. | 62599063379a373c97d9a72e |
class ImageRepository(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Reponame = None <NEW_LINE> self.Repotype = None <NEW_LINE> self.TagCount = None <NEW_LINE> self.IsPublic = None <NEW_LINE> self.IsUserFavor = None <NEW_LINE> self.IsQcloudOfficial = None <NEW_LINE> self.FavorCount = N... | 镜像仓库
| 625990633cc13d1c6d466e53 |
class TestRiskDeliveryAddress(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 testRiskDeliveryAddress(self): <NEW_LINE> <INDENT> pass | RiskDeliveryAddress unit test stubs | 62599063baa26c4b54d509b4 |
class JSONFileStorage(FileStorage): <NEW_LINE> <INDENT> def load(self): <NEW_LINE> <INDENT> content = self._load_raw_content() <NEW_LINE> return self._deserialize(content) <NEW_LINE> <DEDENT> def save(self, content): <NEW_LINE> <INDENT> content = self._serialize(content) <NEW_LINE> self._save_raw_content(content) <NEW_... | Utility object to save and load serialized JSON objects stored in a file. | 62599063d7e4931a7ef3d70d |
@dataclass <NEW_LINE> class CyclicLRParams(SchedulerParams): <NEW_LINE> <INDENT> base_lr: float = 0.001 <NEW_LINE> max_lr: float = 0.1 <NEW_LINE> step_size_up: int = 2000 <NEW_LINE> step_size_down: Optional[int] = None <NEW_LINE> mode: str = 'triangular' <NEW_LINE> gamma: float = 1.0 <NEW_LINE> scale_mode: str = 'cycle... | Config for CyclicLR.
NOTE:
# `scale_fn` is not supported
It is not derived from Config as it is not a NeMo object (and in particular it doesn't need a name). | 6259906356b00c62f0fb3fdc |
class PatchManager: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ungrown_patches = [] <NEW_LINE> <DEDENT> def add_patch(self, patch): <NEW_LINE> <INDENT> self.ungrown_patches.append(patch) <NEW_LINE> <DEDENT> def remove_patch(self, patch): <NEW_LINE> <INDENT> self.ungrown_patches.remove(patch) <NEW_... | Class that helps defining the patches into the model.
attributes:
ungrown_patches: list of all non grown patches
methods:
grow_patches
add_patch
remove_patch | 625990637d43ff2487427f98 |
class ImageDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, file_name, length, class_num, transform=None): <NEW_LINE> <INDENT> with open(file_name) as fh: <NEW_LINE> <INDENT> self.img_and_label = fh.readlines() <NEW_LINE> <DEDENT> self.length = length <NEW_LINE> self.transform = transform <NEW_LINE> self.class_... | Face Landmarks dataset. | 62599063498bea3a75a59188 |
class UserBooksSessionsListSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> url = serializers.HyperlinkedIdentityField(view_name='user-session-detail', read_only=True) <NEW_LINE> user = serializers.ReadOnlyField(source='user.username') <NEW_LINE> library = serializers.ReadOnlyField(source='library.title') <... | Сериализатор для получения списка сессий пользователей
с гиперссылками на их экземпляры | 6259906397e22403b383c61d |
class Timeout(socket.timeout): <NEW_LINE> <INDENT> def __init__(self, message: str) -> None: <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.message = message | Wrapper for network timeouts.
This wraps both "socket.timeout" and "asyncio.TimeoutError" | 625990638e7ae83300eea79f |
class Hunk(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.startsrc = None <NEW_LINE> self.linessrc = None <NEW_LINE> self.starttgt = None <NEW_LINE> self.linestgt = None <NEW_LINE> self.invalid = False <NEW_LINE> self.hasplus = False <NEW_LINE> self.hasminus = False <NEW_LINE> self.text = [] ... | Parsed hunk data container (hunk starts with @@ -R +R @@) | 6259906321bff66bcd724376 |
class TestConverter(TestCase): <NEW_LINE> <INDENT> def test_converter(self): <NEW_LINE> <INDENT> c = UpcaseConverter() <NEW_LINE> test_cases = [ ('big bad wolf', 'BIG BAD WOLF'), ('big <strong>bad</strong> wolf', 'BIG <strong>BAD</strong> WOLF'), ('big <b>bad</b> <i>wolf</i>', 'BIG <b>BAD</b> <i>WOLF</i>'), ('big %(adj... | Tests functionality of i18n/converter.py | 62599063d268445f2663a6e5 |
class UTC(datetime.tzinfo): <NEW_LINE> <INDENT> def __init__(self, offset=0): <NEW_LINE> <INDENT> if not -24 < offset < 24: <NEW_LINE> <INDENT> raise ValueError("offset must be greater than -24 " "and less than 24") <NEW_LINE> <DEDENT> self.offset = datetime.timedelta(hours=offset) <NEW_LINE> <DEDENT> def utcoffset(sel... | UTC timezone with optional offset. | 62599063ac7a0e7691f73bf6 |
class GroupViewSet(mixins.RetrieveModelMixin, mixins.ListModelMixin, mixins.CreateModelMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> queryset = Group.objects.order_by('name') <NEW_LINE> serializer_class = GroupSerializer <NEW_LINE> permission_classes = (IsAdminUser,) <NEW_LINE> def create(self, request, *args, *... | Returns a list of all User Groups | 625990637047854f46340ace |
class ExistingSourceError(PyfaError): <NEW_LINE> <INDENT> pass | Raised on attempt to add source with alias which
already exists. | 625990638e71fb1e983bd1dd |
class ProdConfig(Config): <NEW_LINE> <INDENT> SQLALCHEMY_DATABASE_URI = os.environ.get("DATABASE_URL") | Production configuration child class
Args:
Config: The parent configuration class with general configuration settings | 62599063f548e778e596cc9b |
class FirstLevelSpells: <NEW_LINE> <INDENT> pass | First-level spell class
This class defines first-level spells as attributes, and their
incantations as those attributes' values. | 62599063462c4b4f79dbd118 |
class User: <NEW_LINE> <INDENT> headers = ['username', 'name', 'avatar', 'email', 'summary', 'id', 'extra'] <NEW_LINE> def __init__(self, data): <NEW_LINE> <INDENT> self.colors = ['green', 'red', 'blue', '#EFE630', '#E10D87', '#11E3D3', '#E49434'] <NEW_LINE> self.colors = iter(self.colors) <NEW_LINE> options = collecti... | simple wrapper for user database listings
username text, name text, avatar text, email text, summary text, id int, extra text | 62599063435de62698e9d51a |
class DATA_OT_jet_low_res_list_hide(Operator): <NEW_LINE> <INDENT> bl_idname = "low_res_obj_list_hide.btn" <NEW_LINE> bl_label = "Show/Hide Objects" <NEW_LINE> bl_description = "Show/Hide Objects all object from the list" <NEW_LINE> hide = BoolProperty(default=False) <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, con... | Operator to show/hide objects from the list | 62599063adb09d7d5dc0bc7c |
class Task(models.Model): <NEW_LINE> <INDENT> date_created = models.DateTimeField(auto_now_add=True, blank=True, null=True) <NEW_LINE> date_done = models.DateTimeField(blank=True, null=True) <NEW_LINE> description = models.CharField('What needs to be done?', max_length=255) <NEW_LINE> is_checked = models.BooleanField(d... | Task that needs to be done. | 6259906329b78933be26ac4d |
class MappingAction(APIView): <NEW_LINE> <INDENT> def post(self, request, format=None): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> action = request.data.get('action') <NEW_LINE> username = request.data.get('username') <NEW_LINE> <DEDENT> except KeyError as e: <NEW_LINE> <INDENT> raise APIException('An action and user... | Generic API endpoint for the login/update/logout actions. | 62599063d486a94d0ba2d6db |
class Task(EndpointsModel): <NEW_LINE> <INDENT> _message_fields_schema = ('id', 'text', 'task_list_id', 'details', 'complete', 'assigned_to_email', 'created') <NEW_LINE> text = ndb.StringProperty(required=True) <NEW_LINE> task_list_id = ndb.IntegerProperty(required=True) <NEW_LINE> details = ndb.StringProperty(required... | Model to store a single task | 625990633539df3088ecd9b0 |
class InvalidQueryError(BaseMongoSqlException): <NEW_LINE> <INDENT> def __init__(self, err: str): <NEW_LINE> <INDENT> super(InvalidQueryError, self).__init__('Query object error: {err}'.format(err=err)) | Invalid input provided by the User | 625990637b25080760ed886a |
class ListAPIMixin(mixins.ListModelMixin): <NEW_LINE> <INDENT> exclusive_params = () <NEW_LINE> required_params = () <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> return self.list(request, *args, **kwargs) <NEW_LINE> <DEDENT> def list(self, request, *args, **kwargs): <NEW_LINE> <INDENT> self.c... | Mixin for any endpoint which returns a list of objects from a GET request | 6259906338b623060ffaa3da |
class GrainsTargetingTest(ShellCase): <NEW_LINE> <INDENT> def test_grains_targeting_os_running(self): <NEW_LINE> <INDENT> test_ret = ['sub_minion:', ' True', 'minion:', ' True'] <NEW_LINE> os_grain = '' <NEW_LINE> for item in self.run_salt('minion grains.get os'): <NEW_LINE> <INDENT> if item != 'minion:': <NEW_LI... | Integration tests for targeting with grains. | 625990637d43ff2487427f99 |
class ObtainJSONWebToken(CustomJSONWebTokenAPIView): <NEW_LINE> <INDENT> serializer_class = JSONWebTokenSerializer | API View that receives a POST with a user's username and password.
Returns a JSON Web Token that can be used for authenticated requests. | 62599063498bea3a75a59189 |
class EventContactUpdated(object): <NEW_LINE> <INDENT> swagger_types = { 'id': 'str', 'created': 'datetime', 'type': 'str', 'contact': 'ContactBase' } <NEW_LINE> attribute_map = { 'id': 'id', 'created': 'created', 'type': '$type', 'contact': 'contact' } <NEW_LINE> def __init__(self, id=None, created=None, type=None, co... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62599063be8e80087fbc079a |
class RT(Enum): <NEW_LINE> <INDENT> WHITESPACE = 1 <NEW_LINE> NEWLINE = 2 <NEW_LINE> ISOLATED_CONSTITUENT = 3 <NEW_LINE> CONSTITUENT = 4 <NEW_LINE> MACRO = 5 <NEW_LINE> INVALID = 6 <NEW_LINE> CLOSING = 7 <NEW_LINE> PUNCTUATION = 8 | Enum of readtable entry types. | 625990638e71fb1e983bd1de |
class ProductComment(models.Model): <NEW_LINE> <INDENT> product = models.ForeignKey('Product') <NEW_LINE> facebook_id = models.CharField(max_length=30, blank=True) <NEW_LINE> name = models.CharField(max_length=400) <NEW_LINE> thumb_url = models.URLField(verify_exists=False, blank=True) <NEW_LINE> comment = models.TextF... | A comment on a product. | 6259906399cbb53fe68325f6 |
class FronteggRESTClient(BaseFronteggClient[None]): <NEW_LINE> <INDENT> def __init__(self, client_id: str, api_key: str, context_callback: typing.Optional[typing.Callable[[ RequestT], FronteggContext]] = None, base_url: str = 'https://api.frontegg.com/', authentication_service_url: typing.Optional[str] = None) -> None:... | A standalone Frontegg REST client. | 62599063f7d966606f749443 |
class FUNCTION(object): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> start = _swig_property(_x64dbgapi.FUNCTION_start_get, _x64dbgapi.FUNCTION_start_set) <NEW_LINE> end = _swig_property(_x64dbgapi.... | Proxy of C++ FUNCTION class | 625990638a43f66fc4bf38a2 |
class HERAgent(GCDQNAgent): <NEW_LINE> <INDENT> def __init__(self, state_space, action_space, goal_size=None, name="DQN + HER", gamma=0.95, epsilon_min=0.01, epsilon_max=1., epsilon_decay_period=1000, epsilon_decay_delay=20, buffer_size=1000000, learning_rate=0.001, update_target_freq=100, batch_size=125, layer_1_size=... | An agent that learn an approximated Q-Function using a neural network.
This Q-Function is used to find the best action to execute in a given state. | 625990637cff6e4e811b7159 |
class Order(ARMBaseModel): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'current_status': {'readonly': True}, 'order_history': {'readonly': True}, 'serial_number': {'readonly': True}, 'delivery_tracking_info': {'readonly': True}, 'return_tracking_... | The order details.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The path ID that uniquely identifies the object.
:vartype id: str
:ivar name: The object name.
:vartype name: str
:ivar type: The hierarchical type of the object.
:vartype type: str
:param contact_info... | 625990637d847024c075dae9 |
class LambdaActionStep(ActionStep): <NEW_LINE> <INDENT> def __init__(self, action: Callable, compensation: Callable, **action_step_kwargs): <NEW_LINE> <INDENT> super().__init__(**action_step_kwargs) <NEW_LINE> self.__action = action <NEW_LINE> self.__compensation = compensation <NEW_LINE> <DEDENT> @property <NEW_LINE> ... | The LambdaActionStep class represents an abstract action that gets an action and compensation as a callable.
The LambdaActionStep handles the logic of act and compensate with the given callables. | 625990633d592f4c4edbc5f0 |
class Splitter(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Splitter, self).__init__() <NEW_LINE> <DEDENT> def __call__(self, f): <NEW_LINE> <INDENT> Parser.splitters.append(f) <NEW_LINE> return f | Decorator for a Splitter | 62599063627d3e7fe0e0859e |
class GacsIgslAnalysisJobForm(ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = GacsIgslAnalysisJob <NEW_LINE> exclude = ['request', 'expected_runtime'] | Form used to start GACS-dev IGSL jobs | 62599063e76e3b2f99fda113 |
class CacheImpl: <NEW_LINE> <INDENT> def __init__(self, cache): <NEW_LINE> <INDENT> self.cache = cache <NEW_LINE> <DEDENT> pass_context = False <NEW_LINE> def get_or_create(self, key, creation_function, **kw): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def set(self, key, value, **kw): <NEW_LINE... | Provide a cache implementation for use by :class:`.Cache`. | 625990634e4d562566373b1b |
class EditPostForm(CreatePostForm): <NEW_LINE> <INDENT> pic_forms = FieldList(FormField(EditImageDataForm)) <NEW_LINE> submit = SubmitField("Update") | Post editing and updating posts. | 6259906367a9b606de54762c |
class ADUsersService(UsersService): <NEW_LINE> <INDENT> readonly_fields = ['username', 'display_name', 'password', 'email', 'phone', 'first_name', 'last_name'] <NEW_LINE> def on_fetched(self, doc): <NEW_LINE> <INDENT> super().on_fetched(doc) <NEW_LINE> for document in doc['_items']: <NEW_LINE> <INDENT> document['_reado... | Service class for UsersResource and should be used when AD is active. | 625990636e29344779b01d63 |
class ShowMacAddressTableLearningSchema(MetaParser): <NEW_LINE> <INDENT> schema = { 'vlans': { Any(): { 'mac_learning': bool, 'vlan': Or(int, str) } } } | Schema for show mac address-table learning | 62599063460517430c432bde |
class OrderPayView(View): <NEW_LINE> <INDENT> def post(self, request): <NEW_LINE> <INDENT> user = request.user <NEW_LINE> if not user.is_authenticated(): <NEW_LINE> <INDENT> return JsonResponse({'res': 0, 'errmsg': '用户未登录'}) <NEW_LINE> <DEDENT> order_id = request.POST.get('order_id') <NEW_LINE> if not all([order_id]): ... | 订单支付 | 6259906329b78933be26ac4e |
class TestPOSTOrderPreviewRequestTypeSubscriptions(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 testPOSTOrderPreviewRequestTypeSubscriptions(self): <NEW_LINE> <INDENT> pass | POSTOrderPreviewRequestTypeSubscriptions unit test stubs | 625990633539df3088ecd9b2 |
class EventCreate(CreateView): <NEW_LINE> <INDENT> form_class = EventForm <NEW_LINE> model = Event <NEW_LINE> template_name = 'evenio/event_form.html' <NEW_LINE> context_object_name = 'event' | Creates an event
| 625990631f5feb6acb1642ff |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.