code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Shape(object): <NEW_LINE> <INDENT> def __init__(self, type_, data=None): <NEW_LINE> <INDENT> self._type = type_ <NEW_LINE> if type_ == "polygon": <NEW_LINE> <INDENT> if isinstance(data, list): <NEW_LINE> <INDENT> data = tuple(data) <NEW_LINE> <DEDENT> <DEDENT> elif type_ == "image": <NEW_LINE> <INDENT> if isinsta...
Data structure modeling shapes. attribute _type is one of "polygon", "image", "compound" attribute _data is - depending on _type a poygon-tuple, an image or a list constructed using the addcomponent method.
62598fabd268445f26639b4f
class SecurityGroupsTestIPv4(SecurityGroupsTest): <NEW_LINE> <INDENT> PING_COMMAND = 'ping -c 3 {}' <NEW_LINE> SSH_COMMAND = ('ssh -o UserKnownHostsFile=/dev/null ' '-o StrictHostKeyChecking=no -o ConnectTimeout=60 ' '-i {private_key_path} root@{ip_address} {command}') <NEW_LINE> NAMES_PREFIX = 'security_groups_IPv4' <...
This class executes the test cases in SecurityGroupsTest for public net IPv4
62598fab3539df3088ecc24b
class Gesture(peewee.Model): <NEW_LINE> <INDENT> id = peewee.PrimaryKeyField() <NEW_LINE> description = peewee.TextField() <NEW_LINE> @staticmethod <NEW_LINE> def fetch(code): <NEW_LINE> <INDENT> if type(code) == str: <NEW_LINE> <INDENT> if code[0] != 'G': <NEW_LINE> <INDENT> raise AttributeError('Incorrect gesture cod...
This table contains the ID and description of a known gesture used in the transcript.
62598faba17c0f6771d5c1cd
class TestMinRationCount(unittest.TestCase): <NEW_LINE> <INDENT> def test_basic(self): <NEW_LINE> <INDENT> self.assertEqual(get_min_ration_count(5, [2, 3, 4, 5, 6]), 4) <NEW_LINE> self.assertEqual(get_min_ration_count(2, [1, 2]), "NO")
Test.
62598fab5fc7496912d4824e
class RDdiffLattice(Lattice): <NEW_LINE> <INDENT> _beta_RD = 1./2. <NEW_LINE> def __init__(self, length, ht=0.1, seed=None): <NEW_LINE> <INDENT> Lattice.__init__(self, length, seed=seed, heighttype=float) <NEW_LINE> self._ht = ht <NEW_LINE> self.beta = RDLattice._beta_RD <NEW_LINE> <DEDENT> def evolve(self, nprtcls): <...
Lattice with evolution following the random deposition model.
62598fab3d592f4c4edbae64
class AbstractSoundRelatedFilter(AbstractFilter): <NEW_LINE> <INDENT> pass
Базовый класс для всех фильтров, связанных со звуком.
62598fab4e4d5625663723be
class FormFieldBlockMixin(object, metaclass=DeclarativeSubBlocksMetaclass): <NEW_LINE> <INDENT> label = CharBlock() <NEW_LINE> required = BooleanBlock(default=False, required=False) <NEW_LINE> help_text = CharBlock(required=False) <NEW_LINE> def get_field_options(self, field): <NEW_LINE> <INDENT> options = {} <NEW_LINE...
Every Block that can be a form field in a StreamField must use this mixin. Inheriting from this class allows for the block to be identified and for the block to generate the needed information for the form.
62598fab45492302aabfc469
class StatusIconHelper(BaseWebElementHelper): <NEW_LINE> <INDENT> @property <NEW_LINE> def value(self): <NEW_LINE> <INDENT> icon_class = self.get_attribute('class') <NEW_LINE> if 'pficon-error-circle-o' in icon_class: <NEW_LINE> <INDENT> return 'failed' <NEW_LINE> <DEDENT> elif 'pficon-ok' in icon_class: <NEW_LINE> <IN...
StatusIcon helper (Selenium webelement wrapper). Provides basic methods for manipulation with a task status icon.
62598fabf548e778e596b53c
class problem(object): <NEW_LINE> <INDENT> def __init__(self, dims, Pdata, Pindices, Pindptr, q, Adata, Aindices, Aindptr, l, u): <NEW_LINE> <INDENT> (self.n, self.m) = dims <NEW_LINE> self.P = spspa.csc_matrix((Pdata, Pindices, Pindptr), shape=(self.n, self.n)) <NEW_LINE> self.q = q <NEW_LINE> self.A = spspa.csc_matri...
QP problem of the form minimize 1/2 x' P x + q' x subject to l <= A x <= u Attributes ---------- P, q A, l, u
62598fabf7d966606f747f7d
class pdf_xref(pdf_match): <NEW_LINE> <INDENT> def trailer(self): <NEW_LINE> <INDENT> return pdf_dict(next(self.find('dicts')), origin=self) <NEW_LINE> <DEDENT> def blocks(self): <NEW_LINE> <INDENT> return (pdf_xblock(x, origin=self) for x in self.finditer(P['xblock']))
A class to represent a single xref Initialized from a re.match object
62598fab10dbd63aa1c70b4c
class AppServerError(Exception): <NEW_LINE> <INDENT> pass
Base OpenROAD AppServer Exception
62598fab460517430c432029
class clean_args(object): <NEW_LINE> <INDENT> def __init__(self, log_context=None,): <NEW_LINE> <INDENT> self.log_context = log_context <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not ...
Attributes: - log_context
62598fab3cc13d1c6d465704
class CorniceSchema(object): <NEW_LINE> <INDENT> def __init__(self, _colander_schema): <NEW_LINE> <INDENT> self._c_schema = _colander_schema <NEW_LINE> <DEDENT> def bind_attributes(self, request=None): <NEW_LINE> <INDENT> if request: <NEW_LINE> <INDENT> self._attributes = self._c_schema().bind(request=request).children...
Defines a cornice schema
62598fab7b25080760ed7446
class GetItemTable(Index, synode.Node): <NEW_LINE> <INDENT> name = 'Get Item Table' <NEW_LINE> nodeid = "org.sysess.sympathy.list.getitemtable" <NEW_LINE> icon = 'list_get_item.svg' <NEW_LINE> inputs = Ports([Port.Tables('Input Tables', name='port1')]) <NEW_LINE> outputs = Ports([Port.Table('Output selected Table', nam...
Get one Table in list of Tables. The Table is selected by index in the list. :Inputs: **List** : Tables Incoming list of Tables. :Outputs: **Item** : Table The Table at the selected index of the incoming list. :Configuration: **Index** Select index in the incoming list to extract th...
62598fabfff4ab517ebcd77d
class ProjectFloorAreaSection(models.Model): <NEW_LINE> <INDENT> project_subtype = models.ForeignKey( ProjectSubtype, verbose_name=_("project subtype"), on_delete=models.CASCADE, related_name="floor_area_sections", ) <NEW_LINE> name = models.CharField(max_length=255, verbose_name=_("name")) <NEW_LINE> index = models.Po...
Defines a floor area data section.
62598fab627d3e7fe0e06e45
class Error(Exception): <NEW_LINE> <INDENT> pass
Base class for exceptions in the numina package.
62598fabcc0a2c111447afa9
class CPEViewSet(PDCModelViewSet): <NEW_LINE> <INDENT> queryset = models.CPE.objects.all() <NEW_LINE> serializer_class = CPESerializer <NEW_LINE> filter_class = filters.CPEFilter <NEW_LINE> permission_classes = (APIPermission,)
Common Platform Enumeration (CPE) for linking CPE with variants ($LINK:variantcpe-list$). CPE is a standardized method of describing and identifying classes of operating systems. Common Vulnerabilities and Exposures (CVE) contain list of affected CPEs. For more information about CPE see [cpe.mitre.org](https://cpe.m...
62598fab38b623060ffa9032
class Material(models.Model): <NEW_LINE> <INDENT> nome = models.CharField(max_length=200) <NEW_LINE> unidade = models.CharField(max_length=20) <NEW_LINE> valor_unitario = models.DecimalField( max_digits=10, decimal_places=2, default=0.0) <NEW_LINE> quantidade = models.DecimalField( max_digits=10, decimal_places=2, defa...
Materiais de determinado 'Deposito'
62598fab66656f66f7d5a389
class JSONResponseMixin(object): <NEW_LINE> <INDENT> content_type = 'application/json' <NEW_LINE> def render_to_response(self, context): <NEW_LINE> <INDENT> return self.get_json_response(self.convert_context_to_json(context)) <NEW_LINE> <DEDENT> def get_json_response(self, content, **httpresponse_kwargs): <NEW_LINE> <I...
Mixin to use with class-based views that provides an extra render_json_response function.
62598fab7d847024c075c35c
class LogPublisher: <NEW_LINE> <INDENT> synchronized = ["msg"] <NEW_LINE> def __init__( self, observerPublisher=None, publishPublisher=None, logBeginner=None, warningsModule=warnings, ): <NEW_LINE> <INDENT> if publishPublisher is None: <NEW_LINE> <INDENT> publishPublisher = NewPublisher() <NEW_LINE> if observerPublishe...
Class for singleton log message publishing.
62598fab3317a56b869be517
class KeyboardFeature(hid_gadget.HidFeature): <NEW_LINE> <INDENT> REPORT_DESC = hid_descriptors.ReportDescriptor( hid_descriptors.UsagePage(0x01), hid_descriptors.Usage(0x06), hid_descriptors.Collection( hid_constants.CollectionType.APPLICATION, hid_descriptors.UsagePage(0x07), hid_descriptors.UsageMinimum(224), hid_de...
HID feature implementation for a keyboard. REPORT_DESC provides an example HID report descriptor for a device including this functionality.
62598fab1f037a2d8b9e4087
class DigikamParser(AbstractParser): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.actions_dict['KEY_KP0'] = lambda key : os.system('xdotool key ctrl+0') <NEW_LINE> self.actions_dict['KEY_KP1'] = lambda key : os.system('xdotool key ctrl+1') <NEW_LINE> self.actions_dict['...
0-5 : giving stars to photos 7,8,9,- : giving flags to photos + : arrow left Enter : arrow right Args: AbstractParser ([type]): [description]
62598fab4f6381625f19948b
class Merge(Abstraction): <NEW_LINE> <INDENT> GROUP_SIZE = 16 <NEW_LINE> Counter = itertools.count() <NEW_LINE> def __init__(self, inputs, outputs, function=None, includes=None, native=False, group=None, collect=False, local=True): <NEW_LINE> <INDENT> Abstraction.__init__(self, function or 'cat {IN} > {OUT}', inputs, o...
Weaver Merge Abstraction.
62598fab1f5feb6acb162bb9
class CertValidatingHTTPSConnection(http_client.HTTPConnection): <NEW_LINE> <INDENT> default_port = http_client.HTTPS_PORT <NEW_LINE> def __init__(self, host, port=default_port, key_file=None, cert_file=None, ca_certs=None, strict=None, **kwargs): <NEW_LINE> <INDENT> if six.PY2: <NEW_LINE> <INDENT> kwargs['strict'] = s...
An HTTPConnection that connects over SSL and validates certificates.
62598fab56ac1b37e6302185
@typehints.with_input_types(Union[pd.DataFrame, pd.Series]) <NEW_LINE> class UnbatchPandas(beam.PTransform): <NEW_LINE> <INDENT> def __init__(self, proxy, include_indexes=False): <NEW_LINE> <INDENT> self._proxy = proxy <NEW_LINE> self._include_indexes = include_indexes <NEW_LINE> <DEDENT> def expand(self, pcoll): <NEW_...
A transform that explodes a PCollection of DataFrame or Series. DataFrame is converterd to a schema-aware PCollection, while Series is converted to its underlying type. Args: include_indexes: (optional, default: False) When unbatching a DataFrame if include_indexes=True, attempt to include index columns in the...
62598fab6e29344779b005f6
class LinearSoftmaxlayer(object): <NEW_LINE> <INDENT> def __init__(self,numin,numout,params): <NEW_LINE> <INDENT> self.numin = numin <NEW_LINE> self.numout = numout <NEW_LINE> self.params = params <NEW_LINE> self.linearlayer = Linearlayer(self.numin,self.numout,self.params) <NEW_LINE> self.softmax = Softmax(self.numou...
Linear layer followed by a softmax. (AKA multinomial logit model).
62598fab4527f215b58e9e7b
class ContainerProjectsLocationsClustersNodePoolsListRequest(_messages.Message): <NEW_LINE> <INDENT> clusterId = _messages.StringField(1) <NEW_LINE> parent = _messages.StringField(2, required=True) <NEW_LINE> projectId = _messages.StringField(3) <NEW_LINE> version = _messages.StringField(4) <NEW_LINE> zone = _messages....
A ContainerProjectsLocationsClustersNodePoolsListRequest object. Fields: clusterId: Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. parent: The parent (project, location, cluster id) where the node pools will be listed. Specified in the format 'proj...
62598fab435de62698e9bd90
class Database: <NEW_LINE> <INDENT> def __init__(self, config, token=None): <NEW_LINE> <INDENT> self._config = config <NEW_LINE> self._token = token <NEW_LINE> <DEDENT> @property <NEW_LINE> def config(self): <NEW_LINE> <INDENT> return self._config <NEW_LINE> <DEDENT> def submit(self, data, verbose=False): <NEW_LINE> <I...
KernelCI database interface
62598fabbe383301e0253793
class App(pyacc.AccCommandLineApp): <NEW_LINE> <INDENT> def build_arg_parser(self): <NEW_LINE> <INDENT> super(App, self).build_arg_parser() <NEW_LINE> self.parser.add_argument('filenames', metavar='FILE', nargs='+', type=str, help='path to file to push') <NEW_LINE> <DEDENT> def main(self): <NEW_LINE> <INDENT> for filen...
Upload files to config server. Note that the file upload option needs to be enabled on the Config Server (agent.file.management.enabled=true in APMCommandCenterServer/config/apmccsrv.properties)
62598fabb7558d58954635c3
class parser(): <NEW_LINE> <INDENT> def __init__(self, animeName="", action='d', siteParser=bestanime, hostParser='trollvideo'): <NEW_LINE> <INDENT> self.animeName = animeName <NEW_LINE> self.episodes = None <NEW_LINE> self.episodeUrls = None <NEW_LINE> self.currentEpisode = None <NEW_LINE> self.prevEpisode = None <NEW...
Wrapper around the actual site parser plugins. This is the class that you'll be interacting with instead of the actual parsers. This makes it easy to to use any plugins while still using the same class and methods.
62598fab7b180e01f3e4901e
class CompositeBuilder(SCons.Util.Proxy): <NEW_LINE> <INDENT> def __init__(self, builder, cmdgen): <NEW_LINE> <INDENT> if __debug__: logInstanceCreation(self, 'Builder.CompositeBuilder') <NEW_LINE> SCons.Util.Proxy.__init__(self, builder) <NEW_LINE> self.cmdgen = cmdgen <NEW_LINE> self.builder = builder <NEW_LINE> <DED...
A Builder Proxy whose main purpose is to always have a DictCmdGenerator as its action, and to provide access to the DictCmdGenerator's add_action() method.
62598fab92d797404e388b31
class NoDoubleSlashes(MiddlewareMixin): <NEW_LINE> <INDENT> def process_request(self, request): <NEW_LINE> <INDENT> if '//' in request.path: <NEW_LINE> <INDENT> new_path = multislash_re.sub('/', request.path) <NEW_LINE> return redirect(new_path) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return None
123-reg redirects djangopeople.com/blah to djangopeople.net//blah - this middleware eliminates multiple slashes from incoming requests.
62598fab01c39578d7f12d19
class Getter(AccessorBase): <NEW_LINE> <INDENT> __slots__ = add_to_slots('parent_xpath', 'tag_name') <NEW_LINE> def __call__(self): <NEW_LINE> <INDENT> element = self.element_by_parent(self.parent_xpath, self.tag_name, create=False) <NEW_LINE> return int(element.text)
Retrieve text on element and convert to int
62598fab097d151d1a2c0fc3
class FeatureNet: <NEW_LINE> <INDENT> def __init__(self, space, extension=None): <NEW_LINE> <INDENT> self.space = space <NEW_LINE> self.extension = extension <NEW_LINE> <DEDENT> def prepare(self, xs): <NEW_LINE> <INDENT> return np.asarray(xs) <NEW_LINE> <DEDENT> def build(self): <NEW_LINE> <INDENT> input_placeholder, f...
Feature vector generation network for `gym.Space` samples.
62598fab63b5f9789fe85100
class AstroFCModel(astro_model.AstroModel): <NEW_LINE> <INDENT> def _build_local_fc_layers(self, inputs, hparams, scope): <NEW_LINE> <INDENT> if hparams.num_local_layers == 0: <NEW_LINE> <INDENT> return inputs <NEW_LINE> <DEDENT> net = inputs <NEW_LINE> with tf.variable_scope(scope): <NEW_LINE> <INDENT> if hparams.tran...
A model for classifying light curves using fully connected layers.
62598fabd486a94d0ba2bf68
class IPMAWeather(WeatherEntity): <NEW_LINE> <INDENT> def __init__(self, station, config): <NEW_LINE> <INDENT> self._station_name = config.get(CONF_NAME, station.local) <NEW_LINE> self._station = station <NEW_LINE> self._condition = None <NEW_LINE> self._forecast = None <NEW_LINE> self._description = None <NEW_LINE> <D...
Representation of a weather condition.
62598fab7b25080760ed7448
class VerletListHadressLennardJonesCappedLocal(InteractionLocal, interaction_VerletListHadressLennardJonesCapped): <NEW_LINE> <INDENT> def __init__(self, vl, fixedtupleList): <NEW_LINE> <INDENT> if not (pmi._PMIComm and pmi._PMIComm.isActive()) or pmi._MPIcomm.rank in pmi._PMIComm.getMPIcpugroup(): <NEW_LINE> <INDENT> ...
The (local) Lennard Jones interaction using Verlet lists.
62598fab627d3e7fe0e06e47
class GitHubPullRequestBackend(GitHubBackend): <NEW_LINE> <INDENT> def pull(self): <NEW_LINE> <INDENT> self.github_repository.get_issues(state='all') <NEW_LINE> return {}
A backend where change requests are stored as GitHub Pull Requests.
62598fab379a373c97d98fad
class ListFeatures(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def defaultFeatures(cls): <NEW_LINE> <INDENT> features = cls() <NEW_LINE> features.setCookieService(True) <NEW_LINE> features.setColumnSearch(True, True) <NEW_LINE> features.setColumnShowHide(True) <NEW_LINE> features.setSearchDialog(True) <NEW_LIN...
Represents features of the list which define, for instance, which elements should be displayed.
62598fab7047854f4633f374
class NoBodyError(Error): <NEW_LINE> <INDENT> pass
Error that indicates a send message request has no body.
62598fab99fddb7c1ca62db6
class CreateReviews(Command): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def setup_parser(subparser): <NEW_LINE> <INDENT> subparser.add_argument('--user', default='test1', help='username to submit as') <NEW_LINE> subparser.add_argument('--identity', default=None, help='ssh identity file used to authenticate as ' 'use...
Create some non-conflicting feature branches based off of master, submit each as a review, and optionally mark them approved and queued.
62598fab8e7ae83300ee903d
class Solution: <NEW_LINE> <INDENT> def bstToDoublyList(self, root): <NEW_LINE> <INDENT> dummy = DoublyListNode(0) <NEW_LINE> self.cur = dummy <NEW_LINE> self.helper(root) <NEW_LINE> return dummy.next <NEW_LINE> <DEDENT> def helper(self, node): <NEW_LINE> <INDENT> if node is None: <NEW_LINE> <INDENT> return <NEW_LINE> ...
@param root: The root of tree @return: the head of doubly list node
62598fabadb09d7d5dc0a526
class MultiFieldMultiSliceAliasTest(BfRuntimeTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> client_id = 0 <NEW_LINE> p4_name = "tna_field_slice" <NEW_LINE> BfRuntimeTest.setUp(self, client_id, p4_name) <NEW_LINE> self.table_name = "SwitchIngress.forward_multi_field_multi_slice_alias" <NEW_LINE> seed = ...
@brief This test adds entries to the table, sends packets which should miss and hit the entries and verifies, reads back the entries and verifies and finally deletes the entries
62598fab7047854f4633f375
class _TiffParser(object): <NEW_LINE> <INDENT> def __init__(self, ifd_entries): <NEW_LINE> <INDENT> super(_TiffParser, self).__init__() <NEW_LINE> self._ifd_entries = ifd_entries <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def parse(cls, stream): <NEW_LINE> <INDENT> stream_rdr = cls._make_stream_reader(stream) <NEW_LIN...
Parses a TIFF image stream to extract the image properties found in its main image file directory (IFD)
62598fab0c0af96317c5631e
class LineEndingTests(EditorConfigTestCase): <NEW_LINE> <INDENT> def test_check_crlf(self): <NEW_LINE> <INDENT> self.assertFileErrors('crlf_valid.txt', []) <NEW_LINE> self.assertFileErrors('crlf_invalid_cr.txt', [ "Final newline found", "Incorrect line ending found: cr", ]) <NEW_LINE> self.assertFileErrors('crlf_invali...
Tests for EditorConfigChecker line endings
62598fab7d847024c075c35f
class Permission(AbsPermission): <NEW_LINE> <INDENT> def __init__(self, perm=""): <NEW_LINE> <INDENT> self._perm = perm <NEW_LINE> <DEDENT> @property <NEW_LINE> def permission(self): <NEW_LINE> <INDENT> return self._perm <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self._perm <NEW_LINE> <DEDENT> de...
Permissions class
62598fab6aa9bd52df0d4e64
class Deck(Hand): <NEW_LINE> <INDENT> def populate(self): <NEW_LINE> <INDENT> self.cards = [] <NEW_LINE> for suit in Card.SUITS: <NEW_LINE> <INDENT> for rank in Card.RANKS: <NEW_LINE> <INDENT> self.add(Card(rank, suit)) <NEW_LINE> <DEDENT> <DEDENT> <DEDENT> def shuffle(self): <NEW_LINE> <INDENT> import random <NEW_LINE...
Колода игральных карт
62598fab4527f215b58e9e7d
class SDSSLogger(logging.Logger): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> super(SDSSLogger, self).__init__(name) <NEW_LINE> <DEDENT> def init(self, log_level=logging.INFO, capture_warnings=True): <NEW_LINE> <INDENT> self.setLevel(logging.DEBUG) <NEW_LINE> self.sh = logging.StreamHandler() <NEW...
Custom logging system. Parameters ---------- name : str The name of the logger. log_level : int The initial logging level for the console handler. capture_warnings : bool Whether to capture warnings and redirect them to the log.
62598fabdd821e528d6d8ed1
class StandardNS(object): <NEW_LINE> <INDENT> __snsHandler = dict() <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.__snsHandler["owl"] = self.__owlNamespace() <NEW_LINE> self.__snsHandler["rdf"] = self.__rdfNamespace() <NEW_LINE> self.__snsHandler["rdfs"] = self.__rdfsNamespace() <NEW_LINE> self.__snsHandler["...
Provides a dictionary of dictionaries containing all the needed tags for OWL, RDF, RDFS, XSD.
62598fabac7a0e7691f724a6
class person(): <NEW_LINE> <INDENT> country = '中国' <NEW_LINE> def __init__(self,name,age,sex,address): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.age = age <NEW_LINE> self.sex = sex <NEW_LINE> self.__address = address <NEW_LINE> <DEDENT> def getName(self): <NEW_LINE> <INDENT> print('我的名字叫%s,我来自%s,我住在%s!'%(sel...
这是一个人类
62598fab7d43ff24874273d0
class DiskOpUseSwap(BaseDiskOp): <NEW_LINE> <INDENT> swap_part = None <NEW_LINE> path = None <NEW_LINE> def __init__(self, device, swap_part): <NEW_LINE> <INDENT> BaseDiskOp.__init__(self, device) <NEW_LINE> self.swap_part = swap_part <NEW_LINE> self.path = self.swap_part.path <NEW_LINE> <DEDENT> def describe(self): <N...
Use an existing swap paritition
62598fab7cff6e4e811b59c8
class ControlShared(ControlBase): <NEW_LINE> <INDENT> meta_type = "ControlShared" <NEW_LINE> security = ClassSecurityInfo() <NEW_LINE> control_title = 'Shared' <NEW_LINE> security.declareProtected('View management screens', 'edit') <NEW_LINE> def edit(self, *args, **kw): <NEW_LINE> <INDENT> temp = ['<div class="">'] <N...
Show the status of which items are shared
62598fab45492302aabfc46d
class SetUpTest(): <NEW_LINE> <INDENT> fixtures = ['fixtures/simplemenu.json'] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.thumbnail = os.path.join(MODEL_DIR, "thumbnail.png") <NEW_LINE> self.thumbnail_content = open(self.thumbnail, 'rb') <NEW_LINE> self.file = os.path.join(MODEL_DIR, "example.model3") <NEW_LI...
SetUp for all Test Class
62598fab3d592f4c4edbae68
class DeltaFetch(object): <NEW_LINE> <INDENT> def __init__(self, dir, dbmodule='anydbm'): <NEW_LINE> <INDENT> self.dir = dir <NEW_LINE> self.dbmodule = __import__(dbmodule) <NEW_LINE> dispatcher.connect(self.spider_opened, signal=signals.spider_opened) <NEW_LINE> dispatcher.connect(self.spider_closed, signal=signals.sp...
This is a spider middleware to ignore requests to pages containing items seen in previous crawls of the same spider, thus producing a "delta crawl" containing only new items. This also speeds up the crawl, by reducing the number of requests that need to be crawled, and processed (typically, item requests are the most ...
62598fabd486a94d0ba2bf6a
class _S3(object): <NEW_LINE> <INDENT> def __init__(self, uri, s3=None, aws_access_key_id=None, aws_secret_access_key=None, *args, **kwargs): <NEW_LINE> <INDENT> result = urlparse(uri) <NEW_LINE> self.bucket = result.netloc <NEW_LINE> self.key = result.path.lstrip('/') <NEW_LINE> if s3 is not None: <NEW_LINE> <INDENT> ...
Parametrized S3 bucket Class Examples -------- >>> S3(CSV) <class 'into.backends.aws.S3(CSV)'>
62598fab5fc7496912d48250
class RegularGrammar(): <NEW_LINE> <INDENT> def __init__( self, initial_symbol: str="", productions: Dict[str, Set[str]]=None) -> None: <NEW_LINE> <INDENT> self._initial_symbol = initial_symbol <NEW_LINE> self._productions = productions if productions else {} <NEW_LINE> <DEDENT> def initial_symbol(self): <NEW_LINE> <IN...
Regular grammar object, it is represented as a dictionary, for each non terminal symbol of the grammar, there is a dictionary entry with the corresponding strings that it can derive. For example, the grammar: S -> aA | bB | a | b A -> aA | a B -> bB | b is represented as: { "S": {"aA", "bB", "a", "b"}, "A": {...
62598fab1b99ca400228f4fe
class idqCalibrationCheck(esUtils.EventSupervisorTask): <NEW_LINE> <INDENT> name = "idqCalibration" <NEW_LINE> def __init__(self, timeout, ifo, classifier, emailOnSuccess=[], emailOnFailure=[], emailOnException=[], logDir='.', logTag='iQ'): <NEW_LINE> <INDENT> self.ifo = ifo <NEW_LINE> self.classifier = classifier <NEW...
a check that iDQ reported historical calibration as expected
62598fab8a43f66fc4bf2118
class CurrentUser(_ApiResourceBase): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self._iface = self.get_client().user <NEW_LINE> super().__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return str(self.steam_id) <NEW_LINE> <DEDENT> @property <NEW_LINE...
Exposed methods related to a current Steam client user. Can be accessed through ``api.current_user``: .. code-block:: python user = api.current_user
62598fabf548e778e596b540
class FunctionBrowserTest(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 testInitShowTable(self): <NEW_LINE> <INDENT> myDialog = FunctionBrowser(PARENT) <NEW_LINE> myStr = myDialog.table.toNewline...
Tests for the function browser gui.
62598faba8370b77170f0378
class Download(DownloadRuntimeConfig,DownloadImpl): <NEW_LINE> <INDENT> def __init__(self,session,tdef): <NEW_LINE> <INDENT> DownloadImpl.__init__(self,session,tdef) <NEW_LINE> <DEDENT> def get_def(self): <NEW_LINE> <INDENT> return DownloadImpl.get_def(self) <NEW_LINE> <DEDENT> def set_state_callback(self,usercallback,...
Representation of a running BT download/upload A Download implements the DownloadConfigInterface which can be used to change download parameters are runtime (for selected parameters). cf. libtorrent torrent_handle
62598fab3346ee7daa337617
class ReplyToViewer: <NEW_LINE> <INDENT> def __init__(self, reply_to): <NEW_LINE> <INDENT> ctx = zmq.Context() <NEW_LINE> self.sock = ctx.socket(zmq.PAIR) <NEW_LINE> self.sock.linger = 1000 <NEW_LINE> self.sock.connect(reply_to) <NEW_LINE> _logger.debug(f"Connecting zmq.PAIR to {reply_to}") <NEW_LINE> self.pollout = zm...
A viewer which dumps to a given stream.
62598fab3317a56b869be519
class MoneyAgent(Agent): <NEW_LINE> <INDENT> def __init__(self, unique_id, model): <NEW_LINE> <INDENT> super().__init__(unique_id, model) <NEW_LINE> self.wealth = 1 <NEW_LINE> <DEDENT> def step(self): <NEW_LINE> <INDENT> if self.wealth == 0: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> other_agent = random.choice(sel...
An agent with fixed initial wealth
62598fab7047854f4633f376
class GtpError(Exception): <NEW_LINE> <INDENT> pass
Error reported by a command handler.
62598fab8e71fb1e983bba50
class MachineLearningComputeManagementClientConfiguration(Configuration): <NEW_LINE> <INDENT> def __init__( self, credential, subscription_id, **kwargs ): <NEW_LINE> <INDENT> if credential is None: <NEW_LINE> <INDENT> raise ValueError("Parameter 'credential' must not be None.") <NEW_LINE> <DEDENT> if subscription_id is...
Configuration for MachineLearningComputeManagementClient. Note that all parameters used to create this instance are saved as instance attributes. :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The Azure subscri...
62598fab1f037a2d8b9e408b
class TransparentPolicy(ABC): <NEW_LINE> <INDENT> def __init__(self, transparent_params): <NEW_LINE> <INDENT> if transparent_params is None: <NEW_LINE> <INDENT> transparent_params = set() <NEW_LINE> <DEDENT> unexpected_keys = set(transparent_params).difference(TRANSPARENCY_KEYS) <NEW_LINE> if unexpected_keys: <NEW_LINE...
Policy which returns its observations and/or activations in its call to self.predict :param transparent_params: (set) a subset of TRANSPARENCY_KEYS. If key is present, that data will be included in the transparency_dict returned in step_transparent.
62598fab32920d7e50bc5ff2
class UserViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = User.objects.all() <NEW_LINE> serializer_class = UserSerializer <NEW_LINE> permission_classes = (permissions.IsAuthenticatedOrReadOnly,) <NEW_LINE> http_method_names = ('get', 'put')
This viewset automatically provides `list` and `detail` actions.
62598fabcc0a2c111447afae
class GlanceUtilsTest(common.HeatTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(GlanceUtilsTest, self).setUp() <NEW_LINE> self.glance_client = mock.MagicMock() <NEW_LINE> con = utils.dummy_context() <NEW_LINE> c = con.clients <NEW_LINE> self.glance_plugin = c.client_plugin('glance') <NEW_LINE...
Basic tests for :module:'heat.engine.resources.clients.os.glance'.
62598fabe5267d203ee6b8a7
class WebResource: <NEW_LINE> <INDENT> def read_json(self): <NEW_LINE> <INDENT> return "Sample plain text as json." <NEW_LINE> <DEDENT> def read_html(self): <NEW_LINE> <INDENT> pass
An instance of this class wraps web data. While it has many output formats, the server can only read the json output.
62598fab66673b3332c30369
class bernoulliArm(): <NEW_LINE> <INDENT> def __init__(self, mean): <NEW_LINE> <INDENT> self.mean = mean <NEW_LINE> <DEDENT> def sample(self, t): <NEW_LINE> <INDENT> return np.random.binomial(p=self.mean, n=1)
Defines a Bernoulli arm
62598fab7cff6e4e811b59ca
class GetProfile(Requester): <NEW_LINE> <INDENT> def __init__(self, session, cid): <NEW_LINE> <INDENT> key = get_key(session, 'storage.msn.com', False) <NEW_LINE> Requester.__init__(self, session, 'http://www.msn.com/webservices/storage/w10/GetProfile', 'storage.msn.com', 443, '/storageservice/SchematizedStore.asmx', X...
make a request to get the nick and personal message
62598fab4e4d5625663723c4
class ImagePortletHelper(grok.CodeView): <NEW_LINE> <INDENT> grok.context(Interface) <NEW_LINE> grok.baseclass()
Expose stuff downloadable from the image portlet BLOBs.
62598fab3d592f4c4edbae6a
class TestOwnershipBase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user1 = get_user_model().objects.create_superuser( 'user1', 'user1@example.com', 'password' ) <NEW_LINE> self.user2 = get_user_model().objects.create_superuser( 'user2', 'user2@example.com', 'password' ) <NEW_LINE> self.cli...
Base test class creating some users.
62598fab5fc7496912d48251
class PluginInfo(object): <NEW_LINE> <INDENT> def __init__(self, infojson=None): <NEW_LINE> <INDENT> self._meta = 'IonPlugin Definition format 1.0' <NEW_LINE> self.name = None <NEW_LINE> self.version = "0.0" <NEW_LINE> self.allow_autorun = True <NEW_LINE> self.config = {} <NEW_LINE> self.runtypes = [] <NEW_LINE> self.f...
Class to encapsulate plugin introspection, to and from json block or plugin class instances
62598fab1b99ca400228f4ff
class NSNitroNserrInvalidnetmask(NSNitroCliErrors): <NEW_LINE> <INDENT> pass
Nitro error code 1111 Invalid netmask
62598fab8a43f66fc4bf211a
@override_settings(SEARCH_ENGINE="search.tests.utils.ForceRefreshElasticSearchEngine") <NEW_LINE> @override_settings(ELASTIC_SEARCH_IMPL=ErroringElasticImpl) <NEW_LINE> class ErroringElasticTests(TestCase, SearcherMixin): <NEW_LINE> <INDENT> def test_index_failure_bulk(self): <NEW_LINE> <INDENT> with patch('search.elas...
testing handling of elastic exceptions when they happen
62598fabf548e778e596b542
class Entry(models.Model): <NEW_LINE> <INDENT> topic = models.ForeignKey('Topic', on_delete=models.CASCADE) <NEW_LINE> text = models.TextField() <NEW_LINE> date_added = models.DateTimeField(auto_now_add=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name_plural = 'entries' <NEW_LINE> <DEDENT> def __str__(self...
Информация, изученная пользователем по теме
62598fab76e4537e8c3ef54c
class ComputeHealthChecksListRequest(_messages.Message): <NEW_LINE> <INDENT> filter = _messages.StringField(1) <NEW_LINE> maxResults = _messages.IntegerField(2, variant=_messages.Variant.UINT32, default=500) <NEW_LINE> orderBy = _messages.StringField(3) <NEW_LINE> pageToken = _messages.StringField(4) <NEW_LINE> project...
A ComputeHealthChecksListRequest object. Fields: filter: Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING. The FIELD_NAME is the name of the field you want to compare. Only atomi...
62598fabf548e778e596b543
class ByteArray(AppMessageType): <NEW_LINE> <INDENT> type = AppMessageTuple.Type.ByteArray
Represents a uint8_t *
62598fabf7d966606f747f83
class InputBoolean(ToggleEntity, RestoreEntity): <NEW_LINE> <INDENT> def __init__(self, config: typing.Optional[dict], from_yaml: bool = False): <NEW_LINE> <INDENT> self._config = config <NEW_LINE> self._editable = True <NEW_LINE> self._state = config.get(CONF_INITIAL) <NEW_LINE> if from_yaml: <NEW_LINE> <INDENT> self....
Representation of a boolean input.
62598fab2ae34c7f260ab080
class JSON: <NEW_LINE> <INDENT> def __init__(self, json: str, indent: int = 2, highlight: bool = True) -> None: <NEW_LINE> <INDENT> data = loads(json) <NEW_LINE> json = dumps(data, indent=indent) <NEW_LINE> highlighter = JSONHighlighter() if highlight else NullHighlighter() <NEW_LINE> self.text = highlighter(json) <NEW...
A renderable which pretty prints JSON. Args: json (str): JSON encoded data. indent (int, optional): Number of characters to indent by. Defaults to 2. highlight (bool, optional): Enable highlighting. Defaults to True.
62598fab379a373c97d98fb1
class ServiceError(Exception): <NEW_LINE> <INDENT> def __init__(self, message, result=None): <NEW_LINE> <INDENT> Exception.__init__(self, message) <NEW_LINE> self.result = result
Raised when a service error occurs.
62598fab38b623060ffa9038
class LinkedImageConversionParser(ResolveUIDAndCaptionFilter): <NEW_LINE> <INDENT> def __init__(self, target='images', sourcedomain=''): <NEW_LINE> <INDENT> ResolveUIDAndCaptionFilter.__init__(self) <NEW_LINE> self.items = [] <NEW_LINE> self.target = target <NEW_LINE> self.sourcedomain = sourcedomain <NEW_LINE> <DEDENT...
Eventuell plone.outputfilters_captioned_image überschreiben: snippet für images
62598fab3317a56b869be51a
class UserViewSet(DRFCacheMixin, viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> queryset = ( User.objects .select_related('department', 'administrative_department') .prefetch_related('groups') .all() .order_by('id') ) <NEW_LINE> serializer_class = auth.serializers.UserSerializer <NEW_LINE> permission_classes = ( a...
Create API views for User.
62598fab0c0af96317c56321
class MergeSort(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def sort(arr): <NEW_LINE> <INDENT> if not arr: <NEW_LINE> <INDENT> raise EmptyArray("Array is empty") <NEW_LINE> <DEDENT> elif not is_sortable(arr[0]): <NEW_LINE> <INDENT> raise IsNotSortable("No order for the object defined") <NEW_LINE> <DEDENT> els...
Merge Sort class for sortable objects. Sorts using divide and conquer
62598fab5fdd1c0f98e5df36
class Command(object): <NEW_LINE> <INDENT> def __init__(self, obj): <NEW_LINE> <INDENT> self._obj = obj <NEW_LINE> <DEDENT> def execute(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def undo(self): <NEW_LINE> <INDENT> raise NotImplementedError
Command interface
62598fab91f36d47f2230e75
class xDataProvider(ABC): <NEW_LINE> <INDENT> def __init__(self, name:str): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> <DEDENT> @abstractproperty <NEW_LINE> def texts(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractproperty <NEW_LINE> def names(self): <NEW_LINE> <INDENT> pass
- interface to data lakes
62598fab32920d7e50bc5ff4
class Variable: <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> <DEDENT> def inspect(self): <NEW_LINE> <INDENT> return str(self) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "#<Var: {}>".format(self.name)
The Variable data structure. Represents variables in States, and only holds a variable name to refer to variables.
62598fab167d2b6e312b6f11
class MappingTests(CollectionWithEmptyTests, EqualityTests): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def relabel(annotation): <NEW_LINE> <INDENT> if annotation == ElementT: <NEW_LINE> <INDENT> return KeyT <NEW_LINE> <DEDENT> return annotation <NEW_LINE> <DEDENT> def test_generic_2110_equality_definition( self, a: ...
The property tests of collections.abc.Mapping.
62598fab30bbd72246469948
@six.add_metaclass(abc.ABCMeta) <NEW_LINE> class PvmVifDriver(object): <NEW_LINE> <INDENT> def __init__(self, adapter, host_uuid, instance): <NEW_LINE> <INDENT> self.adapter = adapter <NEW_LINE> self.host_uuid = host_uuid <NEW_LINE> self.instance = instance <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def plug(se...
Represents an abstract class for a PowerVM Vif Driver. A VIF Driver understands a given virtual interface type (network). It understands how to plug and unplug a given VIF for a virtual machine.
62598fab435de62698e9bd96
class TempoEvaluation(EvaluationMixin): <NEW_LINE> <INDENT> METRIC_NAMES = [ ('pscore', 'P-score'), ('any', 'one tempo correct'), ('all', 'both tempi correct'), ('acc1', 'Accuracy 1'), ('acc2', 'Accuracy 2') ] <NEW_LINE> def __init__(self, detections, annotations, tolerance=TOLERANCE, double=DOUBLE, triple=TRIPLE, sort...
Tempo evaluation class. Parameters ---------- detections : str, list of tuples or numpy array Detected tempi (rows) and their strengths (columns). If a file name is given, load them from this file. annotations : str, list or numpy array Annotated ground truth tempi (rows) and their strengths (columns). ...
62598fab67a9b606de545f6c
class WordFunction(Function): <NEW_LINE> <INDENT> def __init__(self, function, value, size, *args, **kwargs): <NEW_LINE> <INDENT> super(WordFunction, self).__init__(*args, **kwargs) <NEW_LINE> self.function = function <NEW_LINE> self.value = value <NEW_LINE> self.size = size <NEW_LINE> <DEDENT> def __str__(self): <NEW_...
A function applied on a word.
62598fab60cbc95b063642ee
class Path(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'is_directory': {'key': 'isDirectory', 'type': 'bool'}, 'last_modified': {'key': 'lastModified', 'type': 'str'}, 'e_tag': {'key': 'eTag', 'type': 'str'}, 'content_length': {'key': 'contentLength', 'typ...
Path. :ivar name: :vartype name: str :ivar is_directory: :vartype is_directory: bool :ivar last_modified: :vartype last_modified: str :ivar e_tag: :vartype e_tag: str :ivar content_length: :vartype content_length: long :ivar owner: :vartype owner: str :ivar group: :vartype group: str :ivar permissions: :vartype permis...
62598fab097d151d1a2c0fc9
class TwitterGeo(models.Model): <NEW_LINE> <INDENT> tweet = models.ForeignKey(Tweet) <NEW_LINE> type = models.CharField(max_length=25) <NEW_LINE> latitude = models.CharField(max_length=25) <NEW_LINE> longitude = models.CharField(max_length=25)
Geo coordinate information entered about individual tweets. Going with char fields on the lat/longs for expediency.
62598fab4f88993c371f04da
@python_2_unicode_compatible <NEW_LINE> class DocumentPageContent(models.Model): <NEW_LINE> <INDENT> document_page = models.OneToOneField( DocumentPage, related_name='ocr_content', verbose_name=_('Document page') ) <NEW_LINE> content = models.TextField(blank=True, verbose_name=_('Content')) <NEW_LINE> def __str__(self)...
Model that describes a document page content
62598fab63b5f9789fe85106
class RemoteBranchLockableFiles(LockableFiles): <NEW_LINE> <INDENT> def __init__(self, bzrdir, _client): <NEW_LINE> <INDENT> self.controldir = bzrdir <NEW_LINE> self._client = _client <NEW_LINE> self._need_find_modes = True <NEW_LINE> LockableFiles.__init__( self, bzrdir.get_branch_transport(None), 'lock', lockdir.Lock...
A 'LockableFiles' implementation that talks to a smart server. This is not a public interface class.
62598fabd486a94d0ba2bf6e
class TransactionError(NotStandardError): <NEW_LINE> <INDENT> pass
Error en la transacción
62598fab090684286d5936ac
class ListFoldersContinueArg(bb.Struct): <NEW_LINE> <INDENT> __slots__ = [ '_cursor_value', ] <NEW_LINE> _has_required_fields = True <NEW_LINE> def __init__(self, cursor=None): <NEW_LINE> <INDENT> self._cursor_value = bb.NOT_SET <NEW_LINE> if cursor is not None: <NEW_LINE> <INDENT> self.cursor = cursor <NEW_LINE> <DEDE...
:ivar sharing.ListFoldersContinueArg.cursor: The cursor returned by the previous API call specified in the endpoint description.
62598fab32920d7e50bc5ff5
class TestPathResponseResultResponseDetailedStatus(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 testPathResponseResultResponseDetailedStatus(self): <NEW_LINE> <INDENT> pass
PathResponseResultResponseDetailedStatus unit test stubs
62598fab460517430c43202d
class CheckinDetailsInputSet(InputSet): <NEW_LINE> <INDENT> def set_CheckinID(self, value): <NEW_LINE> <INDENT> super(CheckinDetailsInputSet, self)._set_input('CheckinID', value) <NEW_LINE> <DEDENT> def set_OauthToken(self, value): <NEW_LINE> <INDENT> super(CheckinDetailsInputSet, self)._set_input('OauthToken', value) ...
An InputSet with methods appropriate for specifying the inputs to the CheckinDetails Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
62598fab3cc13d1c6d46570c
class ProductInfoPic(models.Model): <NEW_LINE> <INDENT> ClassOne = models.ForeignKey('ClassOne') <NEW_LINE> ClassTwo = models.ForeignKey('ClassTwo') <NEW_LINE> Product = models.ForeignKey('Products') <NEW_LINE> Picture = models.ImageField(upload_to='product_info_picture') <NEW_LINE> ImageName = models.CharField(max_len...
产品详细介绍图片表格。 ClassOne:隶属的第一级别的类; ClassTwo:隶属的第二级别的类; Product:隶属产品; Picture:图片路径; ImageName:图片名称;
62598fabd486a94d0ba2bf6f