code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class CategoryAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> prepopulated_fields = {'slug': ('name',)}
Behaviour specific to the Django admin panel for the Category class.
62598f0b099cdd3c6367497c
class PathCompleter(Completer): <NEW_LINE> <INDENT> def complete(self, original, pos): <NEW_LINE> <INDENT> if not original: <NEW_LINE> <INDENT> return [('~/', 2)] <NEW_LINE> <DEDENT> prefix = os.path.expanduser(original[:pos]) <NEW_LINE> def escape(path): <NEW_LINE> <INDENT> return path.replace('\\', '\\\\').replace(' ...
completion for paths
62598f0badb09d7d5dc090f7
class SingleClickMode (InteractionMode): <NEW_LINE> <INDENT> cursor = gdk.Cursor(gdk.BOGOSITY) <NEW_LINE> def __init__(self, ignore_modifiers=False, **kwds): <NEW_LINE> <INDENT> super(SingleClickMode, self).__init__(**kwds) <NEW_LINE> self._button_pressed = None <NEW_LINE> <DEDENT> def enter(self, doc, **kwds): <NEW_LI...
Base class for non-drag (single click) modes
62598f0b5fc7496912d47818
class Post(models.Model): <NEW_LINE> <INDENT> author = models.ForeignKey('auth.User', on_delete=models.CASCADE) <NEW_LINE> title = models.CharField(max_length=200) <NEW_LINE> text = models.TextField() <NEW_LINE> created_date = models.DateTimeField(default=timezone.now) <NEW_LINE> published_date = models.DateTimeField(b...
Создаем класс, реализующий поведение поста
62598f0b4527f215b58e8a44
class Env(object): <NEW_LINE> <INDENT> metadata = {'render.modes': []} <NEW_LINE> action_space = None <NEW_LINE> observation_space = None <NEW_LINE> def _step(self, action): raise NotImplementedError <NEW_LINE> def _reset(self): raise NotImplementedError <NEW_LINE> def _render(self, mode='human', close=False): <NEW_LIN...
The main OpenAI Gym class. It encapsulates an environment with arbitrary behind-the-scenes dynamics. An environment can be partially or fully observed. The main API methods that users of this class need to know are: reset step render When implementing an environment, override the following methods in you...
62598f0bbe7bc26dc9251407
class VideoUploader(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._session = None <NEW_LINE> <DEDENT> def upload(self, video, wait_for_encoding=False): <NEW_LINE> <INDENT> if self._session: <NEW_LINE> <INDENT> raise FacebookError( "There is already an upload session for this video uploader",...
Video Uploader that can upload videos to adaccount
62598f0b656771135c4881d6
class Ball(object): <NEW_LINE> <INDENT> def __init__(self, x, y): <NEW_LINE> <INDENT> self.mass = 1 <NEW_LINE> self.radius = 14 <NEW_LINE> self.inertia = pk.moment_for_circle(self.mass, 0, self.radius) <NEW_LINE> self.body = pk.Body(self.mass, self.inertia) <NEW_LINE> self.body.position = x, y <NEW_LINE> self.shape = p...
Ball that rolls down ramps
62598f0bec188e330fdf73fd
class Forbidden(APIException): <NEW_LINE> <INDENT> code = 403 <NEW_LINE> msg = 'forbidden, not in scope' <NEW_LINE> error_code = 1004
禁止跨权限访问
62598f0b97e22403b3839a2c
class BackfileWindow(QtGui.QMainWindow): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(BackfileWindow, self).__init__() <NEW_LINE> textEdit = QtGui.QTextEdit() <NEW_LINE> self.setCentralWidget(textEdit) <NEW_LINE> self.statusBar().showMessage('Ready') <NEW_LINE> self.createActions() <NEW_LINE> self....
Base window for the Backfile program
62598f0b5fcc89381b2656d2
class ImplicitNode(BracketNode): <NEW_LINE> <INDENT> def __init__(self, config, leaf, parent): <NEW_LINE> <INDENT> super().__init__(config, leaf, parent) <NEW_LINE> self.type = IndentationTypes.IMPLICIT <NEW_LINE> next_leaf = leaf.get_next_leaf() <NEW_LINE> if leaf == ':' and '\n' not in next_leaf.prefix and '\r' not i...
Implicit indentation after keyword arguments, default arguments, annotations and dict values.
62598f0b7c178a314d78bfeb
class _ArrXMrCubeCounts(_BaseCubeCounts): <NEW_LINE> <INDENT> @lazyproperty <NEW_LINE> def column_bases(self): <NEW_LINE> <INDENT> return self.counts <NEW_LINE> <DEDENT> @lazyproperty <NEW_LINE> def counts(self): <NEW_LINE> <INDENT> return self._counts[:, :, 0] <NEW_LINE> <DEDENT> @lazyproperty <NEW_LINE> def row_bases...
Counts cube-measure for a slice with rows=ARR & columns=MR dimensions
62598f0bbf627c535bcaffc2
class HBox(Container): <NEW_LINE> <INDENT> def __init__(self, children=[], homogeneous=True, spacing=1): <NEW_LINE> <INDENT> self._spacing = spacing <NEW_LINE> self._homogeneous = homogeneous <NEW_LINE> Container.__init__(self, children) <NEW_LINE> self.style = theme.Container <NEW_LINE> <DEDENT> def _update_size(self,...
Horizontal box.
62598f0b5fdd1c0f98e5caed
class FqlEcRateLimitExceededError(OAuthException): <NEW_LINE> <INDENT> error_code = 613 <NEW_LINE> error_id = "FQL_EC_RATE_LIMIT_EXCEEDED" <NEW_LINE> error_description = 'Calls to stream have exceeded the rate of 100 calls per 600 seconds.'
Autogenerated exception class for API error code 613
62598f0b9f28863672817344
class TestTaskHistoryList(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 testTaskHistoryList(self): <NEW_LINE> <INDENT> model = artikcloud.models.task_history_list.TaskHistoryList()
TaskHistoryList unit test stubs
62598f0b8a349b6b43684d90
class StyleError(Exception): <NEW_LINE> <INDENT> pass
Exception indicating a style error has occured
62598f0b71ff763f4b5e62b1
class Model(AsyncObject): <NEW_LINE> <INDENT> _model_type = None <NEW_LINE> objects = None <NEW_LINE> DoesNotExist = ObjectNotFound <NEW_LINE> DoesNotValidate = ObjectNotValidated <NEW_LINE> def __new__(cls, *args, **kwargs): <NEW_LINE> <INDENT> o = super(Model,cls).__new__(cls) <NEW_LINE> pkname = cls._meta.pkname() <...
A mixin class for :class:`StdModel`. It implements the :attr:`uuid` attribute which provides the univarsal unique identifier for an instance of a model.
62598f0bdc8b845886d52115
class BlazeFuncDeprecatedDescriptor(IDataDescriptor): <NEW_LINE> <INDENT> _args = None <NEW_LINE> deferred = True <NEW_LINE> def __init__(self, kerneltree, outdshape, argmap): <NEW_LINE> <INDENT> self.kerneltree = kerneltree <NEW_LINE> self.outdshape = outdshape <NEW_LINE> self.argmap = argmap <NEW_LINE> <DEDENT> def _...
Data descriptor for blaze.bkernel.BlazeFunc Attributes: =========== kerneltree: blaze.bkernel.kernel_tree.KernelTree deferred expression DAG/tree outdshape: DataShape result type argmap: { blaze.bkernel.kernel_tree.Argument : Array } Keeps track of concrete input arrays
62598f0b099cdd3c6367497e
class CmTrustdomain(CmTrustdomainSchema): <NEW_LINE> <INDENT> cli_command = "/mgmt/tm/cm/trust-domain" <NEW_LINE> def rest(self): <NEW_LINE> <INDENT> response = self.device.get(self.cli_command) <NEW_LINE> response_json = response.json() <NEW_LINE> if not response_json: <NEW_LINE> <INDENT> return {} <NEW_LINE> <DEDENT>...
To F5 resource for /mgmt/tm/cm/trust-domain
62598f0b3346ee7daa336c0a
class InceptionBUnit(nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(InceptionBUnit, self).__init__() <NEW_LINE> in_channels = 1024 <NEW_LINE> self.branches = Concurrent() <NEW_LINE> self.branches.add_module("branch1", Conv1x1Branch( in_channels=in_channels, out_channels=384)) <NEW_LINE> s...
InceptionV4 type Inception-B unit.
62598f0bad47b63b2c5a6366
class Particle(Shape, BInducer): <NEW_LINE> <INDENT> def __init__(self, pos, moment, scene = None): <NEW_LINE> <INDENT> self.pos = pos <NEW_LINE> self.moment = moment <NEW_LINE> if scene: <NEW_LINE> <INDENT> Shape.__init__(self, scene) <NEW_LINE> self.obj = sphere(pos = pos, radius = 0.5, display = scene) <NEW_LINE> <D...
A point particle.
62598f0b377c676e912f630c
class HighPerformanceBot(HighPerformanceBotBase): <NEW_LINE> <INDENT> def participate(self): <NEW_LINE> <INDENT> self.log('Bot player participating.') <NEW_LINE> node_id = None <NEW_LINE> while True: <NEW_LINE> <INDENT> url = "{host}/node/{self.participant_id}".format( host=self.host, self=self ) <NEW_LINE> result = re...
Bot for experiment participation with direct server interaction
62598f0b7cff6e4e811b4536
class IvenResponse: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.error = None <NEW_LINE> self.task = None <NEW_LINE> self.status = 0 <NEW_LINE> self.api_key = None <NEW_LINE> self.iven_code = 0 <NEW_LINE> self.description = None <NEW_LINE> self.need_conf_update = False <NEW_LINE> self.need_firm_upda...
this object could be filled differently according to the related request. Users should check the fields if they not null or zero, otherwise they are set to the data came from the server.
62598f0b50812a4eaa620193
class ICreationCondition(ICondition): <NEW_LINE> <INDENT> pass
Creation condition of task.
62598f0b851cf427c66b6e18
class LibrarySearchIndexer(SearchIndexerBase): <NEW_LINE> <INDENT> INDEX_NAME = "library_index" <NEW_LINE> ENABLE_INDEXING_KEY = 'ENABLE_LIBRARY_INDEX' <NEW_LINE> INDEX_EVENT = { 'name': 'edx.library.index.reindexed', 'category': 'library_index' } <NEW_LINE> @classmethod <NEW_LINE> def normalize_structure_key(cls, stru...
Base class to perform indexing for library search from different modulestores
62598f0b956e5f7376df4c24
class Event(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=400) <NEW_LINE> body = models.TextField( help_text="Optional: Helpful links, additional information", blank=True, default="", ) <NEW_LINE> archived = models.BooleanField(default=False) <NEW_LINE> slug = models.SlugField(max_length=400, bl...
Event model.
62598f0bdc8b845886d52117
class SimpleMLP(nn.Module, BaseModel): <NEW_LINE> <INDENT> def __init__( self, num_classes=10, input_size=28 * 28, hidden_size=512, hidden_layers=1, drop_rate=0.5, ): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> layers = nn.Sequential( *( nn.Linear(input_size, hidden_size), nn.ReLU(inplace=True), nn.Dropout(p=drop...
Multi-Layer Perceptron with custom parameters. It can be configured to have multiple layers and dropout.
62598f0bad47b63b2c5a6368
class _ChangePasswordAction(Action): <NEW_LINE> <INDENT> enabled = Bool(False) <NEW_LINE> name = Unicode("&Change Password...") <NEW_LINE> def __init__(self, **traits): <NEW_LINE> <INDENT> super(_ChangePasswordAction, self).__init__(**traits) <NEW_LINE> get_permissions_manager().user_manager.on_trait_event(self._refres...
An action that allows the current user to change their password. It isn't exported through actions/api.py because it is specific to this user manager implementation.
62598f0bab23a570cc2d4314
class UsageError(ClickException): <NEW_LINE> <INDENT> exit_code = 2 <NEW_LINE> def __init__(self, message, ctx=None): <NEW_LINE> <INDENT> ClickException.__init__(self, message) <NEW_LINE> self.ctx = ctx <NEW_LINE> self.cmd = self.ctx.command if self.ctx else None <NEW_LINE> <DEDENT> def show(self, file=None): <NEW_LINE...
An internal exception that signals a usage error. This typically aborts any further handling. :param message: the error message to display. :param ctx: optionally the context that caused this error. Click will fill in the context automatically in some situations.
62598f0badb09d7d5dc090fd
class ProbeTest(ChecksTestBase): <NEW_LINE> <INDENT> configs = {} <NEW_LINE> def setUp(self, **kwargs): <NEW_LINE> <INDENT> super(ProbeTest, self).setUp(**kwargs) <NEW_LINE> if not self.configs: <NEW_LINE> <INDENT> config_file = os.path.join(CONFIGS, "probes.yaml") <NEW_LINE> with open(config_file) as data: <NEW_LINE> ...
Test 'Probe' operations.
62598f0b4a966d76dd5eda24
class RadixTrie(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.root = RadixTrieNode() <NEW_LINE> <DEDENT> def key_path(self, key, node, tail=None): <NEW_LINE> <INDENT> for child in node.children: <NEW_LINE> <INDENT> if not key.startswith(child.subkey): continue <NEW_LINE> key = key[len(child....
A radix trie is a collection of nodes linked by parent-child relationships. This class contais the methods to build and search the trie.
62598f0bbf627c535bcaffc6
class PyKubeError(KubernetesError): <NEW_LINE> <INDENT> pass
PyKube specific errors.
62598f0bd8ef3951e32c73fc
class KillOpsRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.InstanceId = None <NEW_LINE> self.Operations = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.InstanceId = params.get("InstanceId") <NEW_LINE> if params.get("Operations") is not None:...
KillOps请求参数结构体
62598f0b97e22403b3839a33
class VMwareDriverConfigurationException(VMwareDriverException): <NEW_LINE> <INDENT> msg_fmt = _("VMware Driver configuration fault.") <NEW_LINE> def __init__(self, message=None, details=None, **kwargs): <NEW_LINE> <INDENT> super(VMwareDriverConfigurationException, self).__init__( message, details, **kwargs) <NEW_LINE>...
Base class for all configuration exceptions.
62598f0ba219f33f346c537d
class SQLitePlugin(object): <NEW_LINE> <INDENT> name = 'sqlite' <NEW_LINE> def __init__(self, dbfile=':memory:', autocommit=True, dictrows=True, keyword='db'): <NEW_LINE> <INDENT> self.dbfile = dbfile <NEW_LINE> self.autocommit = autocommit <NEW_LINE> self.dictrows = dictrows <NEW_LINE> self.keyword = keyword <NEW_LINE...
This plugin passes an sqlite3 database handle to route callbacks that accept a `db` keyword argument. If a callback does not expect such a parameter, no connection is made. You can override the database settings on a per-route basis.
62598f0badb09d7d5dc090ff
class BestFringe(Fringe): <NEW_LINE> <INDENT> def __init__(self, start, goal): <NEW_LINE> <INDENT> super(BestFringe, self).__init__(goal, PriorityQueue()) <NEW_LINE> start.cost = start.h(self.goal) <NEW_LINE> self.fringe.put((start.cost, start)) <NEW_LINE> <DEDENT> def is_not_empty(self): <NEW_LINE> <INDENT> return sel...
Define fringe for best first search algorithm. We use a PriorityQueue as the fringe data structure.
62598f0b5fdd1c0f98e5caf3
class Word: <NEW_LINE> <INDENT> def __init__(self, dataset): <NEW_LINE> <INDENT> self.raw = None <NEW_LINE> self.word_id = None <NEW_LINE> self.tup = None <NEW_LINE> morpheme = Morpheme() <NEW_LINE> morpheme.oow(dataset) <NEW_LINE> self.morphemes = [morpheme] <NEW_LINE> <DEDENT> def read(self, word, dataset): <NEW_LINE...
表層によって管理される単語情報
62598f0b3617ad0b5ee04c80
class PSTNSessionInfo(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.SessionID = None <NEW_LINE> self.RoomID = None <NEW_LINE> self.Caller = None <NEW_LINE> self.Callee = None <NEW_LINE> self.StartTimestamp = None <NEW_LINE> self.AcceptTimestamp = None <NEW_LINE> self.StaffEmail = None...
PSTN 会话信息
62598f0b50812a4eaa620195
class StreamingPolicyContentKey(Model): <NEW_LINE> <INDENT> _attribute_map = { 'label': {'key': 'label', 'type': 'str'}, 'policy_name': {'key': 'policyName', 'type': 'str'}, 'tracks': {'key': 'tracks', 'type': '[TrackSelection]'}, } <NEW_LINE> def __init__(self, *, label: str=None, policy_name: str=None, tracks=None, *...
Class to specify properties of content key. :param label: Label can be used to specify Content Key when creating Stremaing Locator :type label: str :param policy_name: Policy used by Content Key :type policy_name: str :param tracks: Tracks which use this content key :type tracks: list[~azure.mgmt.media.models.TrackSe...
62598f0c851cf427c66b6e1c
class ActionResizeDevice(DeviceAction): <NEW_LINE> <INDENT> type = ACTION_TYPE_RESIZE <NEW_LINE> obj = ACTION_OBJECT_DEVICE <NEW_LINE> typeDescStr = N_("resize device") <NEW_LINE> def __init__(self, device, newsize): <NEW_LINE> <INDENT> if not device.resizable: <NEW_LINE> <INDENT> raise ValueError("device is not resiza...
An action representing the resizing of an existing device.
62598f0c97e22403b3839a35
class JobListResult(Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'Value', 'type': '[str]'}, } <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(JobListResult, self).__init__(**kwargs) <NEW_LINE> self.value = kwargs.get('value', None)
The list of job ids. :param value: The job id. :type value: list[str]
62598f0cf548e778e596a0dd
class NefitSensor(NefitEntity, SensorEntity): <NEW_LINE> <INDENT> entity_description: NefitSensorEntityDescription <NEW_LINE> @property <NEW_LINE> def native_value(self) -> StateType: <NEW_LINE> <INDENT> value = self.coordinator.data.get(self.entity_description.key) <NEW_LINE> if value is None: <NEW_LINE> <INDENT> retu...
Representation of a NefitSensor entity.
62598f0c5fc7496912d4781d
class Error1210(Error): <NEW_LINE> <INDENT> def __init__(self, pos, arg, ref, spec): <NEW_LINE> <INDENT> super().__init__(1210, pos, arg, ref) <NEW_LINE> self.spec = spec <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "arg {}: flag '{}': input '{}': usage value '{}' not recognized".format(self.pos, s...
Error for print mode: malformed usage value.
62598f0c7c178a314d78bff3
class SSLContextAdapter(requests.adapters.HTTPAdapter): <NEW_LINE> <INDENT> def init_poolmanager(self, connections, maxsize, block=requests.adapters.DEFAULT_POOLBLOCK, **pool_kwargs): <NEW_LINE> <INDENT> context = ssl.create_default_context() <NEW_LINE> pool_kwargs['ssl_context'] = context <NEW_LINE> return super(SSLCo...
HTTPAdapter that uses the default SSL context on the machine
62598f0cab23a570cc2d4316
class TimeWidget(OptionsPlugin): <NEW_LINE> <INDENT> label = "Time Range" <NEW_LINE> RangeTimeSlider = "Time Slider" <NEW_LINE> RangeStartEnd = "Start/End" <NEW_LINE> def __init__(self, parent=None): <NEW_LINE> <INDENT> super(TimeWidget, self).__init__(parent=parent) <NEW_LINE> self._layout = QtWidgets.QHBoxLayout() <N...
Widget for time based options This does not emit options changed signals because the time settings does not influence the visual representation of the preview snapshot.
62598f0cadb09d7d5dc09101
class StraightSelectionSort(Sorter): <NEW_LINE> <INDENT> def sort(self, array): <NEW_LINE> <INDENT> i = 0 <NEW_LINE> length = len(array) <NEW_LINE> while i<length -1: <NEW_LINE> <INDENT> k = i <NEW_LINE> j = i <NEW_LINE> while j<length: <NEW_LINE> <INDENT> if array[j]<array[k]: <NEW_LINE> <INDENT> k = j <NEW_LINE> <DED...
Straight selection sorter
62598f0c9f2886367281734b
class PersonaAuth(BaseAuth): <NEW_LINE> <INDENT> name = 'persona' <NEW_LINE> def get_user_id(self, details, response): <NEW_LINE> <INDENT> return details['email'] <NEW_LINE> <DEDENT> def get_user_details(self, response): <NEW_LINE> <INDENT> email = response['email'] <NEW_LINE> return {'username': email.split('@', 1)[0]...
BrowserID authentication backend
62598f0c656771135c4881e0
class GoodsType(models.Model): <NEW_LINE> <INDENT> id = models.AutoField(primary_key=True) <NEW_LINE> name = models.CharField(max_length=50) <NEW_LINE> cover = models.ImageField(upload_to='static/images/goodstype', default='static/images/goodstype/type.jpg') <NEW_LINE> intro = models.TextField() <NEW_LINE> parent = mod...
商品类型
62598f0c0fa83653e46f3a3a
class Owner(db.Model): <NEW_LINE> <INDENT> email = db.EmailProperty() <NEW_LINE> @staticmethod <NEW_LINE> def to_key(owner): <NEW_LINE> <INDENT> return '<%s>' % owner
key == email address.
62598f0c55399d3f0562507c
class BoundedExpressions(ModuleAnalysis): <NEW_LINE> <INDENT> Boundable = ( ast.Name, ast.Subscript, ast.BoolOp, ) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.result = set() <NEW_LINE> super(BoundedExpressions, self).__init__() <NEW_LINE> <DEDENT> def isboundable(self, node): <NEW_LINE> <INDENT> return any(...
Gathers all nodes that are bound to an identifier.
62598f0c31939e2706ed100d
class CronIdentity(SyslogFacilityIdentity): <NEW_LINE> <INDENT> _prefix = 'syslogtypes' <NEW_LINE> _revision = '2015-11-09' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> SyslogFacilityIdentity.__init__(self) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _meta_info(): <NEW_LINE> <INDENT> from ydk.models.ietf._me...
The facility for the clock daemon as defined in RFC 5424.
62598f0c7b180e01f3e485f3
class GroupsColumn(Column): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(GroupsColumn, self).__init__( label=_('Groups'), detailed_label=_('Target Groups'), sortable=False, shrink=False, *args, **kwargs) <NEW_LINE> <DEDENT> def render_data(self, review_request): <NEW_LINE> <INDENT>...
Shows the list of groups requested to review the review request.
62598f0c283ffb24f3cf2403
class Stats(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.b_key = "stats" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> self.client_eprt_request = "" <NEW_LINE> self.server_epsv_reply = "" <NEW_LINE> self.client_port_request = "" <NEW_LINE> self.s...
This class does not support CRUD Operations please use parent. :param client_eprt_request: {"description": "EPRT Requests From Client", "format": "counter", "type": "number", "oid": "2", "optional": true, "size": "8"} :param server_epsv_reply: {"description": "EPSV Replies From Server", "format": "counter", "type": "n...
62598f0c7cff6e4e811b453e
class Gfx2HeaderStruct(struct.Struct): <NEW_LINE> <INDENT> def __init__(self, endianness): <NEW_LINE> <INDENT> super().__init__(endianness + '4s7I') <NEW_LINE> <DEDENT> def loadFrom(self, data, idx): <NEW_LINE> <INDENT> (self.magic, self._04, self._08, self._0C, self._10, self._14, self._18, self._1C) = self.unpack_fro...
Header struct for Gfx2. Based on Wii U GTX Extractor.
62598f0c5fdd1c0f98e5caf7
class C_CANCEL: <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> self._message_id_being_responded_to: Optional[int] = None <NEW_LINE> self._context_id: Optional[int] = None <NEW_LINE> self._dataset_path: Optional[Union[Path, Tuple[Path, int]]] = None <NEW_LINE> self._dataset_file: Optional["NTF"] = N...
Represents a C-CANCEL primitive. +-------------------------------+---------+ | Parameter | Req/ind | +===============================+=========+ | Message ID Being Responded To | M | +-------------------------------+---------+ | (=) - The value of the parameter is equal to the value of the p...
62598f0c4a966d76dd5eda2b
class GradientCriterion(object): <NEW_LINE> <INDENT> def __init__(self, gtol, weight = None): <NEW_LINE> <INDENT> self.error = gtol <NEW_LINE> if weight != None: <NEW_LINE> <INDENT> self.weight = weight <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.weight = 1 <NEW_LINE> <DEDENT> <DEDENT> def __call__(self, state, ...
The gradient criterion stops the optimization when the gradient at the current point is less that a given tolerance
62598f0c9f2886367281734e
class CT_P(BaseOxmlElement): <NEW_LINE> <INDENT> pPr = ZeroOrOne('w:pPr') <NEW_LINE> r = ZeroOrMore('w:r') <NEW_LINE> def _insert_pPr(self, pPr): <NEW_LINE> <INDENT> self.insert(0, pPr) <NEW_LINE> return pPr <NEW_LINE> <DEDENT> def add_p_before(self): <NEW_LINE> <INDENT> new_p = OxmlElement('w:p') <NEW_LINE> self.addpr...
``<w:p>`` element, containing the properties and text for a paragraph.
62598f0cfbf16365ca792bf4
@register_resource <NEW_LINE> class SpacyEnCoreWebLg(BaseSpacyResource): <NEW_LINE> <INDENT> resource_str: str = "SpacyEnCoreWebLg" <NEW_LINE> _spacy_package_str: str = "en_core_web_lg"
Spacy 'en_core_web_lg' model.
62598f0c099cdd3c63674983
class JsonResponse(HttpResponse): <NEW_LINE> <INDENT> def __init__(self, resp_obj=None, status=None, encoder=EDXJSONEncoder, *args, **kwargs): <NEW_LINE> <INDENT> if resp_obj in (None, ""): <NEW_LINE> <INDENT> content = "" <NEW_LINE> status = status or 204 <NEW_LINE> <DEDENT> elif isinstance(resp_obj, QuerySet): <NEW_L...
Django HttpResponse subclass that has sensible defaults for outputting JSON.
62598f0c55399d3f0562507e
class _Restriction(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def check(self, value): <NEW_LINE> <INDENT> if isinstance(value, list): <NEW_LINE> <INDENT> return all((self._single_check(v) for v in value)) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return self._singl...
Superclass for restriction classes (numeric, file format, controlled vocabulary).
62598f0cff9c53063f5191b6
class memoize(object): <NEW_LINE> <INDENT> def __init__(self, func): <NEW_LINE> <INDENT> self.func = func <NEW_LINE> self.cache = {} <NEW_LINE> try: <NEW_LINE> <INDENT> self.__name__ = func.__name__ <NEW_LINE> self.__doc__ = func.__doc__ <NEW_LINE> <DEDENT> except AttributeError: <NEW_LINE> <INDENT> pass <NEW_LINE> <DE...
cache a function's return value to avoid recalulation
62598f0c283ffb24f3cf2404
@add_metaclass(ABCMeta) <NEW_LINE> class _CacheImpl(object): <NEW_LINE> <INDENT> _locator_classes = [_UserProvidedCacheLocator, _InTreeCacheLocator, _UserWideCacheLocator, _IPythonCacheLocator] <NEW_LINE> def __init__(self, py_func): <NEW_LINE> <INDENT> self._is_closure = bool(py_func.__closure__) <NEW_LINE> self._line...
Provides the core machinery for caching. - implement how to serialize and deserialize the data in the cache. - control the filename of the cache. - provide the cache locator
62598f0c3d592f4c4edb9a41
class Component(ApplicationSession): <NEW_LINE> <INDENT> async def onJoin(self, details): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> now = await self.call(u'com.timeservice.now') <NEW_LINE> <DEDENT> except Exception as e: <NEW_LINE> <INDENT> print("Error: {}".format(e)) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> p...
An application component using the time service.
62598f0c5fc7496912d4781f
class RunnerApp(): <NEW_LINE> <INDENT> def main(self, **kwargs): <NEW_LINE> <INDENT> args = argparse.Namespace( **kwargs) if kwargs else self._parse_command_line() <NEW_LINE> for filename in sorted(pathlib.Path(args.searchpath).glob("**/*.cfg")): <NEW_LINE> <INDENT> metadata = fromFile(filename) <NEW_LINE> if metadata:...
Application for searching for and running PyLith .cfg files.
62598f0c4527f215b58e8a52
class IntentionClassifierModels: <NEW_LINE> <INDENT> GLOBAL_INTENTIONS_MODEL = load_model('luci/models/global_intentions') <NEW_LINE> MYSELF_INTENTIONS_MODEL = load_model('luci/models/myself_intentions') <NEW_LINE> PARENTS_INTENTION_MODEL = load_model('luci/models/parents_intentions') <NEW_LINE> FRIENDS_INTENTION_MODEL...
Models for intention classification.
62598f0cbf627c535bcaffce
class UnauthorizedError(Exception): <NEW_LINE> <INDENT> pass
The given key wasn't acceptable for the requested operation.
62598f0c3617ad0b5ee04c86
class CommentList(DefaultsMixin, generics.ListAPIView): <NEW_LINE> <INDENT> serializer_class = serializers.ReadCommentSerializer <NEW_LINE> permission_classes = (permissions.AllowAny,) <NEW_LINE> def get_queryset(self, **kwargs): <NEW_LINE> <INDENT> content_type_arg = self.kwargs.get('content_type', None) <NEW_LINE> ob...
List all comments for a given ContentType and object ID.
62598f0c656771135c4881e4
class TestEntity(db.Model): <NEW_LINE> <INDENT> pass
Dummy test entity.
62598f0c956e5f7376df4c29
class PlantSquareValidator(Validator): <NEW_LINE> <INDENT> def __init__(self, size): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> <DEDENT> def validate(self, document): <NEW_LINE> <INDENT> text = document.text <NEW_LINE> if not text or (text and not text.isdigit()): <NEW_LINE> <INDENT> raise ValidationError(message=...
Ensures prompt is a number and it fits in the squares required for this plant
62598f0c97e22403b3839a3b
class ManagedInstancePrivateLink(ProxyResource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'properties': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'k...
A private link resource. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str :ivar properties: The private link resource group id. :vartype properties...
62598f0c091ae35668703774
class Assessment: <NEW_LINE> <INDENT> BASE = "http://lsa.colorado.edu/cgi-bin" <NEW_LINE> TERM_SEPARATOR = "%0D%0A%0D%0A" <NEW_LINE> URL = '' <NEW_LINE> FORM_PARAMS = {} <NEW_LINE> def __init__(self, text_1=None, text_2=None): <NEW_LINE> <INDENT> self.form_data = dict(self.FORM_PARAMS) <NEW_LINE> self.assign_text(text_...
Abstract Base class for type of comparison. Initializes HTML form data & attempts to get score for a particular pair/group of pairs.
62598f0c7c178a314d78bff9
class VARLENGTHMDHEADER(Structure): <NEW_LINE> <INDENT> _fields_ = [('tlv_class', c_uint, 16), ('tlv_type', c_byte), ('flags', c_ushort, 3), ('length', c_ushort, 5)] <NEW_LINE> header_size = 8 <NEW_LINE> def __init__(self, tlv_class=3, tlv_type=1,flags=NSH_FLAG_ZERO, length=NSH_VAR_MD_LEN, *args, **kwargs): <NEW_LINE> ...
Represent an NSH Optional Variable Length Context Headers
62598f0c5fc7496912d47820
class SingleLocker(ServerLocker): <NEW_LINE> <INDENT> __thisInstance = None <NEW_LINE> def __new__(cls, *args, **kwds): <NEW_LINE> <INDENT> if cls.__thisInstance is None: <NEW_LINE> <INDENT> cls.__thisInstance = super(ServerLocker,cls).__new__(cls) <NEW_LINE> cls.__thisInstance._isInitialized = False <NEW_LINE> <DEDENT...
This is singleton implementation of ServerLocker class. It's better to create a single locker in a process.
62598f0cfbf16365ca792bf8
class AuthTest(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'wlan_perception_auth_test' <NEW_LINE> sampledate = db.Column(db.Date, default=lambda: date.today().strftime('%Y-%m-%d')) <NEW_LINE> samplehour = db.Column(db.Integer, default=lambda: datetime.now().hour) <NEW_LINE> sta_mac = db.Column(db.S...
认证测试
62598f0c50812a4eaa620199
class BaseEstimator(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def _get_param_names(cls): <NEW_LINE> <INDENT> init = getattr(cls.__init__, 'deprecated_original', cls.__init__) <NEW_LINE> if init is object.__init__: <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> init_signature = signature(init) <NEW_LINE> p...
Base class for all estimators in scikit-learn Notes ----- All estimators should specify all the parameters that can be set at the class level in their ``__init__`` as explicit keyword arguments (no ``*args`` or ``**kwargs``).
62598f0c851cf427c66b6e24
class HAProxyListenBlock(object): <NEW_LINE> <INDENT> SERVER_TEMPLATE = ('server {block_id}-{location} {location} ' 'maxconn {max_connections} check') <NEW_LINE> BLOCK_TEMPLATE = pkgutil.get_data('appscale.admin.routing', 'templates/listen_block.cfg') <NEW_LINE> def __init__(self, block_id, port, max_connections, serve...
Represents an HAProxy configuration block.
62598f0cad47b63b2c5a6374
class EkklesiaAuth: <NEW_LINE> <INDENT> def __init__(self, settings, token=None, get_token=None, set_token=None): <NEW_LINE> <INDENT> self.settings = settings <NEW_LINE> if token is not None and get_token is not None: <NEW_LINE> <INDENT> raise RuntimeError('token and get_token arguments cannot be used at the same time'...
Wraps the OAuth2 session and provides helpers for Ekklesia ID server API access.
62598f0cf548e778e596a0e5
class Page7(WebrtcPage): <NEW_LINE> <INDENT> def __init__(self, page_set): <NEW_LINE> <INDENT> super(Page7, self).__init__( url=WEBRTC_GITHUB_SAMPLES_URL + 'peerconnection/audio/?codec=ISAC_16K', name='audio_call_isac16k_10s', page_set=page_set) <NEW_LINE> <DEDENT> def RunPageInteractions(self, action_runner): <NEW_LIN...
Why: Sets up a WebRTC audio call with iSAC 16K.
62598f0c3d592f4c4edb9a45
class SearchClubsEndpoint(Endpoint): <NEW_LINE> <INDENT> __uri__ = '/clubs/search' <NEW_LINE> @validate(SearchClubsRequest, SearchClubsResponse) <NEW_LINE> async def get(self, request): <NEW_LINE> <INDENT> query = None <NEW_LINE> if 'query' in request.args: <NEW_LINE> <INDENT> query = request.args['query'] <NEW_LINE> <...
Handles requests to /clubs/search.
62598f0c7cff6e4e811b4544
class ApBsWrapError(Exception): <NEW_LINE> <INDENT> def __init__(self,msg): <NEW_LINE> <INDENT> self.msg = msg <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.msg
ApBsWrapError ============= Exception raised in C++ code. Attributes: msg -- explanation of the error
62598f0c71ff763f4b5e62c2
class DefaultSpacing(Atom): <NEW_LINE> <INDENT> ABUTMENT = Range(low=0, value=10) <NEW_LINE> ALIGNMENT = Range(low=0, value=0) <NEW_LINE> BOX_MARGINS = Coerced(Box, factory=lambda: Box(0, 0, 0, 0))
A class which encapsulates the default spacing parameters for the various layout helper objects.
62598f0c3346ee7daa336c12
class Bernstein: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def basis(degree, t): <NEW_LINE> <INDENT> return [ _comb(degree, i) * t**i * (1 - t)**(degree - i) for i in range(degree + 1)] <NEW_LINE> <DEDENT> def __init__(self, segments, grid=None): <NEW_LINE> <INDENT> self.segments = [_np.array(control_points, copy=Tr...
Piecewise Bézier curve, see __init__().
62598f0c7cff6e4e811b4546
class GatewayRouteListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[GatewayRoute]'}, } <NEW_LINE> def __init__( self, *, value: Optional[List["GatewayRoute"]] = None, **kwargs ): <NEW_LINE> <INDENT> super(GatewayRouteListResult, self).__init__(**kwargs) <...
List of virtual network gateway routes. :param value: List of gateway routes. :type value: list[~azure.mgmt.network.v2018_01_01.models.GatewayRoute]
62598f0c283ffb24f3cf240b
class Reject(Submit): <NEW_LINE> <INDENT> template = ViewPageTemplateFile("reject.pt") <NEW_LINE> form_fields = form.FormFields(IWorkflowSchema) <NEW_LINE> actions = form.Actions( form.Action( name="reject", label=_(u"Reject this item"), success='handle_workflow', failure='handle_failure' ) )
Reject an item submitted for publication
62598f0cadb09d7d5dc0910b
class _UnbatchDataset(UnaryDataset): <NEW_LINE> <INDENT> def __init__(self, input_dataset, name=None): <NEW_LINE> <INDENT> flat_shapes = input_dataset._flat_shapes <NEW_LINE> if any(s.ndims == 0 for s in flat_shapes): <NEW_LINE> <INDENT> raise ValueError("Cannot unbatch an input with scalar components.") <NEW_LINE> <DE...
A dataset that splits the elements of its input into multiple elements.
62598f0c9f28863672817356
class AR(object): <NEW_LINE> <INDENT> def __init__(self, phi, variance=1.0, dt=1.0, Tmax=100): <NEW_LINE> <INDENT> self.phi = phi <NEW_LINE> self.variance = variance <NEW_LINE> self.dt = dt <NEW_LINE> self.Tmax = Tmax <NEW_LINE> self.klags = phi.size <NEW_LINE> self.NTmax = int(self.Tmax * 1.0 / self.dt) <NEW_LINE> sel...
This is a class that represents an AR process. We will make the conceptualization here that an AR can be characterized by a vector of phis in the following expression: z(t) = phi_0 + phi_1 * z(t - 1) + ... phi_k * z(t - k) + a_t Where alpha is random noise NOte: check whether the variance is properly transcipred (si...
62598f0cbf627c535bcaffd4
class HardwareEnvironment(models.Model): <NEW_LINE> <INDENT> Machine_Name_Choices = ( ('Habonaro', 'Habonaro'), ('Palmetto', 'Palmetto'), ('S812L', 'S812L'), ('S822L', 'S822L'), ('X86_E5', 'X86 E5 Series'), ) <NEW_LINE> Architecture_Type_Choices = ( ('x86', 'x86'), ('powerpc', 'powerpc'), ('arm64', 'arm64'), ('mips', '...
Store Base Hardware Information.
62598f0c50812a4eaa62019b
class RunTaskTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> @register_task('test', force=True) <NEW_LINE> def test(**kwargs): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> @register_task('test_exception', force=True) <NEW_LINE> def test_exception(**kwargs): <NEW_LINE> <INDENT> raise Exce...
Test run task.
62598f0cbe7bc26dc9251411
class Pattern: <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> self.index = 0 <NEW_LINE> self.collection = args <NEW_LINE> <DEDENT> def interpret(self): <NEW_LINE> <INDENT> return next(self)
Sequence
62598f0cd8ef3951e32c7403
class ShellyCover(ShellyBlockEntity, CoverEntity): <NEW_LINE> <INDENT> def __init__(self, wrapper: ShellyDeviceWrapper, block: Block) -> None: <NEW_LINE> <INDENT> super().__init__(wrapper, block) <NEW_LINE> self.control_result = None <NEW_LINE> self._supported_features = SUPPORT_OPEN | SUPPORT_CLOSE | SUPPORT_STOP <NEW...
Switch that controls a cover block on Shelly devices.
62598f0cad47b63b2c5a6378
class ContainerError(Error): <NEW_LINE> <INDENT> def __init__(self, message='Unsupported format'): <NEW_LINE> <INDENT> self.message = message
Exception raised for errors in the container. Arguments: message – explanation of the error
62598f0c55399d3f05625085
class Station: <NEW_LINE> <INDENT> def __init__(self, station_name): <NEW_LINE> <INDENT> self.name = station_name <NEW_LINE> <DEDENT> @property <NEW_LINE> def id(self): <NEW_LINE> <INDENT> return list(get_station(self.name)['station_id'])[0] <NEW_LINE> <DEDENT> def fetch_data_for_period(self, start_date, end_date): <NE...
Meteo station to get the weather conditions results for
62598f0cf548e778e596a0e9
class BadPinFactory(GPIOZeroError, ImportError): <NEW_LINE> <INDENT> pass
Error raised when an unknown pin factory name is specified
62598f0cff9c53063f5191be
class OptimizationError(Exception): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> default_message = ( "Please check your objectives/constraints or use a different solver." ) <NEW_LINE> super().__init__(default_message, *args, **kwargs)
When an optimization routine fails – usually, this means that cvxpy has not returned the "optimal" flag.
62598f0c7b180e01f3e485f8
class Group: <NEW_LINE> <INDENT> def __init__(self, name: str, url_prefix: str): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.url_prefix = url_prefix <NEW_LINE> self.deferred_function = [] <NEW_LINE> <DEDENT> def record(self, func: Callable) -> None: <NEW_LINE> <INDENT> def decorator(app): <NEW_LINE> <INDENT> f...
Use group to divide an app by the different logic. Its instance will be added in :attr:`freesia.app.Freesia.groups`. :param name: Name of this group. :param url_prefix: Url prefix of this group. All rules registered to this group will be prefixed to the `url_prefix`.
62598f0cbf627c535bcaffd6
class Runner: <NEW_LINE> <INDENT> def __init__(self, env_fn, agent, seed=None): <NEW_LINE> <INDENT> self.env_fn = env_fn <NEW_LINE> self.agent = agent <NEW_LINE> self.seed = seed <NEW_LINE> <DEDENT> def eval(self, eval_episodes): <NEW_LINE> <INDENT> eval_result = self.__eval_episodes__(self.env_fn(), self.agent, eval_e...
Runner provides an abstraction for executing agent on given environment.
62598f0cd8ef3951e32c7404
class LaneValue: <NEW_LINE> <INDENT> def __init__(self, lane_width): <NEW_LINE> <INDENT> self.lane_width = lane_width <NEW_LINE> <DEDENT> @property <NEW_LINE> def min(self): <NEW_LINE> <INDENT> return -pow(2, self.lane_width - 1) <NEW_LINE> <DEDENT> @property <NEW_LINE> def max(self): <NEW_LINE> <INDENT> return pow(2, ...
This class stands for the value of signed integer represented by a lane in v128. Suppose a bit number of the lane is n, then: For signed integer: minimum = -pow(2, n - 1), maximum = pow(2, n - 1) - 1 The bit number of the lane can be 8, 16, 32, 64
62598f0c5fcc89381b2656dd
class CachedStoreFD(): <NEW_LINE> <INDENT> def __init__(self, key, target_factory): <NEW_LINE> <INDENT> self._target_factory = target_factory <NEW_LINE> self._key = key <NEW_LINE> <DEDENT> def read(self, info=None, **kwargs): <NEW_LINE> <INDENT> res = self._target_factory.read(self._key, **kwargs) <NEW_LINE> if isinsta...
A class to access Cached Store elements as regular file descriptors
62598f0c851cf427c66b6e2a
@pytest.mark.destructive_test <NEW_LINE> class SPMTestUserInterface(salt.spm.SPMUserInterface): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._status = [] <NEW_LINE> self._confirm = [] <NEW_LINE> self._error = [] <NEW_LINE> <DEDENT> def status(self, msg): <NEW_LINE> <INDENT> self._status.append(msg) ...
Unit test user interface to SPMClient
62598f0cdc8b845886d52128
class WrongExpectedVersionError(Exception): <NEW_LINE> <INDENT> def __init__(self, expected, current, grpc_response): <NEW_LINE> <INDENT> self.expected = expected <NEW_LINE> self.current = current <NEW_LINE> self.grpc_response = grpc_response <NEW_LINE> self.msg = f"Current version ({current!s}) != Expected version ({e...
Occurs when an event is appended with the wrong expected version.
62598f0cad47b63b2c5a637a
class RestoreRequiredConfigElementsTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.config = mock.MagicMock() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def _call(cls, *args, **kwargs): <NEW_LINE> <INDENT> from certbot.renewal import restore_required_config_elements <NEW_LINE> ret...
Tests for certbot.renewal.restore_required_config_elements.
62598f0c091ae3566870377c