code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class artMediumProp(SchemaProperty): <NEW_LINE> <INDENT> _prop_schema = 'artMedium' <NEW_LINE> _expected_schema = None <NEW_LINE> _enum = False <NEW_LINE> _format_as = "TextField"
SchemaField for artMedium Usage: Include in SchemaObject SchemaFields as your_django_field = artMediumProp() schema.org description:The material used. (e.g. Oil, Watercolour, Acrylic, Linoprint, Marble, Cyanotype, Digital, Lithograph, DryPoint, Intaglio, Pastel, Woodcut, Pencil, Mixed Media, etc.) Supersedes material...
62599045507cdc57c63a60d0
class Bounds: <NEW_LINE> <INDENT> def __init__(self, minx=None, maxx=None, miny=None, maxy=None, minz=None, maxz=None, value=None, channelIndex=None): <NEW_LINE> <INDENT> if minx is not None: <NEW_LINE> <INDENT> self.value = [minx, maxx, miny, maxy, minz, maxz] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.value =...
Class to hold Bounding Box values. It also writes and reads the in-memory XML representation of these values using ElementTree.
62599045c432627299fa429c
class MyPasswordChangeView(LoginRequiredMixin, PasswordChangeView, PageTitleMixin, ): <NEW_LINE> <INDENT> form_class = MyChangePasswordForm <NEW_LINE> template_name = 'pages/customer/password_change.html' <NEW_LINE> success_url = reverse_lazy("customer:account_change_password") <NEW_LINE> page_title = _("Modification d...
Django-allauth. Changement du mot de passe
625990453eb6a72ae038b996
class ComputedPath(object): <NEW_LINE> <INDENT> def __init__(self, host): <NEW_LINE> <INDENT> level = host.location.level <NEW_LINE> level.register_on_tile_change_callback(self.invalidate) <NEW_LINE> self.host = host <NEW_LINE> self.inner_map = level.inner_map <NEW_LINE> self.a_star = path.AStar(self.inner_map, 0.0) <N...
This object hooks on to the level and will invalidate itself whenever a tile is changed in the map.
6259904530dc7b76659a0b66
class btkAcquisitionFileReader(_object): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, btkAcquisitionFileReader, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, btkAcquisitionFileReader...
Reader for files which contain acquisition data (C3D, TRC, ...). This class uses a btkAcquisitionFileIO object to read the data from the file corresponding to the given filename. You have two ways to set this object. First, you can set it manually by using the method btkAcquisitionFileReader::SetAcquisitionIO(), Secon...
62599045d53ae8145f919793
class CreateListRetrieveViewSet( CreateModelMixin, ListModelMixin, RetrieveModelMixin, GenericViewSet ): <NEW_LINE> <INDENT> pass
A viewset that provides "retrieve", "create", and "list" actions. To use it, override the class and set the ".queryset" and ".serializer_class" attributes"
6259904515baa723494632c6
class SklearnClusteringTree(DecisionTreeRegressor, ClusteringTree): <NEW_LINE> <INDENT> def transform(self, X): <NEW_LINE> <INDENT> return self.tree_.apply(X) <NEW_LINE> <DEDENT> def get_leaf_values(self): <NEW_LINE> <INDENT> return self.tree_.value.flatten() <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def prepare_dat...
RegressionTree from scikit-learn, which provides transforming interface.
6259904523e79379d538d833
class MsgPortModeInfoRequest(DownstreamMsg): <NEW_LINE> <INDENT> TYPE = 0x22 <NEW_LINE> INFO_NAME = 0x00 <NEW_LINE> INFO_RAW_RANGE = 0x01 <NEW_LINE> INFO_PCT_RANGE = 0x02 <NEW_LINE> INFO_SI_RANGE = 0x03 <NEW_LINE> INFO_UNITS = 0x04 <NEW_LINE> INFO_MAPPING = 0x05 <NEW_LINE> INFO_MOTOR_BIAS = 0x07 <NEW_LINE> INFO_CAPABIL...
https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#port-mode-information-request
6259904594891a1f408ba090
class XMLDocument(object): <NEW_LINE> <INDENT> def __init__(self, declaration, root): <NEW_LINE> <INDENT> self.declaration = declaration <NEW_LINE> self.root = root <NEW_LINE> self.root.document = self <NEW_LINE> self.root._setDepth()
Represents an XML document. Parameters ---------- declaration : XMLDeclaration An XML declaration object root : XMLElement An XML element that is the root element of this document Attributes ---------- declaration : XMLDeclaration This document's XML declaration root : XMLElement This document's root ...
6259904507d97122c4217fd6
class SendSmsResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Data = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("Data") is not None: <NEW_LINE> <INDENT> self.Data = [] <NEW_LINE> for item in params....
SendSms返回参数结构体
62599045e76e3b2f99fd9d41
class ServiceException(Exception): <NEW_LINE> <INDENT> pass
Custom exception type for service calls
6259904529b78933be26aa5d
class RequestsHosts: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def collect(): <NEW_LINE> <INDENT> g_hosts = GaugeMetricFamily("foreman_exporter_hosts", 'foreman host status', labels=['hostname', 'domain', 'configuration', 'configuration_label', 'puppet...
Register Prometheus Metrics for Foremant's hosts
625990451f5feb6acb163f2b
class StartGameServerSessionPlacementRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.PlacementId = None <NEW_LINE> self.GameServerSessionQueueName = None <NEW_LINE> self.MaximumPlayerSessionCount = None <NEW_LINE> self.DesiredPlayerSessions = None <NEW_LINE> self.GameProperties ...
StartGameServerSessionPlacement请求参数结构体
62599045596a897236128f4a
class PsplupsParser(ScupsParser): <NEW_LINE> <INDENT> filetype = 'psplups' <NEW_LINE> dtypes = [int, int, int, float, float, float, 'object'] <NEW_LINE> units = [ None, None, None, u.dimensionless_unscaled, u.Ry, u.dimensionless_unscaled, u.dimensionless_unscaled ] <NEW_LINE> headings = ['lower_level', 'upper_level', '...
Spline fits to scaled collision rates for protons. These files are discussed in section 2.2 of [young]_ and the details of how these quantities are scaled are given in [burgess]_. Notes ----- * Unlike the electron "scups" and "splups" files which contain the collision strengths (upsilons), these files contain the sc...
625990453c8af77a43b688d8
class Analysis(object): <NEW_LINE> <INDENT> def __init__(self, layout, model): <NEW_LINE> <INDENT> if not isinstance(layout, BIDSLayout): <NEW_LINE> <INDENT> layout = BIDSLayout(layout) <NEW_LINE> <DEDENT> self.layout = layout <NEW_LINE> self._load_model(model) <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT...
Represents an entire BIDS-Model analysis. Args: layout (BIDSLayout, str): A BIDSLayout instance or path to pass on to the BIDSLayout initializer. model (str or dict): a BIDS model specification. Can either be a string giving the path of the JSON model spec, or an already-loaded dict con...
6259904523e79379d538d834
@with_incremental_state <NEW_LINE> class LSFSTransformerDecoderLayer(LSTransformerDecoderLayer): <NEW_LINE> <INDENT> def __init__(self, config, initial_weights=None, initial_biases=None): <NEW_LINE> <INDENT> super().__init__(config, initial_weights, initial_biases) <NEW_LINE> <DEDENT> def get_self_attn_cache(self, incr...
Decoder layer only for inference.
62599045a8ecb03325872547
class ManualMetadata(ContentMetadataSource): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def source_name(cls): <NEW_LINE> <INDENT> return "Manual" <NEW_LINE> <DEDENT> description = models.TextField()
Manually entered metadata.
625990450fa83653e46f6212
class Attendee(People): <NEW_LINE> <INDENT> student_id = 0 <NEW_LINE> def __init__(self, name, address, phone): <NEW_LINE> <INDENT> super(Attendee, self).__init__(name, address, phone) <NEW_LINE> self.__id = Attendee.student_id <NEW_LINE> Attendee.student_id += 1
docstring for Attendee.
62599045004d5f362081f981
class Appliance(models.Model): <NEW_LINE> <INDENT> residential_home = models.ForeignKey( ResidentialHome, related_name='appliances', ) <NEW_LINE> name = models.CharField(max_length=64, choices=APPLIANCES_CHOICES) <NEW_LINE> location = models.CharField(max_length=32, choices=LOCATION_CHOICES) <NEW_LINE> created = models...
Represents the appliances the meters are attached to
6259904507d97122c4217fd7
class PetHungryOrThirstyError(PetSadError): <NEW_LINE> <INDENT> _validation = { 'error_type': {'required': True}, } <NEW_LINE> _attribute_map = { 'error_type': {'key': 'errorType', 'type': 'str'}, 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'reason': {'key': 'reason', 'type': 'str'}, 'hungry_or_thirsty': {...
PetHungryOrThirstyError. All required parameters must be populated in order to send to Azure. :param error_type: Required. Constant filled by server. :type error_type: str :param error_message: the error message. :type error_message: str :param reason: why is the pet sad. :type reason: str :param hungry_or_thirsty: i...
6259904507f4c71912bb0768
class EditToolbarDeluxe(hildon.EditToolbar): <NEW_LINE> <INDENT> def __init__(self, label_text, button_text): <NEW_LINE> <INDENT> hildon.EditToolbar.__init__(self, label_text, button_text) <NEW_LINE> alignment, separator, close_button = self.get_children() <NEW_LINE> hbox = alignment.get_child() <NEW_LINE> label, image...
HildonEditToolbar with sensitivity and AppMenu action * Public method to set the button sensitivity * Open the parent window's AppMenu when touching titlebar (Enhancement requests filed as Maemo bugs #5166 and #5167)
62599045a79ad1619776b3b6
class ArchiveJobsCommand(Command): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def setup(parser): <NEW_LINE> <INDENT> parser.add_argument( "ids", nargs="*", metavar="ID", help="the job ID(s) to archive") <NEW_LINE> parser.add_argument( "-a", "--all", action="store_true", help="whether to archive all jobs") <NEW_LINE> ...
Archive jobs on the platform. Examples: # Archive specific jobs voxel51 jobs archive <id> [...] # Archive all jobs voxel51 jobs archive --all
6259904594891a1f408ba091
class TestLoginUser(testLib.RestTestCase): <NEW_LINE> <INDENT> def assertResponse(self, respData, count = 1, errCode = testLib.RestTestCase.SUCCESS): <NEW_LINE> <INDENT> expected = { 'errCode' : errCode } <NEW_LINE> if count is not None: <NEW_LINE> <INDENT> expected['count'] = count <NEW_LINE> <DEDENT> self.assertDict...
Test adding users
6259904576d4e153a661dc11
class ContestList(generics.ListAPIView): <NEW_LINE> <INDENT> permission_classes = [IsLogined] <NEW_LINE> queryset = Contest.objects.all() <NEW_LINE> serializer_class = ContestSerializer
List all contests.
62599045d4950a0f3b1117dd
class HScalingTreeColumnView (Gtk.TreeViewColumn): <NEW_LINE> <INDENT> def __init__(self, name, renderer, identifier): <NEW_LINE> <INDENT> self.renderer = renderer <NEW_LINE> Gtk.TreeViewColumn.__init__(self, name, renderer, identifier=identifier) <NEW_LINE> <DEDENT> def on_scale_change(self, scale): <NEW_LINE> <INDENT...
Gtk.TreeViewColumn that scales its width according to the scale object it should to be subscribed to. Hookup the renderer to the scale objects on_scale_change: scale.add(object of HScalingTreeColumnView)
62599045b830903b9686ee16
class VKOAuth2(BaseOAuth2): <NEW_LINE> <INDENT> name = 'vk-oauth2' <NEW_LINE> ID_KEY = 'id' <NEW_LINE> AUTHORIZATION_URL = 'http://oauth.vk.com/authorize' <NEW_LINE> ACCESS_TOKEN_URL = 'https://oauth.vk.com/access_token' <NEW_LINE> ACCESS_TOKEN_METHOD = 'POST' <NEW_LINE> EXTRA_DATA = [ ('id', 'id'), ('expires_in', 'exp...
VKOAuth2 authentication backend
62599045be383301e0254b51
class BasisFunctionRegression(LinearRegression): <NEW_LINE> <INDENT> _basis_funcs = {'gaussian': gaussian_basis} <NEW_LINE> def __init__(self, basis_func='gaussian', fit_intercept=True, regularization='none', kwds=None, **kwargs): <NEW_LINE> <INDENT> self.basis_func = basis_func <NEW_LINE> self.kwargs = kwargs <NEW_LIN...
Basis Function with errors in y Parameters ---------- basis_func : str or function specify the basis function to use. This should take an input matrix of size (n_samples, n_features), along with optional parameters, and return a matrix of size (n_samples, n_bases). fit_intercept : bool (optional) if Tr...
6259904507d97122c4217fda
class MockCollection(object): <NEW_LINE> <INDENT> def __init__(self, label, service): <NEW_LINE> <INDENT> self.label = label <NEW_LINE> self.service = service <NEW_LINE> self.items = [] <NEW_LINE> <DEDENT> def create_item(self, label, attr, value, replace=True): <NEW_LINE> <INDENT> item = MockItem(label, self, attr, va...
A collection of items containing secrets.
62599045c432627299fa429f
class NavigableMap(p.SingletonPlugin): <NEW_LINE> <INDENT> p.implements(p.IConfigurer, inherit=True) <NEW_LINE> p.implements(p.IResourceView, inherit=True) <NEW_LINE> def update_config(self, config): <NEW_LINE> <INDENT> p.toolkit.add_template_directory(config, 'theme/templates') <NEW_LINE> p.toolkit.add_resource('theme...
Creates a map view
62599045b57a9660fecd2db6
class Entry(models.Model): <NEW_LINE> <INDENT> blog = models.ForeignKey(Blog, on_delete=models.CASCADE) <NEW_LINE> headline = models.CharField(max_length=255) <NEW_LINE> body_text = models.TextField() <NEW_LINE> pub_date = models.DateField(auto_now_add=True) <NEW_LINE> mod_date = models.DateField(auto_now=True) <NEW_LI...
A blog entry with authors field.
625990458a43f66fc4bf34ce
class SpannerProjectsInstancesDatabasesSessionsBatchCreateRequest(_messages.Message): <NEW_LINE> <INDENT> batchCreateSessionsRequest = _messages.MessageField('BatchCreateSessionsRequest', 1) <NEW_LINE> database = _messages.StringField(2, required=True)
A SpannerProjectsInstancesDatabasesSessionsBatchCreateRequest object. Fields: batchCreateSessionsRequest: A BatchCreateSessionsRequest resource to be passed as the request body. database: Required. The database in which the new sessions are created.
62599045097d151d1a2c23a5
class TargetSmokyDingo(SmokyDingo, metaclass=ABCMeta): <NEW_LINE> <INDENT> group = "admin" <NEW_LINE> permission = "target"
A SmokyDingo which checks for the 'target' or 'admin' permission after activation.
62599045a4f1c619b294f825
class UBloxError(Exception): <NEW_LINE> <INDENT> def __init__(self, msg): <NEW_LINE> <INDENT> Exception.__init__(self, msg) <NEW_LINE> self.message = msg
Ublox error class
62599045004d5f362081f983
class VisitorsResource(CachedResource): <NEW_LINE> <INDENT> date = fields.DateField('date') <NEW_LINE> visitors = fields.IntegerField('visitors', default=0) <NEW_LINE> def get_object_list(self, request): <NEW_LINE> <INDENT> kind = MetricKind.objects.get(code=VISITORS_METRIC_CODE) <NEW_LINE> qs = Metric.objects.filter(k...
Returns the number of unique visitors per day.
625990451d351010ab8f4e54
class MyRoot(Tk): <NEW_LINE> <INDENT> def __init__(self, rows, cols): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.rows = rows <NEW_LINE> self.cols = cols <NEW_LINE> self.configure() <NEW_LINE> <DEDENT> def configure(self): <NEW_LINE> <INDENT> for c in range(self.cols): <NEW_LINE> <INDENT> self.columnconfigur...
Class derived from tkinter.Tk. Sets and configures the row and columns of the main widget.
6259904523e79379d538d838
class PollingHandler(BaseSocketHandler): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(PollingHandler, self).__init__(*args, **kwargs) <NEW_LINE> self.tracker = PeriodicCallback(self.get_location, 5000) <NEW_LINE> self.q = Queue(maxsize=5) <NEW_LINE> self.updating = False <NEW_LINE>...
This class represents separate websocket connection. Attributes: tracker: tornado.ioloop.PeriodicCallback with get_location method as a callback. Starts when user pushes "track" button. When started, it runs every 5 seconds to find out and update character's location. q: tornado.queues...
625990450fa83653e46f6216
class List(RedisSortable, Sequence): <NEW_LINE> <INDENT> __slots__ = ("_key", "_client", "_pipe") <NEW_LINE> def __init__(self, client, key, iter=[]): <NEW_LINE> <INDENT> super(List, self).__init__(client, key) <NEW_LINE> if hasattr(iter, "__iter__") and len(iter): <NEW_LINE> <INDENT> for val in iter: <NEW_LINE> <INDEN...
Sequence datatype that tries to meme a native ``list`` datatype by implementing *most* of its methods. Be aware that some methods still exist, but will throw ``NotImplementedError``s.
6259904516aa5153ce401828
class PDBWarning(ChemWarning): <NEW_LINE> <INDENT> pass
A non-fatal error to indicate a problematic PDB file
6259904573bcbd0ca4bcb5c7
class RoomSafetyItem(models.Model): <NEW_LINE> <INDENT> unit = models.ForeignKey(Unit, null=False, blank=False, on_delete=models.PROTECT) <NEW_LINE> label = models.CharField(null=False, blank=False, max_length=50) <NEW_LINE> description = models.CharField(null=True, blank=True, max_length=500) <NEW_LINE> hidden = model...
Allow each unit to manage the categories which are now included in a visit.
6259904526238365f5fade96
class DescribeChartPlaceholder(object): <NEW_LINE> <INDENT> def it_can_insert_a_chart_into_itself(self, request, part_prop_): <NEW_LINE> <INDENT> slide_part_ = instance_mock(request, SlidePart) <NEW_LINE> slide_part_.add_chart_part.return_value = "rId6" <NEW_LINE> part_prop_.return_value = slide_part_ <NEW_LINE> graphi...
Unit-test suite for `pptx.shapes.placeholder.ChartPlaceholder` object.
62599045d4950a0f3b1117df
class BIM(Attack): <NEW_LINE> <INDENT> def __init__(self, model, eps=4/255, alpha=1/255, steps=0): <NEW_LINE> <INDENT> super(BIM, self).__init__("BIM", model) <NEW_LINE> self.eps = eps <NEW_LINE> self.alpha = alpha <NEW_LINE> if steps == 0: <NEW_LINE> <INDENT> self.steps = int(min(eps*255 + 4, 1.25*eps*255)) <NEW_LINE>...
BIM or iterative-FGSM in the paper 'Adversarial Examples in the Physical World' [https://arxiv.org/abs/1607.02533] Distance Measure : Linf Arguments: model (nn.Module): model to attack. eps (float): maximum perturbation. (DEFALUT: 4/255) alpha (float): step size. (DEFALUT: 1/255) steps (int): number o...
62599045c432627299fa42a0
class Section(TexEnvironment): <NEW_LINE> <INDENT> def __init__(self, name, label=''): <NEW_LINE> <INDENT> super().__init__('section', name, label=label) <NEW_LINE> <DEDENT> def new_subsection(self, name, label=''): <NEW_LINE> <INDENT> return self.new(Subsection(name, label=label))
Implements a LaTeX section.
62599045b57a9660fecd2db8
class Config(object): <NEW_LINE> <INDENT> def __init__(self, config_file, env_tag): <NEW_LINE> <INDENT> self.configs = self.load_config_file(config_file, env_tag) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def load_config_file(config_file, env_name): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> with open(config_file)...
Test Env Config
62599045b830903b9686ee18
class OS(Collection): <NEW_LINE> <INDENT> _validation = { 'on_save': False, 'on_set': False, 'allow_foreign_fields': True } <NEW_LINE> _fields = { 'name': Field(), 'description': Field() }
The operating system which DataModels may apply to.
62599045d6c5a102081e3458
class ArrayValue(_messages.Message): <NEW_LINE> <INDENT> values = _messages.MessageField('Value', 1, repeated=True)
An array value. Fields: values: Values in the array. The order of this array may not be preserved if it contains a mix of indexed and unindexed values.
6259904521a7993f00c672a5
class DagExecutor(object): <NEW_LINE> <INDENT> def __init__(self, dag_config, req_state): <NEW_LINE> <INDENT> self.dag_config = dag_config <NEW_LINE> self.context = state.DagExecutionContext( dag_config, req_state, ) <NEW_LINE> <DEDENT> def call_hook(self, hook_name): <NEW_LINE> <INDENT> if hook_name not in self.dag_co...
This object is responsible for stepping a transaction through a Dagyr
6259904515baa723494632ce
class PruebaForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Prueba <NEW_LINE> fields = ('titulo', 'subtitulo', 'cantidad') <NEW_LINE> widgets = { 'titulo': forms.TextInput(attrs={'size': 12, 'Placeholder': 'Ingrese titulo'}), 'subtitulo': forms.TextInput(attrs={'size': 10, 'Placeholde...
Form definition for Prueba.
6259904507d97122c4217fdd
class Static(Downloadable): <NEW_LINE> <INDENT> @property <NEW_LINE> def should_refresh(self): <NEW_LINE> <INDENT> return False
For requests that do not change once downloaded.
6259904507f4c71912bb076e
class TraceVariable: <NEW_LINE> <INDENT> def __init__(self, func, interval: float = 1.0, name: str = 'variable', verbose: bool = False, ): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.name = name <NEW_LINE> self.func = func <NEW_LINE> self.interval = interval <NEW_LINE> self.verbose = verbose <NEW_LINE> self....
Simple class to trace a variable over time. Usage: t = TraceVariable(ctrl.stage.get, verbose=True) t.start() t.stage.set(x=0, y=0, wait=False) ... values = t.stop()
62599045379a373c97d9a367
class DDD(D): <NEW_LINE> <INDENT> regex = "ddd(?!d)" <NEW_LINE> def format(self, value: Union[date, datetime], tokens: List[Token]) -> str: <NEW_LINE> <INDENT> return value.strftime("%a") <NEW_LINE> <DEDENT> def parse(self, value: str, tokens: List[Token]) -> Tuple[Dict[str, Any], str]: <NEW_LINE> <INDENT> return {"wee...
Day of the week, three letter abbreviation (e.g., "Mon").
6259904596565a6dacd2d928
class RetargetScheduleProperties(Model): <NEW_LINE> <INDENT> _attribute_map = { 'current_resource_id': {'key': 'currentResourceId', 'type': 'str'}, 'target_resource_id': {'key': 'targetResourceId', 'type': 'str'}, } <NEW_LINE> def __init__(self, current_resource_id=None, target_resource_id=None): <NEW_LINE> <INDENT> su...
Properties for retargeting a virtual machine schedule. :param current_resource_id: The resource Id of the virtual machine on which the schedule operates :type current_resource_id: str :param target_resource_id: The resource Id of the virtual machine that the schedule should be retargeted to :type target_resource_id:...
6259904526238365f5fade98
class DeletePost(FlaskForm): <NEW_LINE> <INDENT> post = HiddenField() <NEW_LINE> reason = StringField() <NEW_LINE> send_to_admin = BooleanField()
Post deletion form.
62599045d6c5a102081e3459
class ProcessingInstallationError(InaSAFEError): <NEW_LINE> <INDENT> pass
When there is an error with Processing.
625990450a366e3fb87ddd23
class CompetitionGroup(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=128) <NEW_LINE> competition_type = models.ForeignKey(CompetitionType, on_delete=models.PROTECT, null=False) <NEW_LINE> end_date = models.DateField() <NEW_LINE> active = models.BooleanField(default=False) <NEW_LINE> def __unicod...
A grouping of competitions, e.g. a set of league boxes
62599045b57a9660fecd2dba
class _ipv4iter(object): <NEW_LINE> <INDENT> def __init__(self, addr): <NEW_LINE> <INDENT> self.mask = addr.netmask() <NEW_LINE> self.last = addr.net() <NEW_LINE> self.cur = addr.addr() <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def __next__(self): <NEW_LINE> <INDENT> m...
An IPv4 address iterator
62599045498bea3a75a58e5c
class WebHandler(DjangoMixin, APIRequestHandler): <NEW_LINE> <INDENT> def initialize(self): <NEW_LINE> <INDENT> self.config = Settings.instance()
Base class for user <-> core APIs (client/async).
6259904550485f2cf55dc2c5
class Worker(BlockchainObject): <NEW_LINE> <INDENT> type_id = 14 <NEW_LINE> def refresh(self): <NEW_LINE> <INDENT> worker = self.transnet.rpc.get_object(self.identifier) <NEW_LINE> if not worker: <NEW_LINE> <INDENT> raise WorkerDoesNotExistsException <NEW_LINE> <DEDENT> worker["work_end_date"] = formatTimeString(worker...
Read data about a worker in the chain :param str id: id of the worker :param transnet transnet_instance: Transnet() instance to use when accesing a RPC
62599045a4f1c619b294f827
class StaticService(object): <NEW_LINE> <INDENT> def __init__(self, name, ip, system_template, user_template=None, user_defined=True): <NEW_LINE> <INDENT> self.name = name.lower() <NEW_LINE> self.ip = IP(ip) <NEW_LINE> self.system_template = system_template <NEW_LINE> self.user_template = user_template <NEW_LINE> self....
A Static Service is a particular container that, when it is executed, uses the static network Args: - name (str): the name of the service - ip (str): the ip on the static network vpn - system_template (str): the first part of the Dockerfile that will be used to build the image - user_template (st...
6259904523e79379d538d83c
class Meta(type): <NEW_LINE> <INDENT> def __new__(cls, name, bases, namespace, **kwargs): <NEW_LINE> <INDENT> return super().__new__(cls, name, bases, namespace, **kwargs) <NEW_LINE> <DEDENT> def __init__(cls, name, bases, namespace, **kwargs): <NEW_LINE> <INDENT> super().__init__(name, bases, namespace, **kwargs) <NEW...
Meta class of LayerCreator.
6259904524f1403a9268626c
class Group(Base): <NEW_LINE> <INDENT> __tablename__ = 'group' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> name = Column(String(64), unique=True, nullable=False) <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return "<id=%s,name=%s>" % (self.id, self.name)
主机组表关联主机用户和堡垒机用户
62599045d10714528d69f02c
class Ipv6NdNeighborOriginEnum(Enum): <NEW_LINE> <INDENT> other = 0 <NEW_LINE> static = 1 <NEW_LINE> dynamic = 2 <NEW_LINE> @staticmethod <NEW_LINE> def _meta_info(): <NEW_LINE> <INDENT> from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_ipv6_nd_oper as meta <NEW_LINE> return meta._meta_table['Ipv6NdNeighborOrigin...
Ipv6NdNeighborOriginEnum IPv6 ND Neighbor Origin Type .. data:: other = 0 Other Address .. data:: static = 1 Static Address .. data:: dynamic = 2 Dynamic Address
6259904516aa5153ce40182c
class set_environ: <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.kwargs = dict( kwargs ) <NEW_LINE> self.save_environ = None <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self.save_environ = dict( os.environ ) <NEW_LINE> for n,v in self.kwargs.items(): <NEW_LINE> <INDENT> if ...
with set_environ( name=value, name=value, ... ): pass
6259904521bff66bcd723fab
class PERDocsViewset(viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> queryset = NiceDocument.objects.all() <NEW_LINE> authentication_classes = (TokenAuthentication,) <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> get_request_user_regions = RegionRestrictedAdmin.get_request_user_regions <NEW_LINE> get...
To collect PER Documents
6259904523e79379d538d83d
class _ProxyTraversedSite(ProxyBase): <NEW_LINE> <INDENT> def __new__(cls, base, site_manager): <NEW_LINE> <INDENT> return ProxyBase.__new__(cls, base) <NEW_LINE> <DEDENT> def __init__(self, base, site_manager): <NEW_LINE> <INDENT> ProxyBase.__init__(self, base) <NEW_LINE> self.__site_manager = site_manager <NEW_LINE> ...
We need to be able to control the site manager used by sites we traverse to in order to ensure that host configuration is at the right place in the resolution order. But a site can be literally any type of object. So we fake out the siteManager methods but proxy everything else.
62599045ec188e330fdf9bda
class itemizeResponseType (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 = pyxb.namespace.ExpandedName(Namespace, 'itemizeResponseType') <N...
Complex type {urn:vpro:media:update:2009}itemizeResponseType with content type ELEMENT_ONLY
625990450a366e3fb87ddd25
class CharRNN(Chain): <NEW_LINE> <INDENT> def __init__(self, n_vocab, n_units): <NEW_LINE> <INDENT> super(CharRNN, self).__init__( embed = F.EmbedID(n_vocab, n_units), l1_x = L.Linear(n_units, 4*n_units), l1_h = L.Linear(n_units, 4*n_units), l2_h = L.Linear(n_units, 4*n_units), l2_x = L.Linear(n_units, 4*n_units), l3 ...
Class: CharRNNFeaturizer ======================== Contains a CharRNN that is capable of featurizing arbitrary text, one vector per character. Usage: ----- >> model = CharRNNFeaturizer(n_vocab, n_units) >> model.train(train_data) >> model.import(other_model) >> model.
62599045b57a9660fecd2dbc
class DemoSiteImporter(object): <NEW_LINE> <INDENT> def __init__(self, logger): <NEW_LINE> <INDENT> self.logger = logger <NEW_LINE> <DEDENT> @atomic <NEW_LINE> def handle(self, product_class_name, filepath): <NEW_LINE> <INDENT> product_class = ProductClass.objects.get( name=product_class_name) <NEW_LINE> attribute_code...
Another quick and dirty catalogue product importer. Used to built the demo site, and most likely not useful outside of it.
6259904515baa723494632d1
class GoogleDirectionsFinder(DirectionsFinder, APIRequest): <NEW_LINE> <INDENT> def __init__(self, cfg): <NEW_LINE> <INDENT> DirectionsFinder.__init__(self) <NEW_LINE> APIRequest.__init__(self, cfg, 'google-directions', 'Google directions query') <NEW_LINE> self.directions_url = 'http://maps.googleapis.com/maps/api/dir...
Transit direction finder using the Google Maps query engine.
62599045009cb60464d02874
class Bullet(Sprite): <NEW_LINE> <INDENT> dmg = 0.0 <NEW_LINE> sprite_move_action = None <NEW_LINE> def __init__(self, image, dmg=0.1): <NEW_LINE> <INDENT> super(Bullet, self).__init__(image) <NEW_LINE> self.scale = 0.25 <NEW_LINE> self.dmg = dmg <NEW_LINE> self.cshape = collision.AARectShape(self.position, self.width,...
Gereneric representation for spaceship and rohenians bullets.
625990458a43f66fc4bf34d4
class BaseConsensusRules(): <NEW_LINE> <INDENT> voting = Voting <NEW_LINE> @staticmethod <NEW_LINE> def validate_transaction(bigchain, transaction): <NEW_LINE> <INDENT> return transaction.validate(bigchain) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def validate_block(bigchain, block): <NEW_LINE> <INDENT> return bloc...
Base consensus rules for Bigchain. A consensus plugin must expose a class inheriting from this one via an entry_point. All methods listed below must be implemented.
625990453c8af77a43b688dd
class ScManager(Manager, models.BaseModelManager): <NEW_LINE> <INDENT> def __init__(self, model_class): <NEW_LINE> <INDENT> self.model_class = model_class <NEW_LINE> <DEDENT> @property <NEW_LINE> def _db(self): <NEW_LINE> <INDENT> return env.mongo_connection
Mix of managers
6259904515baa723494632d2
class BlockedRequestList: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._requests_data = deque() <NEW_LINE> <DEDENT> @cached_property <NEW_LINE> def redis_conn(self): <NEW_LINE> <INDENT> if settings.RQ_BLOCKED_REQUESTS_LIST: <NEW_LINE> <INDENT> return get_redis_connection("default") <NEW_LINE> <DEDEN...
Singleton indirection between our code and Redis to isolate how we're enqueing the request data to be further read by the system. Doing this also allow us to unit test it without relying on complicated mocking strategies. Import as: from traffic_control.blocked_list import blocked_requests
6259904507d97122c4217fe1
class GeventTask(Task): <NEW_LINE> <INDENT> def start(self, *args, **kwargs): <NEW_LINE> <INDENT> return spawn(functools.partial(Task.start, self, *args, **kwargs))
Task that spawns a greenlet
62599045b5575c28eb713669
class Txt: <NEW_LINE> <INDENT> def __init__(self,path, mode='r',coding='utf8'): <NEW_LINE> <INDENT> self.data = [] <NEW_LINE> self.f = None <NEW_LINE> if mode =='r': <NEW_LINE> <INDENT> for line in open(path, encoding=coding): <NEW_LINE> <INDENT> self.data.append(line) <NEW_LINE> <DEDENT> for i in range(self.data.__len...
用来读写文件
6259904523849d37ff8523fc
class NoResponse(TestServerError): <NEW_LINE> <INDENT> pass
Raised by get_response method when no response data is available to hande the request
6259904526068e7796d4dc87
class RequireDocs(type): <NEW_LINE> <INDENT> def __new__(mcs, name, bases, dct): <NEW_LINE> <INDENT> for attr_name, value in dct.items(): <NEW_LINE> <INDENT> if callable(value) and not hasattr(value, "__doc__"): <NEW_LINE> <INDENT> raise exception.DocstringsMissing(attr_name) <NEW_LINE> <DEDENT> <DEDENT> return super(R...
Requires from all methods to include docstrings
6259904530c21e258be99b47
class ArtifactFileInfoResponse(ArtifactInfoResponseBase): <NEW_LINE> <INDENT> downloadUri: Optional[str] = None <NEW_LINE> remoteUrl: Optional[str] = None <NEW_LINE> mimeType: Optional[str] = None <NEW_LINE> size: Optional[int] = None <NEW_LINE> checksums: Optional[Checksums] = None <NEW_LINE> originalChecksums: Option...
Models an artifact file info response.
62599045507cdc57c63a60de
class Commands: <NEW_LINE> <INDENT> def setRawIOLoopback( self, enable=True ): <NEW_LINE> <INDENT> data.rawio_loopback = enable <NEW_LINE> <DEDENT> def setRawIOPacketSize( self, packet_size=8 ): <NEW_LINE> <INDENT> control.kiibohd.HIDIO_packet_size.argtypes = [ c_uint16 ] <NEW_LINE> return control.kiibohd.HIDIO_packet_...
Container class of commands available to control the host-side KLL implementation
62599045c432627299fa42a3
class MathInlineMixin(object): <NEW_LINE> <INDENT> def enable_math(self): <NEW_LINE> <INDENT> self.rules.math = re.compile(r'^\$(.+?)\$') <NEW_LINE> self.default_rules.insert(0, 'math') <NEW_LINE> self.rules.text = re.compile( r'^[\s\S]+?(?=[\\<!\[_*`~\$]|https?://| {2,}\n|\{\{|$)') <NEW_LINE> <DEDENT> def output_math(...
Math mixin for InlineLexer, mix this with InlineLexer:: class MathInlineLexer(InlineLexer, MathInlineMixin): def __init__(self, *args, **kwargs): super(MathInlineLexer, self).__init__(*args, **kwargs) self.enable_math()
62599045b830903b9686ee1b
class UserSessionData(db.Model): <NEW_LINE> <INDENT> session = db.ReferenceProperty(UserSession) <NEW_LINE> keyname = db.StringProperty() <NEW_LINE> content = db.BlobProperty()
Model for the session data in the datastore.
625990456fece00bbaccccf7
class Employee: <NEW_LINE> <INDENT> def __init__(self, first_name, last_name, annual_salary): <NEW_LINE> <INDENT> self.first_name = first_name.title() <NEW_LINE> self.last_name = last_name.title() <NEW_LINE> self.annual_salary = annual_salary <NEW_LINE> <DEDENT> def give_raise(self, amount=5000): <NEW_LINE> <INDENT> se...
Collect the first name, last name and annual salary and store them.
62599045cad5886f8bdc5a1f
class PreparerSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ('id', 'first_name', 'last_name', 'username')
Serializer for User Info in a workflow
6259904573bcbd0ca4bcb5ce
class Poster(models.Model): <NEW_LINE> <INDENT> poster = models.ImageField(upload_to='posters/') <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return '{}'.format(self.poster)
Genre model : Table for movie Genres
6259904523849d37ff8523fe
class _BrowserSwitch(str): <NEW_LINE> <INDENT> def string_to_browser(self, browser_string): <NEW_LINE> <INDENT> method = getattr(self, browser_string.lower(), lambda: "invalid") <NEW_LINE> return method() <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def android(): <NEW_LINE> <INDENT> return webdriver.Android() <NEW_LIN...
Get a new instance of a specific driver. (ChromeDriver, FirefoxDriver, etc).
62599045a79ad1619776b3c2
class AiRecognitionTaskFaceResult(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Status = None <NEW_LINE> self.ErrCode = None <NEW_LINE> self.Message = None <NEW_LINE> self.Input = None <NEW_LINE> self.Output = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT...
人脸识别结果。
625990458da39b475be04532
class TestS3SearchOptionsWidget(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.resource = current.manager.define_resource("hrm", "human_resource") <NEW_LINE> <DEDENT> def testQuery(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def testWidget(self): <NEW_LINE> <INDENT> widget = S...
Test S3SearchOptionsWidget
6259904576d4e153a661dc17
class StaticSite(StoredFileMixin, db.Model): <NEW_LINE> <INDENT> __tablename__ = 'static_sites' <NEW_LINE> __table_args__ = {'schema': 'events'} <NEW_LINE> add_file_date_column = False <NEW_LINE> file_required = False <NEW_LINE> id = db.Column( db.Integer, primary_key=True ) <NEW_LINE> event_id = db.Column( db.Integer,...
Static site for an Indico event.
62599045e76e3b2f99fd9d4f
class NameNotSpecifiedException(MCVirtException): <NEW_LINE> <INDENT> pass
A name has not been specified and cannot be determined by the path/URL.
6259904545492302aabfd81c
class NZBGetConfigFlow(ConfigFlow, domain=DOMAIN): <NEW_LINE> <INDENT> VERSION = 1 <NEW_LINE> @staticmethod <NEW_LINE> @callback <NEW_LINE> def async_get_options_flow(config_entry): <NEW_LINE> <INDENT> return NZBGetOptionsFlowHandler(config_entry) <NEW_LINE> <DEDENT> async def async_step_import( self, user_input: dict[...
Handle a config flow for NZBGet.
6259904550485f2cf55dc2ca
class BaseFlowModel(models.Model): <NEW_LINE> <INDENT> title = models.CharField(verbose_name=_('Title'), max_length=50) <NEW_LINE> description = models.TextField(verbose_name=_('Description')) <NEW_LINE> stage = models.CharField(verbose_name=_('Stage'), max_length=25) <NEW_LINE> remind_me = models.BooleanField(verbose_...
流程
62599045435de62698e9d147
class RoutePather(IPather): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> for _s in [IPather]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, RoutePather, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> for _s...
Proxy of C++ FIFE::RoutePather class
62599045b57a9660fecd2dc0
class SquareCompactness: <NEW_LINE> <INDENT> def __init__(self, gdf, areas=None, perimeters=None): <NEW_LINE> <INDENT> self.gdf = gdf <NEW_LINE> gdf = gdf.copy() <NEW_LINE> if perimeters is None: <NEW_LINE> <INDENT> gdf["mm_p"] = gdf.geometry.length <NEW_LINE> perimeters = "mm_p" <NEW_LINE> <DEDENT> else: <NEW_LINE> <I...
Calculates compactness index of each object in given GeoDataFrame. .. math:: \begin{equation*} \left(\frac{4 \sqrt{area}}{perimeter}\right) ^ 2 \end{equation*} Adapted from :cite:`feliciotti2018`. Parameters ---------- gdf : GeoDataFrame GeoDataFrame containing objects areas : str, list, np.array, pd...
62599045b830903b9686ee1c
class Inform(UserOwnedModel, EntityModel): <NEW_LINE> <INDENT> STATUS_PENDING = 'PENDING' <NEW_LINE> STATUS_SUCCESS = 'SUCCESS' <NEW_LINE> STATUS_FAIL = 'FAIL' <NEW_LINE> STATUS_CHOICES = ( (STATUS_PENDING, '等待处理'), (STATUS_SUCCESS, '举报成功'), (STATUS_FAIL, '举报失败'), ) <NEW_LINE> status = models.CharField( verbose_name='状...
举报消息
6259904582261d6c52730867
class FIOMinutely(object): <NEW_LINE> <INDENT> minutely = None <NEW_LINE> def __init__(self, forecast_io): <NEW_LINE> <INDENT> if forecast_io.has_minutely(): <NEW_LINE> <INDENT> self.minutely = forecast_io.get_minutely() <NEW_LINE> for item in list(forecast_io.get_minutely().keys()): <NEW_LINE> <INDENT> setattr(self, i...
This class recieves an ForecastIO object and holds the minutely weather conditions. It has one class for this purpose.
625990456fece00bbaccccf9
class PkgIndex(object): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> self.index_db = TinyDB(path, create_dirs=True) <NEW_LINE> <DEDENT> def add(self, pkg): <NEW_LINE> <INDENT> query = Query() <NEW_LINE> if not self.index_db.search(query.name == pkg["pkg_name"]): <NEW_LINE> <INDENT> self.index_db.in...
Helper for managing the packages index.json file
62599045b5575c28eb71366b
class CGInfo(TypedDict): <NEW_LINE> <INDENT> id: int <NEW_LINE> users: List[str]
Data representing a koji Content Generator. A dict of these are typically obtained via the ``listCGs`` XMLRPC call, mapping their friendly names to the CGInfo structure
6259904573bcbd0ca4bcb5d1
class UserDetailView(RetrieveAPIView): <NEW_LINE> <INDENT> serializer_class = serializers.UserDetailSerializer <NEW_LINE> permission_classes = [IsAuthenticated] <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> return self.request.user
用户的基本信息详情 RetrieveAPIView提供get方法: 将数据库的信息序列化后包裹在Response的data中返回
6259904507d97122c4217fe6
class DataChangeFilter(FrozenClass): <NEW_LINE> <INDENT> ua_types = [ ('Trigger', 'DataChangeTrigger'), ('DeadbandType', 'UInt32'), ('DeadbandValue', 'Double'), ] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.Trigger = DataChangeTrigger(0) <NEW_LINE> self.DeadbandType = 0 <NEW_LINE> self.DeadbandValue = 0 <NE...
:ivar Trigger: :vartype Trigger: DataChangeTrigger :ivar DeadbandType: :vartype DeadbandType: UInt32 :ivar DeadbandValue: :vartype DeadbandValue: Double
625990458da39b475be04534
class Document( object ): <NEW_LINE> <INDENT> def __init__( self, file, outpath ): <NEW_LINE> <INDENT> self.file = file <NEW_LINE> self.filename = os.path.splitext( os.path.basename( self.file ) )[0] <NEW_LINE> self.outpath = outpath <NEW_LINE> self.extract() <NEW_LINE> <DEDENT> def ext_text( self, doc ): <NEW_LIN...
document object
6259904521bff66bcd723fb1
class Point: <NEW_LINE> <INDENT> def index(self): <NEW_LINE> <INDENT> return "point"
A Point object describes a position in three different ways. These are accessed through the following attributes: image The pixel coordinates of the point in the image, with the origin (0,0) in the top-left of the image. This has two attributes: x and y. world The Cartesian coordinates of the point in 3D space...
6259904563b5f9789fe864b1