code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Document(pgdb.Model): <NEW_LINE> <INDENT> document_id = pgdb.Column(UUID(as_uuid=True), primary_key=True, nullable=False, default=lambda: uuid.uuid4(), unique=True) <NEW_LINE> user_id = pgdb.Column(UUID(as_uuid=True), nullable=False) <NEW_LINE> document = pgdb.Column(pgdb.Text, nullable=False) <NEW_LINE> created_... | A squanched document | 6259902926238365f5fadaef |
class InvalidCommand(ParsingError): <NEW_LINE> <INDENT> _fmt = (_LOCATION_FMT + "Invalid command '%(cmd)s'") <NEW_LINE> def __init__(self, lineno, cmd): <NEW_LINE> <INDENT> self.cmd = cmd <NEW_LINE> ParsingError.__init__(self, lineno) | Raised when an unknown command found. | 62599029711fe17d825e1469 |
class Dim(object): <NEW_LINE> <INDENT> def __init__(self, dist: float, dist_label=None): <NEW_LINE> <INDENT> self.dist = dist <NEW_LINE> self.dist_label = dist_label <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return str(self.dist) <NEW_LINE> <DEDENT> def __add__(self, other: Union[float, 'Dim']): <NEW_L... | Corresponds to a 'dimension' - a distance with an optional
label.
The labels are informational right now - the intended future use is that
they will be passed to 360 so that object dimensions are specfied by user
parameters. Alternatively in some cases, user paramters will be generated
from Dim object labels.
Opera... | 625990291d351010ab8f4ab6 |
class FormElementPluginError(FormPluginError): <NEW_LINE> <INDENT> pass | Raised when form element plugin error occurs. | 625990295166f23b2e244375 |
class TypeArgDoesNotExistException(FriendlyException): <NEW_LINE> <INDENT> def __init__(self, missing_type): <NEW_LINE> <INDENT> super().__init__(f"type {missing_type} doesn't exist in the .ctxrc") | Exception raised when the type argument passed is not in the .ctxrc | 62599029a4f1c619b294f594 |
class Dict(dict): <NEW_LINE> <INDENT> def __init__(self, names=(), values=(), **kw): <NEW_LINE> <INDENT> super(Dict,self).__init__(**kw) <NEW_LINE> for k, v in zip(names, values): <NEW_LINE> <INDENT> self[k] = v <NEW_LINE> <DEDENT> <DEDENT> def __getattr__(self, key): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return... | simple dict but support access as x,y style. | 62599029925a0f43d25e8fe7 |
class AppsLocationsService(base_api.BaseApiService): <NEW_LINE> <INDENT> _NAME = u'apps_locations' <NEW_LINE> def __init__(self, client): <NEW_LINE> <INDENT> super(AppengineV1alpha.AppsLocationsService, self).__init__(client) <NEW_LINE> self._upload_configs = { } <NEW_LINE> <DEDENT> def Get(self, request, global_params... | Service class for the apps_locations resource. | 6259902973bcbd0ca4bcb231 |
class HostTestPluginResetMethod_Stlink(HostTestPluginBase): <NEW_LINE> <INDENT> name = "HostTestPluginResetMethod_Stlink" <NEW_LINE> type = "ResetMethod" <NEW_LINE> capabilities = ["stlink"] <NEW_LINE> required_parameters = [] <NEW_LINE> stable = False <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> HostTestPluginBa... | Plugin interface adaptor for STLINK_CLI. | 62599029796e427e5384f71d |
class ILabCASCollectionRDFGenerator(IRDFGenerator): <NEW_LINE> <INDENT> labcasSolrURL = schema.TextLine( title=_('LabCAS Data Access API URL'), description=_('The Uniform Resource Locator to the LabCAS API.'), required=True, constraint=validateAccessibleURL, default='https://edrn-labcas.jpl.nasa.gov/data-access-api' ) ... | Generator for RDF using data from LabCAS. | 6259902921bff66bcd723c02 |
@base.ReleaseTracks(base.ReleaseTrack.BETA) <NEW_LINE> class SetClusterSelector(base.UpdateCommand): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> flags.AddTemplateFlag(parser, 'set cluster selector') <NEW_LINE> flags.AddZoneFlag(parser) <NEW_LINE> parser.add_argument( '--cluster-la... | Set cluster selector for the workflow template. | 6259902966673b3332c31390 |
class PacketEvent(object): <NEW_LINE> <INDENT> def __init__(self, event, args=None): <NEW_LINE> <INDENT> self.name = event <NEW_LINE> self.arguments = OrderedDict() if args is None else OrderedDict(args) <NEW_LINE> <DEDENT> def __call__(self, argument, value=None): <NEW_LINE> <INDENT> if value is None: <NEW_LINE> <INDE... | Packet event.
This object is a data structure which stores packet data under specific
keys according to the mapping rules defined in the Protocol Parser. | 625990298e05c05ec3f6f62c |
class SecretLinkFactoryTestCase(InvenioTestCase): <NEW_LINE> <INDENT> extra_data = dict(recid=1) <NEW_LINE> def test_validation(self): <NEW_LINE> <INDENT> t = SecretLinkFactory.create_token(1, self.extra_data) <NEW_LINE> self.assertIsNotNone(SecretLinkFactory.validate_token( t, expected_data=self.extra_data)) <NEW_LINE... | Test case for factory class. | 62599029287bf620b6272b90 |
class LayerNotFound(Exception): <NEW_LINE> <INDENT> pass | ... | 6259902926238365f5fadaf3 |
class _FileDiffCommon(object): <NEW_LINE> <INDENT> fieldsets = ( (None, { 'fields': ('diffset', 'status', 'binary', ('source_file', 'source_revision'), ('dest_file', 'dest_detail'), 'diff', 'parent_diff') }), (_('Internal State'), { 'description': _('<p>This is advanced state that should not be ' 'modified unless somet... | Common attributes for FileDiffAdmin and FileDiffInline. | 625990298a349b6b436871da |
class TestBadgeApplicationPurchaseConstraints(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> re... | BadgeApplicationPurchaseConstraints unit test stubs | 6259902963f4b57ef0086543 |
class InputKolBspData(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.DataList = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("DataList") is not None: <NEW_LINE> <INDENT> self.DataList = [] <NEW_LINE> for item in params.get("DataList"): <NEW... | CheckKol
| 6259902921bff66bcd723c04 |
class process_gpm(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.enabled = True <NEW_LINE> self.checked = False <NEW_LINE> <DEDENT> def onClick(self): <NEW_LINE> <INDENT> pass | Implementation for WEBDHMV2_addin.process_gpm (Button) | 62599029d10714528d69ee5d |
class ImageQualityClassifier(object): <NEW_LINE> <INDENT> def __init__(self, model_ckpt, model_patch_side_length, num_classes, graph=None, session_config=None): <NEW_LINE> <INDENT> self._model_patch_side_length = model_patch_side_length <NEW_LINE> self._num_classes = num_classes <NEW_LINE> if graph is None: <NEW_LINE> ... | Object for running image quality model inference.
Attributes:
graph: TensorFlow graph. | 625990299b70327d1c57fd24 |
class TestPipeline(compiler.Compiler): <NEW_LINE> <INDENT> def define_pipelines(self): <NEW_LINE> <INDENT> name = 'test parfor aliasing' <NEW_LINE> pm = PassManager(name) <NEW_LINE> pm.add_pass(TranslateByteCode, "analyzing bytecode") <NEW_LINE> pm.add_pass(FixupArgs, "fix up args") <NEW_LINE> pm.add_pass(IRProcessing,... | Test pipeline that just converts prange() to parfor and calls
remove_dead(). Copy propagation can replace B in the example code
which this pipeline avoids. | 6259902923e79379d538d4ad |
class ChromaticMotionFeature(featuresModule.FeatureExtractor): <NEW_LINE> <INDENT> id = 'm10' <NEW_LINE> def __init__(self, dataOrStream=None, *arguments, **keywords): <NEW_LINE> <INDENT> super().__init__(dataOrStream=dataOrStream, *arguments, **keywords) <NEW_LINE> self.name = 'Chromatic Motion' <NEW_LINE> self.descri... | Fraction of melodic intervals corresponding to a semitone.
>>> s = corpus.parse('bwv66.6')
>>> fe = features.jSymbolic.ChromaticMotionFeature(s)
>>> f = fe.extract()
>>> f.vector
[0.220...] | 62599029be8e80087fbc001b |
class SageManager(pw.Model): <NEW_LINE> <INDENT> NAME = pw.CharField(unique=True) <NEW_LINE> PASSWD = pw.CharField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> database = DATABASE | Main database class for storing passwords. Built on the Peewee ORM. | 625990298c3a8732951f74fb |
class CustomTire(car.Tire): <NEW_LINE> <INDENT> __maximum_miles = 500 | This is the class for CustomTire.
Arg:
None | 625990291f5feb6acb163b93 |
class FieldTypeViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = models.FieldType.objects.all() <NEW_LINE> serializer_class = serializers.FieldTypeSerializer | Viewset for FieldType model. | 625990298e05c05ec3f6f62d |
class TweetViewSet(viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> model = Tweet <NEW_LINE> queryset = Tweet.public.all().order_by('pk') <NEW_LINE> serializer_class = TweetSerializer <NEW_LINE> paginate_by = 50 | `Tweet` šiuo atveju yra žinutė,
kuri buvo užskaityta upkarmoas boto
kaip teisinga ir už ją buvo priskaičiuota
karmos taškų. | 62599029d164cc6175821f1b |
class Client: <NEW_LINE> <INDENT> def __init__(self, clientID, name, email) : <NEW_LINE> <INDENT> self.name=name <NEW_LINE> self.email=email <NEW_LINE> self.clientID=clientID <NEW_LINE> self.positions={} <NEW_LINE> <DEDENT> def getName(self) : <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> def getID(self): <N... | A class representing a client holding a position | 62599029a8ecb033258721c1 |
class DistributionBarViz(DistributionPieViz): <NEW_LINE> <INDENT> viz_type = "dist_bar" <NEW_LINE> verbose_name = _("Distribution - Bar Chart") <NEW_LINE> is_timeseries = False <NEW_LINE> def query_obj(self): <NEW_LINE> <INDENT> d = super(DistributionBarViz, self).query_obj() <NEW_LINE> fd = self.form_data <NEW_LINE> i... | A good old bar chart | 62599029be8e80087fbc001d |
class FlattenLayer(Layer): <NEW_LINE> <INDENT> @deprecated_alias(layer='prev_layer', end_support_version=1.9) <NEW_LINE> def __init__(self, prev_layer, name='flatten'): <NEW_LINE> <INDENT> super(FlattenLayer, self).__init__(prev_layer=prev_layer, name=name) <NEW_LINE> _out = flatten_reshape(self.inputs, name=name) <NEW... | A layer that reshapes high-dimension input into a vector.
Then we often apply DenseLayer, RNNLayer, ConcatLayer and etc on the top of a flatten layer.
[batch_size, mask_row, mask_col, n_mask] ---> [batch_size, mask_row * mask_col * n_mask]
Parameters
----------
prev_layer : :class:`Layer`
Previous layer.
name : s... | 62599029d164cc6175821f1c |
class VLStringAtom(_BufferedAtom): <NEW_LINE> <INDENT> kind = 'vlstring' <NEW_LINE> type = 'vlstring' <NEW_LINE> base = UInt8Atom() <NEW_LINE> def _tobuffer(self, object_): <NEW_LINE> <INDENT> if not isinstance(object_, basestring): <NEW_LINE> <INDENT> raise TypeError("object is not a string: %r" % (object_,)) <NEW_LIN... | Defines an atom of type ``vlstring``.
This class describes a *row* of the VLArray class, rather than an atom. It
differs from the StringAtom class in that you can only add *one instance of
it to one specific row*, i.e. the :meth:`VLArray.append` method only
accepts one object when the base atom is of this type.
Like ... | 6259902930c21e258be997b0 |
class PipedReaderBuilder(ReaderBuilder): <NEW_LINE> <INDENT> def __init__(self, builder, piper): <NEW_LINE> <INDENT> self._builder = builder <NEW_LINE> self._piper = piper <NEW_LINE> <DEDENT> def schema(self): <NEW_LINE> <INDENT> return self._builder.schema() <NEW_LINE> <DEDENT> def enqueue_splits(self, net, split_queu... | ReaderBuilder that modifies underlying builder by calling `piper`
function on each new reader produced, and return the result of
the function. This way, it is possible to append data processing
pipelines that will be replicated for each reader that gets created.
E.g.:
PipedReaderBuilder(
ReaderBuilder(...),
l... | 6259902921a7993f00c66f22 |
class Vertex: <NEW_LINE> <INDENT> def __init__(self, p): <NEW_LINE> <INDENT> self.x = p[0] <NEW_LINE> self.y = p[1] <NEW_LINE> self.next = None <NEW_LINE> self.expanded = False <NEW_LINE> <DEDENT> def expand(self, lp): <NEW_LINE> <INDENT> v1 = self <NEW_LINE> v2 = self.next <NEW_LINE> v = array([v2.y - v1.y, v1.x - v2.... | Vertex of the projected polygon, with a pointer to its successor. | 625990295e10d32532ce40d6 |
class SuitSplitDateTimeWidget(forms.SplitDateTimeWidget): <NEW_LINE> <INDENT> def __init__(self, attrs=None): <NEW_LINE> <INDENT> widgets = [SuitDateWidget, SuitTimeWidget] <NEW_LINE> forms.MultiWidget.__init__(self, widgets, attrs) <NEW_LINE> <DEDENT> def format_output(self, rendered_widgets): <NEW_LINE> <INDENT> out_... | A SplitDateTime Widget that has some admin-specific styling. | 62599029d18da76e235b7920 |
class TransactionViewSet(ModelViewSet): <NEW_LINE> <INDENT> queryset = Transaction.objects.all() <NEW_LINE> serializer_class = TransactionSerializer | Вывод транзакций | 625990290a366e3fb87dd98e |
class Net(BaseNet): <NEW_LINE> <INDENT> def forward(self, inputs): <NEW_LINE> <INDENT> axes = self.config['axes'] <NEW_LINE> starts = self.config['starts'] <NEW_LINE> ends = self.config['ends'] <NEW_LINE> if self.config['isStartsTensor']: <NEW_LINE> <INDENT> starts = paddle.to_tensor(starts) <NEW_LINE> <DEDENT> if self... | simple Net | 6259902921bff66bcd723c08 |
class Query: <NEW_LINE> <INDENT> def __init__(self, raw_query: str, **config): <NEW_LINE> <INDENT> self._tree = _QueryParser(config).parse(raw_query) <NEW_LINE> <DEDENT> def execute( self, lexicon: Lexicon, index: CaptionIndex, documents=None, ignore_word_not_found=True, case_insensitive=False ) -> Iterable[CaptionInde... | Parse and execute queries | 62599029711fe17d825e146d |
class AudioModel(UserOwnedModel, EntityModel): <NEW_LINE> <INDENT> audio = models.FileField( verbose_name='音频', upload_to='audio/', blank=True, null=True, ) <NEW_LINE> duration = models.FloatField( verbose_name='时长', blank=True, default=0, ) <NEW_LINE> is_active = models.BooleanField( verbose_name='是否可用', default=True,... | 音频对象
| 6259902930c21e258be997b2 |
class BluetoothAddress(bytes): <NEW_LINE> <INDENT> def __new__(cls, value: Union[str, bytes]) -> "BluetoothAddress": <NEW_LINE> <INDENT> if isinstance(value, str): <NEW_LINE> <INDENT> value = [int(x, 16) for x in value.split(":")] <NEW_LINE> <DEDENT> if len(value) != 6: <NEW_LINE> <INDENT> raise TypeError("requires exa... | A Bluetooth address.
These addresses use the same EUI-48 format as MAC addresses but are for
identifying individual Bluetooth devices instead of network cards. | 625990291f5feb6acb163b97 |
class ScenarioLeafItem(GrayIfLastMixin, EditableMixin, LeafItem): <NEW_LINE> <INDENT> @property <NEW_LINE> def item_type(self): <NEW_LINE> <INDENT> return "scenario" <NEW_LINE> <DEDENT> def add_item_to_db(self, db_item): <NEW_LINE> <INDENT> self.db_mngr.add_scenarios({self.db_map: [db_item]}) <NEW_LINE> <DEDENT> def up... | A scenario leaf item. | 62599029bf627c535bcb245e |
class OutStream(object): <NEW_LINE> <INDENT> flush_interval = 0.05 <NEW_LINE> topic=None <NEW_LINE> def __init__(self, session, pub_socket, name): <NEW_LINE> <INDENT> self.session = session <NEW_LINE> self.pub_socket = pub_socket <NEW_LINE> self.name = name <NEW_LINE> self.parent_header = {} <NEW_LINE> self._new_buffer... | A file like object that publishes the stream to a 0MQ PUB socket. | 625990295166f23b2e24437d |
class Sent(UnaryConcept): <NEW_LINE> <INDENT> def get_next_concept(self, lexed): <NEW_LINE> <INDENT> first_unconsumed_concept = find(lambda c: c is not None, lexed) <NEW_LINE> if type(first_unconsumed_concept) not in {Eval, Def}: <NEW_LINE> <INDENT> raise SyntaxError("Sentence must be evaluation or definition") <NEW_LI... | Statement. Collects all concepts to the left | 62599029d10714528d69ee60 |
class Declaration(object): <NEW_LINE> <INDENT> __slots__ = ( 'end_location', 'name', 'spelling', 'start_location', 'usr', ) <NEW_LINE> def __init__(self, cursor): <NEW_LINE> <INDENT> self.name = cursor.displayname <NEW_LINE> self.spelling = cursor.spelling <NEW_LINE> self.usr = cursor.get_usr() <NEW_LINE> start = curso... | The base class for all declarations.
This class is never instantiated directly. It provides fields common to
all declarations.
Declarations are intended to be dumb containers. Most of the logic for
populating data can be found in the built-in observers. The few exceptions
are where it makes sense to consolidate redun... | 625990299b70327d1c57fd2a |
class TestSFCardViewerRowData: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def test_init_and_property() -> None: <NEW_LINE> <INDENT> used_date = "2018/11/13" <NEW_LINE> is_commuter_pass_enter = "" <NEW_LINE> railway_company_name_enter = "メトロ" <NEW_LINE> station_name_enter = "六本木一丁目" <NEW_LINE> is_commuter_pass_exit = ... | Tests for SFCardViewerRowData. | 6259902915baa72349462f41 |
class GRRConfig(rdfvalue.RDFProtoStruct): <NEW_LINE> <INDENT> protobuf = jobs_pb2.GRRConfig | The configuration of a GRR Client. | 625990293eb6a72ae038b60d |
@gin.configurable <NEW_LINE> class EventFirstOccurrenceMetric(ExperimentMetric): <NEW_LINE> <INDENT> event_never_occurred_val = -1 <NEW_LINE> def __init__(self, check_event_fn, name): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._first_occurrence_epoch = None <NEW_LINE> self._check_event_fn = check_event_fn <N... | Logs first occurrence of an event. | 62599029711fe17d825e146e |
class Hansen(Benchmark): <NEW_LINE> <INDENT> def __init__(self, dimensions=2): <NEW_LINE> <INDENT> Benchmark.__init__(self, dimensions) <NEW_LINE> self._bounds = list(zip([-10.0] * self.N, [10.0] * self.N)) <NEW_LINE> self.global_optimum = [[-7.58989583, -7.70831466]] <NEW_LINE> self.fglob = -176.54179 <NEW_LINE> <DEDE... | Hansen objective function.
This class defines the Hansen [1]_ global optimization problem. This is a
multimodal minimization problem defined as follows:
.. math::
f_{\text{Hansen}}(x) = \left[ \sum_{i=0}^4(i+1)\cos(ix_1+i+1)\right ]
\left[\sum_{j=0}^4(j+1)\cos[(j+2)x_2+j+1])\right ]
with :math:`x_i \in [-1... | 62599029d99f1b3c44d0664b |
class WsDeployment(Construct): <NEW_LINE> <INDENT> def __init__( self, scope: Stack, id: str, ws_stage: WsStage, description: Optional[str] = None ) -> None: <NEW_LINE> <INDENT> deployment_func = StageDeploymentSingletonFunction( scope=scope, name=f'{id}Function' ) <NEW_LINE> StageDeploymentResource( scope=scope, resou... | Creates web socket api deployment. | 625990295166f23b2e24437f |
class Environment(object): <NEW_LINE> <INDENT> def __init__(self, model): <NEW_LINE> <INDENT> classes, activityenum = core.steplist(model), model.ACTIVITY <NEW_LINE> stepclasses = list() <NEW_LINE> stepinstances = list() <NEW_LINE> knownclassnames = set() <NEW_LINE> knowninstancenames = set() <NEW_LINE> AvailableStepGr... | Represent the current environment in a (presumably) easy way for writing
recipes. | 6259902923e79379d538d4b4 |
class ApplyTable(models.Model): <NEW_LINE> <INDENT> name = models.CharField('名称',max_length=200) <NEW_LINE> desp = models.TextField(verbose_name='描述',blank=True) <NEW_LINE> file = models.CharField('文件材料',max_length=500,help_text='请选择(PDF/图片)上传') <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.name o... | 申请表格 | 6259902963f4b57ef0086547 |
class MyInt(int): <NEW_LINE> <INDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return int(self) != int(other) <NEW_LINE> <DEDENT> def __ne__(self, other): <NEW_LINE> <INDENT> return int(self) == int(other) | class to override int comparrisons | 62599029e76e3b2f99fd99b6 |
class WafStateTest(TestCase): <NEW_LINE> <INDENT> def test_wafstate(self): <NEW_LINE> <INDENT> print("========== waf state test begin ==========") <NEW_LINE> response = self.client.get('/api/statefile/') <NEW_LINE> print(response.content) <NEW_LINE> print("********** waf state test end *****************\n") | class to Test waf state | 62599029a8ecb033258721c7 |
class AnalysisVersion: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.version = "1.0.0" <NEW_LINE> <DEDENT> def getVersion(self): <NEW_LINE> <INDENT> return self.version | Analysis version class to store version information and return
it to the caller. | 625990298c3a8732951f7502 |
class NegativeBinomial(Discrete): <NEW_LINE> <INDENT> def __init__(self, mu, alpha, *args, **kwargs): <NEW_LINE> <INDENT> super(NegativeBinomial, self).__init__(*args, **kwargs) <NEW_LINE> self.mu = mu <NEW_LINE> self.alpha = alpha <NEW_LINE> self.mode = floor(mu).astype('int32') <NEW_LINE> <DEDENT> def logp(self, valu... | Negative binomial log-likelihood.
The negative binomial distribution describes a Poisson random variable
whose rate parameter is gamma distributed. PyMC's chosen parameterization
is based on this mixture interpretation.
.. math::
f(x \mid \mu, lpha) = rac{\Gamma(x+lpha)}{x! \Gamma(lpha)} (lpha/(\mu+lpha... | 62599029d99f1b3c44d0664d |
class MapSwipeDialogTest(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 test_icon_png(self): <NEW_LINE> <INDENT> path = ':/plugins/MapSwipe/icon.png' <NEW_LINE> icon = QIcon(path) <NEW_LINE> self.... | Test rerources work. | 6259902930c21e258be997b7 |
class Bullet(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, target, origin): <NEW_LINE> <INDENT> pygame.sprite.Sprite.__init__(self) <NEW_LINE> self.image = pygame.Surface([2, 2]) <NEW_LINE> self.image.fill(color.BLACK) <NEW_LINE> self.rect = self.image.get_rect() <NEW_LINE> self.rect.center = (origin[0]... | This class represents the bullets shot in the game
Parameters
----------
target : Int List with length 2
Specifies a point (x,y) that the Bullet should pass through
origin : Int List with length 2
Specifies the point (x,y) that the Bullet should start from
Attributes
---------
image : Pygame's Sprite's image... | 62599029e76e3b2f99fd99b8 |
class ReweightedLasso(BaseEstimator, RegressorMixin): <NEW_LINE> <INDENT> def __init__(self, alpha_fraction=.01, max_iter=2000, max_iter_reweighting=100, tol=1e-4): <NEW_LINE> <INDENT> self.alpha_fraction = alpha_fraction <NEW_LINE> self.max_iter = max_iter <NEW_LINE> self.max_iter_reweighting = max_iter_reweighting <N... | Reweighted Lasso estimator with L1 regularizer.
The optimization objective for Reweighted Lasso is::
(1 / (2 * n_samples)) * ||Y - XW||^2_Fro + alpha * ||W||_0.5
Where::
||W||_0.5 = sum_i sum_j sqrt|w_ij|
Parameters
----------
alpha : (float or array-like), shape (n_tasks)
Optional, default ones(n_tasks)... | 6259902921bff66bcd723c0e |
class Deck(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.deck = [] <NEW_LINE> self.shuffled = False <NEW_LINE> for suit in SUITS: <NEW_LINE> <INDENT> for rank in RANKS: <NEW_LINE> <INDENT> self.deck.append(Card(suit, rank)) <NEW_LINE> <DEDENT> <DEDENT> <DEDENT> def __str__(self): <NEW_LINE> <INDEN... | class layout for all items and methods that compromise a deck | 625990293eb6a72ae038b611 |
class PyPymc3(PythonPackage): <NEW_LINE> <INDENT> homepage = "http://github.com/pymc-devs/pymc3" <NEW_LINE> pypi = "pymc3/pymc3-3.8.tar.gz" <NEW_LINE> version('3.8', sha256='1bb2915e4a29877c681ead13932b0b7d276f7f496e9c3f09ba96b977c99caf00') <NEW_LINE> depends_on('python@3.5.4:', type=('build', 'run')) <NEW_LINE> depend... | PyMC3 is a Python package for Bayesian statistical modeling and
Probabilistic Machine Learning focusing on advanced Markov chain Monte
Carlo (MCMC) and variational inference (VI) algorithms. Its flexibility and
extensibility make it applicable to a large suite of problems. | 625990295e10d32532ce40da |
class RHChatManageEventRemove(RHEventChatroomMixin, RHChatManageEventBase): <NEW_LINE> <INDENT> def _checkParams(self, params): <NEW_LINE> <INDENT> RHChatManageEventBase._checkParams(self, params) <NEW_LINE> RHEventChatroomMixin._checkParams(self) <NEW_LINE> <DEDENT> def _process(self): <NEW_LINE> <INDENT> reason = '{}... | Removes a chatroom from an event (and if necessary from the server) | 62599029d18da76e235b7924 |
class validate_in(validate_base): <NEW_LINE> <INDENT> def check_arg(self, arg, values, exception): <NEW_LINE> <INDENT> if arg not in values: <NEW_LINE> <INDENT> raise exception("%s:%d %s must be one of %s" % (self.file, self.line, arg, values)) | Decorator to validate argument is in a set of valid argument values
The decorator expects one or more arguments, which are 3-tuples of
(name, list, exception), where name is the argument name in the
function being decorated, list is the list of valid argument values
and exception is the exception type to be raised if ... | 62599029925a0f43d25e8ff5 |
class SvnCreateCustomTagDirStep(AbstractStep): <NEW_LINE> <INDENT> def __init__( self, dirTrunk, dirTag ): <NEW_LINE> <INDENT> AbstractStep.__init__( self, "Svn Create Tag" ) <NEW_LINE> self.dirTrunk = dirTrunk <NEW_LINE> self.dirTag = dirTag <NEW_LINE> <DEDENT> def do( self ): <NEW_LINE> <INDENT> self.reporter.message... | Svn Create Tag Dir Step | 625990298a349b6b436871e6 |
class AfterSaleServiceConditions(BaseApi): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(AfterSaleServiceConditions, self).__init__(*args, **kwargs) <NEW_LINE> self.endpoint = 'after-sales-service-conditions' <NEW_LINE> self.return_policies = AfterSaleServiceConditionReturnPolicies(... | Base Endpoint | 62599029e76e3b2f99fd99ba |
@implementer(IViewView) <NEW_LINE> class SiteLayoutView(BrowserView): <NEW_LINE> <INDENT> index = ViewPageTemplateFile(os.path.join("templates", "main_template.pt")) <NEW_LINE> def __init__(self, context, request, name="layout"): <NEW_LINE> <INDENT> super().__init__(context, request) <NEW_LINE> self.__name__ = name <NE... | Default site layout view called from the site layout resolving view | 62599029a4f1c619b294f5a2 |
class HTTPSession(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> requests.packages.urllib3.disable_warnings() <NEW_LINE> self.rs = requests.Session() <NEW_LINE> self.baseurl = 'http://radiant-gorge-83016.herokuapp.com' <NEW_LINE> <DEDENT> def print_res_info(self, res): <NEW_LINE> <INDENT> print('I... | Class that holds the requests session for all api calls. | 625990291d351010ab8f4ac4 |
class CB_RECALL_ANY4res(BaseObj): <NEW_LINE> <INDENT> _strfmt1 = "" <NEW_LINE> _attrlist = ("status",) <NEW_LINE> def __init__(self, unpack): <NEW_LINE> <INDENT> self.status = nfsstat4(unpack) | struct CB_RECALL_ANY4res {
nfsstat4 status;
}; | 6259902921a7993f00c66f2c |
class DecisionTreeRegressionModel(JavaModel): <NEW_LINE> <INDENT> pass | Model fitted by DecisionTreeRegressor. | 6259902966673b3332c3139e |
class TagRegistered(type): <NEW_LINE> <INDENT> attr_name = 'tag' <NEW_LINE> def __init__(cls, name, bases, namespace): <NEW_LINE> <INDENT> super(TagRegistered, cls).__init__(name, bases, namespace) <NEW_LINE> if not hasattr(cls, '_registry'): <NEW_LINE> <INDENT> cls._registry = {} <NEW_LINE> <DEDENT> meta = cls.__class... | As classes of this metaclass are created, they keep a registry in the
base class of all classes by a class attribute, indicated by attr_name.
>>> FooObject = TagRegistered('FooObject', (), dict(tag='foo'))
>>> FooObject._registry['foo'] is FooObject
True
>>> BarObject = TagRegistered('Barobject', (FooObject,), dict(ta... | 625990295e10d32532ce40db |
class DatasetTransform(object): <NEW_LINE> <INDENT> r <NEW_LINE> def __init__(self, configs=None): <NEW_LINE> <INDENT> if configs: <NEW_LINE> <INDENT> self.configs = configs <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.configs = get_specified_config('DatasetTransform') <NEW_LINE> <DEDENT> self.labels = self.confi... | Base class for all dataset transforms. | 6259902956b00c62f0fb386f |
class Subject(ABC): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def attach(self, observer: Observer) -> None: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def detach(self) -> None: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def notify(self) -> None: <NEW_LINE> ... | The Subject interface declares a set of methods for managing subscribers. | 6259902926238365f5fadb01 |
class Cblas(Package): <NEW_LINE> <INDENT> homepage = "http://www.netlib.org/blas/_cblas/" <NEW_LINE> version('2015-06-06', sha256='0f6354fd67fabd909baf57ced2ef84e962db58fae126e4f41b21dd4fec60a2a3', url='http://www.netlib.org/blas/blast-forum/cblas.tgz') <NEW_LINE> depends_on('blas') <NEW_LINE> parallel = False <NEW_LIN... | The BLAS (Basic Linear Algebra Subprograms) are routines that
provide standard building blocks for performing basic vector and
matrix operations. | 62599029925a0f43d25e8ff7 |
class DatFont8(KaitaiStruct): <NEW_LINE> <INDENT> SEQ_FIELDS = ["chars"] <NEW_LINE> def __init__(self, _io, _parent=None, _root=None): <NEW_LINE> <INDENT> self._io = _io <NEW_LINE> self._parent = _parent <NEW_LINE> self._root = _root if _root else self <NEW_LINE> self._debug = collections.defaultdict(dict) <NEW_LINE> <... | Simple monochrome monospaced font, 95 characters, 8x8 px
characters. | 62599029ac7a0e7691f73498 |
class ResourceManager(): <NEW_LINE> <INDENT> def __init__(self, acquire_resource, release_resource, check_resource_ok=None): <NEW_LINE> <INDENT> self.acquire_resource = acquire_resource <NEW_LINE> self.release_resource = release_resource <NEW_LINE> if check_resource_ok is None: <NEW_LINE> <INDENT> def check_resource_ok... | A Resoruce Manager that loosely implements Resource Acquisiton as Initialization. | 6259902963f4b57ef008654a |
class BitVecNumRef(BitVecRef): <NEW_LINE> <INDENT> def as_long(self): <NEW_LINE> <INDENT> return int(self.as_string()) <NEW_LINE> <DEDENT> def as_signed_long(self): <NEW_LINE> <INDENT> sz = self.size() <NEW_LINE> val = self.as_long() <NEW_LINE> if val >= 2**(sz - 1): <NEW_LINE> <INDENT> val = val - 2**sz <NEW_LINE> <DE... | Bit-vector values. | 625990296fece00bbaccc969 |
class IAvataSkin(IOpenPlansSkin): <NEW_LINE> <INDENT> pass | i am a skin | 625990298c3a8732951f7508 |
@attributes([ "bucket", "target_prefix", ]) <NEW_LINE> class UpdateS3ErrorPage(object): <NEW_LINE> <INDENT> @property <NEW_LINE> def error_key(self): <NEW_LINE> <INDENT> return '{}error_pages/404.html'.format(self.target_prefix) | Update the error_key for an S3 bucket website endpoint to point to a new
path.
If the key is changed, return the old key.
:ivar bytes bucket: Name of bucket to change routing rule for.
:ivar bytes target_prefix: Target prefix to redirect to. | 62599029be8e80087fbc0029 |
class Ruleset(object): <NEW_LINE> <INDENT> def __init__(self, name, comments=[], props={}, uid=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.comments = comments <NEW_LINE> self.props = props <NEW_LINE> if uid: <NEW_LINE> <INDENT> self.uid = uid <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.uid = name... | Set of rules | 625990290a366e3fb87dd998 |
class DealSubscribeDetailForm(NoManytoManyHintModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = DealSubscribe <NEW_LINE> fields = ['mobile', 'includes', 'excludes', 'is_active', 'msg_count'] | Detail form for DealSubscribe | 62599029507cdc57c63a5d58 |
class TestFloodEvacuationVectorHazardFunction(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> registry = ImpactFunctionManager().registry <NEW_LINE> registry.clear() <NEW_LINE> registry.register(FloodEvacuationVectorHazardFunction) <NEW_LINE> <DEDENT> def test_run(self): <NEW_LINE> <INDENT>... | Test for Flood Vector Building Impact Function. | 625990295e10d32532ce40dc |
class Event(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=200) <NEW_LINE> teaser = models.TextField(max_length=200, blank=True, null=True) <NEW_LINE> wikiPage = models.CharField(max_length=200) <NEW_LINE> startDate = models.DateTimeField() <NEW_LINE> endDate = models.DateTimeField(blank=True, nu... | Represents an event | 625990295166f23b2e244387 |
class ProgressSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> user = UserSerializer(read_only=True) <NEW_LINE> category = CategorySerializer(read_only=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Progress <NEW_LINE> fields = '__all__' | serializes the Progress model
(nested with user and the category serializer) | 625990298a349b6b436871ea |
class FeedbackDeleted(): <NEW_LINE> <INDENT> def __init__(self, *, status: int = None, message: str = None) -> None: <NEW_LINE> <INDENT> self.status = status <NEW_LINE> self.message = message <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_dict(cls, _dict: Dict) -> 'FeedbackDeleted': <NEW_LINE> <INDENT> args = {} ... | The status and message of the deletion request.
:attr int status: (optional) HTTP return code.
:attr str message: (optional) Status message returned from the service. | 62599029ac7a0e7691f7349a |
class CacheId(str): <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> return f"CacheId({super().__repr__()})" | Unique identifier of the Cache object. | 6259902973bcbd0ca4bcb243 |
class NestedHost(Host): <NEW_LINE> <INDENT> def __init__(self, host): <NEW_LINE> <INDENT> super(NestedHost, self).__init__(host) <NEW_LINE> <DEDENT> def children(self): <NEW_LINE> <INDENT> return self.procs | This class contains information and actions related to a nested job. | 62599029ec188e330fdf9846 |
class ProjectOverviewResponse(object): <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRUCT, 'project', (Project, Project.thrift_spec), None, ), (2, TType.I32, 'numExperiments', None, None, ), (3, TType.I32, 'numExperimentRuns', None, None, ), ) <NEW_LINE> def __init__(self, project=None, numExperiments=None, num... | Attributes:
- project
- numExperiments
- numExperimentRuns | 625990299b70327d1c57fd34 |
class CharmUpgradeOperation(object): <NEW_LINE> <INDENT> def __init__(self, agent): <NEW_LINE> <INDENT> self._agent = agent <NEW_LINE> self._log = logging.getLogger("unit.upgrade") <NEW_LINE> self._charm_directory = tempfile.mkdtemp( suffix="charm-upgrade", prefix="tmp") <NEW_LINE> <DEDENT> def retrieve_charm(self, cha... | A unit agent charm upgrade operation. | 625990296fece00bbaccc96b |
class BgClient(object): <NEW_LINE> <INDENT> executor = ThreadPoolExecutor(max_workers=10) <NEW_LINE> def __init__(self, t_client): <NEW_LINE> <INDENT> self.t_client = t_client <NEW_LINE> <DEDENT> def __getattr__(self, thrift_method): <NEW_LINE> <INDENT> def submit(*args, **kwargs): <NEW_LINE> <INDENT> return self.execu... | Helper class that wraps a thriftpy TClient | 625990298c3a8732951f750b |
class MapReader: <NEW_LINE> <INDENT> def recursive_flood_fill(self, grid, row: int, col: int): <NEW_LINE> <INDENT> if (row < 0 or row > len(grid) - 1): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> if (col < 0 or col > len(grid[0]) - 1): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> if (grid[row][col] != 1): <NEW_LIN... | Reads the reduced map (1s and 0s), where 1 - island and 0 - sea | 6259902956b00c62f0fb3873 |
class SectionLinkCollection(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swaggerTypes = { 'SectionLinkList': 'list[SectionLink]', 'link': 'Link' } <NEW_LINE> self.attributeMap = { 'SectionLinkList': 'SectionLinkList','link': 'link'} <NEW_LINE> self.SectionLinkList = None <NEW_LINE> self.lin... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62599029d10714528d69ee66 |
class _CoordGroup: <NEW_LINE> <INDENT> def __init__(self, coords, cubes): <NEW_LINE> <INDENT> self.coords = coords <NEW_LINE> self.cubes = cubes <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return iter(self.coords) <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> return list(self).__ge... | Represents a list of coordinates, one for each given cube. Which can be
operated on conveniently. | 62599029d164cc6175821f2c |
class Address(models.Model): <NEW_LINE> <INDENT> street = models.CharField(max_length=200, blank=True, verbose_name=_('street')) <NEW_LINE> city = models.CharField(max_length=100, blank=True, verbose_name=_('city')) <NEW_LINE> postal_number = models.CharField(max_length=10, blank=True, verbose_name=_('zip code')) <NEW_... | Represents a postal address. | 625990291d351010ab8f4acb |
class RelativeChessBoard(): <NEW_LINE> <INDENT> def __init__(self, chessboard, row, col, relative_row_start_pos=0, relative_col_start_pos=0): <NEW_LINE> <INDENT> if (row + relative_row_start_pos > chessboard.getRowMaxNum() or col + relative_col_start_pos > chessboard.getColMaxNum()): <NEW_LINE> <INDENT> raise ValueErro... | Get a chessboard in a chessboard.
rwo:new chessboard row.
col:new chessboard col.
relative_row_start_pos:this chessboard row relative to main chessboard.
relative_col_start_pos:this chessboard col relative to main chessboard. | 6259902991af0d3eaad3addd |
class Treelet(object): <NEW_LINE> <INDENT> def __init__(self, subtree, frontier_ids): <NEW_LINE> <INDENT> self.subtree = subtree <NEW_LINE> self.frontier_ids = set(frontier_ids) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_monosaccharide(cls, monosaccharide): <NEW_LINE> <INDENT> monosaccharide = root(monosaccha... | Represents a subgraph of a larger :class:`~.Glycan`, with a frontier
of node ids which are children of the current subgraph.
Attributes
----------
frontier_ids : :class:`set`
The id values of the nodes from the parent :class:`~.Glycan` which
are children of members of :attr:`subtree`
subtree : :class:`~.Glycan... | 625990291f5feb6acb163ba5 |
class LandsatArchiveError(LandsatError): <NEW_LINE> <INDENT> pass | Base class for LandsatArchive exceptions | 62599029507cdc57c63a5d5c |
class _ErrorHandler(object): <NEW_LINE> <INDENT> def __init__(self, log, defaultloglevel=logging.INFO, raiseExceptions=True): <NEW_LINE> <INDENT> self.enabled = True <NEW_LINE> if log: <NEW_LINE> <INDENT> self._log = log <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> import sys <NEW_LINE> self._log = logging.getLogger('... | handles all errors and log messages | 6259902930c21e258be997c1 |
class FeedParser(object): <NEW_LINE> <INDENT> def __init__(self, url): <NEW_LINE> <INDENT> self.url = url <NEW_LINE> <DEDENT> @log_function_call(log_result=False) <NEW_LINE> def parse(self, modified=None): <NEW_LINE> <INDENT> feed = feedparser.parse(self.url, modified=self._datetime_to_time_struct(modified)) <NEW_LINE>... | Executive class used to download and parse feed. | 625990295166f23b2e24438b |
class FamilyEnrollmentList(generics.ListCreateAPIView): <NEW_LINE> <INDENT> serializer_class = FamilyEnrollmentSerializer <NEW_LINE> permission_classes = (permissions.IsAuthenticated,) <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> if len(self.request.query_params) == 0: <NEW_LINE> <INDENT> return FamilyEnrollm... | Defines the enrollment status of a family in a given program. The open date is required, but the close date
is optional (if missing, it indicates that the family is still enrolled). Read/write access is determined by
the read/write access of the user to the family. Read access to the supplied program is required for cr... | 62599029d164cc6175821f2d |
class Dashboard: <NEW_LINE> <INDENT> def __init__(self, name=__name__, secret='__secret__'): <NEW_LINE> <INDENT> import os <NEW_LINE> self.app = Flask(name, static_folder=os.path.join(os.path.dirname(__file__), 'static')) <NEW_LINE> self.app.debug = True <NEW_LINE> self.app.config['DEBUG'] = True <NEW_LINE> self.app.co... | Dashboard entry point | 6259902973bcbd0ca4bcb247 |
class WriteToParquet(PTransform): <NEW_LINE> <INDENT> def __init__( self, file_path_prefix, schema, row_group_buffer_size=64 * 1024 * 1024, record_batch_size=1000, codec='none', use_deprecated_int96_timestamps=False, file_name_suffix='', num_shards=0, shard_name_template=None, mime_type='application/x-parquet'): <NEW_L... | A ``PTransform`` for writing parquet files.
This ``PTransform`` is currently experimental. No backward-compatibility
guarantees. | 62599029e76e3b2f99fd99c2 |
class ListProductsAsyncPager: <NEW_LINE> <INDENT> def __init__( self, method: Callable[..., Awaitable[product_search_service.ListProductsResponse]], request: product_search_service.ListProductsRequest, response: product_search_service.ListProductsResponse, *, metadata: Sequence[Tuple[str, str]] = () ): <NEW_LINE> <INDE... | A pager for iterating through ``list_products`` requests.
This class thinly wraps an initial
:class:`google.cloud.vision_v1p4beta1.types.ListProductsResponse` object, and
provides an ``__aiter__`` method to iterate through its
``products`` field.
If there are more pages, the ``__aiter__`` method will make additional
... | 6259902923e79379d538d4c0 |
class FormsetForm(object): <NEW_LINE> <INDENT> def _fieldset(self, field_names): <NEW_LINE> <INDENT> fieldset = copy(self) <NEW_LINE> if not hasattr(self, "_fields_done"): <NEW_LINE> <INDENT> self._fields_done = [] <NEW_LINE> <DEDENT> fieldset.non_field_errors = lambda *args: None <NEW_LINE> names = [f for f in field_n... | Form mixin that provides template methods for iterating through
sets of fields by prefix, single fields and finally remaning
fields that haven't been, iterated with each fieldset made up from
a copy of the original form, giving access to as_* methods.
The use case for this is ``OrderForm`` below. It contains a
handful... | 62599029d10714528d69ee67 |
class ALU(): <NEW_LINE> <INDENT> def execute_instruction(): <NEW_LINE> <INDENT> pass | Arithmetic Logical Unit handles all of the arithmetic instructions
| 6259902921bff66bcd723c18 |
class TestDistrictsDeleted(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 testDistrictsDeleted(self): <NEW_LINE> <INDENT> pass | DistrictsDeleted unit test stubs | 62599029796e427e5384f733 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.