code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
@view_auth_classes() <NEW_LINE> class CourseGradingPolicy(GradeViewMixin, ListAPIView): <NEW_LINE> <INDENT> allow_empty = False <NEW_LINE> def get(self, request, course_id, **kwargs): <NEW_LINE> <INDENT> course = self._get_course(request, course_id, request.user, 'staff') <NEW_LINE> if isinstance(course, Response): <NE... | **Use Case**
Get the course grading policy.
**Example requests**:
GET /api/grades/v0/policy/{course_id}/
**Response Values**
* assignment_type: The type of the assignment, as configured by course
staff. For example, course staff might make the assignment types Homework,
Quiz, and Exam.
... | 62599076379a373c97d9a982 |
class GetMaintenanceScheduleInfo(Base): <NEW_LINE> <INDENT> def __init__(self, ): <NEW_LINE> <INDENT> super(GetMaintenanceScheduleInfo, self).__init__( module='admin', cls='GetMaintenanceScheduleInfo', fn='get', args={ }) | class: veracode.SDK.admin.GetMaintenanceScheduleInfo
params:
returns: A python object that represents the returned API data. | 62599076167d2b6e312b8241 |
class Exploit(BaseExploit): <NEW_LINE> <INDENT> target_protocol = Protocol.CUSTOM <NEW_LINE> def run(self): <NEW_LINE> <INDENT> raise NotImplementedError("You have to define your own 'run' method.") <NEW_LINE> <DEDENT> def check(self): <NEW_LINE> <INDENT> raise NotImplementedError("You have to define your own 'check' m... | Base class for exploits | 6259907621bff66bcd7245c9 |
class ofdpaDropStatusEntry_t(_object): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, ofdpaDropStatusEntry_t, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, ofdpaDropStatusEntry_t, name... | Proxy of C ofdpaDropStatusEntry_s struct | 625990764e4d562566373d65 |
class GridMDP(MDP): <NEW_LINE> <INDENT> def __init__(self, grid, terminals, init=(0, 0), gamma=.9): <NEW_LINE> <INDENT> grid.reverse() <NEW_LINE> MDP.__init__(self, init, actlist=orientations, terminals=terminals, gamma=gamma) <NEW_LINE> update(self, grid=grid, rows=len(grid), cols=len(grid[0])) <NEW_LINE> for x in ran... | A two-dimensional grid MDP, as in [Figure 17.1]. All you have to do is
specify the grid as a list of lists of rewards; use None for an obstacle
(unreachable state). Also, you should specify the terminal states.
An action is an (x, y) unit vector; e.g. (1, 0) means move east. | 625990765fdd1c0f98e5f8de |
class CreateHTMLConfigData(_CreateBasicHTMLData): <NEW_LINE> <INDENT> def __init__(self, current_config): <NEW_LINE> <INDENT> super().__init__("Config", current_config) <NEW_LINE> <DEDENT> def get_sensor_data(self, ip): <NEW_LINE> <INDENT> command_data = sensor_commands.CreateSensorNetworkCommand(ip, self.network_timeo... | Create a Configuration HTML Report data object. | 625990763d592f4c4edbc80d |
class Order(BaseOrderInfo): <NEW_LINE> <INDENT> SUBMITTED = 1 <NEW_LINE> PROCESSED = 2 <NEW_LINE> SHIPPED = 3 <NEW_LINE> CANCELLED = 4 <NEW_LINE> ORDER_STATUSES = ((SUBMITTED, _(u'Submitted')), (PROCESSED, _(u'Processed')), (SHIPPED, _(u'Shipped')), (CANCELLED, _(u'Cancelled')),) <NEW_LINE> date = models.DateTimeField(... | Класс для заказа | 6259907644b2445a339b760e |
class XIVDS8KDriver(san.SanDriver): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(XIVDS8KDriver, self).__init__(*args, **kwargs) <NEW_LINE> self.configuration.append_config_values(xiv_ds8k_opts) <NEW_LINE> proxy = importutils.import_class(self.configuration.xiv_ds8k_proxy) <NEW_LINE... | Unified IBM XIV and DS8K volume driver. | 625990767cff6e4e811b73a0 |
class CreateNotificationConfigurationResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.AutoScalingNotificationId = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.AutoScalingNotificationId = params.get("AutoScalin... | CreateNotificationConfiguration response structure.
| 625990761f5feb6acb164556 |
class BlockQuote(WebElement): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> tagName = "blockquote" <NEW_LINE> properties = WebElement.properties.copy() <NEW_LINE> properties['cite'] = {'action':'attribute'} | Defines a section that is quoted from another source | 625990768a43f66fc4bf3af6 |
class Encode(Transform): <NEW_LINE> <INDENT> function = 'ENCODE' <NEW_LINE> arity = 2 <NEW_LINE> def __init__(self, *expressions, **extra): <NEW_LINE> <INDENT> raise NotSupportedError('This function is not implemented in ' 'the current version.') | Encode(data bytea, format text)
:return text: | 6259907663b5f9789fe86ac6 |
class DeckGeoJson(BaseDeckGLViz): <NEW_LINE> <INDENT> viz_type = "deck_geojson" <NEW_LINE> verbose_name = _("Deck.gl - GeoJSON") <NEW_LINE> def query_obj(self) -> QueryObjectDict: <NEW_LINE> <INDENT> query_obj = super().query_obj() <NEW_LINE> query_obj["columns"] += [self.form_data.get("geojson")] <NEW_LINE> query_obj[... | deck.gl's GeoJSONLayer | 6259907697e22403b383c863 |
class CTD_ANON_35 (pyxb.binding.basis.complexTypeDefinition): <NEW_LINE> <INDENT> _TypeDefinition = None <NEW_LINE> _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY <NEW_LINE> _Abstract = False <NEW_LINE> _ExpandedName = None <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('/home/user/W... | Angular velocity about the Y axis | 62599076097d151d1a2c29d5 |
class IdChecker: <NEW_LINE> <INDENT> name = "flake8_oist_steps" <NEW_LINE> version = "0.0.1" <NEW_LINE> tet_id_mesg = ( "E421 consider using steps.geom.UNKNOWN_TET" " constant instead of -1." ) <NEW_LINE> tri_id_mesg = ( "E422 consider using steps.geom.UNKNOWN_TRI" " constant instead of -1." ) <NEW_LINE> def __init__(s... | Flake8 checker to enforce usage of STEPS simulator | 6259907697e22403b383c864 |
class BeliefUpdateNodeModel(BayesianModel): <NEW_LINE> <INDENT> def __init__(self, nodes_dict): <NEW_LINE> <INDENT> super().__init__(edges=self._get_edges_from_nodes(nodes_dict.values()), variables=list(nodes_dict.keys()), cpds=[node.cpd for node in nodes_dict.values()]) <NEW_LINE> self.nodes_dict = nodes_dict <NEW_LIN... | A Bayesian model storing nodes (e.g. Node or BernoulliOrNode) implementing properties
and methods for Pearl's belief update algorithm.
ref: "Fusion, Propagation, and Structuring in Belief Networks"
Artificial Intelligence 29 (1986) 241-288 | 62599076be8e80087fbc09f4 |
class User(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> email = models.EmailField(max_length=255, unique=True) <NEW_LINE> name = models.CharField(max_length=255) <NEW_LINE> is_active = models.BooleanField(default=True) <NEW_LINE> is_staff = models.BooleanField(default=False) <NEW_LINE> objects = UserManager... | Custom user model that suppoerts using email instead of username | 62599076fff4ab517ebcf178 |
class ZoomApiService(CallService): <NEW_LINE> <INDENT> ZOOM_API_URL = "https://api.zoom.us/v2/users/" <NEW_LINE> ZOOM_GET_USER_API = "https://api.zoom.us/v2/users/me" <NEW_LINE> def __init__(self, team_id): <NEW_LINE> <INDENT> self.team_id = team_id <NEW_LINE> self.zoom: Zoom = DynamoUtils.get_zoom_data(team_id) <NEW_L... | Service to handle zoom api calls | 625990763317a56b869bf1f6 |
class ConnectorError(MongoConnectorError): <NEW_LINE> <INDENT> pass | Raised when creating a mongo_connector.Connector object with
nonsensical parameters | 6259907623849d37ff852a19 |
class RHCreateReferenceMixin: <NEW_LINE> <INDENT> def _process_args(self): <NEW_LINE> <INDENT> self.reference_value = request.form['value'] <NEW_LINE> reference_type_name = request.form['type'] <NEW_LINE> self.reference_type = (ReferenceType.query .filter(db.func.lower(ReferenceType.name) == reference_type_name.lower()... | Common methods for RH class creating a ContibutionReference
or SubContributionReference. | 625990764527f215b58eb651 |
class TreeItemAttr: <NEW_LINE> <INDENT> def __init__(self, colText=wx.NullColour, colBack=wx.NullColour, font=wx.NullFont): <NEW_LINE> <INDENT> self._colText = colText <NEW_LINE> self._colBack = colBack <NEW_LINE> self._font = font <NEW_LINE> <DEDENT> def SetTextColour(self, colText): <NEW_LINE> <INDENT> self._colText ... | Creates the item attributes (text colour, background colour and font). | 625990762c8b7c6e89bd514a |
class CustomBlockTreeNode(TreeNode): <NEW_LINE> <INDENT> canonical_tag_name = 'test' <NEW_LINE> alias_tag_names = () | Custom subclass of ``TreeNode`` for tests. | 625990764e4d562566373d66 |
class DecisionCreateUpdateNestedSerializer( UpdateNestedMixin, FieldPermissionsSerializerMixin, serializers.ModelSerializer ): <NEW_LINE> <INDENT> id = serializers.IntegerField(required=False) <NEW_LINE> type = InstanceDictPrimaryKeyRelatedField( instance_class=DecisionType, queryset=DecisionType.objects.filter(), rela... | This is used when the decision is added or updated inside a lease
The lease is not included in this serializer, but set via the UpdateNestedMixin in LeaseCreateUpdateSerializer. | 6259907644b2445a339b760f |
@dataclass(frozen=True) <NEW_LINE> class CorosyncRunningOnNode(ReportItemMessage): <NEW_LINE> <INDENT> node: str <NEW_LINE> _code = codes.COROSYNC_RUNNING_ON_NODE <NEW_LINE> @property <NEW_LINE> def message(self) -> str: <NEW_LINE> <INDENT> return f"{self.node}: corosync is running" | Corosync is running on a node, which is not ok
node -- node address / name | 62599076283ffb24f3cf520d |
class MyCustomUser(AbstractUser, PermissionsMixin): <NEW_LINE> <INDENT> username = models.CharField(_('username'), max_length=254, unique=False, blank=True) <NEW_LINE> email = models.EmailField( _('Email Address'), unique=True, error_messages={ 'unique': _("A user with that email already exists."), } ) <NEW_LINE> first... | An abstract base class implementing a fully featured User model with
admin-compliant permissions.
Username, password and email are required. Other fields are optional. | 62599076009cb60464d02e9e |
class BatchTreeOperator(Operator): <NEW_LINE> <INDENT> bl_idname = "mod_tree.batch_tree" <NEW_LINE> bl_label = "Batch Tree Generation" <NEW_LINE> bl_options = {"REGISTER", "UNDO"} <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> print(LOGO) <NEW_LINE> messages, message_lvls, status = save_everything() <NEW_LI... | Batch trees | 62599076f548e778e596cef2 |
class UserProfileSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = models.UserProfile <NEW_LINE> fields = ('id', 'name', 'email', 'password') <NEW_LINE> extra_kwargs = { 'password': { 'write_only': True, 'style': {'input_type': 'password'} } } <NEW_LINE> <DEDENT> def c... | Serializes a user profile object | 625990767047854f46340d1b |
class OpenfoodfactsClient: <NEW_LINE> <INDENT> def __init__(self, country="fr"): <NEW_LINE> <INDENT> if country not in ("fr", "en", "world"): <NEW_LINE> <INDENT> raise ValueError("Country must be fr, en or world") <NEW_LINE> <DEDENT> self.url = f"https://{country}.openfoodfacts.org/cgi/search.pl" <NEW_LINE> <DEDENT> de... | Attributes and methods to do things with Open Food Facts API | 62599076f9cc0f698b1c5f7d |
class IngeschrevenPersoonHalAllOf(ModelNormal): <NEW_LINE> <INDENT> allowed_values = { } <NEW_LINE> validations = { } <NEW_LINE> additional_properties_type = None <NEW_LINE> _nullable = False <NEW_LINE> @cached_property <NEW_LINE> def openapi_types(): <NEW_LINE> <INDENT> lazy_import() <NEW_LINE> return { 'embedded': (I... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
Attributes:
allowed_values (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
with a capitalized key describing the a... | 6259907663b5f9789fe86ac8 |
class Soul: <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> pool = random.randint(3, 10) <NEW_LINE> self.ar_boost = random.randint(1, pool-2) <NEW_LINE> pool -= self.ar_boost <NEW_LINE> self.df_boost = random.randint(1, pool-1) <NEW_LINE> pool -= self.df_boost <NEW_LINE> se... | Soul class | 62599076e1aae11d1e7cf4c0 |
@register_response('goto') <NEW_LINE> @register <NEW_LINE> class GotoResponse(BaseSchema): <NEW_LINE> <INDENT> __props__ = { "seq": { "type": "integer", "description": "Sequence number." }, "type": { "type": "string", "enum": [ "response" ] }, "request_seq": { "type": "integer", "description": "Sequence number of the c... | Response to 'goto' request. This is just an acknowledgement, so no body field is required.
Note: automatically generated code. Do not edit manually. | 62599076adb09d7d5dc0becd |
class ClusterUtilizationModel(GenericChartModel): <NEW_LINE> <INDENT> _title = "Cluster Utilization" | Cluster Utilization Model | 6259907691f36d47f2231b40 |
class ConfigBase(object): <NEW_LINE> <INDENT> config_subdir = None <NEW_LINE> config_suffix = ".json" <NEW_LINE> def __init__(self, name, config_dirs=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self._set_config_dirs(config_dirs) <NEW_LINE> self._set_config_path() <NEW_LINE> self._read_config() <NEW_LINE> <DE... | Base class for configurations. | 625990768a349b6b43687bbd |
class ForgotForm(Form): <NEW_LINE> <INDENT> email = TextField('Email', [validators.Required(), validators.Length(min=3, max=50)]) <NEW_LINE> security_question = TextField('Security Question', [validators.Required(), validators.Length(min=10, max=40)]) <NEW_LINE> security_answer = TextField('Security Answer', [validator... | Forgot password form of the user | 6259907655399d3f05627e7c |
class ListTree: <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> self.__visited = {} <NEW_LINE> return '<Instance of {0}, address {1}:\n{2}{3}>'.format( self.__class__.__name__, id(self), self.__attrnames(self, 0), self.__listclass(self.__class__, 4) ) <NEW_LINE> <DEDENT> def __listclass(self, aClass, indent)... | Mix-in that returns an __str__ trace of the entire class
tree and all its objects' attrs at and above self; run
by print(), str() returns constructed string; uses __X
attr names to avoid impacting clients; uses generator
expr to recurse to superclasses | 625990767d847024c075dd3d |
class AutoTarget: <NEW_LINE> <INDENT> pass | Use this as target value in clients for them to automatically connect
to the target exposed by the server. Servers must have only one target. | 6259907697e22403b383c865 |
class NameGenerator(object): <NEW_LINE> <INDENT> implements(INameGenerator) <NEW_LINE> def __init__(self, context): <NEW_LINE> <INDENT> self.context = context <NEW_LINE> <DEDENT> @property <NEW_LINE> def title(self): <NEW_LINE> <INDENT> import pdb;pdb.set_trace() <NEW_LINE> folder = self.context.aq_parent <NEW_LINE> im... | Customized name from title behavior."
| 62599076d268445f2663a80f |
class Floppy(object): <NEW_LINE> <INDENT> def __init__(self, id, control_pin, direction_pin, arduino): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.control_pin = control_pin <NEW_LINE> self.direction_pin = direction_pin <NEW_LINE> self.arduino = arduino <NEW_LINE> <DEDENT> def play_note(self, note, is_midi=False): ... | Represents a floppy drive connected to the Arduino | 625990767b180e01f3e49d16 |
class RandomSampler(Sampler): <NEW_LINE> <INDENT> def __init__(self, dataset: Dataset): <NEW_LINE> <INDENT> self._dataset = dataset <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> self._dataset.shuffle() <NEW_LINE> return iter(self._dataset.index_pool) <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDE... | Sample elements randomly | 6259907660cbc95b06365a1f |
class ElementViewForFakeModelWithLocateChild(_HasLocateChild, Element): <NEW_LINE> <INDENT> pass | Non-live element with a locateChild. | 62599076fff4ab517ebcf17a |
class Patient(object): <NEW_LINE> <INDENT> def __init__(self, viruses, maxPop): <NEW_LINE> <INDENT> self.viruses = viruses <NEW_LINE> self.maxPop = maxPop <NEW_LINE> <DEDENT> def getViruses(self): <NEW_LINE> <INDENT> return self.viruses <NEW_LINE> <DEDENT> def getMaxPop(self): <NEW_LINE> <INDENT> return self.maxPop <NE... | Representation of a simplified patient. The patient does not take any drugs
and his/her virus populations have no drug resistance. | 6259907632920d7e50bc79ab |
class GenericHandler: <NEW_LINE> <INDENT> def __init__(self, repo: publishing.GenericRepo): <NEW_LINE> <INDENT> self.repo = repo <NEW_LINE> <DEDENT> async def handle_request(self, req: request) -> str: <NEW_LINE> <INDENT> secret = req.args.get('secret') <NEW_LINE> if secret != self.repo.secret: <NEW_LINE> <INDENT> logg... | Handler that serves request for Generic repos.
It verifies that the repo's secret is passed as GET argument of the request | 625990765fc7496912d48f1b |
class PlaceHolder: <NEW_LINE> <INDENT> def __init__(self, alogger): <NEW_LINE> <INDENT> self.loggerMap = { alogger : None } <NEW_LINE> <DEDENT> def append(self, alogger): <NEW_LINE> <INDENT> if alogger not in self.loggerMap: <NEW_LINE> <INDENT> self.loggerMap[alogger] = None | PlaceHolder instances are used in the Manager logger hierarchy to take
the place of nodes for which no loggers have been defined. This class is
intended for internal use only and not as part of the public API. | 625990765fdd1c0f98e5f8e1 |
class TweetsFromFiles(Pipeline): <NEW_LINE> <INDENT> def __init__(self, *filepaths): <NEW_LINE> <INDENT> lines = LinesFromGzipFiles(filepaths) <NEW_LINE> steps = [(map, tweet_info.tweet_from_json_line)] <NEW_LINE> super().__init__(lines, steps) | Iterate over tweets from the given .jsonl.gz files.
Args:
filepaths (iterable of str): Paths to gzip files of tweets.
Yields:
dict: Tweet object.
Notes:
See `twitter_analysis_tools.utils.Pipeline` for more details. | 6259907676e4537e8c3f0ee3 |
class BlogDetails(APIView): <NEW_LINE> <INDENT> def get_object(self, pk): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return Blog.objects.get(pk=pk) <NEW_LINE> <DEDENT> except Blog.DoesNotExist: <NEW_LINE> <INDENT> raise Http404 <NEW_LINE> <DEDENT> <DEDENT> def get(self, request, pk, format=None): <NEW_LINE> <INDENT> ... | Retrieve a Blog instance. | 625990764e4d562566373d67 |
class Sprint(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=100, blank=True, default='') <NEW_LINE> description = models.TextField(blank=True, default='') <NEW_LINE> end = models.DateField() <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> if self.name != '': <NEW_LINE> <INDENT> return "<Sprint:... | a Dev iteration period | 625990763539df3088ecdbfc |
class LutronScene(LutronDevice, Scene): <NEW_LINE> <INDENT> def __init__(self, area_name, keypad_name, lutron_device, lutron_led, controller): <NEW_LINE> <INDENT> super().__init__(area_name, lutron_device, controller) <NEW_LINE> self._keypad_name = keypad_name <NEW_LINE> self._led = lutron_led <NEW_LINE> <DEDENT> def a... | Representation of a Lutron Scene. | 625990767c178a314d78e89d |
class CmdBase(Command): <NEW_LINE> <INDENT> def execute(self): <NEW_LINE> <INDENT> raise Exception("virtual, not implemented") <NEW_LINE> <DEDENT> def undo(self): <NEW_LINE> <INDENT> raise Exception("virtual, not implemented") <NEW_LINE> <DEDENT> def redo(self): <NEW_LINE> <INDENT> self.execute() | Base command | 62599076f548e778e596cef4 |
class AutoModelForPreTraining: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> raise EnvironmentError( "AutoModelForPreTraining is designed to be instantiated " "using the `AutoModelForPreTraining.from_pretrained(pretrained_model_name_or_path)` or " "`AutoModelForPreTraining.from_config(config)` methods." )... | :class:`~transformers.AutoModelForPreTraining` is a generic model class
that will be instantiated as one of the model classes of the library -with the architecture used for pretraining this model– when created with the `AutoModelForPreTraining.from_pretrained(pretrained_model_name_or_path)`
class method.
This class ca... | 62599076f9cc0f698b1c5f7e |
class BreakRop(Op): <NEW_LINE> <INDENT> def __hash__(self): <NEW_LINE> <INDENT> return hash(type(self)) <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return type(self) == type(other) <NEW_LINE> <DEDENT> def make_node(self, x): <NEW_LINE> <INDENT> return Apply(self, [x], [x.type()]) <NEW_LINE> <DEDENT... | @note: Non-differentiable. | 62599076097d151d1a2c29d9 |
class UKAINodeErrorState(object): <NEW_LINE> <INDENT> def __init__(self, address, reason): <NEW_LINE> <INDENT> self._suspend_time = 60 <NEW_LINE> self._address = address <NEW_LINE> self._reason = reason <NEW_LINE> self._retry_after = time.time() + self._suspend_time <NEW_LINE> <DEDENT> @property <NEW_LINE> def address(... | The UKAINodeErrorState class represents the node information
which is considered in a failure status. | 6259907691f36d47f2231b41 |
class MapValue(Record): <NEW_LINE> <INDENT> map = models.ForeignKey(Map) <NEW_LINE> key = models.CharField(max_length=255) <NEW_LINE> v1 = models.TextField(verbose_name='Value 1', blank=True) <NEW_LINE> v2 = models.TextField(verbose_name='Value 2', blank=True, null=True) <NEW_LINE> v3 = models.TextField(verbose_name='V... | Generic key->value mappings for maps | 625990765fc7496912d48f1c |
class DictMatch(ListMatch): <NEW_LINE> <INDENT> MATCH = 'dict' <NEW_LINE> def __init__(self, value, option): <NEW_LINE> <INDENT> ListMatch.__init__(self, value, '', option) <NEW_LINE> self.match = value <NEW_LINE> self.reason = '' <NEW_LINE> self.option = option <NEW_LINE> <DEDENT> def GetValidMatches(self, command, in... | An option that matches on a dict. | 62599076fff4ab517ebcf17c |
class TLStagingNotice(TLChangeNotice): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> content_template = "{} has approved a change for staging to {}" <NEW_LINE> super(TLStagingNotice, self).__init__( content_template=content_template, ) | Notification when entry has been moved from draft
to staging. | 62599076091ae3566870659f |
class SwaApplicationSettingsApplication( ApplicationSettingsApplication ): <NEW_LINE> <INDENT> def __init__(self, config=None): <NEW_LINE> <INDENT> super().__init__(config) <NEW_LINE> if config: <NEW_LINE> <INDENT> self.button_field = config["buttonField"] if "buttonField" in config else None <NEW_LINE> ... | A class for SwaApplicationSettingsApplication objects. | 625990764c3428357761bc1c |
class ApplicationRuleCondition(FirewallPolicyRuleCondition): <NEW_LINE> <INDENT> _validation = { 'rule_condition_type': {'required': True}, } <NEW_LINE> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'rule_condition_type': {'key': 'ruleConditionType', 't... | Rule condition of type application.
All required parameters must be populated in order to send to Azure.
:param name: Name of the rule condition.
:type name: str
:param description: Description of the rule condition.
:type description: str
:param rule_condition_type: Required. Rule Condition Type.Constant filled by s... | 62599076dc8b845886d54f20 |
class Trackpoints(_SegWrap): <NEW_LINE> <INDENT> def import_locations(self, gpx_file): <NEW_LINE> <INDENT> self._gpx_file = gpx_file <NEW_LINE> data = utils.prepare_xml_read(gpx_file, objectify=True) <NEW_LINE> with suppress(AttributeError): <NEW_LINE> <INDENT> self.metadata.import_metadata(data.metadata) <NEW_LINE> <D... | Class for representing a group of :class:`Trackpoint` objects.
.. versionadded:: 0.10.0 | 62599076f548e778e596cef5 |
@attr.attrs(auto_attribs=True) <NEW_LINE> class FileStream(abc.MappingFieldset[OffsetType, Message]): <NEW_LINE> <INDENT> path: str <NEW_LINE> errors: str = attr.attrib( default="warn", validator=attr.validators.in_(["ignore", "warn", "raise"]) ) <NEW_LINE> def items(self) -> T.ItemsView[OffsetType, Message]: <NEW_LINE... | Mapping-like access to a filestream of Messages.
Sample usage:
>>> filestream = FileStream("era5-levels-members.grib")
>>> message1 = filestream[None]
>>> message1["offset"]
0.0
>>> message2 = filestream[14760]
>>> message2["offset"]
14760.0
Note that any offset return the first message found _after_ that offset:
>... | 6259907632920d7e50bc79ae |
class ReturnGameState(messages.Message): <NEW_LINE> <INDENT> user_states = messages.MessageField(StringMessage, 1, repeated=True) | Outbound response to return the state of a game for a user. | 62599076460517430c432d0c |
class SnifferBase(node.NodeBase): <NEW_LINE> <INDENT> def __init__(self, comm): <NEW_LINE> <INDENT> node.NodeBase.__init__(self, comm=comm) | Sniffer STA
This represents a platform-independent monitor STA that should be used by tests.
Real Sniffer STAs should extend this class and implement the actual AP functions. | 625990761f5feb6acb16455c |
class MetaStratusLabXml(MetaDataBase): <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> super(MetaStratusLabXml, self).__init__() <NEW_LINE> try: <NEW_LINE> <INDENT> self.xml_obj = et.parse(filename) <NEW_LINE> <DEDENT> except et.ParseError: <NEW_LINE> <INDENT> vprint('XML parse error') <NEW_LINE> ... | Parse the metadata .xml file, from the stratuslab marketplace
Extract interesting data: url and message digests | 625990768a43f66fc4bf3afc |
class StateTest(object): <NEW_LINE> <INDENT> def __init__(self, func, msg): <NEW_LINE> <INDENT> self.func = func <NEW_LINE> self.msg = msg <NEW_LINE> <DEDENT> def __call__(self, token): <NEW_LINE> <INDENT> return self.func(token) <NEW_LINE> <DEDENT> def expect_token(*types, **kw): <NEW_LINE> <INDENT> msg = kw.pop('msg'... | Wrapper class for basic lambdas in order to simplify
debugging in the parser. It also provides static helper
functions that replace some lambda expressions | 62599076aad79263cf43011f |
class ManagementLinkClient(object): <NEW_LINE> <INDENT> def __init__( self, credentials, subscription_id, api_version='2016-09-01', accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None): <NEW_LINE> <INDENT> self.config = ManagementLinkClientConf... | Azure resources can be linked together to form logical relationships. You can establish links between resources belonging to different resource groups. However, all the linked resources must belong to the same subscription. Each resource can be linked to 50 other resources. If any of the linked resources are deleted or... | 62599076097d151d1a2c29db |
class RpcProxy(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.url = "None" <NEW_LINE> self.flavour = "Base" <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "<{flavour} Client for {url}>".format( url=self.url, flavour=self.flavour) <NEW_LINE> <DEDENT> def __enter__(self): <N... | A base implementation of the proxy pattern for RPC clients. | 62599076a8370b77170f1d33 |
class UHostInstanceSetSchema(schema.ResponseSchema): <NEW_LINE> <INDENT> fields = { "AutoRenew": fields.Str(required=False, load_from="AutoRenew"), "BasicImageId": fields.Str(required=False, load_from="BasicImageId"), "BasicImageName": fields.Str( required=False, load_from="BasicImageName" ), "BootDiskState": fields.St... | UHostInstanceSet - DescribeUHostInstance
| 6259907660cbc95b06365a21 |
class Institution(QObject): <NEW_LINE> <INDENT> populationChanged = pyqtSignal() <NEW_LINE> def __init__(self, parent=None): <NEW_LINE> <INDENT> QObject.__init__(self, parent) <NEW_LINE> self.name = 'Institution' <NEW_LINE> self.people = [] <NEW_LINE> self.templates = [] <NEW_LINE> self.durations = [] | storage of all people
storage of a list of templates used to create events
storage of a list of durations used to sort events | 62599076627d3e7fe0e087ef |
class BroadcastResponse(object): <NEW_LINE> <INDENT> def __init__(self, request_id=None): <NEW_LINE> <INDENT> self.request_id = request_id | BroadcastResponse.
https://developers.line.biz/en/reference/messaging-api/#send-broadcast-message | 6259907623849d37ff852a1f |
class SettingsStringUpdater(object): <NEW_LINE> <INDENT> def __init__(self, source): <NEW_LINE> <INDENT> drv = driver.Driver(pygram.python_grammar, pytree.convert) <NEW_LINE> tree = self._parse_func(drv)(source) <NEW_LINE> if not isinstance(tree, Node): <NEW_LINE> <INDENT> raise SettingsError('Invalid settings: no node... | Base class that implements node tree parsing and updating.
Handles strings. | 6259907616aa5153ce401e41 |
class DeletionRobot: <NEW_LINE> <INDENT> def __init__(self, generator, summary, always=False, undelete=True): <NEW_LINE> <INDENT> self.generator = generator <NEW_LINE> self.summary = summary <NEW_LINE> self.prompt = not always <NEW_LINE> self.undelete = undelete <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> fo... | This robot allows deletion of pages en masse. | 6259907656ac1b37e6303996 |
class DataViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Data.objects.all() <NEW_LINE> serializer_class = DataSerializer | API endpoint that allows data to be viewed or edited. | 625990764a966d76dd5f0852 |
class LutronCasetaFan(LutronCasetaDevice, FanEntity): <NEW_LINE> <INDENT> @property <NEW_LINE> def speed(self) -> str: <NEW_LINE> <INDENT> return VALUE_TO_SPEED[self._device["fan_speed"]] <NEW_LINE> <DEDENT> @property <NEW_LINE> def speed_list(self) -> list: <NEW_LINE> <INDENT> return FAN_SPEEDS <NEW_LINE> <DEDENT> @pr... | Representation of a Lutron Caseta fan. Including Fan Speed. | 6259907655399d3f05627e80 |
class TestExpirable(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 testExpirable(self): <NEW_LINE> <INDENT> pass | Expirable unit test stubs | 625990762ae34c7f260aca4d |
@base <NEW_LINE> class Layer3D(VariableTree): <NEW_LINE> <INDENT> thickness = Array(units='m', desc='layer thickness') <NEW_LINE> angle = Array(units='deg', desc='layup angle') | Same as Layer, except for being a function of span
A layer thickness can go to zero if material disappears at
a certain spanwise location. | 625990768e7ae83300eea9fa |
class Acl(object): <NEW_LINE> <INDENT> def is_authorized(self, user_info=None, action='viewrestr'): <NEW_LINE> <INDENT> if user_info is None: <NEW_LINE> <INDENT> user_info = current_user <NEW_LINE> <DEDENT> restriction = self.get('restriction') <NEW_LINE> if restriction is None: <NEW_LINE> <INDENT> return (1, 'Missing ... | Access controled behavior for JSONAlchemy models. | 62599076be7bc26dc9252b09 |
class EntityAssociation( object ): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.recordType = 4 <NEW_LINE> self.changeIndicator = 0 <NEW_LINE> self.associationStatus = 0 <NEW_LINE> self.associationType = 0 <NEW_LINE> self.entityID = EntityID(); <NEW_LINE> self.ownStationLocation = 0 <NEW_LINE> self.p... | Association or disassociation of two entities. Section 6.2.94.4.3 | 625990767cff6e4e811b73a8 |
class Breadcrumb(models.Model): <NEW_LINE> <INDENT> spot_id = models.BigIntegerField(unique=True) <NEW_LINE> timestamp = models.DateTimeField() <NEW_LINE> point = PointField() <NEW_LINE> raw = JSONField() <NEW_LINE> post = models.ForeignKey( Post, blank=True, null=True, related_name="breadcrumbs", on_delete=models.SET_... | A raw track from the SPOT tracker
Store this separate from the Location to prevent clutter, and to maybe use to display a live-ish track. | 625990767c178a314d78e89f |
class CountryMeta(type): <NEW_LINE> <INDENT> def __getattr__(cls, name): <NEW_LINE> <INDENT> if name.startswith('from'): <NEW_LINE> <INDENT> return partial(cls.fromcode, converter=name[4:]) <NEW_LINE> <DEDENT> return getattr(cls, name) | The :class:`Country` metaclass
Dynamically redirect :meth:`Country.frommycode` to :meth:`Country.fromcode` with the ``mycode`` `converter` | 6259907663b5f9789fe86ace |
@pytest.mark.usefixtures('settings', 'import_realm', 'login_broker_sso_form', 'import_realm_external') <NEW_LINE> class Test_CT_TC_SAML_SSO_BROKER_LOGOUT_SIMPLE(): <NEW_LINE> <INDENT> def test_CT_TC_SAML_SSO_BROKER_LOGOUT_SIMPLE(self, settings, login_broker_sso_form): <NEW_LINE> <INDENT> s = Session() <NEW_LINE> sp = s... | Class to test the CT_TC_SAML_SSO_BROKER_LOGOUT_SIMPLE use case:
As a resource owner I need the solution to ensure that all access tokens/sessions are invalidated
and not usable anymore after the a user of company B, who authenticated on company B IDP,
has proceeded to a logout on the target application.
Company A appli... | 625990767d847024c075dd43 |
class TRPO(PPO): <NEW_LINE> <INDENT> def __init__(self, env, monitor_path: str, video=False, **usercfg) -> None: <NEW_LINE> <INDENT> usercfg["kl_coef"] = 1.0 <NEW_LINE> super().__init__(env, monitor_path, video=video, **usercfg) <NEW_LINE> <DEDENT> def _actor_loss(self, old_logprob, new_logprob, advantage): <NEW_LINE> ... | Trust Region Policy Optimization agent. | 6259907601c39578d7f143e9 |
class RenameRecipientList(Choreography): <NEW_LINE> <INDENT> def __init__(self, temboo_session): <NEW_LINE> <INDENT> Choreography.__init__(self, temboo_session, '/Library/SendGrid/NewsletterAPI/Lists/RenameRecipientList') <NEW_LINE> <DEDENT> def new_input_set(self): <NEW_LINE> <INDENT> return RenameRecipientListInputSe... | Create a new instance of the RenameRecipientList Choreography. A TembooSession object, containing a valid
set of Temboo credentials, must be supplied. | 6259907699cbb53fe683284e |
class VrfSvcsRuleAction(IntEnum): <NEW_LINE> <INDENT> RULE_ACTION_ALLOW = 1 <NEW_LINE> RULE_ACTION_DENY = 2 <NEW_LINE> RULE_ACTION_DNAT = 3 <NEW_LINE> RULE_ACTION_REJECT = 4 <NEW_LINE> RULE_ACTION_SNAT = 5 | actions defined in model,
insert new action values per model before internal actions. | 6259907656ac1b37e6303997 |
class Account: <NEW_LINE> <INDENT> def __init__(self, nAccountNo, nCustomerName, nBalance): <NEW_LINE> <INDENT> self.__AccountNo = nAccountNo <NEW_LINE> self.__CustomerName = nCustomerName <NEW_LINE> self.__Balance = nBalance <NEW_LINE> <DEDENT> def getAccountNo(self): <NEW_LINE> <INDENT> return self.__AccountNo <NEW_L... | superclass for bank account | 62599076cc0a2c111447c786 |
class FirewallPolicyListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[FirewallPolicy]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, value: Optional[List["FirewallPolicy"]] = None, next_link: Optional[str] = None, ... | Response for ListFirewallPolicies API service call.
:param value: List of Firewall Policies in a resource group.
:type value: list[~azure.mgmt.network.v2019_11_01.models.FirewallPolicy]
:param next_link: URL to get the next set of results.
:type next_link: str | 625990764a966d76dd5f0855 |
class random_read_generator: <NEW_LINE> <INDENT> def __init__(self, bamfile, chrom, barcode_getter): <NEW_LINE> <INDENT> inbam = pysam.Samfile(bamfile) <NEW_LINE> if chrom: <NEW_LINE> <INDENT> self.inbam = inbam.fetch(reference=chrom) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.inbam = inbam.fetch() <NEW_LINE> <... | class to generate umis at random based on the
distributon of umis in a bamfile | 6259907676e4537e8c3f0ee9 |
class PHPTravelsPage(BasePageObject): <NEW_LINE> <INDENT> def get_header(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def get_footer(self): <NEW_LINE> <INDENT> pass | This is the base page of the PHP Travels page which contains methods to reach the header and footer | 625990763d592f4c4edbc812 |
class ArgumentError(NelkitException): <NEW_LINE> <INDENT> pass | Raised when passing invalid arguments using cli tools. | 625990768e7ae83300eea9fd |
class CreateCommand(QuantumCommand, show.ShowOne): <NEW_LINE> <INDENT> api = 'network' <NEW_LINE> resource = None <NEW_LINE> log = None <NEW_LINE> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(CreateCommand, self).get_parser(prog_name) <NEW_LINE> parser.add_argument( '--tenant-id', metavar='TENANT... | Create a resource for a given tenant
| 625990767047854f46340d23 |
class MarginalInference(InferenceModule): <NEW_LINE> <INDENT> def initializeUniformly(self, gameState): <NEW_LINE> <INDENT> if self.index == 1: <NEW_LINE> <INDENT> jointInference.initialize(gameState, self.legalPositions) <NEW_LINE> <DEDENT> jointInference.addGhostAgent(self.ghostAgent) <NEW_LINE> <DEDENT> def observe(... | A wrapper around the JointInference module that returns marginal beliefs
about ghosts. | 625990764f6381625f19a160 |
class OutputUrl(models.Model): <NEW_LINE> <INDENT> unique_inputs = models.ForeignKey(TaxSaveInputs, default=None) <NEW_LINE> user = models.ForeignKey(User, null=True, default=None) <NEW_LINE> model_pk = models.IntegerField(default=None, null=True) <NEW_LINE> uuid = UUIDField(auto=True, default=None, null=True) <NEW_LIN... | This model creates a unique url for each calculation. | 6259907671ff763f4b5e9116 |
class LinearAdstockTransformation(object): <NEW_LINE> <INDENT> def __init__(self, variables, week_to_peak, length, retention_rate): <NEW_LINE> <INDENT> self.week_to_peak = week_to_peak <NEW_LINE> self.length = length <NEW_LINE> self.retention_rate = retention_rate <NEW_LINE> self.variables = np.matrix(variables) <NEW_L... | This class performs adstock transformation on variables with same adstock transformation parameters
This class implements a linear adstock build | 62599076e1aae11d1e7cf4c4 |
class VerificationDeadline(TimeStampedModel): <NEW_LINE> <INDENT> class Meta(object): <NEW_LINE> <INDENT> app_label = "verify_student" <NEW_LINE> <DEDENT> course_key = CourseKeyField( max_length=255, db_index=True, unique=True, help_text=ugettext_lazy(u"The course for which this deadline applies"), ) <NEW_LINE> deadlin... | Represent a verification deadline for a particular course.
The verification deadline is the datetime after which
users are no longer allowed to submit photos for initial verification
in a course.
Note that this is NOT the same as the "upgrade" deadline, after
which a user is no longer allowed to upgrade to a verified... | 62599076f9cc0f698b1c5f81 |
class JSONLogRotator(BaseLogRotator): <NEW_LINE> <INDENT> def _make_writer(self): <NEW_LINE> <INDENT> self._buffer = StringIO() <NEW_LINE> self._bytes_written = 0 <NEW_LINE> now = datetime.now() <NEW_LINE> self.fname = self.log_folder + '/' + now.strftime('%Y%m%d_%H%M%S_{}.json'.format(self.make_random(6))) <NEW_LINE> ... | A JSON Log Rotator | 625990768a349b6b43687bc5 |
class TaskContainerExecutionInformation(Model): <NEW_LINE> <INDENT> _attribute_map = { 'container_id': {'key': 'containerId', 'type': 'str'}, 'state': {'key': 'state', 'type': 'str'}, 'error': {'key': 'error', 'type': 'str'}, } <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(TaskContainerExecutionInf... | Contains information about the container which a Task is executing.
:param container_id:
:type container_id: str
:param state: This is the state of the container according to the Docker
service. It is equivalent to the status field returned by "docker
inspect".
:type state: str
:param error: This is the detailed err... | 625990767d43ff24874280c9 |
class BinaryEdgeException(Exception): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> self.message = message <NEW_LINE> Exception.__init__(self, message) | Exception raised if a request to BinaryEdge returns anything else than 200 | 6259907632920d7e50bc79b3 |
class settings(object): <NEW_LINE> <INDENT> def __init__(self, ): <NEW_LINE> <INDENT> self._config_data = None <NEW_LINE> self._default_cinfig_data = {'database' : {'path' : ''}, 'behavior' : {'load_last_database' : True}, 'interface' : {'odd_color' : '#FFFFFF', 'even_color' : '#FFFFFF'}, 'chart' : {'legend': {'positio... | rief settings saving class
| 62599076091ae356687065a5 |
class HuggingFaceFellowship(_BaseScenario): <NEW_LINE> <INDENT> def __init__( self, hf_datasets: Union[List[HFDataset], List[str], List[Tuple]], lazy: bool = False, train: bool = True ): <NEW_LINE> <INDENT> self.hf_datasets = hf_datasets <NEW_LINE> self.lazy = lazy <NEW_LINE> self.split = "train" if train else "test" <... | A scenario for a collection of HuggingFace (HF) dataset.
It simply wraps multiple datasets and returns them one by one.
To have a full list of the available datasets (only HuggingFace!), see
there: https://huggingface.co/datasets
:param hf_datasets: A list of HF dataset instances or a list of HF dataset string id.
:p... | 625990765fdd1c0f98e5f8e9 |
class BaseSessionTest(BaseEnvVar): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(BaseSessionTest, self).setUp() <NEW_LINE> self.environ['AWS_ACCESS_KEY_ID'] = 'access_key' <NEW_LINE> self.environ['AWS_SECRET_ACCESS_KEY'] = 'secret_key' <NEW_LINE> self.environ['AWS_CONFIG_FILE'] = 'no-exist-foo' <NEW_LI... | Base class used to provide credentials.
This class can be used as a base class that want to use a real
session class but want to be completely isolated from the
external environment (including environment variables).
This class will also set credential vars so you can make fake
requests to services. | 625990764a966d76dd5f0857 |
class CouchDbContext(DbContext): <NEW_LINE> <INDENT> DOCUMENT_RESERVED_KEYS = {'_id', '_rev'} <NEW_LINE> def __init__(self, host, db_name): <NEW_LINE> <INDENT> server = couchdb.Server(host) <NEW_LINE> if db_name not in server: <NEW_LINE> <INDENT> raise ValueError('Database \'{}\' doesn\'t exist'.format(db_name)) <NEW_L... | A DbContext that wraps a CouchDb server. | 62599076bf627c535bcb2e39 |
class VppGreInterface(VppInterface): <NEW_LINE> <INDENT> def __init__(self, test, src_ip, dst_ip, outer_fib_id=0, is_teb=0): <NEW_LINE> <INDENT> self._sw_if_index = 0 <NEW_LINE> super(VppGreInterface, self).__init__(test) <NEW_LINE> self._test = test <NEW_LINE> self.t_src = src_ip <NEW_LINE> self.t_dst = dst_ip <NEW_LI... | VPP GRE interface | 625990765fdd1c0f98e5f8ea |
class IdHasherTests(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.random_string = str(random.randint(-1e6, 1e6)) <NEW_LINE> self.random_int = random.randint(-1e6, 1e6) <NEW_LINE> self.test_string = "ldlaldfd_dfdfldfdf_ssdfdf" <NEW_LINE> self.test_empty = "" <NEW_LINE> self.test_none ... | Test Hash Function | 625990769c8ee82313040e3d |
class VIEW3D_TP_X_Mod_Mirror(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "tp_ops.mod_mirror_x" <NEW_LINE> bl_label = "Mirror X" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> scene = bpy.context.scene <NEW_LINE> selected = bpy.context.selected_objects <N... | Add a x mirror modifier with cage and clipping | 62599076a05bb46b3848bde1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.