code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class BadOptionException(RuntimeError): <NEW_LINE> <INDENT> pass
This is raised if the section blueprint is improperly configured
625990283eb6a72ae038b5e4
class MySQLError(Exception): <NEW_LINE> <INDENT> __module__ = "MySQLdb"
Exception related to operation with MySQL.
62599028711fe17d825e1459
class DataTablesConfig(object): <NEW_LINE> <INDENT> classes = ['table', 'cell-border', 'nowrap'] <NEW_LINE> extensions = DataTablesExtensions <NEW_LINE> options = DataTablesOptions <NEW_LINE> limit = 1000 <NEW_LINE> sample_size = None <NEW_LINE> sort = False <NEW_LINE> warnings = True
Default configuration for Jupyter DataTables.
6259902826238365f5fadad1
class HTTPXDownloader(IDownloader): <NEW_LINE> <INDENT> async def download(self, url: str) -> str: <NEW_LINE> <INDENT> async with httpx.AsyncClient() as client: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> response = await client.get(url) <NEW_LINE> <DEDENT> except httpx.ConnectError as e: <NEW_LINE> <INDENT> raise Dow...
Real downloader. Sends request to linguee.com to read the page.
625990281d351010ab8f4a96
class RandomWalk(DiscoveryStrategy): <NEW_LINE> <INDENT> def __init__(self, overlay, timeout=3.0, window_size=5, reset_chance=50, target_interval=0): <NEW_LINE> <INDENT> super(RandomWalk, self).__init__(overlay) <NEW_LINE> self.intro_timeouts = {} <NEW_LINE> self.node_timeout = timeout <NEW_LINE> self.window_size = win...
Walk randomly through the network.
62599028a4f1c619b294f574
class ControlPoint(RectangleShape): <NEW_LINE> <INDENT> def __init__(self, theCanvas, object, size, the_xoffset, the_yoffset, the_type): <NEW_LINE> <INDENT> RectangleShape.__init__(self, size, size) <NEW_LINE> self._canvas = theCanvas <NEW_LINE> self._shape = object <NEW_LINE> self._xoffset = the_xoffset <NEW_LINE> sel...
The :class:`ControlPoint` class.
625990281d351010ab8f4a97
class DenseCapsule(nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_num_caps, in_dim_caps, out_num_caps, out_dim_caps, routings=3, gpu=0): <NEW_LINE> <INDENT> super(DenseCapsule, self).__init__() <NEW_LINE> self.in_num_caps = in_num_caps <NEW_LINE> self.in_dim_caps = in_dim_caps <NEW_LINE> self.out_num_caps = out_...
The dense capsule layer. It is similar to Dense (FC) layer. Dense layer has `in_num` inputs, each is a scalar, the output of the neuron from the former layer, and it has `out_num` output neurons. DenseCapsule just expands the output of the neuron from scalar to vector. So its input size = [None, in_num_caps, in_dim_cap...
6259902830c21e258be99797
class BaseDnsAdminTest(BaseDnsTest): <NEW_LINE> <INDENT> _interface = "json" <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> super(BaseDnsAdminTest, cls).setUpClass() <NEW_LINE> if (CONF.compute.allow_tenant_isolation or cls.force_tenant_isolation is True): <NEW_LINE> <INDENT> creds = cls.is...
Base test case class for Dns Admin API tests.
6259902866673b3332c3136f
class BinaryOpExpr(TypedExpr): <NEW_LINE> <INDENT> def __init__(self, typ, op, arg1, arg2, op_name_uni=None, op_name_latex=None, tcheck_args=True): <NEW_LINE> <INDENT> if tcheck_args: <NEW_LINE> <INDENT> args = [self.ensure_typed_expr(arg1, typ), self.ensure_typed_expr(arg2, typ)] <NEW_LINE> <DEDENT> else: <NEW_LINE> <...
This class abstracts over expressions headed by specific binary operators. It is not necessarily designed to be instantiated directly, but rather subclassed for particular hard-coded operators. Because of the way the copy function works, it is currently not suited for direct instantiation at all.
6259902856b00c62f0fb3840
class CmdPasswordCreate(Command): <NEW_LINE> <INDENT> key = CMD_NOMATCH <NEW_LINE> locks = "cmd:all()" <NEW_LINE> def func(self): <NEW_LINE> <INDENT> password = self.args <NEW_LINE> self.caller.msg(echo=False) <NEW_LINE> if not hasattr(self.menutree, 'playername'): <NEW_LINE> <INDENT> self.caller.msg("{rSomething went ...
Handle the creation of a password. This also creates the actual Player/User object.
62599028bf627c535bcb2437
class Logging: <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self._logger = logging.getLogger( self.__module__+"."+self.__class__.__name__ )
Subclass for any class that could use a _logger attribute.
62599028d164cc6175821ef9
class MercatorLatitudeScale(mscale.ScaleBase): <NEW_LINE> <INDENT> name = 'mercator' <NEW_LINE> def __init__(self, axis, **kwargs): <NEW_LINE> <INDENT> mscale.ScaleBase.__init__(self) <NEW_LINE> thresh = kwargs.pop("thresh", np.radians(85)) <NEW_LINE> if thresh >= np.pi / 2.0: <NEW_LINE> <INDENT> raise ValueError("thre...
Scales data in range -pi/2 to pi/2 (-90 to 90 degrees) using the system used to scale latitudes in a Mercator projection. The scale function: ln(tan(y) + sec(y)) The inverse scale function: atan(sinh(y)) Since the Mercator scale tends to infinity at +/- 90 degrees, there is user-defined threshold, above and belo...
62599028d164cc6175821efa
class TestData(IDataVerify): <NEW_LINE> <INDENT> customers: [Customer] = None <NEW_LINE> lc_global: LCGlobal = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.customers = [] <NEW_LINE> <DEDENT> def data_verify(self): <NEW_LINE> <INDENT> if self.customers is not None: <NEW_LINE> <INDENT> for customer in sel...
测试数据封装类
62599028d18da76e235b790f
class FilterGroup: <NEW_LINE> <INDENT> CONJUNCTIONS = { 'and': lambda l: reduce(lambda memo, item: memo and item, l), 'or': lambda l: reduce(lambda memo, item: memo or item, l), 'not': lambda l: not reduce(lambda memo, item: memo and item, l), } <NEW_LINE> def __init__(self, conjunction, filter_list): <NEW_LINE> <INDEN...
Stores a list of filter objects joined by a conjunction
6259902866673b3332c31371
class Skill(object): <NEW_LINE> <INDENT> deserialized_types = { 'stage': 'ask_smapi_model.v1.stage_type.StageType', 'locale': 'str' } <NEW_LINE> attribute_map = { 'stage': 'stage', 'locale': 'locale' } <NEW_LINE> supports_multiple_types = False <NEW_LINE> def __init__(self, stage=None, locale=None): <NEW_LINE> <INDENT>...
:param stage: :type stage: (optional) ask_smapi_model.v1.stage_type.StageType :param locale: skill locale in bcp 47 format :type locale: (optional) str
6259902891af0d3eaad3adab
class JSONResponse(HttpResponse): <NEW_LINE> <INDENT> def __init__(self, data, **kwargs): <NEW_LINE> <INDENT> content = JSONRenderer().render(data) <NEW_LINE> kwargs['content_type'] = 'application/json' <NEW_LINE> super(JSONResponse, self).__init__(content, **kwargs)
将JSON转为httpresponse
625990281d351010ab8f4a9a
class PictureQuerySet(models.QuerySet, PictureQuerySetMixin, ModeratedQuerySetMixin): <NEW_LINE> <INDENT> pass
Queryset des images
62599028ac7a0e7691f7346d
class TransformerEncoder(FairseqEncoder): <NEW_LINE> <INDENT> def __init__(self, args, dictionary, embed_tokens, proj_to_decoder=True): <NEW_LINE> <INDENT> super().__init__(dictionary) <NEW_LINE> self.transformer_embedding = TransformerEmbedding( args=args, embed_tokens=embed_tokens ) <NEW_LINE> self.transformer_encode...
Transformer encoder.
62599028507cdc57c63a5d2b
class ModelLock(ModelSQL): <NEW_LINE> <INDENT> __name__ = 'test.modelsql.lock'
Model to test lock
6259902866673b3332c31373
class CheckRequestModelView(APIView): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.cassandra_data = CassandraQcResult() <NEW_LINE> <DEDENT> def deal_pointrule(self, conversation_data): <NEW_LINE> <INDENT> start_time = conversation_data.starttime // 1000 <NEW_LINE> end_time = conversation_data.endtim...
查看质检结果
6259902891af0d3eaad3adad
class ItemFinder(object): <NEW_LINE> <INDENT> def __init__(self, view): <NEW_LINE> <INDENT> self.view = view <NEW_LINE> <DEDENT> def get_item_at_point(self, pos): <NEW_LINE> <INDENT> item, handle = self.view.get_handle_at_point(pos) <NEW_LINE> return item or self.view.get_item_at_point(pos)
Find an item on the canvas.
62599028bf627c535bcb243b
class Cat(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=100) <NEW_LINE> breed = models.CharField(max_length=100) <NEW_LINE> description = models.CharField(max_length=200) <NEW_LINE> age = models.IntegerField() <NEW_LINE> user = models.ForeignKey(User, on_delete=models.CASCADE) <NEW_LINE> likes =...
Cat class.
62599028796e427e5384f702
class RNNet(nn.Module): <NEW_LINE> <INDENT> def __init__( self, in_channels=9, num_bins=32, hidden_size=128, num_rnn_layers=1, rnn_dropout=0.25, dense_features=None, ): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> if dense_features is None: <NEW_LINE> <INDENT> dense_features = [256, 1] <NEW_LINE> <DEDENT> dense_fe...
A crop yield conv net. For a description of the parameters, see the RNNModel class.
625990281f5feb6acb163b76
class TimerScheduler(scheduler_base.APRSScheduler): <NEW_LINE> <INDENT> def ready(self, gps_data, start_datetime): <NEW_LINE> <INDENT> if start_datetime is None: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> if not self.last_packet_gps_data: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> if (gps_data.curren...
Very simple scheduler. Send a message every SCHEDULER_TIME_INTERVAL seconds. Returns True if we're ready to send our message.
62599028c432627299fa3f79
class TLSRecordHeader: <NEW_LINE> <INDENT> __slots__ = ("record_type", "version", "length") <NEW_LINE> fmt = "!BHH" <NEW_LINE> class RecordType(enum.IntEnum): <NEW_LINE> <INDENT> CHANGE_CIPHER_SPEC = 0x14 <NEW_LINE> ALERT = 0x15 <NEW_LINE> HANDSHAKE = 0x16 <NEW_LINE> APPLICATION_DATA = 0x17 <NEW_LINE> <DEDENT> def __in...
Encode/decode TLS record protocol format.
6259902830c21e258be9979d
class HelloSerializer(serializers.Serializer): <NEW_LINE> <INDENT> name = serializers.CharField(max_length=10)
Serializes a name field for testing our API view.
6259902815baa72349462f1f
class Scene(object): <NEW_LINE> <INDENT> def enter(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def notify(self, event): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def leave(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def draw(self, surface): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def handle_even...
Drawing GUI and handle scene specific events for a different game-states, like menu or lobby etc.
6259902821a7993f00c66f04
class Supremacy(): <NEW_LINE> <INDENT> game_id = None <NEW_LINE> url = None <NEW_LINE> debug = 0 <NEW_LINE> default_params = { "@c": "ultshared.action.UltUpdateGameStateAction", "playerID": 0, "userAuth": "787925a25d0c072c3eaff5c1eff52829475fd506", "tstamp": int(time.time()) } <NEW_LINE> headers = { "Host": "xgs8.c.byt...
The supremacy class allow easy asses to the Supremacy 1914 API
625990286e29344779b015d7
class _MarkerFinder(object): <NEW_LINE> <INDENT> def __init__(self, stream): <NEW_LINE> <INDENT> super(_MarkerFinder, self).__init__() <NEW_LINE> self._stream = stream <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_stream(cls, stream): <NEW_LINE> <INDENT> return cls(stream) <NEW_LINE> <DEDENT> def next(self, star...
Service class that knows how to find the next JFIF marker in a stream.
62599028a8ecb033258721a5
class ItemsByTagView(AdsMixin, FavoriteItemsMixin, CacheMixin, ListView): <NEW_LINE> <INDENT> template_name = 'news_by_tag.html' <NEW_LINE> context_object_name = 'items' <NEW_LINE> paginate_by = 20 <NEW_LINE> paginator_class = DiggPaginator <NEW_LINE> model = Item <NEW_LINE> cache_timeout = 300 <NEW_LINE> def get_query...
Лента новостей.
62599028796e427e5384f704
class _Job(object): <NEW_LINE> <INDENT> def __init__(self, _id, pending=True, machine_name=None, tags=frozenset(), args=tuple(), kwargs=None, machine=None, allocation_id=None): <NEW_LINE> <INDENT> self.id = _id <NEW_LINE> self.pending = pending <NEW_LINE> self.machine_name = machine_name <NEW_LINE> self.tags = set(tags...
The internal state representing a job. Attributes ---------- id : int A unique ID assigned to the job. pending : bool If True, the job is currently queued for execution, if False the job has been allocated. machine_name : str or None The machine this job must be executed on or None if any machine with ...
625990281f5feb6acb163b77
class ImageLayer(Layer): <NEW_LINE> <INDENT> type = 'image' <NEW_LINE> def __init__(self, map, name, visible=True, opacity=1, image=None): <NEW_LINE> <INDENT> super(ImageLayer, self).__init__(map=map, name=name, visible=visible, opacity=opacity) <NEW_LINE> self.image = image <NEW_LINE> <DEDENT> def __nonzero__(self): <...
An image layer See :class:`Layer` documentation for most init arguments. Other init agruments, which become attributes: .. attribute:: image The image to use for the layer
625990286fece00bbaccc941
class Xml_Profiles_s(Collection): <NEW_LINE> <INDENT> def __init__(self, policy): <NEW_LINE> <INDENT> super(Xml_Profiles_s, self).__init__(policy) <NEW_LINE> self._meta_data['object_has_stats'] = False <NEW_LINE> self._meta_data['minimum_version'] = '11.6.0' <NEW_LINE> self._meta_data['allowed_lazy_attributes'] = [Xml_...
BIG-IP® ASM Xml-Profiles sub-collection. Due to the bug that prevents from creating this object in 11.5.4 Final, I am disabling this for anything lower than 11.6.0. This will be subject to change at some point
6259902863f4b57ef0086536
class Elf32_File(object): <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> super(Elf32_File, self).__init__() <NEW_LINE> self.filename = filename <NEW_LINE> try: <NEW_LINE> <INDENT> self.efile = open(filename, 'rb+') <NEW_LINE> <DEDENT> except Exception as e: <NEW_LINE> <INDENT> print(e) <NEW_LINE>...
docstring for Elf32_File
62599028d99f1b3c44d0662b
class NetworkLogIncident(): <NEW_LINE> <INDENT> def __init__(self, server_id, incident_type, ip_address, network_log_date, log): <NEW_LINE> <INDENT> self.server_id = server_id <NEW_LINE> self.incident_type = incident_type <NEW_LINE> self.ip_address = ip_address <NEW_LINE> self.network_log_date = network_log_date <NEW_L...
structure of data to be written to database
62599028796e427e5384f706
@Actions.register("json.check") <NEW_LINE> class JsonCheckAction(BaseAction): <NEW_LINE> <INDENT> def execute(self, context): <NEW_LINE> <INDENT> d = json.loads(context.get_last_return_value()) <NEW_LINE> action_config = self.get_action_config() <NEW_LINE> if 'assert_path' not in action_config: <NEW_LINE> <INDENT> prin...
:param url || string || @required :param content_type || string || @optional
625990285166f23b2e24435f
class Solution: <NEW_LINE> <INDENT> def maxSubArray(self, nums): <NEW_LINE> <INDENT> if nums is None: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> a = [0 for _ in xrange(len(nums))] <NEW_LINE> a[0] = nums[0] <NEW_LINE> for i in xrange(1, len(a)): <NEW_LINE> <INDENT> a[i] = max(a[i - 1], 0) + nums[i] <NEW_LINE> <...
@param nums: A list of integers @return: An integer denote the sum of maximum subarray
62599028d10714528d69ee51
class OUI(BaseIdentifier): <NEW_LINE> <INDENT> __slots__ = ('records',) <NEW_LINE> def __init__(self, oui): <NEW_LINE> <INDENT> super(OUI, self).__init__() <NEW_LINE> from netaddr.eui import ieee <NEW_LINE> self.records = [] <NEW_LINE> if isinstance(oui, str): <NEW_LINE> <INDENT> self._value = int(oui.replace('-', ''),...
An individual IEEE OUI (Organisationally Unique Identifier). For online details see - http://standards.ieee.org/regauth/oui/
625990289b70327d1c57fd0c
class Monster: <NEW_LINE> <INDENT> def __init__(self,name: str, health: int,dam_low: int,dam_high: int,defense: int,speed: int): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._health = health <NEW_LINE> self._cur_health = health <NEW_LINE> self._dam_low = dam_low <NEW_LINE> self._dam_high = dam_high <NEW_LINE> ...
Defines a mosnter class
62599028c432627299fa3f7d
class PolicyNetworkParams: <NEW_LINE> <INDENT> UNSUPPORTED = ["obs_size"] <NEW_LINE> DEPRECATED = ["end_learning_rate", "decay_steps", "decay_power"] <NEW_LINE> def __init__(self, hidden_size, dropout_rate, l2_reg_coef, dense_size, attention_mechanism, network_parameters): <NEW_LINE> <INDENT> self.hidden_size = hidden_...
The class to deal with the overcomplicated structure of the GO-bot configs. It is initialized from the config-as-is and performs all the conflicting parameters resolution internally.
6259902830c21e258be997a1
class PythonRequirement: <NEW_LINE> <INDENT> def __init__(self, requirement, name=None, repository=None, use_2to3=False, compatibility=None): <NEW_LINE> <INDENT> self._requirement = Requirement.parse(requirement) <NEW_LINE> self._repository = repository <NEW_LINE> self._name = name or self._requirement.project_name <NE...
Pants wrapper around pkg_resources.Requirement Describes an external dependency as understood by ``easy_install`` or ``pip``. It takes a single non-keyword argument of the `Requirement`-style string, e.g. :: python_requirement('django-celery') python_requirement('tornado==2.2') python_requirement('kombu>=...
62599028711fe17d825e145f
class MyObject: <NEW_LINE> <INDENT> CLASS_ATTRIBUTE = 'some value' <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return 'MyObject({})'.format(self.name) <NEW_LINE> <DEDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name
Example for dis.
625990288e05c05ec3f6f621
class PhylipWriter(SequentialAlignmentWriter): <NEW_LINE> <INDENT> def write_alignment(self, alignment, id_width=_PHYLIP_ID_WIDTH): <NEW_LINE> <INDENT> handle = self.handle <NEW_LINE> if len(alignment) == 0: <NEW_LINE> <INDENT> raise ValueError("Must have at least one sequence") <NEW_LINE> <DEDENT> length_of_seqs = ali...
Phylip alignment writer.
6259902866673b3332c31379
class AssumableEmailOrUsernameModelBackend(ModelBackend): <NEW_LINE> <INDENT> def authenticate(self, username=None, password=None): <NEW_LINE> <INDENT> if '@' in username: <NEW_LINE> <INDENT> kwargs = {'email': username} <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> kwargs = {'username': username} <NEW_LINE> <DEDENT> t...
Custom authentication backend that allows logging in using either username or email address, and allows authentication without a password. IMPORTANT: This backend assumes that the credentials have already been verified if a password is not passed to authenticate(), so all calls to that method should be done very caref...
625990286e29344779b015db
class Meter(object): <NEW_LINE> <INDENT> def reset(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def add(self, value): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def value(self): <NEW_LINE> <INDENT> pass
Meters provide a way to keep track of important statistics in an online manner. This class is abstract, but provides a standard interface for all meters to follow.
62599028a8ecb033258721a9
class Rotacionar_90Y3(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "object.rotate_90y3" <NEW_LINE> bl_label = "-{}º y_3".format(R) <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> return context.active_object is not None <NEW_LINE> <DEDENT> def execute(self, context): <NEW_LINE> <I...
Operator 'rotate'. Rotaciona o grupo y_3 -90 graus.
625990281f5feb6acb163b7b
class SetTopicAttributesResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None)
A ResultSet with methods tailored to the values returned by the SetTopicAttributes Choreo. The ResultSet object is used to retrieve the results of a Choreo execution.
6259902863f4b57ef0086538
class LinearDataGenerator: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def generateLinearInput(intercept, weights, xMean, xVariance, nPoints, seed, eps): <NEW_LINE> <INDENT> weights = [float(weight) for weight in weights] <NEW_LINE> xMean = [float(mean) for mean in xMean] <NEW_LINE> xVariance = [float(var) for var in ...
Utils for generating linear data. .. versionadded:: 1.5.0
625990289b70327d1c57fd0e
class OlnDetectionGenerator(GenericDetectionGenerator): <NEW_LINE> <INDENT> def __call__(self, box_outputs, class_outputs, anchor_boxes, image_shape, is_single_fg_score=False, keep_nms=True): <NEW_LINE> <INDENT> if is_single_fg_score: <NEW_LINE> <INDENT> dummy_bg_scores = tf.zeros_like(class_outputs) <NEW_LINE> class_o...
Generates the final detected boxes with scores and classes.
62599028c432627299fa3f7f
class Generation(SamlBase): <NEW_LINE> <INDENT> c_tag = 'Generation' <NEW_LINE> c_namespace = NAMESPACE <NEW_LINE> c_children = SamlBase.c_children.copy() <NEW_LINE> c_attributes = SamlBase.c_attributes.copy() <NEW_LINE> c_child_order = SamlBase.c_child_order[:] <NEW_LINE> c_cardinality = SamlBase.c_cardinality.copy() ...
The urn:oasis:names:tc:SAML:2.0:ac:classes:Password:Generation element
6259902830c21e258be997a2
class SubGame(GameState): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> GameState.__init__(self) <NEW_LINE> self.screen_state = GetScreen().copy()
A game state which will set up the screen with the same parameters as used earlier in the game. Should be the base subclass for most GameStates.
62599028711fe17d825e1460
class rect(rect_pt): <NEW_LINE> <INDENT> def __init__(self, x, y, width, height): <NEW_LINE> <INDENT> rect_pt.__init__(self, unit.topt(x), unit.topt(y), unit.topt(width), unit.topt(height))
rectangle at position (x,y) with width and height
6259902821bff66bcd723bf0
class RESTError(Exception): <NEW_LINE> <INDENT> http_code = None <NEW_LINE> app_code = None <NEW_LINE> message = None <NEW_LINE> info = None <NEW_LINE> errid = None <NEW_LINE> errobj = None <NEW_LINE> trace = None <NEW_LINE> def __init__(self, info = None, errobj = None, trace = None): <NEW_LINE> <INDENT> self.errid = ...
Base class for REST errors. .. attribute:: http_code Integer, HTTP status code for this error. Also emitted as X-Error-HTTP header value. .. attribute:: app_code Integer, application error code, to be emitted as X-REST-Status header. .. attribute:: message String, information about the error, to be em...
62599028287bf620b6272b7d
class Feature(collections.namedtuple( "Feature", ["index", "name", "layer_set", "full_name", "scale", "type", "palette", "clip"])): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> dtypes = { 1: np.uint8, 8: np.uint8, 16: np.uint16, 32: np.int32, } <NEW_LINE> def unpack(self, obs): <NEW_LINE> <INDENT> planes = getattr(obs...
Define properties of a feature layer. Attributes: index: Index of this layer into the set of layers. name: The name of the layer within the set. layer_set: Which set of feature layers to look at in the observation proto. full_name: The full name including for visualization. scale: Max value (+1) of this laye...
62599028925a0f43d25e8fd5
class GatewayCollection(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'value': {'readonly': True}, 'next_link': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'value': {'key': 'value', 'type': '[GatewayContract]'}, 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type...
Paged Gateway list representation. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Page values. :vartype value: list[~api_management_client.models.GatewayContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next p...
62599028d99f1b3c44d06631
class SomAccountInvoicePendingError(Exception): <NEW_LINE> <INDENT> def __init__(self, msg): <NEW_LINE> <INDENT> super(SomAccountInvoicePendingError, self).__init__(msg) <NEW_LINE> self.msg = msg <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return self.msg <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE...
Base class for other exceptions
625990288e05c05ec3f6f623
class ML_phys(GenerativeModel): <NEW_LINE> <INDENT> def __init__(self, init_params, inf_params=None, X=T.matrix(), S=T.matrix(), P=T.matrix(), batch_size=1, rng=None): <NEW_LINE> <INDENT> super().__init__(init_params, inf_params, X, S, P, batch_size, rng) <NEW_LINE> self.type = 'ML_phys' <NEW_LINE> start = T.zeros([sel...
Nonlinear model as described in the paper, allows for facilitation and saturation. Sigmoid and softplus functions are used to ensure valid parameters. Otherwise training might crash. delta_t is the constant bin size, and is not trained. C_(t) = s + exp(δ/τ) * C_(t-1) D_(t) = minimum(1/softplus(γ),(D_(t-1) * maximum(0...
62599028d18da76e235b7915
class AsyncDeviceStorage(RemoteDeviceBased): <NEW_LINE> <INDENT> ERROR_MSG_INSUFFICIENT_STORAGE = "INSTALL_FAILED_INSUFFICIENT_STORAGE" <NEW_LINE> def __init__(self, device: Device): <NEW_LINE> <INDENT> super(AsyncDeviceStorage, self).__init__(device) <NEW_LINE> self._ext_storage = None <NEW_LINE> <DEDENT> @property <N...
Class providing API to push, install and remove files and apps to a remote device :param device: which device Class providing API to push, push and pull files to a remote device
62599028796e427e5384f70c
class BaseCheckpointer(NonTransformableMixin, BaseStep): <NEW_LINE> <INDENT> def __init__( self, execution_mode: ExecutionMode ): <NEW_LINE> <INDENT> BaseStep.__init__(self) <NEW_LINE> self.execution_mode = execution_mode <NEW_LINE> <DEDENT> def is_for_execution_mode(self, execution_mode: ExecutionMode) -> bool: <NEW_L...
Base class to implement a step checkpoint or data container checkpoint. :class:`Checkpoint` uses many BaseCheckpointer to checkpoint both data container checkpoints, and step checkpoints. BaseCheckpointer has an execution mode so there could be different checkpoints for each execution mode (fit, fit_transform or tran...
62599028d10714528d69ee54
class ServerStatus: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.tried_to_launch = False
What is the status of our current attempt at launching the server
625990288a349b6b436871c8
class Tween(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def _checkRange(n): <NEW_LINE> <INDENT> if not 0.0 <= n <= 1.0: <NEW_LINE> <INDENT> raise ValueError('Argument must be between 0.0 and 1.0.') <NEW_LINE> <DEDENT> <DEDENT> @staticmethod <NEW_LINE> def _split_values(*values, floor=0, ceiling=1): <NEW_LINE>...
These tween functions support tween function modification. The tween functions themselves can be imported from https://github.com/asweigart/pytweening/blob/master/pytweening/__init__.py A handy visualisation of tween can be found at https://easings.net/en
62599028c432627299fa3f83
class HandShakeFailed(Exception): <NEW_LINE> <INDENT> pass
Raised when the handshake fails
6259902821a7993f00c66f0e
class Cell(object): <NEW_LINE> <INDENT> def __init__(self, vertices): <NEW_LINE> <INDENT> self.vertices = vertices <NEW_LINE> self.index = [] <NEW_LINE> <DEDENT> @property <NEW_LINE> def pos(self): <NEW_LINE> <INDENT> position = self.vertices.sum(axis=0)/8. <NEW_LINE> return position <NEW_LINE> <DEDENT> @property <NEW_...
A container of cell info @vertices is a np.array with 8 vertices and self-explanatory. Each vertex of @vertices is the coordinate.
62599028ac7a0e7691f7347b
class SkyPositionTest(unittest.TestCase): <NEW_LINE> <INDENT> pass
docstring
62599028507cdc57c63a5d3a
class NapRequest(object): <NEW_LINE> <INDENT> VALID_HTTP_METHODS = ('GET', 'POST', 'PUT', 'DELETE', 'PATCH') <NEW_LINE> def __init__(self, method, url, data=None, headers=None, auth=None, *args, **kwargs): <NEW_LINE> <INDENT> self._method = method <NEW_LINE> self.url = url <NEW_LINE> self.data = data <NEW_LINE> if not ...
A request to send to a nap-modeled API. Primarily used internally within ResourceModel methods.
625990285166f23b2e244369
class Out: <NEW_LINE> <INDENT> def __init__ (self, write_function = None, flush_function = None): <NEW_LINE> <INDENT> if write_function is None: <NEW_LINE> <INDENT> self.write = lambda *args: None <NEW_LINE> <DEDENT> elif not hasattr(write_function, '__call__'): <NEW_LINE> <INDENT> raise TypeError('argument must be cal...
A generic .write-able class. Pass a function to act as a write method. This is useful for, for example, piping stuff that gets sent to sys.stdout to your own write function. If no argument is given, write does nothing. A function to act as a flush method can be passed as a second argument; if it is not, Out.flush()...
62599028925a0f43d25e8fdb
class TestRequestHandler(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.addr = ('0.0.0.0', 9999) <NEW_LINE> self.real_do_GET = SimpleHTTPRequestHandler.do_GET <NEW_LINE> self.real_setup = RewritingHTTPRequestHandler.setup <NEW_LINE> self.real_handle = RewritingHTTPRequestHandler.handl...
The RewritingHTTPRequestHandler.
6259902873bcbd0ca4bcb225
class CourseSerializer(serializers.Serializer): <NEW_LINE> <INDENT> course_id = serializers.CharField()
Serializer for Course IDs
625990289b70327d1c57fd16
class ProductSelectView(generics.ListAPIView): <NEW_LINE> <INDENT> renderer_classes = (JSONRenderer, BrowsableAPIRenderer) <NEW_LINE> serializer_class = app_settings.PRODUCT_SELECT_SERIALIZER <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> term = self.request.GET.get('term', '') <NEW_LINE> if len(term) >= 2: <NE...
A simple list view, which is used only by the admin backend. It is required to fetch the data for rendering the select widget when looking up for a product.
62599028d99f1b3c44d06637
class VpnClientConfiguration(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'vpn_client_address_pool': {'key': 'vpnClientAddressPool', 'type': 'AddressSpace'}, 'vpn_client_root_certificates': {'key': 'vpnClientRootCertificates', 'type': '[VpnClientRootCertificate]'}, 'vpn_client_revoked_certificate...
VpnClientConfiguration for P2S client. :param vpn_client_address_pool: The reference of the address space resource which represents Address space for P2S VpnClient. :type vpn_client_address_pool: ~azure.mgmt.network.v2018_08_01.models.AddressSpace :param vpn_client_root_certificates: VpnClientRootCertificate for virt...
6259902866673b3332c31384
class Null(object): <NEW_LINE> <INDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> def __ne__(self, other): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return ''
Always different
62599028bf627c535bcb244b
class Measure: <NEW_LINE> <INDENT> def __init__(self, names): <NEW_LINE> <INDENT> self.res = {} <NEW_LINE> self.cnt = {} <NEW_LINE> for n in names: <NEW_LINE> <INDENT> self.res[n] = [0,0,0] <NEW_LINE> self.cnt[n] = [0,0] <NEW_LINE> <DEDENT> <DEDENT> def update_res(self, preds, c): <NEW_LINE> <INDENT> for p in preds: <N...
Class which handles metrics computation names list of names of the svms
625990283eb6a72ae038b5fa
class LoginTask(Task): <NEW_LINE> <INDENT> def __init__(self, o, container, registries={}): <NEW_LINE> <INDENT> Task.__init__(self, o, container) <NEW_LINE> self._registries = registries <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> image = self.container.get_image_details() <NEW_LINE> if image['repository'].f...
Log in with the registry hosting the image a container is based on. Extracts the registry name from the image needed for the container, and if authentication data is provided for that registry, login to it so a subsequent pull operation can be performed.
6259902826238365f5fadae7
class EggPMExtensionFactory(ExtensionFactory): <NEW_LINE> <INDENT> def build(self, extensionPath, moduleName, className, pmExtensionName): <NEW_LINE> <INDENT> return EggPMExtension(extensionPath, moduleName, className, pmExtensionName)
Simple factory class for EggPMExtension objects
62599028d18da76e235b7919
@BACKBONES.register_module() <NEW_LINE> class ResNeXt(ResNet): <NEW_LINE> <INDENT> arch_settings = { 50: (Bottleneck, (3, 4, 6, 3)), 101: (Bottleneck, (3, 4, 23, 3)), 152: (Bottleneck, (3, 8, 36, 3)) } <NEW_LINE> def __init__(self, groups=1, base_width=4, **kwargs): <NEW_LINE> <INDENT> self.groups = groups <NEW_LINE> s...
ResNeXt backbone. Args: depth (int): Depth of resnet, from {18, 34, 50, 101, 152}. in_channels (int): Number of input image channels. Default: 3. num_stages (int): Resnet stages. Default: 4. groups (int): Group of resnext. base_width (int): Base width of resnext. strides (Sequence[int]): Stride...
62599028796e427e5384f714
class VoterErrors( Errors ): <NEW_LINE> <INDENT> def __init__( self ): <NEW_LINE> <INDENT> super().__init__()
Error objects which are raised when the Voter has done something which prevents her vote from being counted
625990286fece00bbaccc951
class SelectableFunctionText(uw.Text): <NEW_LINE> <INDENT> def __init__(self, name, activated, on_select): <NEW_LINE> <INDENT> markup = name <NEW_LINE> if activated: <NEW_LINE> <INDENT> markup += ' (active)' <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> markup += ' (nopped)' <NEW_LINE> <DEDENT> super().__init__(markup,...
Text that is selectable, works like a button but with a different appearance :ivar name: The name of the function :ivar on_select: Called when the text is selected
62599028ac7a0e7691f73481
class AclModelTest(BaseTest): <NEW_LINE> <INDENT> def test_change_permission(self): <NEW_LINE> <INDENT> for permission in ('read', 'write', 'delete'): <NEW_LINE> <INDENT> self.sketch1.grant_permission( user=self.user1, permission=permission) <NEW_LINE> self.assertTrue( self.sketch1.has_permission( user=self.user1, perm...
Test the ACL model.
625990280a366e3fb87dd980
class Actions(ActionsBase): <NEW_LINE> <INDENT> def prepare(self,**args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def stop(self,**kwargs): <NEW_LINE> <INDENT> if j.system.fs.exists('$(param.base)/var/run/asterisk/asterisk.ctl'): <NEW_LINE> <INDENT> j.do.execute('cd $(param.base)/sbin && ./asterisk -rx "core stop n...
process for install ------------------- step1: prepare actions step2: check_requirements action step3: download files & copy on right location (hrd info is used) step4: configure action step5: check_uptime_local to see if process stops (uses timeout $process.stop.timeout) step5b: if check uptime was true will do stop ...
62599028a4f1c619b294f58d
class UnitTestBaseAsync(unittest.IsolatedAsyncioTestCase): <NEW_LINE> <INDENT> async def asyncSetUp(self): <NEW_LINE> <INDENT> self.session = ClientSession() <NEW_LINE> self.rdy = RainCloudy(USERNAME, PASSWORD, self.session) <NEW_LINE> <DEDENT> async def asyncTearDown(self): <NEW_LINE> <INDENT> await self.session.close...
Top level test class for RainCloudy Core.
625990289b70327d1c57fd1a
class InvalidLocation(Exception): <NEW_LINE> <INDENT> pass
InvalidLocation Exception class.
62599028507cdc57c63a5d40
class SetBase(_ORMBase): <NEW_LINE> <INDENT> pass
Wrapper class for set element
62599028bf627c535bcb244f
class TestMigrationStat(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 testMigrationStat(self): <NEW_LINE> <INDENT> pass
MigrationStat unit test stubs
62599028287bf620b6272b89
class TestCall(mox.MoxTestBase): <NEW_LINE> <INDENT> def test(self): <NEW_LINE> <INDENT> self.mox.StubOutWithMock(dbus, 'SystemBus', use_mock_anything=True) <NEW_LINE> bus = self.mox.CreateMock(dbus.bus.BusConnection) <NEW_LINE> proxy = self.mox.CreateMockAnything() <NEW_LINE> method = self.mox.CreateMockAnything() <NE...
Test dispatching privileged operations.
62599028796e427e5384f716
class FeedbackSubjectOneOffJob(jobs.BaseMapReduceOneOffJobManager): <NEW_LINE> <INDENT> DEFAULT_SUBJECT = u'(Feedback from a learner)' <NEW_LINE> @classmethod <NEW_LINE> def entity_classes_to_map_over(cls): <NEW_LINE> <INDENT> return [feedback_models.FeedbackThreadModel] <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def...
One-off job for updating the feedback subject.
6259902863f4b57ef008653f
class SymConf(object): <NEW_LINE> <INDENT> dimension=1 <NEW_LINE> base =2 <NEW_LINE> basemax =2 <NEW_LINE> def __init__(self,val=0): <NEW_LINE> <INDENT> tmp=val <NEW_LINE> if isinstance(val,str): <NEW_LINE> <INDENT> tmp = int(val,SymConf.base) <NEW_LINE> <DEDENT> self.label,self.label_int,self.repetition = SymConf...
represents an unique network configuration. * Important: in this representation, states are limited up to maximum of 10 states.
625990289b70327d1c57fd1c
@admin.register(models.Room) <NEW_LINE> class RoomAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> inlines = (PhotoInline,) <NEW_LINE> fieldsets = ( ( "Basic Info", { "fields": ( "name", "description", "country", "city", "address", "price", "room_type", ) }, ), ("Times", {"fields": ("check_in", "check_out", "instant_book",...
Room Admin Definition
625990288a349b6b436871d2
class RiderViewSet(mixins.CreateModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, mixins.ListModelMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> serializer_class = RiderModelSerializer <NEW_LINE> lookup_field = 'slugname' <NEW_LINE> search_fields = ( 'first_name', 'last_slugname', 'vehicle_made', 'v...
Riders view set. ################################################################################# Http methods and the URLs: GET /riders/ (list Riders) POST /riders/ (create Rider) PUT /riders/ (update Rider info)...
6259902891af0d3eaad3adc3
class RepoHandler(object): <NEW_LINE> <INDENT> def __init__(self, repo_url=None, temp_dir_path=None): <NEW_LINE> <INDENT> if repo_url is None and temp_dir_path is None: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> if repo_url is None and temp_dir_path is not None: <NEW_LINE> <INDENT> self.set_repo(temp_dir_path)...
The main Repository Handler class. 1. Initializes the folder in which to store the cloned repo 2. Clones the repo 3. Gets the list of modified files in the repo_url as a list of file descriptor objects
62599028e76e3b2f99fd99a8
class Test_sqlite(B3TestCase, StorageAPITest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> B3TestCase.setUp(self) <NEW_LINE> self.storage = self.console.storage = DatabaseStorage('sqlite://'+SQLITE_DB, self.console) <NEW_LINE> self.storage.executeSql("@b3/sql/sqlite/b3.sql") <NEW_LINE> <DEDENT> def tearDow...
NOTE: to work properly you must be running a MySQL database on localhost which must have a user named 'b3test' with password 'test' which has all privileges over a table (already created or not) named 'b3_test'
62599028796e427e5384f718
class GetUsersInfo(Resource): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.parser = reqparse.RequestParser() <NEW_LINE> self.parser.add_argument("nickname", type=str, default="") <NEW_LINE> pass <NEW_LINE> <DEDENT> @swagger.operation( notes="根据用户昵称获取用户信息", nickname="get", parameters=[ { "name": "nic...
# 获取关注用户的openid列表
62599028a8ecb033258721b9
class WebParserTest(UnittestPythonCompatibility): <NEW_LINE> <INDENT> web_file = os.path.join(FILEPATH, 'graph.web') <NEW_LINE> tempfiles = [] <NEW_LINE> def tearDown(self): <NEW_LINE> <INDENT> for tmp in self.tempfiles: <NEW_LINE> <INDENT> if os.path.exists(tmp): <NEW_LINE> <INDENT> os.remove(tmp) <NEW_LINE> <DEDENT> ...
Unit tests for parsing Spider serialized data structures (.web format)
625990280a366e3fb87dd984
class SpecMeta(abc.ABCMeta): <NEW_LINE> <INDENT> def __init__(cls, name, bases, dct): <NEW_LINE> <INDENT> cls.validate_handler(dct) <NEW_LINE> SpecRegistry.register(cls) <NEW_LINE> super().__init__(name, bases, dct) <NEW_LINE> <DEDENT> def validate_handler(self, dct): <NEW_LINE> <INDENT> self.validate_handler_schema(dc...
Meta class for all elements with schemas. This allows for registration, validation, and tracking of the schema implementors.
62599028a4f1c619b294f591
class _MandatoryValue: <NEW_LINE> <INDENT> def __str__(self) -> str: <NEW_LINE> <INDENT> return '<mandatory argument value>'
Use this as a default value for an Argument to indicate that the argument is mandatory: requests without the argument are not accepted.
62599028be8e80087fbc0016
class GitResponse(HttpResponse): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.service = Services(kwargs.pop('service', None)) <NEW_LINE> self.action = kwargs.pop('action', None) <NEW_LINE> self.repository = kwargs.pop('repository', None) <NEW_LINE> self.data = kwargs.pop('data', Non...
An extension of Django's HttpResponse that meets Git's smart HTTP specs The responses to Git's requests must follow a protocol, and this class is meant to build properly formed responses. Attributes: service (str): the initiated git plumbing command action (str): the action initiated by the service reposi...
6259902830c21e258be997ab
class PlaceView(): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> res = Place.query.all() <NEW_LINE> return [{'id' : u.id, 'name' : u.name} for u in res] <NEW_LINE> <DEDENT> def post(self): <NEW_LINE> <INDENT> place = Place(name=request.form.get('name')) <NEW_LINE> place.insert() <NEW_LINE> return {'id' : place...
CRUD Places
625990288c3a8732951f74f5
class ApiTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.url = apitestconfig.URL <NEW_LINE> self.headers = apitestconfig.HEADERS <NEW_LINE> self.get_params = apitestconfig.GET_PARAMS <NEW_LINE> self.post_data = apitestconfig.POST_DATA <NEW_LINE> <DEDENT> def test_get(self): <NEW_L...
XX接口自动化测试
625990281d351010ab8f4ab4
class DescribeAuditResultRequest(JDCloudRequest): <NEW_LINE> <INDENT> def __init__(self, parameters, header=None, version="v1"): <NEW_LINE> <INDENT> super(DescribeAuditResultRequest, self).__init__( '/regions/{regionId}/instances/{instanceId}/audit:describeAuditResult', 'GET', header, version) <NEW_LINE> self.parameter...
查询 Clickhouse audit列表信息
62599028bf627c535bcb2453
class Docfield: <NEW_LINE> <INDENT> def __init__(self, name, type_name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.type_name = type_name <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '%s : %s' % (self.name, self.type_name)
Python representing docfield in a frappe doctype
62599028c432627299fa3f8f
class User(MetaData): <NEW_LINE> <INDENT> email = EmailField(required=True, unique=True) <NEW_LINE> username = StringField(regex=r'[a-zA-Z0-9_-]+$', max_length=120, required=True, unique=True) <NEW_LINE> password = StringField(max_length=64, required=True) <NEW_LINE> is_superuser = BooleanField(default=False) <NEW_LINE...
Collection of users profiles.
625990298a349b6b436871d6