code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Branch(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=128, unique=True) <NEW_LINE> addr = models.CharField(max_length=128) <NEW_LINE> date = models.DateTimeField(auto_now_add=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> ...
校区
62598f6791af0d3eaad39504
class ProbabilityLabels(SEMLikeCommandLine): <NEW_LINE> <INDENT> input_spec = ProbabilityLabelsInputSpec <NEW_LINE> output_spec = ProbabilityLabelsOutputSpec <NEW_LINE> _cmd = " ProbabilityLabels " <NEW_LINE> _outputs_filenames = {'outputMeshFile': 'outputMeshFile'}
title: BRAINS Probability Labels category: BRAINS.Surface description: This program calculates the probability of each label across a list of surfaces when the flag "probability" is ON and the most likely labels (assign each point with the highest probability label across surfaces) when the flag "most...
62598f6766673b3332c2fab7
class CrossStitchLayer: <NEW_LINE> <INDENT> def __init__(self, model, num_tasks, hidden_dim, num_subspaces=1, init_scheme=BALANCED): <NEW_LINE> <INDENT> print('Using %d subspaces...' % num_subspaces, flush=True) <NEW_LINE> alpha_params = np.full((num_tasks * num_subspaces, num_tasks * num_subspaces), 1. / (num_tasks * ...
Cross-stitch layer class.
62598f6776d4e153a661c311
class LayoutDemoPanel(bpy.types.Panel): <NEW_LINE> <INDENT> bl_label = "Layout Demo" <NEW_LINE> bl_idname = "SCENE_PT_layout" <NEW_LINE> bl_space_type = 'PROPERTIES' <NEW_LINE> bl_region_type = 'WINDOW' <NEW_LINE> bl_context = "scene" <NEW_LINE> def draw(self, context): <NEW_LINE> <INDENT> layout = self.layout <NEW_LIN...
Creates a Panel in the scene context of the properties editor
62598f678a349b6b4368593c
class Meta: <NEW_LINE> <INDENT> model = Person <NEW_LINE> fields = ['first_name', 'last_name', 'email', 'date_of_birth', 'sex', 'is_active', 'grades', 'role']
Bases the form on the Person model
62598f6791af0d3eaad39506
class DataCollectionEndpointResourceSystemData(SystemData): <NEW_LINE> <INDENT> _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'str'}, 'created_by_type': {'key': 'createdByType', 'type': 'str'}, 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, 'last_modified_by': {'key': 'lastModifiedBy', 'type': ...
Metadata pertaining to creation and last modification of the resource. :ivar created_by: The identity that created the resource. :vartype created_by: str :ivar created_by_type: The type of identity that created the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". :vartype created_by...
62598f676aa9bd52df0d45cc
class Singleton: <NEW_LINE> <INDENT> __instance = None <NEW_LINE> def __new__(cls, *args, **kwargs): <NEW_LINE> <INDENT> if not cls.__instance: <NEW_LINE> <INDENT> cls.__instance = super(Singleton, cls).__new__(cls, *args, **kwargs) <NEW_LINE> <DEDENT> return cls.__instance
Classic Singleton pattern.
62598f67d10714528d69d5c8
class TestBuildOneTypeDef(OneMixin, TypeDefMixin, BuildQuantityMixin, TestCase): <NEW_LINE> <INDENT> pass
Test building a group that has a nested type def with quantity 1
62598f671f037a2d8b9e37ed
class SelectorCV(ModelSelector): <NEW_LINE> <INDENT> def cv_score(self, number_components): <NEW_LINE> <INDENT> model_cv = self.base_model(number_components) <NEW_LINE> split_method = KFold() <NEW_LINE> scores_fold = [] <NEW_LINE> for _, test_idx in split_method.split(self.sequences): <NEW_LINE> <INDENT> test_X, test_l...
select best model based on average log Likelihood of cross-validation folds
62598f67287bf620b62712bb
class Person(object): <NEW_LINE> <INDENT> def __init__(self, str_, dex, end, int_, edu, soc, age, skills): <NEW_LINE> <INDENT> self._str = str_ <NEW_LINE> self._dex = dex <NEW_LINE> self._end = end <NEW_LINE> self._int = int_ <NEW_LINE> self._edu = edu <NEW_LINE> self._soc = soc <NEW_LINE> self._age = age <NEW_LINE> se...
classdocs
62598f67d164cc6175820679
class CanQueue: <NEW_LINE> <INDENT> def __init__(self, can_dev, maxsize=0): <NEW_LINE> <INDENT> self.can_dev = can_dev <NEW_LINE> self.recv_thread = threading.Thread(target=indirect_caller, args=(self, 'recv_task')) <NEW_LINE> self.send_thread = threading.Thread(target=indirect_caller, args=(self, 'send_task')) <NEW_LI...
Queue-based interface to the CAN bus
62598f67c432627299fa26d2
class WaIntents: <NEW_LINE> <INDENT> def __init__(self,intents_file_name): <NEW_LINE> <INDENT> self.intents = {} <NEW_LINE> with open(intents_file_name) as intents_file: <NEW_LINE> <INDENT> csv_reader = csv.reader(intents_file, delimiter=',') <NEW_LINE> for ll in csv_reader: <NEW_LINE> <INDENT> aText, anIntentName = l...
Set of intents for WA workspace e.g. of a line in intents_file_name: "What will be my out of pocket cost for the visit?,benefit_coverage"
62598f676e29344779affd59
class Error(Exception): <NEW_LINE> <INDENT> pass
Base error for installers.
62598f67a8ecb03325870904
class AABBContact(BroadContact): <NEW_LINE> <INDENT> pass
Broad phase contact using AABBs.
62598f67d10714528d69d5ca
class VersionedPluginManager(PluginManagerDecorator): <NEW_LINE> <INDENT> def __init__(self, decorated_manager=None, categories_filter={"Default": IPlugin}, directories_list=None, plugin_info_ext="yapsy-plugin"): <NEW_LINE> <INDENT> PluginManagerDecorator.__init__(self, decorated_manager, categories_filter, directories...
Handle plugin versioning by making sure that when several versions are present for a same plugin, only the latest version is manipulated via the standard methods (eg for activation and deactivation) More precisely, for operations that must be applied on a single named plugin at a time (``getPluginByName``, ``activateP...
62598f67d10714528d69d5cb
class A2APolicyCreationInput(PolicyProviderSpecificInput): <NEW_LINE> <INDENT> _validation = { 'instance_type': {'required': True}, 'multi_vm_sync_status': {'required': True}, } <NEW_LINE> _attribute_map = { 'instance_type': {'key': 'instanceType', 'type': 'str'}, 'recovery_point_history': {'key': 'recoveryPointHistory...
A2A Policy creation input. All required parameters must be populated in order to send to Azure. :param instance_type: Required. The class type.Constant filled by server. :type instance_type: str :param recovery_point_history: The duration in minutes until which the recovery points need to be stored. :type recovery_p...
62598f678a349b6b43685940
class Particle: <NEW_LINE> <INDENT> def __init__(self, coin, name=None): <NEW_LINE> <INDENT> if name is not None and len(str(name)) == 0: <NEW_LINE> <INDENT> raise ValueError("invalid name") <NEW_LINE> <DEDENT> self._coin = coin <NEW_LINE> self._name = name <NEW_LINE> <DEDENT> @property <NEW_LINE> def coin(self): <NEW_...
Class that represents a particle in a quantum walk.
62598f67d99f1b3c44d04db4
class TokenScanner(object): <NEW_LINE> <INDENT> def __init__(self, path_or_str): <NEW_LINE> <INDENT> if isinstance(path_or_str, str): <NEW_LINE> <INDENT> if os.path.exists(path_or_str): <NEW_LINE> <INDENT> self.io = io.open(path_or_str, 'rU', encoding='utf8') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.io = Stri...
The scanner reads a gherkin doc (typically read from a `.feature` file) and creates a token for each line. The tokens are passed to the parser, which outputs an AST (Abstract Syntax Tree). If the scanner sees a `#` language header, it will reconfigure itself dynamically to look for Gherkin keywords for the associated...
62598f67a4f1c619b294dcf4
class Conv2D(Layer): <NEW_LINE> <INDENT> def __init__(self, filters, kernel_size, strides=(1, 1), dilation_rates=(1, 1), kernel_initializer=tf.initializers.he_normal(), kernel_regularizer=None, bias_initializer=tf.initializers.zeros(), bias_regularizer=None, use_bias=False, use_explicit_padding=False, name=None): <NEW_...
2D convolution network layer.
62598f6730c21e258be97efe
class AWSS3Bucket: <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self._s3_client = boto3.resource('s3') <NEW_LINE> self.s3_name = name <NEW_LINE> self.s3_bucket = self._s3_client.Bucket(self.s3_name) <NEW_LINE> self.__create_bucket() <NEW_LINE> self.s3_keys = [] <NEW_LINE> <DEDENT> def __create_buck...
AWS S3 Versioned Bucket.
62598f671f5feb6acb162339
class TestMicroshopManager(myunit.MyTest): <NEW_LINE> <INDENT> def test_edit_weidian(self): <NEW_LINE> <INDENT> login_page.LoginPage(self.driver).login() <NEW_LINE> sleep(2) <NEW_LINE> landlord_nav_page.LandlordNavPage(self.driver).Iamlandlord() <NEW_LINE> sleep(2) <NEW_LINE> landlord_nav_page.LandlordNavPage(self.driv...
房东微店
62598f6726238365f5fac276
class InequalitySplitHandler(base_split_handler.BaseSplitHandler): <NEW_LINE> <INDENT> def __init__(self, l1_regularization, l2_regularization, tree_complexity_regularization, min_node_weight, feature_column_group_id, epsilon, num_quantiles, gradient_shape, hessian_shape, multiclass_strategy, init_stamp_token=0, loss_u...
Base class for handlers of inequality splits.
62598f670a366e3fb87dc0c4
class Actor(object): <NEW_LINE> <INDENT> name = "Generic actor" <NEW_LINE> busted = False <NEW_LINE> gotace = False <NEW_LINE> turn = False <NEW_LINE> numofaces = 0 <NEW_LINE> value = 0 <NEW_LINE> ace = 11 <NEW_LINE> kqjlist = ["King!", "Queen!", "Jack!"] <NEW_LINE> kingqueenjack = 10 <NEW_LINE> def __init__(self): <NE...
actor class for variables and methods shared by player and dealer
62598f67925a0f43d25e773a
class TestSyncReportPolicy(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 testSyncReportPolicy(self): <NEW_LINE> <INDENT> pass
SyncReportPolicy unit test stubs
62598f678c3a8732951f5c51
@register <NEW_LINE> class WebRTCRoom(DOMWidget): <NEW_LINE> <INDENT> _model_module = Unicode('jupyter-webrtc').tag(sync=True) <NEW_LINE> _view_module = Unicode('jupyter-webrtc').tag(sync=True) <NEW_LINE> _model_name = Unicode('WebRTCRoomModel').tag(sync=True) <NEW_LINE> _view_module_version = Unicode(semver_range_fron...
A 'chatroom', which consists of a list of :`WebRTCPeer` connections
62598f678c3a8732951f5c52
class MLP(nn.Module): <NEW_LINE> <INDENT> def __init__(self, size_layer, activation='relu', output_activation=None, initial_method=None, dropout=0.0): <NEW_LINE> <INDENT> super(MLP, self).__init__() <NEW_LINE> self.hiddens = nn.ModuleList() <NEW_LINE> self.output = None <NEW_LINE> self.output_activation = output_activa...
多层感知器 .. note:: 隐藏层的激活函数通过activation定义。一个str/function或者一个str/function的list可以被传入activation。 如果只传入了一个str/function,那么所有隐藏层的激活函数都由这个str/function定义; 如果传入了一个str/function的list,那么每一个隐藏层的激活函数由这个list中对应的元素定义,其中list的长度为隐藏层数。 输出层的激活函数由output_activation定义,默认值为None,此时输出层没有激活函数。 Examples:: >>> net1 = MLP([...
62598f67287bf620b62712be
class AddressResponse(Model): <NEW_LINE> <INDENT> _attribute_map = { 'service_ip_address': {'key': 'serviceIpAddress', 'type': 'str'}, 'internal_ip_address': {'key': 'internalIpAddress', 'type': 'str'}, 'outbound_ip_addresses': {'key': 'outboundIpAddresses', 'type': '[str]'}, 'vip_mappings': {'key': 'vipMappings', 'typ...
Describes main public IP address and any extra virtual IPs. :param service_ip_address: Main public virtual IP. :type service_ip_address: str :param internal_ip_address: Virtual Network internal IP address of the App Service Environment if it is in internal load-balancing mode. :type internal_ip_address: str :param ou...
62598f6750485f2cf55da679
class EndEvent(ThrowingEvent): <NEW_LINE> <INDENT> def __init__(self, wf_spec, name, event_definition, **kwargs): <NEW_LINE> <INDENT> super(EndEvent, self).__init__(wf_spec, name, event_definition, **kwargs) <NEW_LINE> <DEDENT> def _on_complete_hook(self, my_task): <NEW_LINE> <INDENT> super(EndEvent, self)._on_complete...
Task Spec for a bpmn:endEvent node. From the specification of BPMN (http://www.omg.org/spec/BPMN/2.0/PDF - document number:formal/2011-01-03): For a "terminate" End Event, the Process is abnormally terminated - no other ongoing Process instances are affected. For all other End Events, the behavior associated with the...
62598f6776d4e153a661c319
class Cards: <NEW_LINE> <INDENT> dict_with_cards = {} <NEW_LINE> def decorator_adder_functions_in_dict(self, func): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def card_1(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def card_2(self): <NEW_LINE> <INDENT> pass
Functions for everycard
62598f675e10d32532ce346b
class CleanEveryN(CustomBehavior): <NEW_LINE> <INDENT> DEFAULT_N = 20 <NEW_LINE> def __init__(self, logger, fixture, n=DEFAULT_N): <NEW_LINE> <INDENT> CustomBehavior.__init__(self, logger, fixture) <NEW_LINE> if "detect_leaks=1" in os.getenv("ASAN_OPTIONS", ""): <NEW_LINE> <INDENT> self.logger.info("ASAN_OPTIONS enviro...
Restarts the fixture after it has ran 'n' tests. On mongod-related fixtures, this will clear the dbpath.
62598f671d351010ab8f3246
class ParamTypeError(GCMException): <NEW_LINE> <INDENT> pass
When GCM params has invalid form
62598f67167d2b6e312b6681
class UrlSwitching(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.b_key = "url-switching" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> self.url_service_group = "" <NEW_LINE> self.url_match_string = "" <NEW_LINE> self.url_switching_type = "" <NEW_L...
This class does not support CRUD Operations please use parent. :param url_service_group: {"description": "Create a Service Group comprising Servers (Service Group Name)", "format": "string-rlx", "minLength": 1, "maxLength": 127, "type": "string", "$ref": "/axapi/v3/slb/service-group"} :param url_match_string: {"minLen...
62598f67796e427e5384de98
class Sampler(metaclass=_abc.ABCMeta): <NEW_LINE> <INDENT> @_abc.abstractmethod <NEW_LINE> def sample(self, start_time, end_time): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _order_by_time(points): <NEW_LINE> <INDENT> a = _np.argsort(points[0]) <NEW_LINE> return points[:,a]
Sample from a point process.
62598f67a4f1c619b294dcf8
class View(object): <NEW_LINE> <INDENT> def __init__(self, main=None): <NEW_LINE> <INDENT> if not main: <NEW_LINE> <INDENT> raise ValueError("No value provided for main") <NEW_LINE> <DEDENT> self.main = main <NEW_LINE> self.canvas = tk.Canvas( self.main.root, background='#FFFFFF', **constants.canvas_dimensions) <NEW_LI...
Manages all of the visible components of the program, including the displayed graph.
62598f6721bff66bcd722361
class BlockEntity(nbt.CompoundSchema): <NEW_LINE> <INDENT> schema = { 'id': nbt.String, 'x': nbt.Int, 'y': nbt.Int, 'z': nbt.Int }
Block entities contain additional metadata for placed blocks
62598f673eb6a72ae0389d46
class Any(All): <NEW_LINE> <INDENT> def operator(self, data): <NEW_LINE> <INDENT> return any(data)
Fail if all checks on the iterable fail. :Input: :of: The source to check. Can be list or dictionary. :<check>: Check to perform on each element of the iterable. :Examples: Fail if `var` doesn't contain element with `k` == `a` :: check: any: of: '{{ var }}' equals: {the: '{{ ITEM...
62598f6776d4e153a661c31b
class MqexsTradeDetails(Base): <NEW_LINE> <INDENT> @camel_case_translate <NEW_LINE> def __init__( self, side: Union[MqexsSide, str], quantity: str, unit_price: str, currency: Union[MqexsCurrencyExt, str], settlement_date: datetime.date = None, quantity_unit: str = None, name: str = None ): <NEW_LINE> <INDENT> super()._...
Details specific to the trade type.
62598f67a8ecb0332587090a
class Page(ContainerElement): <NEW_LINE> <INDENT> buttons = [] <NEW_LINE> def __init__(self, path, children, title=None): <NEW_LINE> <INDENT> super(Page, self).__init__(path, children, title) <NEW_LINE> self.buttons = self.buttons or [SaveButton("%s.save" % path, _("Save")), ResetButton("%s.reset" % path, _("Reset")) ]...
An abstract page with a couple of widgets
62598f675166f23b2e242ae0
class Solution: <NEW_LINE> <INDENT> def removeDuplicates(self, s: str, k: int) -> str: <NEW_LINE> <INDENT> stack = [] <NEW_LINE> for c in s: <NEW_LINE> <INDENT> if len(stack) > 0 and stack[-1][0] == c: <NEW_LINE> <INDENT> stack[-1][1] += 1 <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> stack.append([c, 1]) <NEW_LINE> <D...
Simple and Easy but hard to get the clean and clear idea at first glance
62598f678c3a8732951f5c55
class Critic: <NEW_LINE> <INDENT> def __init__(self, state_size, action_size): <NEW_LINE> <INDENT> self.state_size = state_size <NEW_LINE> self.action_size = action_size <NEW_LINE> self.build_model() <NEW_LINE> <DEDENT> def build_model(self): <NEW_LINE> <INDENT> states = layers.Input(shape=(self.state_size,), name='sta...
Critic (Value) Model.
62598f6730c21e258be97f04
class MetricsColumnMetaData(Model): <NEW_LINE> <INDENT> _attribute_map = { 'column_name': {'key': 'columnName', 'type': 'str'}, 'column_value_type': {'key': 'columnValueType', 'type': 'str'} } <NEW_LINE> def __init__(self, column_name=None, column_value_type=None): <NEW_LINE> <INDENT> super(MetricsColumnMetaData, self)...
MetricsColumnMetaData. :param column_name: Name. :type column_name: str :param column_value_type: Data type. :type column_value_type: str
62598f6791af0d3eaad39510
class PtpRequest: <NEW_LINE> <INDENT> def __init__(self, opcode, sessionid, transactionid, params=None): <NEW_LINE> <INDENT> self.opcode = opcode <NEW_LINE> self.sessionid = sessionid <NEW_LINE> self.transactionid = transactionid <NEW_LINE> self.params = () if params == None else params <NEW_LINE> <DEDENT> def __str__(...
Class encapsulating a PTP Request.
62598f671d351010ab8f3249
class Content(object): <NEW_LINE> <INDENT> def __init__(self, content_type, name, label, url=None, gpg=None, tags=None, cert=None, enabled=None, metadata_expire=None): <NEW_LINE> <INDENT> self.content_type = content_type <NEW_LINE> self.name = name <NEW_LINE> self.label = label <NEW_LINE> self.url = url <NEW_LINE> self...
A generic representation of entitled content.
62598f67d164cc6175820680
class Rotate(object): <NEW_LINE> <INDENT> def __call__(self, *args): <NEW_LINE> <INDENT> angle = np.random.randint(0, 3) <NEW_LINE> result = [] <NEW_LINE> for arg in args: <NEW_LINE> <INDENT> result.append(F.rotate(arg, angle*90)) <NEW_LINE> <DEDENT> return tuple(result)
随机选择0, 90, 180, 270度
62598f67d164cc6175820681
class LoveLetterInvalidCommand(Exception): <NEW_LINE> <INDENT> pass
You tried to do something a card has no business doing
62598f673eb6a72ae0389d48
class TestCompareXLSXFiles(base_test_class.XLSXBaseTest): <NEW_LINE> <INDENT> def test_optimize01(self): <NEW_LINE> <INDENT> self.run_lua_test('test_optimize01') <NEW_LINE> <DEDENT> def test_optimize02(self): <NEW_LINE> <INDENT> self.run_lua_test('test_optimize02')
Test a file created with xlsxwriter.lua against a file created by Excel. Test data writing in optimization, i.e. in-line, mode.
62598f6773bcbd0ca4bc995a
class Conv2D(Layer): <NEW_LINE> <INDENT> @types(None, int, tuple) <NEW_LINE> def __init__(self, n_filters, kernel_size, strides=1, padding='valid', filters_initializer='lecun_uniform', biases_initializer='zeros', activation=None, input_shape=None): <NEW_LINE> <INDENT> assert len(kernel_size) == 2 <NEW_LINE> self.n_filt...
https://jefkine.com/general/2016/09/05/backpropagation-in-convolutional-neural-networks/
62598f6750485f2cf55da67b
class AsGymEnv(gym.Env): <NEW_LINE> <INDENT> def __init__(self, domain: Domain, unwrap_spaces: bool = True) -> None: <NEW_LINE> <INDENT> self._domain = domain <NEW_LINE> self._unwrap_spaces = unwrap_spaces <NEW_LINE> if unwrap_spaces: <NEW_LINE> <INDENT> self.observation_space = domain.get_observation_space().unwrapped...
This class wraps a scikit-decide domain as an OpenAI Gym environment. !!! warning The scikit-decide domain to wrap should inherit #UnrestrictedActionDomain since OpenAI Gym environments usually assume that all their actions are always applicable. An OpenAI Gym environment encapsulates an environment with arbi...
62598f6763f4b57ef00858f3
class OAuth2ProviderSettings(object): <NEW_LINE> <INDENT> def __init__(self, user_settings=None, defaults=None, import_strings=None, mandatory=None): <NEW_LINE> <INDENT> self.user_settings = user_settings or {} <NEW_LINE> self.defaults = defaults or {} <NEW_LINE> self.import_strings = import_strings or () <NEW_LINE> se...
A settings object, that allows OAuth2 Provider settings to be accessed as properties. Any setting with string import paths will be automatically resolved and return the class, rather than the string literal.
62598f670383005118f6ce12
class TestMixin(object): <NEW_LINE> <INDENT> maxDiff = None <NEW_LINE> baseUrl = 'http://testserver' <NEW_LINE> def tearDown(self): <NEW_LINE> <INDENT> cache.clear() <NEW_LINE> <DEDENT> def reverse(self, viewname, **kwargs): <NEW_LINE> <INDENT> return self.baseUrl + reverse(viewname, kwargs=kwargs) <NEW_LINE> <DEDENT> ...
Useful methods for testing
62598f674d74a7450cd58a5c
class WhoisJSON2CSVMigrator(JSON2CSVMigratorBase): <NEW_LINE> <INDENT> dataset: Optional[CSVWhoisDataset] = CSVWhoisDataset() <NEW_LINE> def __post_init__(self) -> None: <NEW_LINE> <INDENT> self.source_file = os.path.join( PyFunceble.storage.CONFIG_DIRECTORY, PyFunceble.cli.storage.WHOIS_DB_OLD_FILE, ) <NEW_LINE> self....
The migrator of the inactive database dile.
62598f67711fe17d825dfdf2
class Application(QtGui.QApplication): <NEW_LINE> <INDENT> def __init__(self, extra_options=None): <NEW_LINE> <INDENT> QtGui.QApplication.__init__(self, []) <NEW_LINE> extra_options = extra_options or [] <NEW_LINE> levels = { "debug": logging.DEBUG, "info": logging.INFO, "warning": logging.WARNING, "error": logging.ERR...
Base Aplication class. Used to set some user options
62598f67711fe17d825dfdf3
class HttpUrlHeader(ValueEntry): <NEW_LINE> <INDENT> LOCATION = "/format/url/headers" <NEW_LINE> ROOT = Root.PANORAMA_VSYS
HTTP header for URL. Note: This is valid for PAN-OS 8.0+ Args: name (str): The header name value (str): The header value
62598f6726238365f5fac27e
class InterceptorRunError(HttpApiError): <NEW_LINE> <INDENT> def __init__(self, code=400, message=None): <NEW_LINE> <INDENT> HttpApiError.__init__(self, code, message)
Raised when running script returned an error
62598f6715baa7234946168e
class ImagesTarHandler(web.RequestHandler): <NEW_LINE> <INDENT> def data_received(self, chunk): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> async def get(self, image_identifier: str): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> content = await Services.aiodocker.images.export_image(image_identifier) <NEW_LINE> self.s...
Images export handler
62598f6738b623060ffa87a3
class icmpv6_code(oxm_tlv): <NEW_LINE> <INDENT> def __init__(self, value, hasmask = False): <NEW_LINE> <INDENT> oxm_tlv.__init__(self, OFPXMT_OFB_ICMPV6_CODE, hasmask, 1, value) <NEW_LINE> <DEDENT> def show(self, prefix=''): <NEW_LINE> <INDENT> outstr = prefix + "icmpv6_code\n" <NEW_LINE> outstr += oxm_tlv.show(self, p...
Wrapper class for icmpv6_code match object Data members inherited from oxm_tlv: @arg class @arg field @arg hasmask @arg body
62598f6791af0d3eaad39512
class Wgs84Transformer(object): <NEW_LINE> <INDENT> def __init__(self, local_origin): <NEW_LINE> <INDENT> self._reference_heading = euler_from_quaternion( quaternion=(local_origin.pose.orientation.x, local_origin.pose.orientation.y, local_origin.pose.orientation.z, local_origin.pose.orientation.w))[2] <NEW_LINE> self._...
A simple class for transforming from the WGS84 frame to the local_xy frame and vice versa. Transforms to and from WGS84 and the local_xy frame using a local origin as a reference.
62598f6730c21e258be97f07
class Product(object): <NEW_LINE> <INDENT> def __init__(self,product_name, product_price): <NEW_LINE> <INDENT> print("Created the following product: " + product_name) <NEW_LINE> self.__product_name = product_name <NEW_LINE> self.__product_price = product_price <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> ...
Stores data about a product: properties: product_name: (string) with the products's name product_price: (float) with the products's standard price methods:
62598f6721bff66bcd722365
class CreateList(Choreography): <NEW_LINE> <INDENT> def __init__(self, temboo_session): <NEW_LINE> <INDENT> Choreography.__init__(self, temboo_session, '/Library/37Signals/Basecamp/CreateList') <NEW_LINE> <DEDENT> def new_input_set(self): <NEW_LINE> <INDENT> return CreateListInputSet() <NEW_LINE> <DEDENT> def _make_res...
Create a new instance of the CreateList Choreography. A TembooSession object, containing a valid set of Temboo credentials, must be supplied.
62598f67d10714528d69d5d4
class ServiceBundleConfig(Config): <NEW_LINE> <INDENT> def __init__(self, name: str): <NEW_LINE> <INDENT> super().__init__(name) <NEW_LINE> self.agents: ConfigListOption = ConfigListOption('agents', "Agent UIDs", ServiceExecConfig, required=True)
Service bundle configuration.
62598f678e05c05ec3f6e9cb
class NotAllowedException(StreamApiException): <NEW_LINE> <INDENT> status_code = 403 <NEW_LINE> code = 17
Raised when the requested action is not allowed for some reason.
62598f678c3a8732951f5c59
class CustomPatternAtPlaceholderWrapper(object): <NEW_LINE> <INDENT> def __init__(self, mode, placeholder): <NEW_LINE> <INDENT> self.mode = mode <NEW_LINE> self.placeholder = placeholder
Used for creating a custom pattern at a specific placeholder. It is used instead of a normal mode, wrapping the real mode and defining where to insert the placeholder. See placeholders in interfaces module.
62598f678c3a8732951f5c5a
class Node: <NEW_LINE> <INDENT> def __contains__(self, item): <NEW_LINE> <INDENT> return self.neighbors.keys().__contains__(item) <NEW_LINE> <DEDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> self.neighbors = dict() <NEW_LINE> <DEDENT> def get(self, item): <NEW_LINE> <INDENT> return s...
Node structure that holds the value of a word in the command structure.
62598f67d164cc6175820684
class MultiFilter(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._filters = [] <NEW_LINE> <DEDENT> def append(self, filter_fun): <NEW_LINE> <INDENT> assert callable(filter_fun) <NEW_LINE> self._filters.append(filter_fun) <NEW_LINE> <DEDENT> def __call__(self, body): <NEW_LINE> <INDENT> for f ...
This class represents a bank of filter, i.e. a list of boolean function. example filters are defined in this file. Note: since the filters are evaluated in the order they are appendend, put the faster filters first and the slower last.
62598f67ff9c53063f519d5f
class SlippyImageArtist(AxesImage): <NEW_LINE> <INDENT> def __init__(self, ax, raster_source, **kwargs): <NEW_LINE> <INDENT> self.raster_source = raster_source <NEW_LINE> if matplotlib.__version__ >= '3': <NEW_LINE> <INDENT> kwargs.setdefault('in_layout', False) <NEW_LINE> <DEDENT> super().__init__(ax, **kwargs) <NEW_L...
A subclass of :class:`~matplotlib.image.AxesImage` which provides an interface for getting a raster from the given object with interactive slippy map type functionality. Kwargs are passed to the AxesImage constructor.
62598f673eb6a72ae0389d4c
class RecursiveTimeSeriesRegressionForecaster(_RecursiveReducer): <NEW_LINE> <INDENT> _estimator_scitype = "time-series-regressor"
Recursive reduction from forecasting to time series regression. For the recursive strategy, a single estimator is fit for a one-step-ahead forecasting horizon and then called iteratively to predict multiple steps ahead. Parameters ---------- estimator : Estimator A time-series regression estimator as provided by ...
62598f67d53ae8145f917ba0
class UnetAllocateEIPSetSchema(schema.ResponseSchema): <NEW_LINE> <INDENT> fields = { "EIPAddr": fields.List(UnetEIPAddrSetSchema()), "EIPId": fields.Str(required=False, load_from="EIPId"), }
UnetAllocateEIPSet - AllocateEIP
62598f671d351010ab8f324e
class add_historical_feats(BaseEstimator, TransformerMixin): <NEW_LINE> <INDENT> def __init__(self, group_col='PGM_SYS_ID', viol_col='VIOL', ret_num_viol=False, new_col='num_viol_src'): <NEW_LINE> <INDENT> self.group_col = group_col <NEW_LINE> self.viol_col = viol_col <NEW_LINE> self.ret_num_viol = ret_num_viol <NEW_LI...
Transformer for determining inspection/violation history for a specific source.
62598f67925a0f43d25e7744
class DataBasePool(BaseConfig): <NEW_LINE> <INDENT> __instance = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> config = { 'host': self.get('mysql.host'), 'port': int(self.get('mysql.port')), 'database': self.get('mysql.db_name'), 'user': self.get('mysql.user'), 'password': self.get('mysql.password'), 'charset...
DataBase pool To get connection from database pool Example : DataBasePool.get_instance()
62598f676fece00bbaccb0a1
class Actor: <NEW_LINE> <INDENT> def __init__(self, name, actor_class): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.actor_class = actor_class
Internal class maintaining the information of an actor in a trial.
62598f678c3a8732951f5c5b
class Instance(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.required = [ "name"] <NEW_LINE> self.b_key = "instance" <NEW_LINE> self.a10_url="/axapi/v3/aam/authentication/server/windows/instance/{name}/stats" <NEW_LINE> self.DeviceProxy = "" <NE...
Class Description:: Statistics for the object instance. Class instance supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.` :param name: {"description": "Specify Windows authentication server name", "format": "string-rlx", "minLength": 1, "oid": "1001"...
62598f6738b623060ffa87a7
class DescribeTaskDetailRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TaskId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.TaskId = params.get("TaskId")
DescribeTaskDetail request structure.
62598f67bf627c535bcb0b8e
class Execute_rx(Execute): <NEW_LINE> <INDENT> def run_analysis(self): <NEW_LINE> <INDENT> Relax_fit(pipe_name=self.data.pipe_name, pipe_bundle=self.data.pipe_bundle, file_root=self.data.file_root, results_dir=self.data.save_dir, grid_inc=self.data.inc, mc_sim_num=self.data.mc_sim_num, view_plots=False) <NEW_LINE> data...
The Rx analysis execution object.
62598f677c178a314d78cbad
class Solution: <NEW_LINE> <INDENT> def surroundedRegions(self, board): <NEW_LINE> <INDENT> if not board: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> row = len(board) <NEW_LINE> col = len(board[0]) <NEW_LINE> total = row * col <NEW_LINE> uf = UnionFind(total + 1) <NEW_LINE> dx = [1, -1, 0, 0] <NEW_LINE> dy = [0...
@param: board: board a 2D board containing 'X' and 'O' @return: nothing
62598f6776d4e153a661c323
class Cube(): <NEW_LINE> <INDENT> def __init__(self, start, x=1, y=0, color=(255,0,0)): <NEW_LINE> <INDENT> self.rows = 20 <NEW_LINE> self.w = 500 <NEW_LINE> self.pos = start <NEW_LINE> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.color = color <NEW_LINE> <DEDENT> def move(self, x, y): <NEW_LINE> <INDENT> self.x = ...
Snakeの各体やFruitのオブジェクト
62598f6773bcbd0ca4bc9960
class IncorrectArgumentException(HtbException): <NEW_LINE> <INDENT> reason: str <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return repr(self) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return f"IncorrectArgumentException(reason='{self.reason}')" <NEW_LINE> <DEDENT> def __init__(self, reason: str)...
An incorrectly formatted argument was passed
62598f6763f4b57ef00858f6
class Lvl2(Actions): <NEW_LINE> <INDENT> def __init__(self, mapp): <NEW_LINE> <INDENT> self.n = mapp.n <NEW_LINE> self.m = mapp.m <NEW_LINE> self.maze = mapp.maze <NEW_LINE> self.units = lvls_units[2] <NEW_LINE> self.filling()
description of lvl1
62598f6756b00c62f0fb1fc1
class CategoryListViewTestCase(ViewRequestFactoryTestMixin, TestCase): <NEW_LINE> <INDENT> view_class = views.CategoryListView <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.category = mixer.blend('multilingual_news.CategoryTranslation') <NEW_LINE> self.entry = mixer.blend( 'multilingual_news.NewsEntryTranslation...
Tests for the ``CategoryListView`` generic view class.
62598f671f037a2d8b9e37fd
class SendEmail: <NEW_LINE> <INDENT> def __init__(self, host, port, username, password, to_emails, subject, content, timeout=30, tls=True): <NEW_LINE> <INDENT> self._host = host <NEW_LINE> self._port = port <NEW_LINE> self._username = username <NEW_LINE> self._password = password <NEW_LINE> self._to_emails = to_emails ...
Send email. Attributes: host: Mail server host. port: Mail server port. username: Email username, e.g. test@gmail.com password: Email password. to_emails: Email list, which mails to be send. subject: Email subject(title). content: Email content(body). timeout: Send timeout time(seconds)...
62598f6750485f2cf55da67f
@maptype('java.lang.Integer') <NEW_LINE> class Integer(Object): <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> return "%d" % self._value <NEW_LINE> <DEDENT> def __cmp__(self, other): <NEW_LINE> <INDENT> if type(other) is int: <NEW_LINE> <INDENT> return self._value == other <NEW_LINE> <DEDENT> elif type(oth...
Remote integer object
62598f67a4f1c619b294dd02
class ECFileMigrator(ObjectMigrator): <NEW_LINE> <INDENT> walkerClass = CatalogWalker <NEW_LINE> src_meta_type = 'ECFile' <NEW_LINE> src_portal_type = 'ECFile' <NEW_LINE> dst_meta_type = 'ATFile' <NEW_LINE> dst_portal_type = 'File' <NEW_LINE> map = {'getFile' : 'setFile', 'getExcludeFromNav' : 'setExcludeFromNav'}
Base class to migrate to File
62598f6730c21e258be97f0c
class OrderStatus(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'status': {'required': True}, 'update_date_time': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, 'update_date_time': {'key': 'updateDateTime', 'type': 'iso-8601'}, 'comments': {'key': 'com...
Represents a single status change. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. :param status: Required. Status of the order as per the allowed status types. Possible values include: "Untracked", "Awaitin...
62598f674d74a7450cd58a5f
class DiscreteEnv(Env): <NEW_LINE> <INDENT> def __init__(self, nS, nA, P, isd): <NEW_LINE> <INDENT> self.P = P <NEW_LINE> self.isd = isd <NEW_LINE> self.lastaction=None <NEW_LINE> self.nS = nS <NEW_LINE> self.nA = nA <NEW_LINE> self.action_space = spaces.Discrete(self.nA) <NEW_LINE> self.observation_space = spaces.Tupl...
Has the following members - nS: number of states - nA: number of actions - P: transitions (*) - isd: initial state distribution (**) (*) dictionary dict of dicts of lists, where P[s][a] == [(probability, nextstate, reward, done), ...] (**) list or array of length nS
62598f67287bf620b62712ca
class PluginManager: <NEW_LINE> <INDENT> def __init__(self, server): <NEW_LINE> <INDENT> self.server = server <NEW_LINE> self.plugins = {} <NEW_LINE> self.subscribers = { "bundle_autoload": [], "extend_autoloader": [], "extend_server_configuration": [], } <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <IND...
Class containing the plugin's manager. This object should contains the plugins defined by the user. A plugin is a set of code containing some functionality which will extend the Python Aboard abilities. For more informations about plugins, see the Plugin class (defined in the plugin module of the same package).
62598f67711fe17d825dfdf9
class ProductionConfig(BaseConfig): <NEW_LINE> <INDENT> SECRET_KEY = 'my_precious' <NEW_LINE> DEBUG = False <NEW_LINE> SQLALCHEMY_DATABASE_URI = postgres_local_base + database_name
Konfigurasi untuk mode produksi.
62598f6776d4e153a661c325
class SchemaMutationError(BQTError): <NEW_LINE> <INDENT> CUSTOM_ERROR_MESSAGE = 'Schema Mutation Error: unable to mutate object path {0} on keyi {1} ' 'object {2}' <NEW_LINE> def __init__(self, objtomatch, keyi, path): <NEW_LINE> <INDENT> super(SchemaMutationError, self).__init__( self.CUSTOM_...
Error for API executions.
62598f67d53ae8145f917ba4
@enum.unique <NEW_LINE> class Processing(PubSubEnumMixin, enum.Enum): <NEW_LINE> <INDENT> DAY_START = 'day_start' <NEW_LINE> DAY_END = 'day_end' <NEW_LINE> PROCESS_FILE = 'process_file' <NEW_LINE> BEGIN = 'begin' <NEW_LINE> END = 'end'
Enumeration that defines the lifecycle of processing the collection of files in the logs. DAY_START - parameters: date - datetime.date object for the day that is being processed. DAY_END - parameters: date - datetime.date object for the day that was processed. PROCESS_FILE - parameters: entry: autology.report...
62598f676aa9bd52df0d45df
class KochStarFlake(KochCurve): <NEW_LINE> <INDENT> def draw(self, width, height): <NEW_LINE> <INDENT> self.turtle.reset() <NEW_LINE> self.turtleScreen.tracer(TRACER_SETTING) <NEW_LINE> self.turtle.penup() <NEW_LINE> self.turtle.goto(width / 2, -height / 8) <NEW_LINE> self.turtle.pendown() <NEW_LINE> self.turtle.right(...
Extra bonus drawing:) Implements draw method so that a square snowflake is drawn. Try changing number of turns to 4, 5 or more for some cool shapes
62598f670383005118f6ce1a
class QuizViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Quiz.objects.all() <NEW_LINE> serializer_class = QuizSerializer <NEW_LINE> permission_classes = (IsAuthenticated, )
API Quiz
62598f6766673b3332c2facb
class Test(BT.BiskitTest): <NEW_LINE> <INDENT> def test_molUtils( self ): <NEW_LINE> <INDENT> from Biskit import PDBModel <NEW_LINE> S = self <NEW_LINE> S.m = PDBModel( t.testRoot()+'/lig/1A19.pdb' ) <NEW_LINE> S.model_1 = S.m.compress( S.m.maskProtein() ) <NEW_LINE> S.model_2 = sortAtomsOfModel( S.model_1) <NEW_LINE> ...
Test case
62598f6721bff66bcd72236d
class SomeHelperClass(object): <NEW_LINE> <INDENT> pass
Другой необходимыый для работы пользовательский класс
62598f6730c21e258be97f0f
class Integer(RMLAttribute, zope.schema.Int): <NEW_LINE> <INDENT> min = None <NEW_LINE> max = None
An integer. A minimum and maximum value can be specified.
62598f678c3a8732951f5c5f
class HFrame(): <NEW_LINE> <INDENT> def __init__(self,path,columns,create_from_scratch=True): <NEW_LINE> <INDENT> self.columns = pd.Index(columns) <NEW_LINE> self.modifiable = False <NEW_LINE> self.iloc = Iloc(self) <NEW_LINE> self.loc = Loc(self) <NEW_LINE> self.path = path <NEW_LINE> if create_from_scratch: <NEW_LINE...
We will imitate basic functionality of pandas dataframes with h5py so that we can save complicated and heavy stuff in cells.
62598f67507cdc57c63a44ad
class Info(Arg): <NEW_LINE> <INDENT> def __init__(self, name="info", attr=None): <NEW_LINE> <INDENT> Arg.__init__(self, name, attr) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def default(): <NEW_LINE> <INDENT> return 0
Info argument.
62598f67c432627299fa26e4
class RandomStrategy(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def record_result(self, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def select_action(self, player, hand): <NEW_LINE> <INDENT> options = ['D', 'Sr', 'H', 'P', 'S'] <NEW_LINE> return random.choi...
Randomly do actions
62598f6773bcbd0ca4bc9964
class NestedStack(stack_resource.StackResource): <NEW_LINE> <INDENT> PROPERTIES = ( TEMPLATE_URL, TIMEOUT_IN_MINS, PARAMETERS, ) = ( 'TemplateURL', 'TimeoutInMinutes', 'Parameters', ) <NEW_LINE> properties_schema = { TEMPLATE_URL: properties.Schema( properties.Schema.STRING, _('The URL of a template that specifies the ...
A Resource representing a child stack to allow composition of templates.
62598f67a8ecb03325870916
class BaseListView(_BaseModelResource): <NEW_LINE> <INDENT> def _get(self) -> 'RPC response': <NEW_LINE> <INDENT> items = self._query.all() <NEW_LINE> return self._serializer(items, many=True).data <NEW_LINE> <DEDENT> def _post(self) -> 'RPC response': <NEW_LINE> <INDENT> item = self._post_populate() <NEW_LINE> return ...
Model based list view Example: >>> class FooListView(BaseListView): >>> _model = Foo >>> _serializer = FooSerializer >>> _deserializer = FooDeserializer >>> >>> def get(self): >>> return self._get() >>> >>> def post(self): >>> foo = self._post_populate() >>> # custom changes...
62598f670a366e3fb87dc0d4
class Banner(models.Model): <NEW_LINE> <INDENT> category = models.ForeignKey(MenuCategory, on_delete=models.CASCADE, verbose_name="类别", help_text="类别") <NEW_LINE> img = models.CharField(default="", max_length=200, verbose_name="图片地址", help_text="图片地址") <NEW_LINE> index = models.IntegerField(default=0, verbose_name="轮播顺...
banner条数据
62598f670383005118f6ce1c
class SurvivorLocationUpdate(APIView): <NEW_LINE> <INDENT> def patch(self, request, survivor_id): <NEW_LINE> <INDENT> survivor = get_object_or_404(Survivor, pk=survivor_id) <NEW_LINE> serializer = SurvivorSerializer(survivor, data=request.data, partial=True) <NEW_LINE> if serializer.is_valid(): <NEW_LINE> <INDENT> seri...
Atualiza parcialmente as informações dos sobreviventes.
62598f67ff9c53063f519d67
class HelpEntryAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ('id', 'db_key', 'db_help_category', 'db_lock_storage') <NEW_LINE> list_display_links = ('id', 'db_key') <NEW_LINE> search_fields = ['^db_key', 'db_entrytext'] <NEW_LINE> ordering = ['db_help_category', 'db_key'] <NEW_LINE> save_as = True <NEW_L...
Sets up the admin manaager for help entries
62598f67711fe17d825dfdfc