code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Client(object): <NEW_LINE> <INDENT> def __init__(self, client=None): <NEW_LINE> <INDENT> self.swagger_types = { 'client': 'str' } <NEW_LINE> self.attribute_map = { 'client': 'client' } <NEW_LINE> self._client = client <NEW_LINE> <DEDENT> @property <NEW_LINE> def client(self): <NEW_LINE> <INDENT> return self._clie... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 625990743317a56b869bf1db |
class CustomCFG: <NEW_LINE> <INDENT> def __init__(self, pg_db_mod): <NEW_LINE> <INDENT> dsn = pg_db_mod.dsn() <NEW_LINE> self.db_name = dsn['database'] <NEW_LINE> self.db_user = dsn['user'] <NEW_LINE> self.db_pass = None <NEW_LINE> self.db_host = dsn['host'] <NEW_LINE> self.db_port = dsn['port'] <NEW_LINE> self.db_ssl_... | Custom config class to override DB config with | 625990747c178a314d78e881 |
class RDose(RPackage): <NEW_LINE> <INDENT> homepage = "https://bioconductor.org/packages/DOSE" <NEW_LINE> git = "https://git.bioconductor.org/packages/DOSE.git" <NEW_LINE> version('3.16.0', commit='a534a4f2ef1e54e8b92079cf1bbedb5042fd90cd') <NEW_LINE> version('3.10.2', commit='5ea51a2e2a04b4f3cc974cecb4537e14efd6a... | Disease Ontology Semantic and Enrichment analysis
This package implements five methods proposed by Resnik, Schlicker,
Jiang, Lin and Wang respectively for measuring semantic similarities
among DO terms and gene products. Enrichment analyses including
hypergeometric model and gene set enrichment analysis are also
imple... | 6259907463b5f9789fe86a91 |
class NonlinearBoundaryValueSolver: <NEW_LINE> <INDENT> def __init__(self, problem): <NEW_LINE> <INDENT> logger.debug('Beginning NLBVP instantiation') <NEW_LINE> self.problem = problem <NEW_LINE> self.domain = domain = problem.domain <NEW_LINE> self.iteration = 0 <NEW_LINE> self.pencils = pencil.build_pencils(domain) <... | Nonlinear boundary value problem solver.
Parameters
----------
problem : problem object
Problem describing system of differential equations and constraints
Attributes
----------
state : system object
System containing solution fields (after solve method is called) | 6259907492d797404e3897f1 |
class SkiaBuildbotPageSet(page_set_module.PageSet): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(SkiaBuildbotPageSet, self).__init__( user_agent_type='tablet', credentials_path = 'data/credentials.json', archive_data_file='data/skia_cuteoverload_nexus10.json') <NEW_LINE> urls_list = [ 'http://cuteo... | Pages designed to represent the median, not highly optimized web | 625990745fdd1c0f98e5f8aa |
class CategoryRelation(models.Model): <NEW_LINE> <INDENT> category = models.ForeignKey(Category, verbose_name=_('category'), on_delete=models.CASCADE) <NEW_LINE> content_type = models.ForeignKey( ContentType, on_delete=models.CASCADE, limit_choices_to=CATEGORY_RELATION_LIMITS, verbose_name=_('content type')) <NEW_LINE>... | Related category item | 62599074a17c0f6771d5d842 |
class FileModel(QFileSystemModel): <NEW_LINE> <INDENT> RE_UN_LoadSignal = pyqtSignal(object) <NEW_LINE> AutoStartSignal = pyqtSignal(object) <NEW_LINE> def __init__(self , manager=None , *a, **kw): <NEW_LINE> <INDENT> super(FileModel,self).__init__(*a,**kw ) <NEW_LINE> self.manager = manager <NEW_LINE> <DEDENT> def co... | 继承QFileSystemModel. | 625990748e7ae83300eea9be |
class Layer(object): <NEW_LINE> <INDENT> def __init__(self, incoming, name=None): <NEW_LINE> <INDENT> if isinstance(incoming, tuple): <NEW_LINE> <INDENT> self.input_shape = incoming <NEW_LINE> self.input_layer = None <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.input_shape = incoming.output_shape <NEW_LINE> self.... | The :class:`Layer` class represents a single layer of a neural network. It
should be subclassed when implementing new types of layers.
Because each layer can keep track of the layer(s) feeding into it, a
network's output :class:`Layer` instance can double as a handle to the full
network.
Parameters
----------
incomin... | 62599074091ae35668706565 |
class Vector2d: <NEW_LINE> <INDENT> type_code = 'd' <NEW_LINE> def __init__(self, x, y): <NEW_LINE> <INDENT> self.x = float(x) <NEW_LINE> self.y = float(y) <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return (i for i in (self.x, self.y)) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> class_n... | A class to emulate a Python numeric type,
in this case a 2d vector | 62599074283ffb24f3cf51d7 |
class Point(TimeStamp): <NEW_LINE> <INDENT> services = [ u"break", u"hold" ] <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> print("Point.__init__() called.") <NEW_LINE> self.offence = 0 <NEW_LINE> self.pull = None <NEW_LINE> self.sequences = [] <NEW_LINE> super(Point, self).__init__(**kwargs) <NEW_LINE> <... | Point is a length of sequences between goals. | 6259907432920d7e50bc7974 |
class Tweet_Generator: <NEW_LINE> <INDENT> def __init__(self, markov, starters): <NEW_LINE> <INDENT> self.markov = markov <NEW_LINE> self.starters = starters <NEW_LINE> <DEDENT> def pick_word_from(self): <NEW_LINE> <INDENT> accumulator = 0 <NEW_LINE> seperators = [] <NEW_LINE> words = self.markov.keys() <NEW_LINE> for ... | generates tweets using a pickled markov chain file and sentence starters | 6259907497e22403b383c830 |
class NearestNeighbor(Approach): <NEW_LINE> <INDENT> name = 'Nearest Neighbor Approach' <NEW_LINE> def guess(self, data, *_): <NEW_LINE> <INDENT> return data[0].values | Returns the values of the closest given sample data. | 6259907491f36d47f2231b25 |
class PredictorFactory(object): <NEW_LINE> <INDENT> def __init__(self, sess, model, towers): <NEW_LINE> <INDENT> self.sess = sess <NEW_LINE> self.model = model <NEW_LINE> self.towers = towers <NEW_LINE> self.tower_built = False <NEW_LINE> <DEDENT> def get_predictor(self, input_names, output_names, tower): <NEW_LINE> <I... | Make predictors for a trainer | 625990741b99ca40022901cc |
class UserFriendTestCase(APITestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> User.objects.create_user(username="test1",password="test",email="[email protected]") <NEW_LINE> User.objects.create_user(username="test2",password="test",email="[email protected]") <NEW_LINE> <DEDENT> def test_add_friend(self): <N... | test user-friend interaction | 625990748e7ae83300eea9bf |
class Pinnacle(CrawlSpider): <NEW_LINE> <INDENT> name = 'pinnacle' <NEW_LINE> allowed_domains = ["www.pinnacle.com"] <NEW_LINE> start_urls = ["https://www.pinnacle.com/en/"] <NEW_LINE> rules = ( Rule(LxmlLinkExtractor(allow="odds/match/e-sports/", allow_domains=allowed_domains, restrict_css="ul li.level-2", unique=True... | Spider for extracting links, following them and parsing data from response.
Note: we using here a generic scrapy spider "CrawlSpider" (instead of "scrapy.Spider")
and set of rules to extract only "required" urls. | 625990745fc7496912d48f00 |
class Translation(object): <NEW_LINE> <INDENT> def __init__(self, translation_output): <NEW_LINE> <INDENT> self.translation_output = translation_output <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def _from_dict(cls, _dict): <NEW_LINE> <INDENT> args = {} <NEW_LINE> if 'translation' in _dict or 'translation_output' in _d... | Translation.
:attr str translation_output: Translation output in UTF-8. | 625990747d43ff24874280aa |
class GISServerManager: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.vampire = VampireDefaults.VampireDefaults() <NEW_LINE> return <NEW_LINE> <DEDENT> def upload_to_GIS_server(self, product, input_file, input_dir, input_pattern, start_date, end_date, vp): <NEW_LINE> <INDENT> gisserver.upload_to_GIS_... | Base Class for managing uploading of products to GIS server | 625990744f88993c371f11b7 |
class Assignment(base.Assignment): <NEW_LINE> <INDENT> implements(IGalleryPortlet) <NEW_LINE> def __init__(self, path='/', count=5): <NEW_LINE> <INDENT> self.count = count <NEW_LINE> self.path = path <NEW_LINE> <DEDENT> @property <NEW_LINE> def title(self): <NEW_LINE> <INDENT> return "Gallery Portlet" <NEW_LINE> <DEDEN... | Portlet assignment.
This is what is actually managed through the portlets UI and associated
with columns. | 62599074442bda511e95d9ee |
class User(BaseModel): <NEW_LINE> <INDENT> email = "" <NEW_LINE> password = "" <NEW_LINE> first_name = "" <NEW_LINE> last_name = "" | class user | 625990744527f215b58eb637 |
class ResultMixin(object): <NEW_LINE> <INDENT> @property <NEW_LINE> def username(self): <NEW_LINE> <INDENT> netloc = self.netloc <NEW_LINE> if "@" in netloc: <NEW_LINE> <INDENT> userinfo = netloc.rsplit("@", 1)[0] <NEW_LINE> if ":" in userinfo: <NEW_LINE> <INDENT> userinfo = userinfo.split(":", 1)[0] <NEW_LINE> <DEDENT... | Shared methods for the parsed result objects. | 625990747d847024c075dd08 |
class WebUtilsTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_cors(self): <NEW_LINE> <INDENT> app = flask.Flask(__name__) <NEW_LINE> app.testing = True <NEW_LINE> @app.route('/xxx') <NEW_LINE> @webutils.cors(origin='*', content_type='application/json') <NEW_LINE> def handler_unused(): <NEW_LINE> <INDENT> return f... | Tests for teadmill.webutils. | 6259907456b00c62f0fb41fe |
class ForkedClient(): <NEW_LINE> <INDENT> def __init__(self, ip, port): <NEW_LINE> <INDENT> self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) <NEW_LINE> self.sock.connect((ip, port)) <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> current_process_id = os.getpid() <NEW_LINE> print('PID %s Sending echo... | A client for the forking server | 625990743317a56b869bf1dc |
class UserTheme(Theme): <NEW_LINE> <INDENT> REQUIRED_CONFIG_KEYS = ['docclass', 'wrapperclass'] <NEW_LINE> OPTIONAL_CONFIG_KEYS = ['papersize', 'pointsize', 'toplevel_sectioning'] <NEW_LINE> def __init__(self, name: str, filename: str) -> None: <NEW_LINE> <INDENT> super().__init__(name) <NEW_LINE> self.config = configp... | A user defined LaTeX theme. | 625990749c8ee82313040e1e |
class TestFieldEActivesessionWeekdaystart(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 testFieldEActivesessionWeekdaystart(self): <NEW_LINE> <INDENT> pass | FieldEActivesessionWeekdaystart unit test stubs | 62599074379a373c97d9a950 |
class TestResponseContainerUserGroupModel(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 testResponseContainerUserGroupModel(self): <NEW_LINE> <INDENT> pass | ResponseContainerUserGroupModel unit test stubs | 6259907456ac1b37e6303979 |
class com_Item: <NEW_LINE> <INDENT> def __init__(self, weight = 0.0, volume = 0.0, use_function = None, value = None): <NEW_LINE> <INDENT> self.weight = weight <NEW_LINE> self.volume = volume <NEW_LINE> self.value = value <NEW_LINE> self.use_function = use_function <NEW_LINE> <DEDENT> def pick_up(self, actor): <NEW_LIN... | Items are components that can be picked up and used.
Attributes:
weight (arg, float): how much does the item weigh
volume (arg, float): how much space does the item take up | 625990748e7ae83300eea9c0 |
class ConnectivityPass(Pass): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ConnectivityPass, self).__init__(core, connectivity) <NEW_LINE> self.edgeless_top = normpath('continuity') <NEW_LINE> self.edgeless_block_dir = self.src_block_dir.replace(core, continuity) <NEW_LINE> self.block_subpath = sel... | The pass for the Connectivity (CTM) pass. Each continuity texture requires both edged and edgeless blocks. The
edgless blocks are taken from the previously-generated Continuity pack. | 62599074627d3e7fe0e087b7 |
class plan_t: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.title = None; <NEW_LINE> self.wpts = []; <NEW_LINE> <DEDENT> def append(self, wpt): <NEW_LINE> <INDENT> self.wpts.append(wpt); | plan_t is a flight plan. | 62599074fff4ab517ebcf145 |
class IPatternsSettingsRenderer(Interface): <NEW_LINE> <INDENT> pass | Interface for the adapter that renders the settings for patterns
| 625990741b99ca40022901cd |
class JobModel(SubModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> model = [ ("user", "user", str, ""), ("file", ("file", "display"), str, ""), ("path", ("file", "path"), str, ""), ("size", ("file", "size"), int, 0), ("estTime", ("estimatedPrintTime"), float, 0.0), ("fl0", ("filament", "tool0", "leng... | A Job Model. | 625990745fc7496912d48f01 |
class Monsoon(_DevlibContinuousEnergyMeter): <NEW_LINE> <INDENT> def __init__(self, target, conf, res_dir): <NEW_LINE> <INDENT> super(Monsoon, self).__init__(target, res_dir) <NEW_LINE> self._instrument = devlib.MonsoonInstrument(self._target, **conf['conf']) <NEW_LINE> self._instrument.reset() | Monsoon Solutions energy monitor | 625990743539df3088ecdbc6 |
class TestAnonymousSurvey(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> question = "What language did you first learn to speak?" <NEW_LINE> self.my_survey = AnonymousSurvey(question) <NEW_LINE> self.responses = ['English', 'Spanish', 'Mandarin'] <NEW_LINE> <DEDENT> def test_store_single_r... | Tests for class AnonymousSurvey | 62599074aad79263cf4300e7 |
class FLS(Enum): <NEW_LINE> <INDENT> FLS_2 = 2 <NEW_LINE> FLS_4 = 4 <NEW_LINE> FLS_8 = 8 <NEW_LINE> FLS_16 = 16 | Allowed parameters' values for FLS.
Accelerometer's full scale. | 625990744f6381625f19a142 |
class Student(models.Model): <NEW_LINE> <INDENT> customer = models.ForeignKey('CustomerInfo',on_delete=None) <NEW_LINE> class_grade = models.ManyToManyField('ClassList') | 学员表 | 6259907456b00c62f0fb4200 |
class ModernaFragment5(ModernaFragment): <NEW_LINE> <INDENT> def __init__(self, struc, anchor5=None, new_sequence=None, sup_r5=LIR_SUPERPOSITION5, build_rule=ALL_FROM_MODEL, keep=keep_nothing, strict=True): <NEW_LINE> <INDENT> ModernaFragment.__init__(self, struc, new_sequence, keep, stric... | Fragment connected to the model by one residue on its 5' end. | 62599074dd821e528d6da61a |
class Bayes(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def predict(self,predict_ex): <NEW_LINE> <INDENT> probs = [] <NEW_LINE> probs.append(self.get_probability_per_class(predict_ex, ut.YES)*self.get_probability_for_class(ut.YES)) <NEW_LINE> probs.append(self.get_proba... | constructor. | 62599074e1aae11d1e7cf4a6 |
class TestMetricUnit(unittest.TestCase): <NEW_LINE> <INDENT> def test_has_same_unit_with(self): <NEW_LINE> <INDENT> unit1 = MetricUnit('kg m/s^2') <NEW_LINE> unit2 = MetricUnit('m s^-2 kg') <NEW_LINE> self.assertEqual(unit1, unit2) <NEW_LINE> <DEDENT> def test_to_SI_base(self): <NEW_LINE> <INDENT> unit = MetricUnit('N'... | A test case for MetricUnit class. | 62599074be8e80087fbc09c2 |
class TestTitle: <NEW_LINE> <INDENT> def test_title_returns_str(self): <NEW_LINE> <INDENT> assert isinstance(filters.title('foo bar'), str) <NEW_LINE> <DEDENT> def test_title_word(self): <NEW_LINE> <INDENT> assert filters.title('foo bar') == 'Foo bar' <NEW_LINE> <DEDENT> def test_title_capitalize(self): <NEW_LINE> <IND... | All tests for title function. | 62599074ad47b63b2c5a917e |
class UpdateEditChannelMessage(TLObject): <NEW_LINE> <INDENT> __slots__: List[str] = ["message", "pts", "pts_count"] <NEW_LINE> ID = 0x1b3f4df7 <NEW_LINE> QUALNAME = "types.UpdateEditChannelMessage" <NEW_LINE> def __init__(self, *, message: "raw.base.Message", pts: int, pts_count: int) -> None: <NEW_LINE> <INDENT> self... | This object is a constructor of the base type :obj:`~pyrogram.raw.base.Update`.
Details:
- Layer: ``122``
- ID: ``0x1b3f4df7``
Parameters:
message: :obj:`Message <pyrogram.raw.base.Message>`
pts: ``int`` ``32-bit``
pts_count: ``int`` ``32-bit`` | 625990744a966d76dd5f081b |
class CTCTrainer(Trainer): <NEW_LINE> <INDENT> def compute_loss(self, targets, logits, logit_seq_length, target_seq_length): <NEW_LINE> <INDENT> batch_size = int(target_seq_length.get_shape()[0]) <NEW_LINE> indices = tf.concat(0, [tf.concat(1, [tf.tile([s], target_seq_length[s]) , tf.range(target_seq_length[s])]) for s... | A trainer that minimises the CTC loss, the output sequences | 62599074aad79263cf4300e8 |
class InstanceGroupsScopedList(_messages.Message): <NEW_LINE> <INDENT> class WarningValue(_messages.Message): <NEW_LINE> <INDENT> class CodeValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> CLEANUP_FAILED = 0 <NEW_LINE> DEPRECATED_RESOURCE_USED = 1 <NEW_LINE> DISK_SIZE_LARGER_THAN_IMAGE_SIZE = 2 <NEW_LINE> FIELD_VAL... | A InstanceGroupsScopedList object.
Messages:
WarningValue: [Output Only] An informational warning that replaces the
list of instance groups when the list is empty.
Fields:
instanceGroups: [Output Only] The list of instance groups that are
contained in this scope.
warning: [Output Only] An informational ... | 6259907401c39578d7f143cd |
class PigOperator(BaseOperator): <NEW_LINE> <INDENT> template_fields = ('pig',) <NEW_LINE> template_ext = ('.pig', '.piglatin',) <NEW_LINE> ui_color = '#f0e4ec' <NEW_LINE> @apply_defaults <NEW_LINE> def __init__( self, pig: str, pig_cli_conn_id: str = 'pig_cli_default', pigparams_jinja_translate: bool = False, pig_opts... | Executes pig script.
:param pig: the pig latin script to be executed. (templated)
:type pig: str
:param pig_cli_conn_id: reference to the Hive database
:type pig_cli_conn_id: str
:param pigparams_jinja_translate: when True, pig params-type templating
${var} gets translated into jinja-type templating {{ var }}. Not... | 625990741b99ca40022901ce |
class Pessoa: <NEW_LINE> <INDENT> def __init__(self, nome: str, idade: int): <NEW_LINE> <INDENT> self.nome = nome <NEW_LINE> self.dade = idade | - Classe para representar os dados de uma **Pessoa** | 62599074009cb60464d02e6c |
class IdentifierType(db.Model): <NEW_LINE> <INDENT> id = db.Column( db.Integer, primary_key=True ) <NEW_LINE> name = db.Column( db.String, nullable=False, unique=True, index=True ) <NEW_LINE> description = db.Column( db.String, nullable=False ) <NEW_LINE> url = db.Column( db.String, nullable=False ) <NEW_LINE> example_... | Represents an identifier type.
An Identifier Type is a persistent identifier type that can be used in
claims by claimants. | 62599074f548e778e596cec0 |
class BaseSchema(base_schema.ObjType, MappingSchema): <NEW_LINE> <INDENT> on = SchemaNode(Bool(), missing=drop) <NEW_LINE> output_zero_step = SchemaNode(Bool()) <NEW_LINE> output_last_step = SchemaNode(Bool()) <NEW_LINE> output_timestep = SchemaNode(extend_colander.TimeDelta(), missing=drop) <NEW_LINE> output_start_tim... | Base schema for all outputters - they all contain the following | 625990741f5feb6acb164526 |
class DjangoBookWriter(IWriter): <NEW_LINE> <INDENT> def __init__(self, exporter, _, **keywords): <NEW_LINE> <INDENT> self.importer = exporter <NEW_LINE> self._keywords = keywords <NEW_LINE> <DEDENT> def create_sheet(self, sheet_name): <NEW_LINE> <INDENT> sheet_writer = None <NEW_LINE> model = self.importer.get(sheet_n... | write data into django models | 6259907423849d37ff8529e9 |
class PrimeNumbers(unittest.TestCase): <NEW_LINE> <INDENT> def test_case(self): <NEW_LINE> <INDENT> generator = primes.prime_numbers() <NEW_LINE> first_ten_primes = [next(generator) for x in range(10)] <NEW_LINE> canonical_values = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29] <NEW_LINE> self.assertEqual(first_ten_primes, canon... | tests for Utilities.primes.prime_numbers | 625990745fdd1c0f98e5f8b0 |
class CurvedRefraction(RayTransferMatrix): <NEW_LINE> <INDENT> def __init__(self, R, n1, n2): <NEW_LINE> <INDENT> R, n1 , n2 = sympify((R, n1, n2)) <NEW_LINE> RayTransferMatrix.__init__(self, 1, 0, (n1-n2)/R/n2, n1/n2) | Ray Transfer Matrix for refraction on curved interface.
Parameters
==========
R: radius of curvature (positive for concave),
n1: refractive index of one medium
n2: refractive index of other medium
See Also
========
RayTransferMatrix
Examples
========
>>> from sympy.physics.gaussopt import CurvedRefraction
>>> fro... | 62599074379a373c97d9a954 |
class IContentNavigation(IPortletDataProvider): <NEW_LINE> <INDENT> pass | Memberships Portlet | 625990747047854f46340ceb |
class WaterbutlerLink(Link): <NEW_LINE> <INDENT> def __init__(self, must_be_file=None, must_be_folder=None, **kwargs): <NEW_LINE> <INDENT> self.kwargs = kwargs <NEW_LINE> self.must_be_file = must_be_file <NEW_LINE> self.must_be_folder = must_be_folder <NEW_LINE> <DEDENT> def resolve_url(self, obj, request): <NEW_LINE> ... | Link object to use in conjunction with Links field. Builds a Waterbutler URL for files.
| 62599074a05bb46b3848bdc4 |
@implementer_if_needed(INativeString, IFromUnicode, IFromBytes) <NEW_LINE> class NativeString(Text if PY3 else Bytes): <NEW_LINE> <INDENT> _type = str <NEW_LINE> if PY3: <NEW_LINE> <INDENT> def fromBytes(self, value): <NEW_LINE> <INDENT> value = value.decode('utf-8') <NEW_LINE> self.validate(value) <NEW_LINE> return va... | A native string is always the type `str`.
In addition to :class:`~zope.schema.interfaces.INativeString`,
this implements :class:`~zope.schema.interfaces.IFromUnicode` and
:class:`~zope.schema.interfaces.IFromBytes`.
.. versionchanged:: 4.9.0
This is now a distinct type instead of an alias for either `Text` or `Byt... | 625990742ae34c7f260aca17 |
class GetGroupByName(IcontrolRestCommand): <NEW_LINE> <INDENT> def __init__(self, group_name, *args, **kwargs): <NEW_LINE> <INDENT> super(GetGroupByName, self).__init__(*args, **kwargs) <NEW_LINE> self.group_name = group_name <NEW_LINE> <DEDENT> def setup(self): <NEW_LINE> <INDENT> group = None <NEW_LINE> groupsresp = ... | Get Device Groups by Group Name
Type: GET
@param group_name: group name
@type group_name: string
@return: the api resp or None if there is no such group
@rtype: attr dict json or None | 62599074be8e80087fbc09c4 |
class SellarDis1(om.ExplicitComponent): <NEW_LINE> <INDENT> def setup(self): <NEW_LINE> <INDENT> self.add_input('z', val=np.zeros(2)) <NEW_LINE> self.add_input('x', val=0.) <NEW_LINE> self.add_input('y2', val=1.0) <NEW_LINE> self.add_output('y1', val=1.0) <NEW_LINE> <DEDENT> def setup_partials(self): <NEW_LINE> <INDENT... | Component containing Discipline 1 -- no derivatives version. | 62599074ad47b63b2c5a9180 |
class Policies(_ObjectWidgetBar): <NEW_LINE> <INDENT> pass | Widget bar of Policy objects. | 6259907432920d7e50bc797a |
class ElementoHardwareForm(ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = ElementoHardware | docstring for ElementoHardware | 62599074283ffb24f3cf51dd |
class OneTimeUseType_(ConditionAbstractType_): <NEW_LINE> <INDENT> c_tag = 'OneTimeUseType' <NEW_LINE> c_namespace = NAMESPACE <NEW_LINE> c_children = ConditionAbstractType_.c_children.copy() <NEW_LINE> c_attributes = ConditionAbstractType_.c_attributes.copy() <NEW_LINE> c_child_order = ConditionAbstractType_.c_child_o... | The urn:oasis:names:tc:SAML:2.0:assertion:OneTimeUseType element | 6259907421bff66bcd72459b |
class TestV1beta1HTTPIngressPath(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 testV1beta1HTTPIngressPath(self): <NEW_LINE> <INDENT> pass | V1beta1HTTPIngressPath unit test stubs | 62599074009cb60464d02e6e |
class BinaryVectorFactory: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def generate_random_vector(dimension): <NEW_LINE> <INDENT> randvec = BinaryVector(dimension) <NEW_LINE> randvec.set_random_vector() <NEW_LINE> return randvec <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def generate_zero_vector(dimension): <NEW_LIN... | BinaryVectorFactory creates three sorts of BinaryVector objects:
(1) Zero vectors (binary vectors with no bits set)
(2) Random vectors (binary vectors with half the bits set to 1 at random)
(3) Vectors with a preset bitarray (e.g. read from disk) | 625990747d43ff24874280ad |
class TestNdarrayIntrinsic(TestCase): <NEW_LINE> <INDENT> def test_to_fixed_tuple(self): <NEW_LINE> <INDENT> const = 3 <NEW_LINE> @njit <NEW_LINE> def foo(array): <NEW_LINE> <INDENT> a = to_fixed_tuple(array, length=1) <NEW_LINE> b = to_fixed_tuple(array, 2) <NEW_LINE> c = to_fixed_tuple(array, const) <NEW_LINE> d = to... | Tests for numba.unsafe.ndarray
| 625990744c3428357761bbe9 |
class UserProfileInline(admin.StackedInline): <NEW_LINE> <INDENT> model = UserProfile <NEW_LINE> can_delete = False | O seu perfil será editado como forma in-line | 625990744f88993c371f11ba |
@admin.register(Voice) <NEW_LINE> class VoiceAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> save_on_top = True <NEW_LINE> save_as = True | Голоса | 625990747d847024c075dd0e |
class JobReference(_messages.Message): <NEW_LINE> <INDENT> jobId = _messages.StringField(1) <NEW_LINE> projectId = _messages.StringField(2) | Encapsulates the full scoping used to reference a job.
Fields:
jobId: Optional. The job ID, which must be unique within the project. The
job ID is generated by the server upon job submission or provided by the
user as a means to perform retries without creating duplicate jobs. The
ID must contain only le... | 625990741f5feb6acb164528 |
class MainViewTestCase(pushit.ClickAppTestCase): <NEW_LINE> <INDENT> def test_initial_label(self): <NEW_LINE> <INDENT> app = self.launch_application() <NEW_LINE> label = app.main_view.select_single(objectName='label') <NEW_LINE> self.assertThat(label.text, Equals('Hello..')) <NEW_LINE> <DEDENT> def test_click_button_sh... | Generic tests for the Hello World | 6259907463b5f9789fe86a99 |
class FailureHoldingErrorHolderTests(ErrorHolderTestsMixin, TestTestHolder): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.description = "description" <NEW_LINE> try: <NEW_LINE> <INDENT> raise self.exceptionForTests <NEW_LINE> <DEDENT> except ZeroDivisionError: <NEW_LINE> <INDENT> self.error = failure.F... | Tests for L{runner.ErrorHolder} behaving similarly to L{runner.TestHolder}
when constructed with a L{Failure} representing its error. | 62599074bf627c535bcb2e01 |
class AddressViewSet(CreateModelMixin, UpdateModelMixin, GenericViewSet): <NEW_LINE> <INDENT> serializer_class = UserAddressSerializer <NEW_LINE> permission_classes = [IsAuthenticated] <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return self.request.user.addresses.filter(is_deleted=False) <NEW_LINE> <DEDENT> ... | 用户地址新增和修改 | 6259907423849d37ff8529eb |
class UserLogin(Resource): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def post(cls): <NEW_LINE> <INDENT> data = _user_parser.parse_args() <NEW_LINE> user = UserModel.get_user_by_username(data["username"]) <NEW_LINE> if user and safe_str_cmp(user.password, data["password"]): <NEW_LINE> <INDENT> access_token = create_ac... | Resource for loging a user. This is basically what JWT did before in section 10. | 62599074435de62698e9d73c |
class KnownValues(unittest.TestCase): <NEW_LINE> <INDENT> known_values_rules = ( (['red', 'white', 'blue', '', '', ''], True, 2), (['white', 'yellow', 'blue', '', '', ''], False, 1), (['', 'white', 'yellow', '', 'red', ''], True, 4), (['', '', '', 'yellow', 'yellow', 'blue'], False, 4), (['', 'red', 'red', 'white', '',... | known sequences - colors or missing wire, and boolean parameter
first wire has number 0 | 62599074ad47b63b2c5a9182 |
class UUIDField(models.CharField): <NEW_LINE> <INDENT> description = _("UUID") <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> kwargs['max_length'] = 36 <NEW_LINE> kwargs['unique'] = True <NEW_LINE> kwargs['blank'] = True <NEW_LINE> models.CharField.__init__(self, **kwargs) <NEW_LINE> <DEDENT> def pre_save... | Unique identifier, which is automatically generated.
| 6259907499cbb53fe683281f |
class _ShardCheckAndSetCallable(object): <NEW_LINE> <INDENT> def __init__(self, engine, get_updates_fn): <NEW_LINE> <INDENT> self.engine = engine <NEW_LINE> self.get_updates_fn = get_updates_fn <NEW_LINE> <DEDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> return self._ShardCheckAndSet(*args, **kwargs) <N... | Callable class to implement the per-shard logic for BatchCheckAnsMultiSet.
This is implemented as a class instead of a closure to reduce memory use and
avoid leaks. | 62599074091ae3566870656d |
class Configuration(object): <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> self.eSpacing = gR.eSpacing <NEW_LINE> self.rSpacing = gR.rSpacing <NEW_LINE> self.emitterParams = 12 <NEW_LINE> self.loadConfig(filename) <NEW_LINE> <DEDENT> def createEmitterConfig(self, config): <NEW_LINE> <INDENT> ml ... | classdocs | 625990745166f23b2e244d0a |
class PinnedLocation(models.Model): <NEW_LINE> <INDENT> name = models.CharField('場所名', max_length=255) <NEW_LINE> lat = models.FloatField('緯度') <NEW_LINE> lng = models.FloatField('経度') <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name | 場所 | 62599074627d3e7fe0e087bd |
class Node(NetworkObject): <NEW_LINE> <INDENT> def __init__( self, **kwargs): <NEW_LINE> <INDENT> super(Node, self).__init__(**kwargs) <NEW_LINE> self.relations['hasInboundPort'] = self.get_has_inbound_port <NEW_LINE> self._has_inbound_port_ports = OrderedDict() <NEW_LINE> self.relations['hasOutboundPort'] =... | A Node object represents a device in a network.
Physical or virtual devices can be represented by instances of this class. | 625990745fcc89381b266df3 |
class ItemListDirective(Directive): <NEW_LINE> <INDENT> optional_arguments = 1 <NEW_LINE> final_argument_whitespace = True <NEW_LINE> option_spec = {'class': directives.class_option, 'filter': directives.unchanged} <NEW_LINE> has_content = False <NEW_LINE> def run(self): <NEW_LINE> <INDENT> item_list_node = item_list('... | Directive to generate a list of items.
Syntax::
.. item-list:: title
:filter: regexp | 625990741b99ca40022901d0 |
class SingleHelperSelectWidget(ModelSelect2Widget): <NEW_LINE> <INDENT> model = Helper <NEW_LINE> search_fields = [ 'firstname__icontains', 'surname__icontains', ] <NEW_LINE> def label_from_instance(self, obj): <NEW_LINE> <INDENT> return obj.full_name | Select2 widget for a single helper.
The search looks at the first and last name. | 62599074009cb60464d02e70 |
class Request(object): <NEW_LINE> <INDENT> def __init__(self, opener): <NEW_LINE> <INDENT> self.routes = None <NEW_LINE> self.opener = opener <NEW_LINE> <DEDENT> def feed(self, routes): <NEW_LINE> <INDENT> self.routes = routes <NEW_LINE> for name, urls in routes: <NEW_LINE> <INDENT> methodName = "request_%s" % name <NE... | docstring for Claws | 625990743d592f4c4edbc7f7 |
class KthSmallestTest(unittest.TestCase): <NEW_LINE> <INDENT> @given(lists(integers(), min_size=1, max_size=1000, unique=True)) <NEW_LINE> @given(integers(min_value=0, max_value=100)) <NEW_LINE> def test_index_error(self, lst, k_shift): <NEW_LINE> <INDENT> self.assertRaises(IndexError, kth_smallest, lst, -1 - k_shift) ... | Test function <kth_smallest()> | 625990744f88993c371f11bb |
class Category(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=100) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = '分类' <NEW_LINE> verbose_name_plural = verbose_name <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.name | 分类表 | 625990747b180e01f3e49cff |
class Config: <NEW_LINE> <INDENT> def __init__(self, filename, filename_default='default.cfg.json'): <NEW_LINE> <INDENT> self.filename = filename_default <NEW_LINE> self.load() <NEW_LINE> self.filename = filename <NEW_LINE> <DEDENT> def load(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> with open(self.filename, '... | Wrapper for a config file.
Loads values from default config file.
Access via point operator:
>>> c: Config = Config("save.cfg.json")
>>> c.delta_t_max
50000000.0
Values can also be set using the same operator
>>> c.delta_t_max = 200.0
Save the config to the file with the filename provided in the constructor
>>> #c.sa... | 62599074460517430c432cf3 |
class MonthJournal(models.Model): <NEW_LINE> <INDENT> student = models.ForeignKey( 'Student', verbose_name=_(u'Student'), blank=False, unique_for_month='date' ) <NEW_LINE> date = models.DateField( verbose_name=_(u'Date'), blank=False ) <NEW_LINE> scope = locals() <NEW_LINE> for field_number in range(1, 32): <NEW_LINE> ... | Student Monthly Journal | 6259907467a9b606de54773f |
class _McFileCollectionQuery(Generic[MCFILE]): <NEW_LINE> <INDENT> def __init__( self, collections_type: Type[_McFileCollection[MCPACK, MCFILE]], collections: Sequence[_McFileCollection[MCPACK, MCFILE]]): <NEW_LINE> <INDENT> self.collections = collections <NEW_LINE> self.collections_type = collections_type <NEW_LINE> <... | Groups multiple file collections (from multiple packs).
Used by :class:`Project` to provide methods for finding :class:`McFile` in
groups of :class:`McFileCollection` objects that belong to that project. | 625990745fdd1c0f98e5f8b3 |
class Node: <NEW_LINE> <INDENT> def __init__(self, move = None, parent = None, state = None): <NEW_LINE> <INDENT> self.move = move <NEW_LINE> self.parentNode = parent <NEW_LINE> self.childNodes = [] <NEW_LINE> self.wins = 0 <NEW_LINE> self.visits = 0 <NEW_LINE> self.untriedMoves = state.GetMoves() <NEW_LINE> self.playe... | A node in the game tree. Note wins is always from the viewpoint of playerJustMoved.
Crashes if state not specified. | 62599074435de62698e9d73e |
class AzureDigitalTwinsAPIConfiguration(AzureConfiguration): <NEW_LINE> <INDENT> def __init__( self, credentials, base_url=None): <NEW_LINE> <INDENT> if credentials is None: <NEW_LINE> <INDENT> raise ValueError("Parameter 'credentials' must not be None.") <NEW_LINE> <DEDENT> if not base_url: <NEW_LINE> <INDENT> base_ur... | Configuration for AzureDigitalTwinsAPI
Note that all parameters used to create this instance are saved as instance
attributes.
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param str base_url: ... | 6259907499cbb53fe6832821 |
class ExtractSuperClassesByName(object): <NEW_LINE> <INDENT> def VisitTypeDeclUnit(self, module): <NEW_LINE> <INDENT> result = {base_class: superclasses for base_class, superclasses in module.classes} <NEW_LINE> for submodule in module.modules: <NEW_LINE> <INDENT> result.update( {self.old_node.name + "." + name: superc... | Visitor for extracting all superclasses (i.e., the class hierarchy).
This returns a mapping by name, e.g. {
"bool": ["int"],
"int": ["object"],
...
}. | 625990744a966d76dd5f0820 |
class TestFileFilterApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = isi_sdk_9_1_0.api.file_filter_api.FileFilterApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_get_file_filter_settings(self): <NEW_LINE> <INDENT> pass <NEW_LI... | FileFilterApi unit test stubs | 62599074be7bc26dc9252af1 |
class TestRegenerateReproducibilityData(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.tempdir = tempfile.mkdtemp() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> shutil.rmtree(self.tempdir) <NEW_LINE> <DEDENT> def test_write_data_with_explicit_filename(self): <NEW_LINE> ... | Yes, this is a test for a test utility. | 625990741b99ca40022901d1 |
class Post(db.Model): <NEW_LINE> <INDENT> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> title = db.Column(db.String(100), nullable=False) <NEW_LINE> date_posted = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) <NEW_LINE> content = db.Column(db.Text, nullable=False) <NEW_LINE> user_id = db.Col... | - modelul de postare
- contine campurile de completare a unei
postari | 62599074fff4ab517ebcf14d |
class EnvvarCollector(object): <NEW_LINE> <INDENT> def __init__(self, envvars_map=None, envvars_to_remove=None): <NEW_LINE> <INDENT> self.map = envvars_map or {} <NEW_LINE> self.to_remove = envvars_to_remove or set() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_str(cls, envvars_str): <NEW_LINE> <INDENT> if not ... | Immutable class for grouping environment variables to add and remove. | 6259907499cbb53fe6832822 |
class Session(Envelope): <NEW_LINE> <INDENT> def __init__( self, state: str = None, encryption_options: List[str] = None, encryption: str = None, compression_options: List[str] = None, compression: str = None, scheme: str = None, scheme_options: List[str] = None, authentication=None, reason: Reason = None, **kwargs ) -... | Session representation. | 6259907499fddb7c1ca63a70 |
class StudentSerializer(QueryFieldsMixin, serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Student <NEW_LINE> fields = ('id', 'name', 'surname', 'zip', 'country', 'email', 'courses') <NEW_LINE> read_only_fields = ('id', 'courses') | Serializer of Student model | 625990744e4d562566373d3f |
class TestIoK8sApimachineryPkgApisMetaV1LabelSelectorRequirement(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 testIoK8sApimachineryPkgApisMetaV1LabelSelectorRequirement(self): <NEW_LINE> <INDENT... | IoK8sApimachineryPkgApisMetaV1LabelSelectorRequirement unit test stubs | 62599074baa26c4b54d50be6 |
class VariantResourceHelper(VariantResource): <NEW_LINE> <INDENT> class _Metas(AttributeForwardMeta, LazyAttributeMeta): pass <NEW_LINE> __metaclass__ = _Metas <NEW_LINE> schema = variant_schema <NEW_LINE> keys = schema_keys(package_schema) - set(["requires", "variants"]) <NEW_LINE> def _uri(self): <NEW_LINE> <INDENT> ... | Helper class for implementing variants that inherit properties from their
parent package.
Since a variant overlaps so much with a package, here we use the forwarding
metaclass to forward our parent package's attributes onto ourself (with some
exceptions - eg 'variants', 'requires'). This is a common enough pattern
tha... | 625990749c8ee82313040e23 |
class DatabaseStatusError(Exception): <NEW_LINE> <INDENT> pass | General error thrown when the database is... Not Good. | 62599074be8e80087fbc09ca |
class TaskScheduleType(DeclEnum): <NEW_LINE> <INDENT> interval = 'int', _('Interval'), 10 <NEW_LINE> crontab = 'cron', _('Crontab'), 20 | Celery beat task schedule type. | 625990742c8b7c6e89bd5120 |
class DecodeView(QWidget): <NEW_LINE> <INDENT> def __init__(self, clipboard, options): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.clipboard = clipboard <NEW_LINE> self.options = options <NEW_LINE> self.buildDecodeView() <NEW_LINE> <DEDENT> def decode_handler(self): <NEW_LINE> <INDENT> if self.readFromClipbo... | Class that builds decode view | 625990744a966d76dd5f0822 |
class RandomPool: <NEW_LINE> <INDENT> def __init__(self, numbytes = 160, cipher=None, hash=None, file=None): <NEW_LINE> <INDENT> warnings.warn("This application uses RandomPool, which is BROKEN in older releases. See http://www.pycrypto.org/randpool-broken", RandomPool_DeprecationWarning) <NEW_LINE> self.__rng = Crypt... | Deprecated. Use Random.new() instead.
See http://www.pycrypto.org/randpool-broken | 625990748e7ae83300eea9ca |
class Cloneable: <NEW_LINE> <INDENT> def clone(self): <NEW_LINE> <INDENT> raise NotImplementedError() | This (empty) interface must be implemented by all classes that wish to
support cloning. The implementation of clone() in :class:`Object` checks if
the object being cloned implements this interface and throws
:class:`NotImplementedError` if it does not. | 625990742c8b7c6e89bd5121 |
class maintest(pyshell.CLIEngine): <NEW_LINE> <INDENT> modes = { "1" : "pyshell.util", "2" : "IPython.core.debugger", "3" : "IPython.core.ultratb", } <NEW_LINE> defaultcfg = False <NEW_LINE> def after_configure(self): <NEW_LINE> <INDENT> self.parser.add_argument('mode',choices=self.modes.values()+self.modes.keys()) <NE... | Test for the main module file variables | 62599074adb09d7d5dc0bea3 |
class VersionsSchema(VersionsSchemaBase, FieldPermissionsMixin): <NEW_LINE> <INDENT> field_load_permissions = {} <NEW_LINE> field_dump_permissions = { "is_latest_draft": "edit", } | Version schema with field-level permissions. | 62599074167d2b6e312b822d |
class Parser: <NEW_LINE> <INDENT> def __init__(self, tokens: t.List[str]): <NEW_LINE> <INDENT> self.reverse_polish_tokens = [] <NEW_LINE> self.tokens = iter(tokens + ["##NONE##"]) <NEW_LINE> self.current_token = next(self.tokens) <NEW_LINE> <DEDENT> def parse(self): <NEW_LINE> <INDENT> self._exp() <NEW_LINE> return sel... | Use for transforming input tokens into reverse polish form | 6259907416aa5153ce401e13 |
class Edge: <NEW_LINE> <INDENT> def __init__(self, v1, v2, w=None): <NEW_LINE> <INDENT> self.edge = (v1, v2) <NEW_LINE> self.weight = w | Connects two vertices with optional weight. | 625990744c3428357761bbef |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.