code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class SolarSchedule(models.Model): <NEW_LINE> <INDENT> EVENTS = { 'dawn_astronomical': { 'method': 'next_rising', 'horizon': '-18', 'use_center': True}, 'dawn_nautical': { 'method': 'next_rising', 'horizon': '-12', 'use_center': True}, 'dawn_civil': { 'method': 'next_rising', 'horizon': '-6', 'use_center': True}, 'sunr...
Model to represent and calculate times for solar events.
62599089283ffb24f3cf547b
@dataclass <NEW_LINE> class CE_Person(Person, CE_BaseModel): <NEW_LINE> <INDENT> def __init__(self, identifier: str, name: str, url: str, contributor: str, creator: str, title: str, source: str): <NEW_LINE> <INDENT> CE_BaseModel.__init__(self, identifier, name, url, contributor, creator) <NEW_LINE> self.title = title <...
Trompa Person model Inherits from schema.org Person
62599089656771135c48ae1e
class XmlSmartyLexer(DelegatingLexer): <NEW_LINE> <INDENT> name = 'XML+Smarty' <NEW_LINE> aliases = ['xml+smarty'] <NEW_LINE> alias_filenames = ['*.xml', '*.tpl'] <NEW_LINE> mimetypes = ['application/xml+smarty'] <NEW_LINE> def __init__(self, **options): <NEW_LINE> <INDENT> super().__init__(XmlLexer, SmartyLexer, **opt...
Subclass of the `SmartyLexer` that highlights unlexed data with the `XmlLexer`.
6259908950812a4eaa6219b3
class WebMaster(RSSSingleElement): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> RSSSingleElement.__init__(self, value, 'webMaster')
Email address for person responsible for technical issues relating to channel Example: WebMaster('jsmith@example.com (John Smith)')
62599089283ffb24f3cf547c
@ejit <NEW_LINE> class OverflowError(ArithmeticError): <NEW_LINE> <INDENT> pass
Result too large to be represented.
6259908992d797404e38994a
class _CommandFemMeshNetgenFromShape(CommandManager): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(_CommandFemMeshNetgenFromShape, self).__init__() <NEW_LINE> self.resources = {'Pixmap': 'fem-femmesh-netgen-from-shape', 'MenuText': QtCore.QT_TRANSLATE_NOOP("FEM_MeshNetgenFromShape", "FEM mesh from ...
The FEM_MeshNetgenFromShape command definition
625990893617ad0b5ee07d2e
class UnsafeContentSource(BaseCSPIssue): <NEW_LINE> <INDENT> def getIssueName(self): <NEW_LINE> <INDENT> return "Unsafe Content Source: %s" % self._directive <NEW_LINE> <DEDENT> def getIssueDetail(self): <NEW_LINE> <INDENT> return "This content security policy allows for unsafe content sources" <NEW_LINE> <DEDENT> def ...
Any directive that allows unsafe content (e.g. 'unsafe-eval')
62599089aad79263cf430397
class LBAL(chainer.Chain): <NEW_LINE> <INDENT> def __init__(self, n_class: int, med_dim: int=1024): <NEW_LINE> <INDENT> super(LBAL, self).__init__() <NEW_LINE> with self.init_scope(): <NEW_LINE> <INDENT> self.med_fc = links.Linear( None, med_dim, initialW=initializers.Normal(scale=0.01)) <NEW_LINE> self.bn = links.Batc...
Chain to feed output of Extractor to FC => BN => ReLU => FC.
6259908955399d3f056280f1
class YARNModel(object): <NEW_LINE> <INDENT> def __init__(self, key): <NEW_LINE> <INDENT> self.key = key <NEW_LINE> <DEDENT> @property <NEW_LINE> @cache.cached(timeout=5) <NEW_LINE> def state(self): <NEW_LINE> <INDENT> state = redis_store.get(self.key) <NEW_LINE> return json.loads(state) if state is not None else {} <N...
Model class that exposes YARN metrics stored in redis by a separate worker process.
625990897b180e01f3e49e53
class SomeString(SomeStringOrUnicode): <NEW_LINE> <INDENT> knowntype = str <NEW_LINE> def noneify(self): <NEW_LINE> <INDENT> return SomeString(can_be_None=True, no_nul=self.no_nul)
Stands for an object which is known to be a string.
625990894527f215b58eb78e
class Stage(object): <NEW_LINE> <INDENT> def __init__(self, size, layers, default_layer): <NEW_LINE> <INDENT> self.__size = size <NEW_LINE> self.__cam_at = None <NEW_LINE> self.__layers = {} <NEW_LINE> self.__spawns = {} <NEW_LINE> self.__layer_names = layers <NEW_LINE> self.__default_layer = default_layer <NEW_LINE> f...
Stage((width, height), layers, default_layer) -> a new Stage Stages store Entities in layers. Layers are all named. Layers and the Entities in them have a set order.
62599089283ffb24f3cf547d
class Arg: <NEW_LINE> <INDENT> NO_DEFAULT = object() <NEW_LINE> ARG_TYPE_FIXTURE = "F" <NEW_LINE> ARG_TYPE_OPTION = "O" <NEW_LINE> ARG_TYPE_POSITIONAL = 'P' <NEW_LINE> ARG_TYPE_TRAIL = "T" <NEW_LINE> def __init__(self, name, arg_type, default=NO_DEFAULT): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.arg_type = ...
Holds meta-information about the associated *function parameter*.
6259908963b5f9789fe86d47
class OrderFilter(django_filters.FilterSet): <NEW_LINE> <INDENT> start_date = DateFilter(field_name='date_created', lookup_expr='gte') <NEW_LINE> end_date = DateFilter(field_name='date_created', lookup_expr='lte') <NEW_LINE> description = CharFilter(field_name='description', lookup_expr='icontains') <NEW_LINE> class Me...
create a class to filter the orders
625990894a966d76dd5f0ac4
class KvcacheSession(DictSession): <NEW_LINE> <INDENT> def _mark_dirty(self): <NEW_LINE> <INDENT> super()._mark_dirty() <NEW_LINE> if self._livedata: <NEW_LINE> <INDENT> self._store() <NEW_LINE> self._is_dirty = False <NEW_LINE> <DEDENT> <DEDENT> def _create_dict(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> retu...
Session backend that makes use of a configured :mod:`score.kvcache`.
62599089d486a94d0ba2db94
class YapfLinter(base.LinterBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(YapfLinter, self).__init__("yapf", "yapf 0.26.0") <NEW_LINE> <DEDENT> def get_lint_version_cmd_args(self): <NEW_LINE> <INDENT> return ["--version"] <NEW_LINE> <DEDENT> def needs_file_diff(self): <NEW_LINE> <INDENT> retu...
Yapf linter.
62599089d8ef3951e32c8c4d
class JSON: <NEW_LINE> <INDENT> def __init__(self, serializer=json.dumps, adapters=(), **kw): <NEW_LINE> <INDENT> self.serializer = serializer <NEW_LINE> self.kw = kw <NEW_LINE> self.components = Components() <NEW_LINE> for type, adapter in adapters: <NEW_LINE> <INDENT> self.add_adapter(type, adapter) <NEW_LINE> <DEDEN...
Renderer that returns a JSON-encoded string. Configure a custom JSON renderer using the :meth:`~pyramid.config.Configurator.add_renderer` API at application startup time: .. code-block:: python from pyramid.config import Configurator config = Configurator() config.add_renderer('myjson', JSON(indent=4)) On...
62599089dc8b845886d55198
class Bucket(object): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.bucket = [] <NEW_LINE> self.name = name <NEW_LINE> <DEDENT> def execute(self, settings_file=None, output=os.path.abspath(__file__), ClsResult = BucketResult): <NEW_LINE> <INDENT> logging.info('Wykonuje zadanie: ' + self.name + ...
Container for tasks to execute.
625990893346ee7daa338452
class Dexterity(Ability): <NEW_LINE> <INDENT> associated_skills = ['Ranged Combat:', 'Sleight of Hand', 'Vehicles'] <NEW_LINE> associated_defenses = [] <NEW_LINE> ability_name = "Dexterity"
Dexterity: Skill: Ranged Combat: *: 0.5 point/rank Skill: Sleight of Hand 0.5 ppr Skill: Vehicles 0.5 ppr TOTAL: 1.5 ppr
6259908950812a4eaa6219b5
class Menu(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=32,unique=True) <NEW_LINE> icon = models.CharField(max_length=32) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.title
菜单表
6259908926068e7796d4e522
class Usuario(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField(User, on_delete=models.CASCADE) <NEW_LINE> direccion = models.CharField(max_length=110, blank=True, null=True) <NEW_LINE> telefono = models.CharField(max_length=50, blank=True, null=True) <NEW_LINE> monto = models.DecimalField(max_digits=11, d...
Model definition for Usuario.
6259908999fddb7c1ca63bcc
class LoggerHook(pecan.hooks.PecanHook): <NEW_LINE> <INDENT> def on_route(self, state): <NEW_LINE> <INDENT> state.request.start = time.time() <NEW_LINE> <DEDENT> def after(self, state): <NEW_LINE> <INDENT> delta = time.time() - state.request.start <NEW_LINE> LOG.info('%s "%s %s" status: %d time: %0.3f', state.request.c...
Print out requests in the log
62599089d486a94d0ba2db96
class ContainerServiceCustomProfile(Model): <NEW_LINE> <INDENT> _validation = { 'orchestrator': {'required': True}, } <NEW_LINE> _attribute_map = { 'orchestrator': {'key': 'orchestrator', 'type': 'str'}, } <NEW_LINE> def __init__(self, *, orchestrator: str, **kwargs) -> None: <NEW_LINE> <INDENT> super(ContainerServiceC...
Properties to configure a custom container service cluster. All required parameters must be populated in order to send to Azure. :param orchestrator: Required. The name of the custom orchestrator to use. :type orchestrator: str
62599089e1aae11d1e7cf604
class OrderBase(TimestableMixin, models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> <DEDENT> __metaclass__ = DeferredModelMetaclass.for_point( Order, extend_meta( verbose_name=u'Заказ', verbose_name_plural=u'Заказы' ) ) <NEW_LINE> user_name = models.CharField(verbose_name=u'ФИ...
Базовый класс для информации о заказе
625990897cff6e4e811b7623
class SyncMapInstance(InstanceResource): <NEW_LINE> <INDENT> def __init__(self, version, payload, service_sid, sid=None): <NEW_LINE> <INDENT> super(SyncMapInstance, self).__init__(version) <NEW_LINE> self._properties = { 'sid': payload['sid'], 'unique_name': payload['unique_name'], 'account_sid': payload['account_sid']...
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
62599089283ffb24f3cf5481
class InvalidAuth(Exception): <NEW_LINE> <INDENT> pass
Raised when osu gives us an error login response. Don't get confused with `InvalidCredentials`, where osu don't even takes with us.
625990892c8b7c6e89bd53c8
class DemoException(Exception): <NEW_LINE> <INDENT> pass
An exception type for the demo.
625990894c3428357761be9c
class Libnet(AutotoolsPackage): <NEW_LINE> <INDENT> homepage = "https://www.example.com" <NEW_LINE> url = "https://github.com/libnet/libnet/archive/v1.2.tar.gz" <NEW_LINE> version('1.2', sha256='b7a371a337d242c017f3471d70bea2963596bec5bd3bd0e33e8517550e2311ef') <NEW_LINE> depends_on('libtool') <NEW_LINE> depen...
FIXME: Put a proper description of your package here.
62599089099cdd3c636761eb
class Sensor(sql.Base, abstract.Sensor): <NEW_LINE> <INDENT> __resource__ = 'sensors' <NEW_LINE> __tablename__ = 'sensor' <NEW_LINE> __table_args__ = sql.table_args() <NEW_LINE> id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True, autoincrement=True) <NEW_LINE> uuid = sqlalchemy.Column(sqlalchemy.String(36)) <N...
Represent an sensor in sqlalchemy.
62599089091ae35668706825
@loader.tds <NEW_LINE> class CONTACTMod(loader.Module): <NEW_LINE> <INDENT> strings = {"name": "contact"} <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.name = self.strings["name"] <NEW_LINE> <DEDENT> def config_complete(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> async def contactcmd(self, message): <...
Это модуль для игры в "контакт"
62599089be7bc26dc9252c47
class TestLexer(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.f = io.StringIO() <NEW_LINE> self.lines = ['First 1 "string"\n', 'Second line\n', 'Third line\n'] <NEW_LINE> self.f.write(''.join(self.lines)) <NEW_LINE> self.f.seek(0) <NEW_LINE> self.lineReader = LineReader(self.f) <NEW_...
Test case docstring.
62599089aad79263cf43039d
class OutputsWriter(object): <NEW_LINE> <INDENT> def __init__(self, options): <NEW_LINE> <INDENT> self._writers = {k: None for k in ['candidates', 'examples', 'gvcfs']} <NEW_LINE> if options.candidates_filename: <NEW_LINE> <INDENT> self._add_writer('candidates', io_utils.RawProtoWriterAdaptor( io_utils.make_tfrecord_wr...
Manages all of the outputs of make_examples in a single place.
62599089adb09d7d5dc0c13d
class TimeEvent(): <NEW_LINE> <INDENT> def __init__(self, signame): <NEW_LINE> <INDENT> self.signal = Signal.register(signame) <NEW_LINE> self.value = None <NEW_LINE> <DEDENT> def is_periodic(self): <NEW_LINE> <INDENT> return self.interval > 0 <NEW_LINE> <DEDENT> def post_at(self, act, abs_time): <NEW_LINE> <INDENT> as...
TimeEvent is a composite class that contains Event-like fields. A TimeEvent is created by the application and added to the Framework. The Framework then posts the event to the HSM after the given delay. A one-shot TimeEvent is created by calling either post_at() or post_in(). A periodic TimeEvent is created by calling ...
62599089283ffb24f3cf5483
class ListaMatriculasAluno(generics.ListAPIView): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> queryset = Matricula.objects.filter(aluno_id=self.kwargs['pk']) <NEW_LINE> return queryset <NEW_LINE> <DEDENT> serializer_class = ListaMatriculasAlunoSerializer <NEW_LINE> authentication_classes = [BasicAut...
Listando as matriculas de um aluno ou aluna
625990894c3428357761be9e
class handles(object): <NEW_LINE> <INDENT> def __init__(self, *nodetypes): <NEW_LINE> <INDENT> if len(nodetypes) == 1 and isinstance(nodetypes[0], collections.Iterable): <NEW_LINE> <INDENT> nodetypes = nodetypes[0] <NEW_LINE> <DEDENT> self.nodetypes = list(nodetypes) <NEW_LINE> <DEDENT> def __call__(self, func): <NEW_L...
Decorator for walker functions. Use it by specifying the nodetypes that need to be handled by the given function. It is possible to use groupd (e.g., op.RELATIONS) directly. :: @handles(op.NODE, ...) def walk_special(...): ...
62599089a8370b77170f1fb1
class CaseLikeObject: <NEW_LINE> <INDENT> def filter_available_review_types(self, milestones: dict, reviews: QuerySet) -> list: <NEW_LINE> <INDENT> now = datetime.date.today() <NEW_LINE> available_reviews = [] <NEW_LINE> for review_type in reviews: <NEW_LINE> <INDENT> status = "ok" <NEW_LINE> review_dict = review_type....
An object that has many of the same qualities as a Case but may not be one. Used to provide shared functionality to both Notice and Case models without duplicating code. Notices share many of the same qualities as a Case, but they do not exist on the TRS system as they were created before it was in use.
62599089099cdd3c636761ec
class FormValidator(FancyValidator): <NEW_LINE> <INDENT> validate_partial_form = False <NEW_LINE> validate_partial_python = None <NEW_LINE> validate_partial_other = None <NEW_LINE> def is_empty(self, value): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> def field_is_empty(self, value): <NEW_LINE> <INDENT> return...
A FormValidator is something that can be chained with a Schema. Unlike normal chaining the FormValidator can validate forms that aren't entirely valid. The important method is .validate(), of course. It gets passed a dictionary of the (processed) values from the form. If you have .validate_partial_form set to True,...
62599089be7bc26dc9252c48
class EnergyManagementSystemProgram(DataObject): <NEW_LINE> <INDENT> _schema = {'extensible-fields': OrderedDict([(u'program line 1', {'name': u'Program Line 1', 'pyname': u'program_line_1', 'required-field': False, 'autosizable': False, 'autocalculatable': False, 'type': u'alpha'})]), 'fields': OrderedDict([(u'name', ...
Corresponds to IDD object `EnergyManagementSystem:Program` This input defines an Erl program Each field after the name is a line of EMS Runtime Language
625990895fc7496912d4905d
class SearchWindow: <NEW_LINE> <INDENT> def __init__(self, input_win, relevant_win): <NEW_LINE> <INDENT> self._input_window = input_win <NEW_LINE> self._relevant_window = relevant_win <NEW_LINE> self._rmaxy, self._rmaxx = relevant_win.getmaxyx() <NEW_LINE> <DEDENT> def _fix(self): <NEW_LINE> <INDENT> self._input_window...
进行单词查询时左侧的窗口
625990894527f215b58eb792
class PubSubmissionFormPreview(FormPreview): <NEW_LINE> <INDENT> FormPreview.form_template = "add_publication.html" <NEW_LINE> FormPreview.preview_template = "add_publication_preview.html" <NEW_LINE> def process_preview(self, request, form, context): <NEW_LINE> <INDENT> cd = form.cleaned_data <NEW_LINE> if 'pmid' in cd...
Form preview view for publication submission.
62599089283ffb24f3cf5486
class TestData2(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 testData2(self): <NEW_LINE> <INDENT> pass
Data2 unit test stubs
62599089ec188e330fdfa493
class QueryNetworkError(Exception): <NEW_LINE> <INDENT> pass
Exception thrown when the socket connection fails.
62599089e1aae11d1e7cf607
class NonNull(Structure): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(NonNull, self).__init__(*args, **kwargs) <NEW_LINE> assert not isinstance(self._of_type, NonNull), ( "Can only create NonNull of a Nullable GraphQLType but got: {}." ).format(self._of_type) <NEW_LINE> <DEDENT> d...
Non-Null Modifier A non-null is a kind of type marker, a wrapping type which points to another type. Non-null types enforce that their values are never null and can ensure an error is raised if this ever occurs during a request. It is useful for fields which you can make a strong guarantee on non-nullability, for exam...
625990893617ad0b5ee07d38
class Solution: <NEW_LINE> <INDENT> def uniquePaths(self, m, n): <NEW_LINE> <INDENT> dp = [[0] *(n) for i in range(m)] <NEW_LINE> for i in range(m): <NEW_LINE> <INDENT> for j in range(n): <NEW_LINE> <INDENT> if i == 0 or j == 0: <NEW_LINE> <INDENT> dp[i][j] = 1 <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> dp[i][j] = d...
@param m: positive integer (1 <= m <= 100) @param n: positive integer (1 <= n <= 100) @return: An integer
6259908997e22403b383cade
class TestWrapper: <NEW_LINE> <INDENT> def __init__(self, test, sconf): <NEW_LINE> <INDENT> self.test = test <NEW_LINE> self.sconf = sconf <NEW_LINE> <DEDENT> def __call__(self, *args, **kw): <NEW_LINE> <INDENT> if not self.sconf.active: <NEW_LINE> <INDENT> raise SCons.Errors.UserError <NEW_LINE> <DEDENT> context = Che...
A wrapper around Tests (to ensure sanity)
625990897cff6e4e811b7629
class PostListAPIView(ListAPIView): <NEW_LINE> <INDENT> authentication_classes = (TokenAuthentication,) <NEW_LINE> permission_classes = [IsAuthenticated, ] <NEW_LINE> queryset = Post.objects.all() <NEW_LINE> serializer_class = PostSerializer <NEW_LINE> filter_backends = [filters.DjangoFilterBackend] <NEW_LINE> filterse...
All post , all likes, likes, dislike
6259908960cbc95b06365b5f
class DummyConverter(conversion.MySQLConverter): <NEW_LINE> <INDENT> ...
A dummy MySQL converter class that doesn't implement any conversion.
625990897047854f46340f9c
class LyLyricElement(LyObject): <NEW_LINE> <INDENT> def __init__(self, lyMarkupOrString=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.lyMarkupOrString = lyMarkupOrString <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '<%s.%s object %r>' % (self.__module__, self.__class__.__name__, se...
Object represents a single Lyric in lilypond. >>> lle = lily.lilyObjects.LyLyricElement("hel_") >>> lle <music21.lily.lilyObjects.LyLyricElement object 'hel_'> >>> print(lle) hel_
62599089fff4ab517ebcf3fe
@abstract <NEW_LINE> class Transport(EnergyAsset): <NEW_LINE> <INDENT> capacity = EAttribute(eType=EDouble, unique=True, derived=False, changeable=True) <NEW_LINE> efficiency = EAttribute(eType=EDouble, unique=True, derived=False, changeable=True) <NEW_LINE> def __init__(self, *, capacity=None, efficiency=None, **kwarg...
An abstract class that describes EnergyAssets that can transport energy. It is one of the 5 capabilities in ESDL
62599089aad79263cf4303a2
class StructEq(object): <NEW_LINE> <INDENT> NONEQ_ATTRS = frozenset() <NEW_LINE> def __eq__(self, other): <NEW_LINE> <INDENT> if self is other: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> if type(self) != type(other): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> if len(self.__dict__) != len(other.__dict...
A simple mixin that defines equality based on the objects attributes. This class is especially useful if you're in a situation where one object might not have all the attributes of the other, and your __eq__ method would otherwise have to remember to deal with that. Classes extending StructEq should only be used in h...
62599089aad79263cf4303a3
class SUPGPStabilizationTerm( Term ): <NEW_LINE> <INDENT> name = 'dw_st_supg_p' <NEW_LINE> arg_types = ('material', 'virtual', 'parameter', 'state') <NEW_LINE> function = staticmethod(terms.dw_st_supg_p) <NEW_LINE> def __call__( self, diff_var = None, chunk_size = None, **kwargs ): <NEW_LINE> <INDENT> delta, virtual, p...
:Description: SUPG stabilization term, pressure part ( :math:`\delta` is a local stabilization parameter). :Definition: .. math:: \sum_{K \in \Ical_h}\int_{T_K} \delta_K\ \nabla p\cdot ((\ul{b} \cdot \nabla) \ul{v}) :Arguments: material : :math:`\delta_K`, virtual : :math:`\ul{v}`, parameter : ...
6259908923849d37ff852ca3
class CollectionResourceTest(TestBase): <NEW_LINE> <INDENT> def test_all_args(self): <NEW_LINE> <INDENT> resource = "RESOURCE" <NEW_LINE> date = datetime.date(1962, 1, 13) <NEW_LINE> user_id = "bilbo" <NEW_LINE> data = { 'a': 1, 'b': 2} <NEW_LINE> expected_data = data.copy() <NEW_LINE> expected_data['date'] = date.strf...
Tests for _COLLECTION_RESOURCE
6259908997e22403b383cae0
class IpAddressScan(BaseWsModel): <NEW_LINE> <INDENT> started_at = models.DateTimeField(null=False) <NEW_LINE> ended_at = models.DateTimeField(null=True) <NEW_LINE> ip_address = models.ForeignKey( IpAddress, related_name="ip_address_scans", null=False, on_delete=models.CASCADE, )
This is a class for representing a scan of a single IP address.
625990894c3428357761bea4
class SumoSolver(ABC): <NEW_LINE> <INDENT> def __init__(self, graph: MultiplexNet, nbins: int, bin_size: int = None, rseed: int = None): <NEW_LINE> <INDENT> if rseed is not None: <NEW_LINE> <INDENT> np.random.seed(rseed) <NEW_LINE> seed(rseed) <NEW_LINE> <DEDENT> if not isinstance(graph, MultiplexNet): <NEW_LINE> <INDE...
Defines solver of sumo Args: | graph (MultiplexNet): network object, containing data about connections between nodes in each layer in form of adjacency matrices | nbins (int): number of bins, to distribute samples into | bin_size (int): size of bin, if None set to number of samples
62599089f9cc0f698b1c60c0
class PatronOrf: <NEW_LINE> <INDENT> def __init__(self, clases_orf): <NEW_LINE> <INDENT> self.clases_orf = clases_orf <NEW_LINE> self.orf_patron_hydro = [] <NEW_LINE> self.orf_patron_protein = [] <NEW_LINE> self.id_patron_hydro = [] <NEW_LINE> self.id_patron_protein = [] <NEW_LINE> <DEDENT> def count_patron(self): <NEW...
Clase para procesar la colección de clases funcionales
6259908926068e7796d4e52c
class VerifyEmailRequestSerializer(serializers.Serializer): <NEW_LINE> <INDENT> code = serializers.CharField()
Serializer for verifying if the request by the verify email API is valid
62599089fff4ab517ebcf400
class DBTable(Table): <NEW_LINE> <INDENT> def __init__(self, storage, cache_size=10): <NEW_LINE> <INDENT> self._storage = storage <NEW_LINE> self._query_cache = LRUCache(capacity=cache_size) <NEW_LINE> data = self._read() <NEW_LINE> if data: <NEW_LINE> <INDENT> self._last_id = max(i for i in data) <NEW_LINE> <DEDENT> e...
Represents a single TinyDB Table.
62599089ad47b63b2c5a943d
class PruneEvaluators(object): <NEW_LINE> <INDENT> pass
PruneEvaluators answer the question (return true/false) Evaluation.INCLUDE_AND_PRUNE Evaluation.EXCLUDE_AND_PRUNE
6259908923849d37ff852ca5
class TruckTableWidget(QWidget): <NEW_LINE> <INDENT> def __init__(self, number_of_goods, type): <NEW_LINE> <INDENT> QWidget.__init__(self) <NEW_LINE> self.type = type <NEW_LINE> self.truckHLayout = QHBoxLayout(self) <NEW_LINE> self.number_of_goods = number_of_goods <NEW_LINE> self.goodTable = QTableWidget(1,number_of_g...
Truck Data Widget
625990897b180e01f3e49e5a
class AliasTest(RepositoryTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(AliasTest, self).setUp() <NEW_LINE> view = self.view <NEW_LINE> self.kind = view.findPath(self._KIND_KIND) <NEW_LINE> self.itemKind = view.findPath(self._ITEM_KIND) <NEW_LINE> self.attrKind = self.itemKind.itsParent['Att...
Test Aliases
62599089dc8b845886d551a4
class BlngYangTypeNotSupported(Exception): <NEW_LINE> <INDENT> def __init__(self, yang_type, path): <NEW_LINE> <INDENT> message = 'No support for the given YANG type: %s\nPath: %s' % (yang_type, path) <NEW_LINE> super().__init__(message)
Raised when we encounter a YANG type (not a typedef) which is not supported.
625990897c178a314d78e9df
class TestPlanGenerator(object): <NEW_LINE> <INDENT> def __init__(self, modules_list, ): <NEW_LINE> <INDENT> self.modules_list = modules_list <NEW_LINE> <DEDENT> def generate_test_plan_json(self): <NEW_LINE> <INDENT> test_plan_json = { TestPlanKeys.MODULES_LIST: [] } <NEW_LINE> import pdb; pdb.set_trace() <NEW_LINE> fo...
Generates an HTML-based test plan document
625990897047854f46340fa0
class ConnectionError(Error): <NEW_LINE> <INDENT> pass
Error raised when there is a problem connecting to the server.
625990894a966d76dd5f0ad2
class DistributionTimeout(RuntimeError): <NEW_LINE> <INDENT> pass
Raised when files timeout during file distribution.
62599089099cdd3c636761f0
class Manager(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.loggers = {} <NEW_LINE> <DEDENT> def getLogger(self, name): <NEW_LINE> <INDENT> if not isinstance(name, basestring): <NEW_LINE> <INDENT> raise TypeError("A logger name must be string or Unicode") <NEW_LINE> <DEDENT> if isinstance(na...
Simplified version of 'logging.Manager'.
625990897cff6e4e811b762f
class CallforpaperFileFactory(grok.Adapter): <NEW_LINE> <INDENT> grok.implements(IFileFactory) <NEW_LINE> grok.context(ICallforpaper) <NEW_LINE> def __call__(self, name, contentType, data): <NEW_LINE> <INDENT> talk = createObject('collective.conference.talk') <NEW_LINE> notify(ObjectCreatedEvent(talk)) <NEW_LINE> retur...
Custom file factory for programs, which always creates a Track.
62599089d8ef3951e32c8c54
class Agent: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def plan(self, state, occupancy_map, debug=False, is_last_plan=False): <NEW_LINE> <INDENT> raise NotImplementedError
Abstract base class for the various exploration agents. Must have a plan method, which takes the state (position of the robot), and the current map. plan should return path to next state and/or actions needed to get there
625990897b180e01f3e49e5b
class MyClass(models.Model): <NEW_LINE> <INDENT> _name = "inspection_tech.inspection_result.type" <NEW_LINE> name = fields.Char(required = True, size = 64, string = "Inspection Result", index = True, help = "Inspection Result Value", select = True) <NEW_LINE> orderno = fields.Integer("Order") <NEW_LINE> _order = 'order...
Inspection Point Result Type
625990894527f215b58eb796
class MuonKerenFittingTest(systemtesting.MantidSystemTest): <NEW_LINE> <INDENT> def runTest(self): <NEW_LINE> <INDENT> LoadMuonNexus(Filename='MUT00053591.nxs', DetectorGroupingTable='gp', OutputWorkspace='MUT53591') <NEW_LINE> MuonProcess(InputWorkspace='MUT53591', Mode='Combined', SummedPeriodSet='1', ApplyDeadTimeCo...
Tests the Keren fitting function on a real workspace, to check results vs. WiMDA
62599089656771135c48ae27
class JNTTFactoryConfigCommon(JNTTFactoryCommon): <NEW_LINE> <INDENT> def test_021_value_entry_config(self, **kwargs): <NEW_LINE> <INDENT> node_uuid='test_node' <NEW_LINE> main_value = self.get_main_value(node_uuid=node_uuid, **kwargs) <NEW_LINE> print(main_value) <NEW_LINE> config_value = main_value.create_config_valu...
Test the value factory
6259908926068e7796d4e530
class PollAnswerManager(core_managers.CoreStateManager): <NEW_LINE> <INDENT> def get_poll_percentages(self): <NEW_LINE> <INDENT> total_vote_counts = 0 <NEW_LINE> vote_count_averages = [] <NEW_LINE> poll_answers = self.permitted() <NEW_LINE> for poll_answer in poll_answers: <NEW_LINE> <INDENT> total_vote_counts += poll_...
Return percentage count the options of a poll have had.
6259908ae1aae11d1e7cf60b
class Down(nn.Module): <NEW_LINE> <INDENT> def __init__( self, in_channels: int, out_channels: int, pool: t.Literal["max", "avg"] = "max" ) -> None: <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.block = nn.Sequential( SENextBottleneck( in_channels=in_channels, out_channels=out_channels, stride=2, is_shortcut=T...
Downscaling with maxpool then double conv
6259908aad47b63b2c5a9441
class Scoreboard: <NEW_LINE> <INDENT> def __init__(self, ai_settings, screen, stats): <NEW_LINE> <INDENT> self.screen = screen <NEW_LINE> self.screen_rect = screen.get_rect() <NEW_LINE> self.ai_settings = ai_settings <NEW_LINE> self.stats = stats <NEW_LINE> self.text_color = (190, 255, 70) <NEW_LINE> self.font = pygame...
A class to report scoring information.
6259908ad8ef3951e32c8c55
class Aircraft(GameObject.GameObject): <NEW_LINE> <INDENT> def __init__(self, location, owner, aircraft_id, unique_id, max_speed, initial_location, health): <NEW_LINE> <INDENT> GameObject.GameObject.__init__(self, location, owner, aircraft_id, unique_id) <NEW_LINE> self.__max_speed = max_speed <NEW_LINE> self.__initial...
This is a base class for all moving objects in the game
6259908a4527f215b58eb797
class Storage(dict): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> __setattr__ = dict.__setitem__ <NEW_LINE> __delattr__ = dict.__delitem__ <NEW_LINE> __getitem__ = dict.get <NEW_LINE> __getattr__ = dict.get <NEW_LINE> __repr__ = lambda self: '<Storage %s>' % dict.__repr__(self) <NEW_LINE> __getstate__ = lambda self: N...
A Storage object is like a dictionary except `obj.foo` can be used in addition to `obj['foo']`, and setting obj.foo = None deletes item foo. >>> o = Storage(a=1) >>> print o.a 1 >>> o['a'] 1 >>> o.a = 2 >>> print o['a'] 2 >>> del o.a >>> print o.a None
6259908a50812a4eaa6219bd
class PygameInput(Input): <NEW_LINE> <INDENT> def sensingLoop(self): <NEW_LINE> <INDENT> if 'Scale' in self: <NEW_LINE> <INDENT> scale = self['Scale'] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> scale = 1 <NEW_LINE> <DEDENT> if self['FollowMouse']: <NEW_LINE> <INDENT> self.respond({Strings.LOCATION: pygame.mouse.get_...
PygameInput is an input tied to the PygameDisplay. Specify: <FollowMouse>True</FollowMouse> to receive an input every frame specifying the current mouse position. <Keyboard>True</Keyboard> to grab keystrokes <Clicks>True</Clicks> to grab clicks. NB: If follow mouse is enabled, PygameInput will not return mouse and ke...
6259908a283ffb24f3cf5490
class Slx9640_IfIndex(Slx_IfIndex_Core): <NEW_LINE> <INDENT> def __init__(self, interface, linecard='', speed='', tunnel_type='', *args, **kwargs): <NEW_LINE> <INDENT> self.data = kwargs <NEW_LINE> if not self.data: <NEW_LINE> <INDENT> self.data['interface'] = interface <NEW_LINE> self.data['linecard'] = linecard <NEW_...
Device specific classes validate against the device specific information.
6259908aa05bb46b3848bf1e
class LinkUser(ABC): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def can_navigate_from_start(self, link) -> bool: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def can_navigate_to_start(self, link) -> bool: <NEW_LINE> <INDENT> pass
Abstract parent class for all kinds link-users.
6259908a99fddb7c1ca63bd4
class Float(Field): <NEW_LINE> <INDENT> type = 'float' <NEW_LINE> _slots = { '_digits': None, 'group_operator': None, } <NEW_LINE> def __init__(self, string=Default, digits=Default, **kwargs): <NEW_LINE> <INDENT> super(Float, self).__init__(string=string, _digits=digits, **kwargs) <NEW_LINE> <DEDENT> @property <NEW_LIN...
The precision digits are given by the attribute :param digits: a pair (total, decimal), or a function taking a database cursor and returning a pair (total, decimal)
6259908aa8370b77170f1fbd
class HistoryStub(dnf.yum.history.YumHistory): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.old_data_pkgs = {} <NEW_LINE> <DEDENT> def _old_data_pkgs(self, tid, sort=True): <NEW_LINE> <INDENT> if sort: <NEW_LINE> <INDENT> raise NotImplementedError('sorting not implemented yet') <NEW_LINE> <DEDENT> r...
Stub of dnf.yum.history.YumHistory for easier testing.
6259908a5fc7496912d49063
class Payload(object): <NEW_LINE> <INDENT> def __init__(self, packets=None, encoded_payload=None): <NEW_LINE> <INDENT> self.packets = packets or [] <NEW_LINE> if encoded_payload is not None: <NEW_LINE> <INDENT> self.decode(encoded_payload) <NEW_LINE> <DEDENT> <DEDENT> def encode(self, b64=False): <NEW_LINE> <INDENT> en...
Engine.IO payload.
6259908a099cdd3c636761f2
class TestBuildingApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = Infoplus.api.building_api.BuildingApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_add_building(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_ad...
BuildingApi unit test stubs
6259908ad486a94d0ba2dba6
class DistributionTestBase(object): <NEW_LINE> <INDENT> dist = None <NEW_LINE> params = None <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> random.seed(0) <NEW_LINE> numpy.random.seed(0) <NEW_LINE> <DEDENT> def _sample_postprocessing(self, sample): <NEW_LINE> <INDENT> return sample <NEW_LINE> <DEDENT> def dist_params(...
Abstract base class for probability distribution unit tests. This class supplies two test methods, :meth:`.test_goodness_of_fit` and :meth:`.test_mixed_density_goodness_of_fit` for testing the goodness of fit functions. Subclasses must override and implement one class attribute and two instance methods. The :attr:`.d...
6259908abe7bc26dc9252c4e
class Online(DeclarativeBase): <NEW_LINE> <INDENT> __tablename__ = 'online' <NEW_LINE> __table_args__ = { 'mysql_engine':'MEMORY', } <NEW_LINE> id = Column('id', INTEGER(), primary_key=True, nullable=False, doc='online id') <NEW_LINE> user = Column('user', VARCHAR(length=32), nullable=False, doc='weixin account') <NEW_...
user online table user column as index
6259908a3617ad0b5ee07d42
class DimError(OptimizationError): <NEW_LINE> <INDENT> def __init__(self, value='expressions have incompatible dimensions'): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return repr(self.value)
Occurs when combining two expressions of incompatible dimension.
6259908a23849d37ff852cab
class EmployeeXlsxReportView(FormView): <NEW_LINE> <INDENT> template_name = 'clock-report.html' <NEW_LINE> form_class = ClockSearchForm <NEW_LINE> success_url = reverse_lazy('employee-clock-report') <NEW_LINE> def post(self, request, *args, **kwargs): <NEW_LINE> <INDENT> form_class = self.get_form_class() <NEW_LINE> fo...
View that allows employee objects to generate a report for clock objects by providing the day, month, and year of the clocks. Uses a range filter
6259908a60cbc95b06365b64
class FortePiano(Dynamic): <NEW_LINE> <INDENT> _command = "\\fp"
FortePiano (\\fp).
6259908aadb09d7d5dc0c14b
@dataclass <NEW_LINE> class BeitModelOutputWithPooling(BaseModelOutputWithPooling): <NEW_LINE> <INDENT> pass
Class for outputs of [`BeitModel`]. Args: last_hidden_state (`torch.FloatTensor` of shape `(batch_size, sequence_length, hidden_size)`): Sequence of hidden-states at the output of the last layer of the model. pooler_output (`torch.FloatTensor` of shape `(batch_size, hidden_size)`): Average of t...
6259908a7b180e01f3e49e5d
class Program(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.completed_logging_setup = False <NEW_LINE> <DEDENT> def main(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.main_setup() <NEW_LINE> logger.debug("setup completed: habitat ready") <NEW_LINE> <DEDENT> except SystemExit: <NEW...
Program provides the :py:meth:`main`, :py:meth:`shutdown` and :py:meth:`reload` methods
6259908a656771135c48ae29
class OrgBehavior(VCardBehavior): <NEW_LINE> <INDENT> hasNative = True <NEW_LINE> @staticmethod <NEW_LINE> def transformToNative(obj): <NEW_LINE> <INDENT> if obj.isNative: <NEW_LINE> <INDENT> return obj <NEW_LINE> <DEDENT> obj.isNative = True <NEW_LINE> obj.value = splitFields(obj.value) <NEW_LINE> return obj <NEW_LINE...
A list of organization values and sub-organization values.
6259908af9cc0f698b1c60c4
class IPView(ip.IPythonView): <NEW_LINE> <INDENT> def onKeyPressExtend(self, event): <NEW_LINE> <INDENT> if ip.IPythonView.onKeyPressExtend(self, event): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> if event.string == '\x04': <NEW_LINE> <INDENT> self.destroy()
Extend IPythonView to support closing with Ctrl+D
6259908aa05bb46b3848bf1f
class SVMCommandPrintStaticFields(gdb.Command): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__('svm-print-static-fields', gdb.COMMAND_USER) <NEW_LINE> <DEDENT> def complete(self, text, word): <NEW_LINE> <INDENT> return [x for x in ['enable', 'disable'] if x.startswith(text)] <NEW_LINE> <DE...
Use this command to enable/disable printing of static field members
6259908a8a349b6b43687e50
class DeleteVolume(command.Command): <NEW_LINE> <INDENT> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(DeleteVolume, self).get_parser(prog_name) <NEW_LINE> parser.add_argument( 'volumes', metavar='<volume>', nargs="+", help=_('Volume(s) to delete (name or ID)'), ) <NEW_LINE> parser.add_argument( '...
Delete volume(s)
6259908aad47b63b2c5a9445
class PhotoEffect(BaseEffect): <NEW_LINE> <INDENT> transpose_method = models.CharField(_('rotate or flip'), max_length=15, blank=True, choices=IMAGE_TRANSPOSE_CHOICES) <NEW_LINE> color = models.FloatField(_('color'), default=1.0, help_text=_("A factor of 0.0 gives a black and white image, a factor of 1.0 gives the orig...
A pre-defined effect to apply to photos
6259908a4527f215b58eb799
class Mixer: <NEW_LINE> <INDENT> def __init__(self, mixer_params): <NEW_LINE> <INDENT> self.amplitude = get_parameter(mixer_params, 'amplitude', 1.e-5, 'Mixer') <NEW_LINE> assert self.amplitude <= 1. <NEW_LINE> self.decay = get_parameter(mixer_params, 'decay', 2., 'Mixer') <NEW_LINE> assert self.decay >= 1. <NEW_LINE> ...
Base class of a general Mixer. Since DMRG performs only local updates of the state, it can get stuck in "local minima", in particular if the Hamiltonain is long-range -- which is the case if one maps a 2D system ("infinite cylinder") to 1D -- or if one wants to do single-site updates (currently not implemented in TeNP...
6259908ad486a94d0ba2dbaa
@registry.register_sensor(name="speed_limit") <NEW_LINE> class SpeedLimitSensor(simulator.Sensor): <NEW_LINE> <INDENT> def __init__( self, hero: carla.ActorBlueprint, *args, **kwargs) -> None: <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self._hero = hero <NEW_LINE> <DEDENT> def _get_uuid(self, *arg...
CARLA vehicle speed limit sensor.
6259908a5fdd1c0f98e5fb6c
class HieroGetShot(Hook): <NEW_LINE> <INDENT> def execute(self, item, data, **kwargs): <NEW_LINE> <INDENT> sequence = self._get_sequence(item, data) <NEW_LINE> sg = self.parent.shotgun <NEW_LINE> filt = [ ["project", "is", self.parent.context.project], ["sg_sequence", "is", sequence], ["code", "is", item.name()], ] <NE...
Return a Shotgun Shot dictionary for the given Hiero items
6259908a63b5f9789fe86d5f
class VertexBufferObject(AbstractBuffer): <NEW_LINE> <INDENT> def __init__(self, size, target, usage): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> self.target = target <NEW_LINE> self.usage = usage <NEW_LINE> self._context = pyglet.gl.current_context <NEW_LINE> id = GLuint() <NEW_LINE> glGenBuffers(1, id) <NEW_LINE...
Lightweight representation of an OpenGL VBO. The data in the buffer is not replicated in any system memory (unless it is done so by the video driver). While this can improve memory usage and possibly performance, updates to the buffer are relatively slow. This class does not implement :py:class:`AbstractMappable`, a...
6259908a5fc7496912d49066
class liberCriaFotogrametria(bpy.types.Panel): <NEW_LINE> <INDENT> bl_label = "Generate/Import Archs" <NEW_LINE> bl_idname = "liber_cria_fotogrametria" <NEW_LINE> bl_space_type = 'VIEW_3D' <NEW_LINE> bl_region_type = 'TOOLS' <NEW_LINE> bl_category = "Liber" <NEW_LINE> def draw(self, context): <NEW_LINE> <INDENT> layout...
Planejamento de cirurgia ortognática no Blender
6259908a5fcc89381b266f59
class SugarModule: <NEW_LINE> <INDENT> def __init__(self, connection, name): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._connection = connection <NEW_LINE> result = self._connection.get_module_fields(self._name) <NEW_LINE> if result is None: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> self._fields = resul...
Defines a SugarCRM module. This is used to perform module related tasks, such as queries and creating new entries.
6259908a23849d37ff852cb2
class CatCertCommandStub(CatCertCommand): <NEW_LINE> <INDENT> def __init__(self, cert_pem): <NEW_LINE> <INDENT> CatCertCommand.__init__(self) <NEW_LINE> self.cert = create_from_pem(cert_pem) <NEW_LINE> <DEDENT> def _validate_options(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def _create_cert(self): <NEW_LINE> ...
A testing CatCertCommand that allows bypassing the loading of a certificate file.
6259908a2c8b7c6e89bd53dd