code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class ProtoTest(): <NEW_LINE> <INDENT> def __init__(self, test=None): <NEW_LINE> <INDENT> self.module = '' <NEW_LINE> self.class_name = '' <NEW_LINE> self.method_name = '' <NEW_LINE> self.docstr_part = '' <NEW_LINE> self.subtest_part = '' <NEW_LINE> self.is_subtest = False <NEW_LINE> if getattr(test, '_subDescription',...
I take a full-fledged TestCase and preserve just the information we need and can pass between processes.
62599062379a373c97d9a713
class Member(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(User, null=True, blank=True) <NEW_LINE> name = models.CharField(max_length=200) <NEW_LINE> slug = models.SlugField(unique=True) <NEW_LINE> site_url = models.CharField(max_length=200) <NEW_LINE> tags = TagField() <NEW_LINE> def __unicode__(self): <...
Class representing a member that has a feed being pulled in May or may not represent a User Service Entries allow us to point to any arbitrary Service Entry
62599062009cb60464d02c28
class DVdt_system(object): <NEW_LINE> <INDENT> def __init__(self, arguments): <NEW_LINE> <INDENT> self.arguments = arguments <NEW_LINE> <DEDENT> def dVdt(self): <NEW_LINE> <INDENT> flowrate = Flows(self.arguments) <NEW_LINE> q_AO = flowrate.flowrate_AO() <NEW_LINE> q_sa = flowrate.flowrate_sa() <NEW_LINE> q_sv = flowra...
docstring for DVdt_system.
6259906299cbb53fe68325d3
class HomeKit(): <NEW_LINE> <INDENT> def __init__(self, hass, port, ip_address, entity_filter, entity_config): <NEW_LINE> <INDENT> self.hass = hass <NEW_LINE> self._port = port <NEW_LINE> self._ip_address = ip_address <NEW_LINE> self._filter = entity_filter <NEW_LINE> self._config = entity_config <NEW_LINE> self.status...
Class to handle all actions between HomeKit and Home Assistant.
6259906297e22403b383c5fd
class CPubKey(bytes): <NEW_LINE> <INDENT> def __new__(cls, buf, _cec_key=None): <NEW_LINE> <INDENT> self = super(CPubKey, cls).__new__(cls, buf) <NEW_LINE> if _cec_key is None: <NEW_LINE> <INDENT> _cec_key = CECKey() <NEW_LINE> <DEDENT> self._cec_key = _cec_key <NEW_LINE> self.is_fullyvalid = _cec_key.set_pubkey(self) ...
An encapsulated public key Attributes: is_valid - Corresponds to CPubKey.IsValid() is_fullyvalid - Corresponds to CPubKey.IsFullyValid() is_compressed - Corresponds to CPubKey.IsCompressed()
625990628da39b475be048d9
class HTTPReadCredentialDTO(object): <NEW_LINE> <INDENT> swagger_types = { } <NEW_LINE> attribute_map = { } <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.discriminator = None <NEW_LINE> <DEDENT> def to_dict(self): <NEW_LINE> <INDENT> result = {} <NEW_LINE> for attr, _ in six.iteritems(self.swagger_types): <NE...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62599062796e427e5384fe66
class ChosenInlineResultTest(BaseTest, unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> user = telegram.User(1, 'First name') <NEW_LINE> self.result_id = 'result id' <NEW_LINE> self.from_user = user <NEW_LINE> self.query = 'query text' <NEW_LINE> self.json_dict = { 'result_id': self.result_i...
This object represents Tests for Telegram ChosenInlineResult.
62599062d6c5a102081e3816
class TestTutorialThread(JNTTThreadRun, JNTTThreadRunCommon): <NEW_LINE> <INDENT> thread_name = "tutorial2" <NEW_LINE> conf_file = "tests/data/helloworldv2.conf" <NEW_LINE> def test_102_check_values(self): <NEW_LINE> <INDENT> self.wait_for_nodeman() <NEW_LINE> time.sleep(5) <NEW_LINE> self.assertValueOnBus('cpu','tempe...
Test the thread
62599062baa26c4b54d50994
class Diagnosis2(nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Diagnosis2, self).__init__() <NEW_LINE> self.conv1 = nn.Sequential( nn.Conv2d(12, 32, (30, 1), 1, 0), nn.ReLU(), nn.MaxPool2d(kernel_size=(3, 1)) ) <NEW_LINE> self.conv2 = nn.Sequential( nn.Conv2d(32, 64, (10, 1), 1, 0), nn.R...
CNN + LSTM
62599062fff4ab517ebcef18
class Vertex: <NEW_LINE> <INDENT> __slots__ = '_element' <NEW_LINE> def __init__(self, x): <NEW_LINE> <INDENT> self._element = x <NEW_LINE> <DEDENT> def element(self): <NEW_LINE> <INDENT> return self._element <NEW_LINE> <DEDENT> def __hash__(self): <NEW_LINE> <INDENT> return hash(self.element()) <NEW_LINE> <DEDENT> def...
'Lightweight vertex structure for a graph
625990623d592f4c4edbc5ce
class LdpNsrPeerSyncStNoneIdentity(NsrPeerSyncStateIdentity): <NEW_LINE> <INDENT> _prefix = 'mpls-ldp-ios-xe-oper' <NEW_LINE> _revision = '2017-02-07' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> NsrPeerSyncStateIdentity.__init__(self) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _meta_info(): <NEW_LINE> <IND...
LDP NSR peer synchronization none.
62599062a8370b77170f1abf
class Vectorization_Layer(LayerInterface): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.input_shape = None <NEW_LINE> self.output_shape = None <NEW_LINE> <DEDENT> def forward_pass(self, input_data): <NEW_LINE> <INDENT> self.input_shape = input_data.shape <NEW_LINE> return np.array([input_data.flatte...
Neural Layer to flatten all the values in the data to a single array Attributes ---------- input_shape : Tuple[int] shape of the image_data output_shape : Tuple[int] shape of the image_data Methods ------- __init__(self): initialization of the layer forward_pass(self, input_data): forward pass function ...
62599062f7d966606f749432
class GoodEndScreen(game.GameState): <NEW_LINE> <INDENT> tile_resolution = (0, 0) <NEW_LINE> h_center = 0 <NEW_LINE> timeout = 0 <NEW_LINE> def wake_up(self): <NEW_LINE> <INDENT> self.timeout = 300 <NEW_LINE> self.tile_resolution = game.pyxeltools.load_png_to_image_bank( game.assets.search('tile.png'), _TILE_SCR_ ) <NE...
A very basic good end screen
62599062498bea3a75a59178
class NumVotesFilter(admin.SimpleListFilter): <NEW_LINE> <INDENT> title = 'number of votes' <NEW_LINE> parameter_name = 'num_votes' <NEW_LINE> def lookups(self, request, model_admin): <NEW_LINE> <INDENT> return ( ('0', 'No votes'), ('1', 'At least 1'), ('5', 'At least 5'), ('10', 'At least 10'), ('20', '20 or more'), )...
Allows filtering on the `num_votes` attribute.
625990624f6381625f19a01c
class EntitiesEntityPresentationInfo(Model): <NEW_LINE> <INDENT> _validation = { 'entity_scenario': {'required': True}, 'entity_type_hints': {'readonly': True}, 'entity_type_display_hint': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'entity_scenario': {'key': 'entityScenario', 'type': 'str'}, 'entity_type_hints...
Defines additional information about an entity such as type hints. 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 entity_scenario: Required. The supported scenario. Possible values include: 'Dominant...
625990623617ad0b5ee07840
class ActivationsProcessor(Processor): <NEW_LINE> <INDENT> def __init__(self, mode, fps=None, sep=None, **kwargs): <NEW_LINE> <INDENT> self.mode = mode <NEW_LINE> self.fps = fps <NEW_LINE> self.sep = sep <NEW_LINE> <DEDENT> def process(self, data, output=None, **kwargs): <NEW_LINE> <INDENT> if self.mode in ('r', 'in', ...
ActivationsProcessor processes a file and returns an Activations instance. Parameters ---------- mode : {'r', 'w', 'in', 'out', 'load', 'save'} Mode of the Processor: read/write. fps : float, optional Frame rate of the activations (if set, it overwrites the saved frame rate). sep : str, optional Separa...
625990624e4d562566373af9
class MAVLink_home_position_message(MAVLink_message): <NEW_LINE> <INDENT> id = MAVLINK_MSG_ID_HOME_POSITION <NEW_LINE> name = 'HOME_POSITION' <NEW_LINE> fieldnames = ['latitude', 'longitude', 'altitude', 'x', 'y', 'z', 'q', 'approach_x', 'approach_y', 'approach_z', 'time_usec'] <NEW_LINE> ordered_fieldnames = [ 'latitu...
This message can be requested by sending the MAV_CMD_GET_HOME_POSITION command. The position the system will return to and land on. The position is set automatically by the system during the takeoff in case it was not explicitely set by the operator before or after. The position the system will return to and land on. T...
6259906291af0d3eaad3b51a
class itkImageMomentsCalculatorIF3(ITKCommonBasePython.itkObject): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") <NEW_LINE> __repr__ = _swig_repr <...
Proxy of C++ itkImageMomentsCalculatorIF3 class
62599062009cb60464d02c2a
class WienerProcess(CountingProcess): <NEW_LINE> <INDENT> def __new__(cls, sym): <NEW_LINE> <INDENT> sym = _symbol_converter(sym) <NEW_LINE> return Basic.__new__(cls, sym) <NEW_LINE> <DEDENT> @property <NEW_LINE> def state_space(self): <NEW_LINE> <INDENT> return S.Reals <NEW_LINE> <DEDENT> def distribution(self, rv): <...
The Wiener process is a real valued continuous-time stochastic process. In physics it is used to study Brownian motion and therefore also known as Brownian Motion. Parameters ========== sym: Symbol/str Examples ======== >>> from sympy.stats import WienerProcess, P, E >>> from sympy import symbols, Contains, Interva...
6259906276e4537e8c3f0c76
class Student: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.gpa = 0.0 <NEW_LINE> self.stress = 50 <NEW_LINE> self.knowledge = 50 <NEW_LINE> self.dexterity = 50 <NEW_LINE> self.strength = 50 <NEW_LINE> self.speed = 50 <NEW_LINE> self.courses = [] <NEW_LINE> self.name = "Bob" <NEW_LINE> <DEDENT> def l...
Default Student Constructor
6259906256b00c62f0fb3fbe
class TokenEndpointError(Exception): <NEW_LINE> <INDENT> def __init__(self, error, error_description): <NEW_LINE> <INDENT> self.error = error <NEW_LINE> self.error_description = error_description <NEW_LINE> super(TokenEndpointError, self).__init__( "[%s] %s" % (self.error, self.error_description))
Error communicating with the token endpoint.
62599062097d151d1a2c275d
class SinusoidalTaskSet(TaskSet): <NEW_LINE> <INDENT> def __init__( self, num_train_points=50, num_test_points=30, num_tasks=10, ): <NEW_LINE> <INDENT> num_points = num_train_points + num_test_points <NEW_LINE> X, Y = random_sinusoid_set(num_tasks, num_points) <NEW_LINE> self.X_train = X[:, :num_train_points] <NEW_LINE...
Each task consists of training points and test points Detailed description coming soon.
62599062442bda511e95d8d3
class SmsGateway(object): <NEW_LINE> <INDENT> BASE_URL = "https://smsgateway.me" <NEW_LINE> def loginDetails(self, email, password): <NEW_LINE> <INDENT> self.email = email <NEW_LINE> self.password = password <NEW_LINE> <DEDENT> def getMessages(self, page=1): <NEW_LINE> <INDENT> return self.makeRequest('/api/v3/messages...
Python equivalent class of the php sample given by smsgateway.me.
62599062be8e80087fbc077a
class Backend: <NEW_LINE> <INDENT> def __init__(self, **zoo_kwargs): <NEW_LINE> <INDENT> self._client = zoo.Client(**zoo_kwargs) <NEW_LINE> self.jobs_control = ifaces.JobsControl(self._client) <NEW_LINE> self.jobs_process = ifaces.JobsProcess(self._client) <NEW_LINE> self.jobs_gc = ifaces.JobsGc(self._client) <NEW_LINE...
ZooKeeper backend provides some interfaces for working with jobs and other operations. Each instance of this class contains an own connection to ZooKeeper and can be used for any operation.
62599062fff4ab517ebcef1a
class RatingOutOfRangeException(SparkException): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> super(RatingOutOfRangeException, self).__init__(message)
CF generated rating is out of range i.e. rating > 1 or rating < -1
62599062498bea3a75a59179
class DecisionTreeClassifier(DecisionTree): <NEW_LINE> <INDENT> def __init__(self, method="gini", max_depth=2, max_points=None): <NEW_LINE> <INDENT> self.PredictionNode = nodes.PredNodeClassify <NEW_LINE> super().__init__(method, max_depth, max_points)
Instantiate this class for a Decision Tree for classification tasks.
6259906221bff66bcd724359
class NodeInstallationTasksSequenceCreator(object): <NEW_LINE> <INDENT> def create(self, instance, graph, installation_tasks): <NEW_LINE> <INDENT> sequence = graph.sequence() <NEW_LINE> sequence.add( instance.set_state('initializing'), forkjoin( installation_tasks.set_state_creating[instance.id], installation_tasks.sen...
This class is used to create a tasks sequence installing one node instance. Considering the order of tasks executions, it enforces the proper dependencies only in context of this particular node instance.
625990623617ad0b5ee07842
class FieldSet(formalchemy.FieldSet): <NEW_LINE> <INDENT> def __init__(self, model, **kwargs): <NEW_LINE> <INDENT> super(FieldSet, self).__init__(model, **kwargs) <NEW_LINE> self.request = kwargs["request"] <NEW_LINE> assert kwargs["request"] <NEW_LINE> <DEDENT> def render(self, **kwargs): <NEW_LINE> <INDENT> kwargs.se...
A base Grid, makes sure that request is passed, sets the context for localization in templates.
625990624a966d76dd5f05e9
class ZoteroRecord(dict): <NEW_LINE> <INDENT> __getattr__ = dict.__getitem__ <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> dict.__init__(self, **kwargs) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> f = '{}({{}}): "{{}}"'.format( str(type(self)).split("'")[1].split('.')[-1]) <NEW_LINE> s = '...
Store and manipulate data from a single Zotero record.
62599062a8ecb0332587290c
class NewlineNormalizer(object): <NEW_LINE> <INDENT> def __init__(self, wrapped_file): <NEW_LINE> <INDENT> self._wrapped_file = wrapped_file <NEW_LINE> self.name = getattr(wrapped_file, 'name', None) <NEW_LINE> <DEDENT> def read(self, *args): <NEW_LINE> <INDENT> return self._wrapped_file.read(*args).replace(b'\r\n', b'...
File wrapper that normalizes CRLF line endings.
625990623eb6a72ae038bd54
class MyList(list): <NEW_LINE> <INDENT> pass <NEW_LINE> def __init__(self, l=list(), call_tabs=True): <NEW_LINE> <INDENT> self.call_tabs = call_tabs <NEW_LINE> super().__init__(l)
list class which accepts all dynamic attributes: >>> l = MyList((1, 3, 4)) >>> l [1, 3, 4] >>> l.foo = 5 >>> l.foo 5
6259906299cbb53fe68325d7
class ProyectosTable(tables.Table): <NEW_LINE> <INDENT> def render_titulo(self, record): <NEW_LINE> <INDENT> enlace = reverse('proyecto_detail', args=[record.id]) <NEW_LINE> return mark_safe(f'<a href="{enlace}">{record.titulo}</a>') <NEW_LINE> <DEDENT> coordinadores = tables.Column( empty_values=(), orderable=False, v...
Muestra las solicitudes de proyecto introducidas.
62599062796e427e5384fe6a
@functools.total_ordering <NEW_LINE> class AccountMeta: <NEW_LINE> <INDENT> def __init__( self, public_key: PublicKey, is_signer: Optional[bool] = False, is_writable: Optional[bool] = False, is_payer: Optional[bool] = False, is_program: Optional[bool] = False, ): <NEW_LINE> <INDENT> self.public_key = public_key <NEW_LI...
Represents the account information required for building transactions.
62599062460517430c432bce
class Manipulations: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def replaceRule(oldRule: Rule, newRule: Rule) -> Rule: <NEW_LINE> <INDENT> for par in oldRule.from_symbols: <NEW_LINE> <INDENT> par._set_to_rule(newRule) <NEW_LINE> newRule._from_symbols.append(par) <NEW_LINE> <DEDENT> for ch in oldRule.to_symbols: <NEW_...
Class that associate function modifying AST
625990622c8b7c6e89bd4ee4
class Hsts_base: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._input_dict = {} <NEW_LINE> self._arguments = [] <NEW_LINE> self._instance = Https() <NEW_LINE> self._output_dict = {} <NEW_LINE> self._mitigations = {} <NEW_LINE> self._set_arguments() <NEW_LINE> self.__logging = self._get_logger() <NEW_...
Hsts_base is the base class for all HSTS analysis. It is used to obtain the results of the analysis.
62599062d268445f2663a6d7
class IsRAuthenticated(permissions.BasePermission): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> return bool(request.user and request.user.is_active)
Allows access only to authenticated users.
6259906363d6d428bbee3e03
class Start(object): <NEW_LINE> <INDENT> def index(self): <NEW_LINE> <INDENT> product_id = Config.get_config(Config.FIELD_PRODUCT_ID) <NEW_LINE> client_id = Config.get_config(Config.FIELD_CLIENT_ID) <NEW_LINE> scope_data = json.dumps( {"alexa:all": { "productID": product_id, "productInstanceAttributes": { "deviceSerial...
The Web object
62599063009cb60464d02c2d
class TestModuleTools(unittest.TestCase): <NEW_LINE> <INDENT> def test_map(self): <NEW_LINE> <INDENT> self.assertEqual(map(1, 0, 2, 0, 10), 5.0) <NEW_LINE> self.assertEqual(map(30, 0, 180, 0, math.pi), 0.5235987755982988) <NEW_LINE> with self.assertRaises(ValueError): map(1, 1, 1, 0, 10)
Unit test for the ``tools`` module.
625990634428ac0f6e659c29
class Block(_messages.Message): <NEW_LINE> <INDENT> class BlockTypeValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> UNKNOWN = 0 <NEW_LINE> TEXT = 1 <NEW_LINE> TABLE = 2 <NEW_LINE> PICTURE = 3 <NEW_LINE> RULER = 4 <NEW_LINE> BARCODE = 5 <NEW_LINE> <DEDENT> blockType = _messages.EnumField('BlockTypeValueValuesEnum', ...
Logical element on the page. Enums: BlockTypeValueValuesEnum: Detected block type (text, image etc) for this block. Fields: blockType: Detected block type (text, image etc) for this block. boundingBox: The bounding box for the block. The vertices are in the order of top-left, top-right, bottom-right, bo...
62599063cc0a2c111447c64a
class NetsBoot(object): <NEW_LINE> <INDENT> def __init__(self, io, filename): <NEW_LINE> <INDENT> self.io = io <NEW_LINE> self.filename = filename <NEW_LINE> self._clear() <NEW_LINE> self._open() <NEW_LINE> <DEDENT> def _clear(self): <NEW_LINE> <INDENT> self.lines = [] <NEW_LINE> <DEDENT> def _open(self): <NEW_LINE> <I...
Extremely simple parser for /etc/tinc/nets.boot This simply reads all lines into a list (this also includes comments). Adding a network via ``add`` avoids duplicate entries.
62599063e76e3b2f99fda0f6
@implementer(IRequestLogger) <NEW_LINE> class ResolvingLogger(object): <NEW_LINE> <INDENT> def __init__(self, resolver, logger): <NEW_LINE> <INDENT> self.resolver = resolver <NEW_LINE> self.logger = logger <NEW_LINE> <DEDENT> class logger_thunk(object): <NEW_LINE> <INDENT> def __init__(self, message, logger): <NEW_LINE...
Feed (ip, message) combinations into this logger to get a resolved hostname in front of the message. The message will not be logged until the PTR request finishes (or fails).
625990637047854f46340ab4
class ForumExample(object): <NEW_LINE> <INDENT> def __init__(self, qas_id, question_text, doc_tokens, orig_answer_text=None, start_position=None, end_position=None, is_impossible=False): <NEW_LINE> <INDENT> self.qas_id = qas_id <NEW_LINE> self.question_text = question_text <NEW_LINE> self.doc_tokens = doc_tokens <NEW_L...
A single training/test example for simple sequence classification. For examples without an answer, the start and end position are -1.
625990639c8ee82313040d03
class RegressionTrainer(SupervisedTrainer, Proxy): <NEW_LINE> <INDENT> def __init__(self, proxy, multiple_labels=False, accepts_matrix=False): <NEW_LINE> <INDENT> self.multiple_labels = multiple_labels <NEW_LINE> self.accepts_matrix = accepts_matrix <NEW_LINE> Proxy.__init__(self, proxy) <NEW_LINE> <DEDENT> def fit(sel...
Regression.
62599063435de62698e9d4fe
class Solution: <NEW_LINE> <INDENT> def deduplication(self, nums): <NEW_LINE> <INDENT> n = len(nums) <NEW_LINE> if n == 0 : <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> nums.sort() <NEW_LINE> res = 1 <NEW_LINE> for i in range(1, n) : <NEW_LINE> <INDENT> if nums[i-1] != nums[i] : <NEW_LINE> <INDENT> nums[res] = nums...
@param nums: an array of integers @return: the number of unique integers
62599063d486a94d0ba2d6bf
class unitTests(unittest.TestCase): <NEW_LINE> <INDENT> def testSearch(self): <NEW_LINE> <INDENT> root = Node(5) <NEW_LINE> node2 = Node(2) <NEW_LINE> node21 = Node(21) <NEW_LINE> nodeNeg4 = Node(-4) <NEW_LINE> node3 = Node(3) <NEW_LINE> node19 = Node(19) <NEW_LINE> node25 = Node(25) <NEW_LINE> root.setLeft(node2) <NEW...
docstring for ClassName
6259906355399d3f05627c16
class User(AbstractEmailUser, BaseModel): <NEW_LINE> <INDENT> roll_no = models.IntegerField( blank=True, null=True ) <NEW_LINE> middle_name = models.CharField( max_length=100, blank = True, null=True ) <NEW_LINE> address = models.TextField( max_length=500, blank = True ) <NEW_LINE> description = models.TextField( max_l...
This model User holds the information about the registering User
625990634f88993c371f109a
class Eclipse(Makefile): <NEW_LINE> <INDENT> def generate(self): <NEW_LINE> <INDENT> super(Eclipse, self).generate() <NEW_LINE> ctx = { 'name': self.project_name, 'elf_location': join('BUILD',self.project_name)+'.elf', 'c_symbols': self.toolchain.get_symbols(), 'asm_symbols': self.toolchain.get_symbols(True), 'target':...
Generic Eclipse project. Intended to be subclassed by classes that specify a type of Makefile.
62599063009cb60464d02c2e
class DbVersion(BaseApp): <NEW_LINE> <INDENT> name = 'db_version' <NEW_LINE> @classmethod <NEW_LINE> def add_argument_parser(cls, subparsers): <NEW_LINE> <INDENT> parser = super(DbVersion, cls).add_argument_parser(subparsers) <NEW_LINE> parser.add_argument('--extension', default=None, help=('Migrate the database for th...
Print the current migration version of the database.
62599063a8ecb0332587290e
class JSONB(TYPECAST): <NEW_LINE> <INDENT> cast = "::jsonb"
Cast to JSONB
6259906332920d7e50bc773d
class AlwaysTrue(Dependency): <NEW_LINE> <INDENT> def should_build(self): <NEW_LINE> <INDENT> return True
Always rebuild the task.
625990630c0af96317c578da
class Playlist(object): <NEW_LINE> <INDENT> def __init__(self, username, spotify_instance, playlist_details): <NEW_LINE> <INDENT> self._logger = logging.getLogger('{base}.{suffix}' .format(base=LOGGER_BASENAME, suffix=self.__class__.__name__) ) <NEW_LINE> self._username = username <NEW_LINE> self._spotify = spotify_ins...
Playlist model
625990638da39b475be048df
class PostPost(View): <NEW_LINE> <INDENT> def post(self, request, username): <NEW_LINE> <INDENT> form = PostForm(self.request.POST) <NEW_LINE> if form.is_valid(): <NEW_LINE> <INDENT> user = User.objects.get(username=username) <NEW_LINE> post = Post(text = form.cleaned_data['text'], user = user) <NEW_LINE> post.save() <...
Create Post View
62599063442bda511e95d8d5
class GhArtifactList(MetadataMap): <NEW_LINE> <INDENT> def __init__(self, metadata): <NEW_LINE> <INDENT> super().__init__(metadata) <NEW_LINE> self._artifact_item_list = [] <NEW_LINE> for artifact in self._metadata['artifacts']: <NEW_LINE> <INDENT> self._artifact_item_list.append(GhArtifactItem(artifact)) <NEW_LINE> <D...
List of GitHub artifacts associated with a workflow
6259906366673b3332c31af3
class BasePage(BaseContentType): <NEW_LINE> <INDENT> def __init__(self, page, *args, **kwargs): <NEW_LINE> <INDENT> super(BasePage, self).__init__(*args, **kwargs) <NEW_LINE> self._data_model = page <NEW_LINE> self._template = 'page.html' <NEW_LINE> <DEDENT> def _get_html_data(self): <NEW_LINE> <INDENT> data = {C.HTML_...
Base Page object to extend when creating different types of pages
625990632ae34c7f260ac7de
@p.toolkit.blanket.config_declarations <NEW_LINE> class TextView(p.SingletonPlugin): <NEW_LINE> <INDENT> p.implements(p.IConfigurer, inherit=True) <NEW_LINE> p.implements(p.IConfigurable, inherit=True) <NEW_LINE> p.implements(p.IResourceView, inherit=True) <NEW_LINE> proxy_is_enabled = False <NEW_LINE> text_formats = [...
This extension previews JSON(P).
62599063a79ad1619776b638
class TestFillHandlebarFormField(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 testFillHandlebarFormField(self): <NEW_LINE> <INDENT> pass
FillHandlebarFormField unit test stubs
62599063be8e80087fbc077e
class InternalError(Exception): <NEW_LINE> <INDENT> def __init__(self, msg, original_exception=None, *args): <NEW_LINE> <INDENT> self.args = (msg, original_exception) + args <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "%s\nOriginal message:\n%s" % self.args[:2]
I am raised whenever a backend encounters an internal error. I wrap the original exception, if any, as my second argument.
625990638e7ae83300eea785
class Port(model_base.BASEV2, HasId, HasTenant): <NEW_LINE> <INDENT> name = sa.Column(sa.String(255)) <NEW_LINE> network_id = sa.Column(sa.String(36), sa.ForeignKey("networks.id"), nullable=False) <NEW_LINE> fixed_ips = orm.relationship(IPAllocation, backref='ports', lazy='joined') <NEW_LINE> mac_address = sa.Column(sa...
Represents a port on a Neutron v2 network.
62599063a8370b77170f1ac5
class UpsampleSkeletonsBase(luigi.Task): <NEW_LINE> <INDENT> task_name = 'upsample_skeletons' <NEW_LINE> src_file = os.path.abspath(__file__) <NEW_LINE> allow_retry = False <NEW_LINE> input_path = luigi.Parameter() <NEW_LINE> input_key = luigi.Parameter() <NEW_LINE> skeleton_path = luigi.Parameter() <NEW_LINE> skeleton...
UpsampleSkeletons base class
62599063498bea3a75a5917b
class LRFinder(Callback): <NEW_LINE> <INDENT> def __init__(self, lr_bounds:Tuple[float,float]=[1e-7, 10], nb:Optional[int]=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.lr_bounds,self.nb = lr_bounds,nb <NEW_LINE> if self.nb is not None: self.lr_mult = (self.lr_bounds[1]/self.lr_bounds[0])**(1/self.nb) <...
Callback class for Smith learning-rate range test (https://arxiv.org/abs/1803.09820) Arguments: nb: number of batches in a epoch lr_bounds: tuple of initial and final LR
62599063cc0a2c111447c64b
class AbortHandshake(InvalidHandshake): <NEW_LINE> <INDENT> def __init__(self, status, headers, body=None): <NEW_LINE> <INDENT> self.status = status <NEW_LINE> self.headers = headers <NEW_LINE> self.body = body
Exception raised to abort a handshake and return a HTTP response.
6259906344b2445a339b74dc
class ImageProcessingTagEntity(ImageProcessingEntity): <NEW_LINE> <INDENT> def __init__(self, ip, port, camera_entity, name, confidence): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._url_check = "http://{}:{}/{}/check".format(ip, port, CLASSIFIER) <NEW_LINE> self._camera = camera_entity <NEW_LINE> if name: <...
Perform a tag search via a Tagbox.
625990638a43f66fc4bf3887
class ErrorsInFile: <NEW_LINE> <INDENT> def __init__(self, regionsLeftBoundaries=None, messages=None): <NEW_LINE> <INDENT> self.regionsLeftBoundaries = regionsLeftBoundaries <NEW_LINE> self.messages = messages
Holder of all errors/warnings in particular file.
62599063a219f33f346c7efe
class RowError(TableError): <NEW_LINE> <INDENT> code = "row-error" <NEW_LINE> name = "Row Error" <NEW_LINE> tags = ["#table", "#row"] <NEW_LINE> template = "Row Error" <NEW_LINE> description = "Row Error" <NEW_LINE> def __init__(self, descriptor=None, *, note, cells, row_number, row_position): <NEW_LINE> <INDENT> self....
Row error representation Parameters: descriptor? (str|dict): error descriptor note (str): an error note row_number (int): row number row_position (int): row position Raises: FrictionlessException: raise any error that occurs during the process
62599063adb09d7d5dc0bc62
class Watchdog(object): <NEW_LINE> <INDENT> _RESTART_TIMEFRAME = 60 <NEW_LINE> def __init__(self, duration, max_mem_mb=None, max_resets=None): <NEW_LINE> <INDENT> import resource <NEW_LINE> self._duration = int(duration) <NEW_LINE> signal.signal(signal.SIGALRM, Watchdog.self_destruct) <NEW_LINE> if max_mem_mb is not No...
Simple signal-based watchdog. Restarts the process when: * no reset was made for more than a specified duration * (optional) a specified memory threshold is exceeded * (optional) a suspicious high activity is detected, i.e. too many resets for a given timeframe. **Warning**: Not thread-safe. Can only be invoked once p...
625990634a966d76dd5f05ed
class IO: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def print_menu(): <NEW_LINE> <INDENT> print('Menu\n\n[l] load Inventory from file\n[a] Add CD\n[i] Display Current Inventory') <NEW_LINE> print('[d] delete CD from Inventory\n[s] Save Inventory to file\n[x] exit\n') <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def ...
Handling Input / Output
62599063d486a94d0ba2d6c1
class RomVerScheme(SemVerScheme): <NEW_LINE> <INDENT> pass
http://dafoster.net/articles/2015/03/14/semantic-versioning-vs-romantic-versioning/
6259906391f36d47f2231a0b
class ManagementCommandMixin(BaseTestCase): <NEW_LINE> <INDENT> def get_command(self, cmd_module): <NEW_LINE> <INDENT> cmd = cmd_module.Command() <NEW_LINE> self.assertIn('help', dir(cmd)) <NEW_LINE> self.assertIsInstance(cmd.help, basestring) <NEW_LINE> self.assertTrue(len(cmd.help)) <NEW_LINE> return cmd
Class mixin for TestCase sub-classes that test Django management commands.
62599063379a373c97d9a718
class OpenStorageCloudBackupServicer(object): <NEW_LINE> <INDENT> def Create(self, request, context): <NEW_LINE> <INDENT> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!') <NEW_LINE> <DEDENT> def Rest...
OpenStorageCloudBackup service manages backing up volumes to a cloud location like Amazon, Google, or Azure. #### Backup To create a backup, you must first call the Create() call for a specified volume. To see the status of this request, use Status() which returns a map where the keys are the source volume id. #### R...
625990633539df3088ecd996
class AllOfDomainsListDomainsItems(object): <NEW_LINE> <INDENT> swagger_types = { } <NEW_LINE> attribute_map = { } <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.discriminator = None <NEW_LINE> <DEDENT> def to_dict(self): <NEW_LINE> <INDENT> result = {} <NEW_LINE> for attr, _ in six.iteritems(self.swagger_type...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
625990630c0af96317c578db
class CommentForm(forms.Form): <NEW_LINE> <INDENT> comment = forms.CharField(required=True, max_length=100, error_messages={ "required": "内容不能为空" })
用户评论表单
6259906332920d7e50bc773f
class IntentMessageImage(_messages.Message): <NEW_LINE> <INDENT> accessibilityText = _messages.StringField(1) <NEW_LINE> imageUri = _messages.StringField(2)
The image response message. Fields: accessibilityText: A text description of the image to be used for accessibility, e.g., screen readers. Required if image_uri is set for CarouselSelect. imageUri: Optional. The public URI to an image file.
625990635fdd1c0f98e5f67c
class ConversionError(Exception): <NEW_LINE> <INDENT> def __init__(self, key_type, attr, value): <NEW_LINE> <INDENT> Exception.__init__(self) <NEW_LINE> self.key_type = key_type <NEW_LINE> self.value = value <NEW_LINE> self.attr = attr <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return 'Could not convert...
Print customized error for options that are not converted correctly and point out that they are maybe not implemented, yet
6259906338b623060ffaa3cd
class EnemyBullet: <NEW_LINE> <INDENT> def __init__(self, var_x, var_y, var_image): <NEW_LINE> <INDENT> self.x = var_x <NEW_LINE> self.y = var_y <NEW_LINE> self.image = var_image <NEW_LINE> <DEDENT> def draw(self, var_screen): <NEW_LINE> <INDENT> var_screen.blit(pygame.image.load(self.image), (self.x, self.y)) <NEW_LIN...
敌军飞机发射的子弹类
62599063442bda511e95d8d6
class ToonGasMeterDeviceSensor(ToonSensor, ToonGasMeterDeviceEntity): <NEW_LINE> <INDENT> pass
Defines a Gas Meter sensor.
625990631f037a2d8b9e53e7
class TemplateTest(unittest.TestCase): <NEW_LINE> <INDENT> def testA(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> template = Template() <NEW_LINE> <DEDENT> except Exception as ex: <NEW_LINE> <INDENT> msg = "Failed to instantiate Template object:\n" <NEW_LINE> msg += str(ex) <NEW_LINE> self.fail(msg) <NEW_LINE> <...
TestCase for Template base object
62599063d6c5a102081e381d
class InaccessibleGroupError(ESDLSyntaxErrorBase): <NEW_LINE> <INDENT> code = "W2006" <NEW_LINE> default_message = "Group '%s' specified after an unbounded group"
Returned when a group appears after an unbounded group and will never be selected into.
625990638e71fb1e983bd1c4
class ServiceOutputParser(LineOnlyReceiver): <NEW_LINE> <INDENT> delimiter = b"\n" <NEW_LINE> substitutions = { "Y": "(?P<Y>\d{4})", "m": "(?P<m>\d{2})", "d": "(?P<d>\d{2})", "H": "(?P<H>\d{2})", "M": "(?P<M>\d{2})", "S": "(?P<S>\d{2})", "msecs": "(?P<msecs>\d{3})", "levelname": "(?P<levelname>[a-zA-Z]+)", "name": "(?P...
Parse the standard output stream of a service and forward it to the Python logging system. The stream is assumed to be a UTF-8 sequence of lines each delimited by a (configurable) delimiter character. Each received line is tested against the RegEx pattern provided in the constructor. If a match is found, a :class:`~l...
62599063f548e778e596cc82
class portal_menu(osv.osv): <NEW_LINE> <INDENT> _name = 'ir.ui.menu' <NEW_LINE> _inherit = 'ir.ui.menu' <NEW_LINE> def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): <NEW_LINE> <INDENT> if context is None: <NEW_LINE> <INDENT> context = {} <NEW_LINE> <DEDENT> if not context.get...
Fix menu class to customize the login search for menus, as web client 6.0 does not support the menu action properly yet
625990634e4d562566373b00
class PhraseMatch(object): <NEW_LINE> <INDENT> def __init__(self, extracted_value, match_start, match_end, phrase): <NEW_LINE> <INDENT> self.extracted_value = extracted_value <NEW_LINE> self.match_start = match_start <NEW_LINE> self.match_end = match_end <NEW_LINE> self.phrase = phrase
Describes a single phrase match to a single RPDR Note for a phrase.
62599063cc0a2c111447c64c
class Mood(models.Model): <NEW_LINE> <INDENT> mood_title = models.CharField(max_length=20) <NEW_LINE> mood_time = models.CharField(max_length=20) <NEW_LINE> mood_content = models.CharField(max_length=128, default='开心的很,没有要讲的') <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.mood_title
记录心情内容
625990638a43f66fc4bf3889
class Wallet: <NEW_LINE> <INDENT> def __init__(self, amount=100): <NEW_LINE> <INDENT> self.amount = amount <NEW_LINE> self.bet_amount = 0 <NEW_LINE> <DEDENT> def add_to_wallet(self, amount): <NEW_LINE> <INDENT> self.amount += amount <NEW_LINE> print("Your wallet now contains: ", self.amount) <NEW_LINE> <DEDENT> def che...
A wallet to store and make the bets
625990633d592f4c4edbc5d6
class ProductRetrieveView(generics.RetrieveAPIView): <NEW_LINE> <INDENT> renderer_classes = (CMSPageRenderer, JSONRenderer, BrowsableAPIRenderer) <NEW_LINE> lookup_field = lookup_url_kwarg = 'slug' <NEW_LINE> product_model = ProductModel <NEW_LINE> serializer_class = None <NEW_LINE> limit_choices_to = Q() <NEW_LINE> de...
View responsible for rendering the products details. Additionally an extra method as shown in products lists, cart lists and order item lists.
6259906392d797404e3896da
class FtWarning(Warning): <NEW_LINE> <INDENT> pass
Base class for all 4Suite-specific warnings.
6259906376e4537e8c3f0c7c
class PersistentCache(object): <NEW_LINE> <INDENT> def set(self, key, value): <NEW_LINE> <INDENT> raise NotImplementedError('abstract method') <NEW_LINE> <DEDENT> def get(self, key): <NEW_LINE> <INDENT> raise NotImplementedError('abstract method')
The base caching backend. This backend should be subclassed by concrete implementations.
6259906332920d7e50bc7740
class propfile(base.TranslationStore): <NEW_LINE> <INDENT> UnitClass = propunit <NEW_LINE> def __init__(self, inputfile=None, personality="java", encoding=None): <NEW_LINE> <INDENT> super(propfile, self).__init__(unitclass=self.UnitClass) <NEW_LINE> self.personality = get_dialect(personality) <NEW_LINE> self.encoding =...
this class represents a .properties file, made up of propunits
6259906376e4537e8c3f0c7d
class CustomLocations(object): <NEW_LINE> <INDENT> def __init__( self, credential, subscription_id, base_url=None, **kwargs ): <NEW_LINE> <INDENT> if not base_url: <NEW_LINE> <INDENT> base_url = 'https://management.azure.com' <NEW_LINE> <DEDENT> self._config = CustomLocationsConfiguration(credential, subscription_id, *...
The customLocations Rest API spec. :ivar custom_locations: CustomLocationsOperations operations :vartype custom_locations: azure.mgmt.extendedlocation.v2021_03_15_preview.operations.CustomLocationsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credenti...
62599063a8ecb03325872912
class InternalAwsInstanceEventViewSet( InternalViewSetMixin, viewsets.ReadOnlyModelViewSet ): <NEW_LINE> <INDENT> queryset = aws_models.AwsInstanceEvent.objects.all() <NEW_LINE> serializer_class = serializers.InternalAwsInstanceEventSerializer <NEW_LINE> filterset_fields = { "subnet": ["exact"], "instance_type": ["exac...
Retrieve or list AwsInstanceEvents for internal use.
625990632ae34c7f260ac7e1
class MainWindow(wx.Frame): <NEW_LINE> <INDENT> def __init__(self,parent,id,title): <NEW_LINE> <INDENT> wx.Frame.__init__(self,parent, wx.ID_ANY, title, size = (800,900), style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE) <NEW_LINE> self.SetBackgroundColour(wx.WHITE) <NEW_LINE> wx.StaticText(self, -1, "Drag and...
This window displays the GUI Widgets.
6259906399cbb53fe68325dd
class ContentGenerator(object): <NEW_LINE> <INDENT> can_defer = True <NEW_LINE> @classmethod <NEW_LINE> def name(cls): <NEW_LINE> <INDENT> return cls.__name__ <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_resource_list(cls, post): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> @classmethod <N...
A class that generates content and dependency list for blog posts
6259906356b00c62f0fb3fc6
class PostInline(admin.StackedInline): <NEW_LINE> <INDENT> model = Post <NEW_LINE> can_delete = False <NEW_LINE> verbose_name_plural = 'posts'
Post in-line
625990638e71fb1e983bd1c6
class NonMSAMortgageData(MortgageBase): <NEW_LINE> <INDENT> state = models.ForeignKey( State, null=True, on_delete=models.CASCADE) <NEW_LINE> @property <NEW_LINE> def county_list(self): <NEW_LINE> <INDENT> return self.state.non_msa_counties
Aggregate state data for counties that do not belong to an MSA.
625990632c8b7c6e89bd4eea
class IMediumFormat(Interface): <NEW_LINE> <INDENT> __uuid__ = '6238e1cf-a17d-4ec1-8172-418bfb22b93a' <NEW_LINE> __wsmap__ = 'managed' <NEW_LINE> @property <NEW_LINE> def id_p(self): <NEW_LINE> <INDENT> ret = self._get_attr("id") <NEW_LINE> return ret <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> ...
The IMediumFormat interface represents a medium format. Each medium format has an associated backend which is used to handle media stored in this format. This interface provides information about the properties of the associated backend. Each medium format is identified by a string represented by the :py:func:`id_p` ...
62599063cc0a2c111447c64d
class HistokatException(Exception): <NEW_LINE> <INDENT> pass
Raise if an exception within the histokat module occurred.
6259906344b2445a339b74de
class UnreliableMagicCarpet(Vehicle): <NEW_LINE> <INDENT> def __init__(self, new_fuel: int) -> None: <NEW_LINE> <INDENT> Vehicle.__init__(self, new_fuel, (random.randint(-10, 10), random.randint(-10, 10))) <NEW_LINE> <DEDENT> def move(self, new_x: int, new_y: int) -> None: <NEW_LINE> <INDENT> se...
An unreliable magic carpet. Does not need to use fuel to travel, but ends up in a random position within two horizontal and two vertical units from the target destination. >>> SDM = SuperDuperManager() >>> SDM.add_vehicle('UnreliableMagicCarpet', 'Silky', 0) >>> SDM.get_vehicle_position('Silky') (-4, 4) >>> SDM.move_...
62599063e76e3b2f99fda0fc
class Device(object): <NEW_LINE> <INDENT> def __init__(self, client, index): <NEW_LINE> <INDENT> super(Device, self).__init__() <NEW_LINE> self._client = client <NEW_LINE> self.index = index <NEW_LINE> self.device_type = self._request('name').decode('utf-8') <NEW_LINE> if self.device_type.endswith('Device'): <NEW_LINE>...
A Peary device. This object acts as a proxy that forwards all function calls to the device specified by the device index using the client object.
6259906376e4537e8c3f0c7e
class lookupByPhoneNumber_result(object): <NEW_LINE> <INDENT> def __init__(self, success=None, e=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> self.e = e <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTrans...
Attributes: - success - e
6259906391af0d3eaad3b524
class Lifetime(enum.Enum): <NEW_LINE> <INDENT> singleton = enum.auto() <NEW_LINE> transient = enum.auto() <NEW_LINE> scoped = enum.auto()
Marks lifetime of an instance.
625990634a966d76dd5f05f1
class StatusBar(tkinter.Frame): <NEW_LINE> <INDENT> def __init__(self, master, text=''): <NEW_LINE> <INDENT> tkinter.Frame.__init__(self, master) <NEW_LINE> self.text = tkinter.StringVar() <NEW_LINE> self.label = tkinter.Label(self, textvariable=self.text, font=('arial', 12, 'normal')) <NEW_LINE> self.text.set(text) <N...
StatusBar class
6259906324f1403a9268644c
class XmippProtMaskVolumes(ProtMaskVolumes, XmippProcessVolumes, XmippProtMask, XmippGeometricalMask3D): <NEW_LINE> <INDENT> _label = 'apply 3d mask' <NEW_LINE> MASK_FILE = 'mask.vol' <NEW_LINE> MASK_CLASSNAME = 'VolumeMask' <NEW_LINE> GEOMETRY_BASECLASS = XmippGeometricalMask3D <NEW_LINE> def __init__(self, **kwargs):...
Apply mask to a volume
62599063b7558d5895464aac