code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Port(Base): <NEW_LINE> <INDENT> def __init__(self, name=''): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.port_type = 0 <NEW_LINE> self.vlan = { 'default': { 'tag': 1, 'type': 'untagged' } } <NEW_LINE> self.traffic_segmentation = None <NEW_LINE> self.lldp = {} <NEW_LINE> self.loopdetect = {} <NEW_LINE> se...
Класс описывающий конкретный порт оборудования.
62598eeef7d966606f746780
class DelHandler(BaseHandler): <NEW_LINE> <INDENT> @tornado.web.authenticated <NEW_LINE> def get(self, *args, **kwargs): <NEW_LINE> <INDENT> pid = int(kwargs['pid']) <NEW_LINE> user = get_user(self.current_user) <NEW_LINE> if is_exits_like(user.id, pid): <NEW_LINE> <INDENT> del_like(user.id, pid) <NEW_LINE> <DEDENT> de...
删除自己上传的图片
62598eee091ae356687033a6
class Verbatim: <NEW_LINE> <INDENT> def __init__(self, x): <NEW_LINE> <INDENT> self._x = x <NEW_LINE> <DEDENT> def pdfRepr(self): <NEW_LINE> <INDENT> return self._x
Store verbatim PDF command content for later inclusion in the stream.
62598eeeadb09d7d5dc08d57
class TestClosedLoopControl(AxisTest): <NEW_LINE> <INDENT> def check_preconditions(self, axis_ctx: AxisTestContext, logger): <NEW_LINE> <INDENT> super(TestClosedLoopControl, self).check_preconditions(axis_ctx, logger) <NEW_LINE> test_assert_eq(axis_ctx.handle.motor.is_calibrated, True) <NEW_LINE> test_assert_eq(axis_ct...
Tests closed loop position control and velocity control and verifies that the sensorless estimator works Precondition: The axis is calibrated and ready for closed loop control
62598eee4e4d562566370ba3
class SignUpView(View): <NEW_LINE> <INDENT> form_class = UserCreationForm <NEW_LINE> context = {} <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> self.context['form'] = self.form_class <NEW_LINE> return render_to_response('signup.html', self.context, context_instance = RequestCon...
Sign Up from for user
62598eee7047854f4633db62
class OmniFileNotGeneratedWarning(Warning): <NEW_LINE> <INDENT> def __init__(self, omni_filename, date): <NEW_LINE> <INDENT> self.date = date <NEW_LINE> self.omni_filename = omni_filename <NEW_LINE> self.message = "Omni file: {filename}, was not generated for the " "date {date}. The omni data will not be use...
Warning when the Omni file was not downloaded from the webpage: https://omniweb.gsfc.nasa.gov/ Parameters: :param omni_filename: file name of the omni file :param date: date trying to obtain for the omni file
62598eee7c178a314d78bc23
class PathFoundError(PathError): <NEW_LINE> <INDENT> pass
A path with a file was required; found no file.
62598eee460517430c430c17
class VTKArray(numpy.matrix): <NEW_LINE> <INDENT> def __new__(cls, input_array, array=None, dataset=None): <NEW_LINE> <INDENT> obj = numpy.asarray(input_array).view(cls) <NEW_LINE> if len(obj.shape) == 1: <NEW_LINE> <INDENT> obj = obj.reshape(obj.shape[0], 1) <NEW_LINE> <DEDENT> obj.VTKObject = array <NEW_LINE> if data...
This is a sub-class of numpy ndarray that stores a reference to a vtk array as well as the owning dataset. The numpy array and vtk array should point to the same memory location.
62598eee56ac1b37e630097a
class CheckOrderView(LoginRequiredJsonMixin, View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> order_id = request.GET.get('order_id') <NEW_LINE> if not order_id: <NEW_LINE> <INDENT> return JsonResponse({'code': 2, 'message': '缺少订单id'}) <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> order = OrderInfo....
查询订单状态
62598eeebe8e80087fbbd7df
class AnyFieldQuery(CollectionQuery): <NEW_LINE> <INDENT> def __init__(self, pattern, fields, cls): <NEW_LINE> <INDENT> self.pattern = pattern <NEW_LINE> self.fields = fields <NEW_LINE> self.query_class = cls <NEW_LINE> subqueries = [] <NEW_LINE> for field in self.fields: <NEW_LINE> <INDENT> subqueries.append(cls(field...
A query that matches if a given FieldQuery subclass matches in any field. The individual field query class is provided to the constructor.
62598eeedd821e528d6d76ce
class DBInterface(object): <NEW_LINE> <INDENT> def __init__(self, database_uri=None): <NEW_LINE> <INDENT> if not database_uri: <NEW_LINE> <INDENT> self.engine = create_engine(config.IN_USE.SQLALCHEMY_DATABASE_URI) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.engine = create_engine(database_uri) <NEW_LINE> <DEDENT...
Helper class for db access
62598eee796e427e5384cf27
class Transaction: <NEW_LINE> <INDENT> def __init__(self, transaction: ofxparse.Transaction = None, account: ofxclient.Account = None) -> None: <NEW_LINE> <INDENT> if transaction and account: <NEW_LINE> <INDENT> self.id: int = None <NEW_LINE> self.payee: str = transaction.payee <NEW_LINE> self.type: str = transaction.t...
A Transaction object (not to be confused with an ofxclient.Transaction).
62598eee30bbd722464683c4
class API_MethodArgSpec(object): <NEW_LINE> <INDENT> def __init__(self, name, type, optional = False): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.type = type <NEW_LINE> self.optional = optional <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '%s(name = %r, type = %r, optional = %r)' % (type...
Specifies an argument of a method. Has a name, type, and an "optional" flag.
62598eee3539df3088ecaa41
class BadJSON(GameException): <NEW_LINE> <INDENT> def msg(self): <NEW_LINE> <INDENT> return jsonify(result="badJSON")
JSON object is incorrect
62598eee97e22403b383967f
class glo: <NEW_LINE> <INDENT> def __init__(self, thi, element): <NEW_LINE> <INDENT> self.gam = thi.gam <NEW_LINE> self.mu = thi.mu <NEW_LINE> self.la = thi.la <NEW_LINE> self.H = thi.H <NEW_LINE> self.A = element.A <NEW_LINE> self.BS = system(coefficient = self.mu / 2., element = el...
make global matrix
62598eee7d847024c075ab5d
class JavaProtobufLibrary(ExportableJvmLibrary): <NEW_LINE> <INDENT> def __init__(self, name, sources, provides = None, dependencies = None, excludes = None, buildflags = None, is_meta = False): <NEW_LINE> <INDENT> ExportableJvmLibrary.__init__(self, name, sources, provides, dependencies, excludes, buildflags, is_meta)...
Defines a target that builds java stubs from a protobuf IDL file.
62598eee99fddb7c1ca621cc
class build_number_needs_reset(LintCheck): <NEW_LINE> <INDENT> requires = ['missing_build_number'] <NEW_LINE> def check_recipe(self, recipe): <NEW_LINE> <INDENT> bldnos = utils.RepoData().get_package_data( key="build_number", name=recipe.name, version=recipe.version) <NEW_LINE> if not bldnos and recipe.build_number > 0...
The recipe build number should be reset to 0 No previous build of a package of this name and this version exists, the build number should therefore be 0.
62598eee3346ee7daa336a2f
class ReportNotification(object): <NEW_LINE> <INDENT> _names = { "consumer_id":'consumerId', "consumer_ssn":'consumerSsn', "event_name":'eventName', "id":'id', "status":'status', "mtype":'type' } <NEW_LINE> def __init__(self, consumer_id=None, consumer_ssn=None, event_name=None, id=None, status=None, mtype=None, additi...
Implementation of the 'ReportNotification' model. TODO: type model description here. Attributes: consumer_id (string): Finicity’s consumer ID. This field is optional and may not always return. consumer_ssn (string): The last four of the consumer’s social security number. This field is optional...
62598eee627d3e7fe0e0561a
class ModifyPwdView(View): <NEW_LINE> <INDENT> def post(self, request): <NEW_LINE> <INDENT> modifypwd_form = forms.ModifyPwdForm(request.POST) <NEW_LINE> if modifypwd_form.is_valid(): <NEW_LINE> <INDENT> password = modifypwd_form.cleaned_data.get("password") <NEW_LINE> reset_code = request.POST.get("reset_code") <NEW_L...
修改密码操作视图
62598eeed486a94d0ba2a75d
class TimeSeries(Series): <NEW_LINE> <INDENT> pass
A Series of TimePoints or TimeSlots (not TimeRegions as time is 1D and only regions with a "slotty" shape make sense). Please note that this TimeSeries does not carry any data. According to Wikipedia, a TimeSeries is "a sequence of data points", but in Luna's logic it is just a sequence of (Time)Points. See DataTimeSe...
62598eee4c34283577618a75
class QuerySpecification(Model): <NEW_LINE> <INDENT> _attribute_map = {"query": {"key": "query", "type": "str"}} <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(QuerySpecification, self).__init__(**kwargs) <NEW_LINE> self.query = kwargs.get("query", None)
The Json query request. :param query: The query string. :type query: str
62598eee851cf427c66b6a5a
class SearchResponse(UntaggedResponse): <NEW_LINE> <INDENT> def __init__(self, seqs: Iterable[int]) -> None: <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.seqs = seqs <NEW_LINE> <DEDENT> @property <NEW_LINE> def text(self) -> bytes: <NEW_LINE> <INDENT> text = BytesFormat(b' ').join( [b'SEARCH'], [b'%i' % seq f...
Constructs the special SEARCH response used by the SEARCH command. Args: seqs: List of message sequence integers.
62598eeebe7bc26dc925122a
class QJob: <NEW_LINE> <INDENT> def __init__(self, job, circuit, backend_name,period,total=1024): <NEW_LINE> <INDENT> self.job = job <NEW_LINE> self.circuit = circuit <NEW_LINE> self.backend_name = backend_name <NEW_LINE> self.total = total <NEW_LINE> self.incorrect = 0 <NEW_LINE> self.correct = 0 <NEW_LINE> self.perio...
Enhanced quantum circuit to hold backend information and other potential useful reporting parameters
62598eee99cbb53fe682f63d
class CompressedFile(object): <NEW_LINE> <INDENT> def __init__(self, path, algorithm='gz'): <NEW_LINE> <INDENT> self.algorithm = algorithm <NEW_LINE> assert self.algorithm in ALLOWED_COMPRESSION_ALGORITHMS, '{algo} is not an supported compression algorithm'.format(algo=self.algorithm) <NEW_LINE> if path.ends...
Read and write the data of a compressed file. Used to cache files for GoogleScraper.s Supported algorithms: gz, bz2 >>> import os >>> f = CompressedFile('/tmp/test.txt', algorithm='gz') >>> f.write('hello world') >>> assert os.path.exists('/tmp/test.txt.gz') >>> f2 = CompressedFile('/tmp/test.txt.gz', algorithm='gz'...
62598eeeadb09d7d5dc08d59
@add_metaclass(ABCMeta) <NEW_LINE> class Space(object): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def contains(self, x): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def sample(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @property <NEW_LINE> @abstractmethod <NEW_LINE> def dimensi...
Baseclass for Spaceobject. All methods have to be implemented in any subclass. Methods ------- contains(x) Check if x is an element of space. element Return arbitray element in space.
62598eee66673b3332c2eb39
class BookAndAuthorSerializer(serializers.HyperlinkedModelSerializer): <NEW_LINE> <INDENT> author = serializers.ReadOnlyField(source='author.name') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Book <NEW_LINE> fields = ('url', 'title', 'author',)
For viewing books in a user's favorites it's nice to see the author's name rather than a link
62598eee460517430c430c19
class RequirementError(InvocationError): <NEW_LINE> <INDENT> errno = 3007 <NEW_LINE> format = _("'%(name)s' is required")
**3007** Raised when a required parameter is not provided. For example: >>> raise RequirementError(name='givenname') Traceback (most recent call last): ... RequirementError: 'givenname' is required
62598eeecc0a2c1114479796
class TimeOutTweet(Exception): <NEW_LINE> <INDENT> pass
Raised for when it received many tweet and didn't check for new Value for a while
62598eeefff4ab517ebcbf68
class MatSubsInventory(bpy.types.PropertyGroup): <NEW_LINE> <INDENT> item_id = StringProperty(default="") <NEW_LINE> item_description = StringProperty(default="")
Material Substance Inventory. :return:
62598eeee5267d203ee6a098
class CreateTestCase(TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.cfg = config.ServerConfig('http://example.com') <NEW_LINE> <DEDENT> def test_generic(self): <NEW_LINE> <INDENT> entities_ = ( entities.AbstractDockerContainer(self.cfg), entities.ConfigGroup(self.cfg...
Tests for :meth:`nailgun.entity_mixins.EntityCreateMixin.create`.
62598eeeaad79263cf42cf9d
class Terraform: <NEW_LINE> <INDENT> def __init__(self, directory=None, settings=None): <NEW_LINE> <INDENT> self.settings = settings if settings else {} <NEW_LINE> self.directory = directory if directory else os.getcwd() <NEW_LINE> self.config_str = '' <NEW_LINE> iterator = iglob( self.directory + '/*.tf') <NEW_LINE> f...
Finds terraform/hcl files (*.tf) in CWD or a supplied directory, parses them with pyhcl, and exposes the configuration via self.config.
62598eee4a966d76dd5ed66b
class TestDijkstraPathLength: <NEW_LINE> <INDENT> def test_weight_function(self): <NEW_LINE> <INDENT> G = nx.complete_graph(3) <NEW_LINE> G.adj[0][2]["weight"] = 10 <NEW_LINE> G.adj[0][1]["weight"] = 1 <NEW_LINE> G.adj[1][2]["weight"] = 1 <NEW_LINE> def weight(u, v, d): <NEW_LINE> <INDENT> return 1 / d["weight"] <NEW_L...
Unit tests for the :func:`networkx.dijkstra_path_length` function.
62598eeea8370b77170eeb76
class KeychainError(Exception): <NEW_LINE> <INDENT> def __init__(self, *args, status: int = None): <NEW_LINE> <INDENT> super().__init__(*args) <NEW_LINE> self.status = status
Base class for all security module errors. Args: *args: Passed to super class status (int, optional): `OSStatus` error if applicable or `None` Attributes: status (int, optional): `OSStatus` error code or `None`
62598eee66656f66f7d58b72
class SmtpServerGetResponse(object): <NEW_LINE> <INDENT> swagger_types = { 'continuation_token': 'str', 'total_item_count': 'int', 'items': 'list[SmtpServer]' } <NEW_LINE> attribute_map = { 'continuation_token': 'continuation_token', 'total_item_count': 'total_item_count', 'items': 'items' } <NEW_LINE> required_args = ...
Attributes: swagger_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition.
62598eee167d2b6e312b572a
class TestThirdPartyParcelAccount(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 testThirdPartyParcelAccount(self): <NEW_LINE> <INDENT> pass
ThirdPartyParcelAccount unit test stubs
62598eee3539df3088ecaa43
class CARU(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_shape): <NEW_LINE> <INDENT> super(CARU, self).__init__() <NEW_LINE> self.b, self.c, self.w, self.h = input_shape <NEW_LINE> self.W_1_s = nn.Parameter(torch.rand(self.b, 64, 1, requires_grad=True)) <NEW_LINE> self.W_2_s = nn.Parameter(torch.rand(self.b,...
Recursive model it implements two gates reset and update (Section 3.3)
62598eee30bbd722464683c6
class AppealViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = models.Appeal.objects.all() <NEW_LINE> serializer_class = serializers.AppealSerializer
API endpoint that allows appeals to be viewed or edited.
62598eee4428ac0f6e656cdf
class LadyDay(MovableFeast): <NEW_LINE> <INDENT> name = 'Lady Day' <NEW_LINE> @functools.lru_cache() <NEW_LINE> def date(year): <NEW_LINE> <INDENT> lady_day = dt.date(year, 3, 25) <NEW_LINE> if PalmSunday.date(year) <= lady_day <= QuasimodoSunday.date(year): <NEW_LINE> <INDENT> return QuasimodoSunday.date(year) + dt.ti...
Represents Lady Day.
62598eee63b5f9789fe838ef
class MultiArgsAction(argparse.Action): <NEW_LINE> <INDENT> def __init__(self, **kw): <NEW_LINE> <INDENT> argparse.Action.__init__(self, **kw) <NEW_LINE> self._nsegs = self.const <NEW_LINE> <DEDENT> def __call__(self, parser, namespace, values, option_string=None): <NEW_LINE> <INDENT> s = values.split(",") <NEW_LINE> i...
CustomAction for argparse to be able to process ,-seperated args
62598eee3cc13d1c6d463f04
class Triangle(Shape, Coordinate): <NEW_LINE> <INDENT> sides = 3 <NEW_LINE> def __init__(self, point_a=Coordinate(), point_b=Coordinate(), point_c=Coordinate()): <NEW_LINE> <INDENT> self.point_a = point_a <NEW_LINE> self.point_b = point_b <NEW_LINE> self.point_c = point_c <NEW_LINE> <DEDENT> def circumference(self): <N...
삼각형을 나타내는 클래스
62598eeeff9c53063f518df6
class EmailUser(AbstractEmailUser): <NEW_LINE> <INDENT> username = models.CharField(max_length=50) <NEW_LINE> CHOICES = (('Author', 'Author'),('Member', 'Member'),) <NEW_LINE> Label = models.CharField(choices=CHOICES, max_length=20) <NEW_LINE> def assign_group(self, email, password, **extra_fields): <NEW_LINE> <INDENT>...
Concrete class of AbstractEmailUser. Use this if you don't need to extend EmailUser.
62598eee851cf427c66b6a5c
class createNotebook_args(object): <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'authenticationToken', None, None, ), (2, TType.STRUCT, 'notebook', (evernote.edam.type.ttypes.Notebook, evernote.edam.type.ttypes.Notebook.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, authenticationToken=None, note...
Attributes: - authenticationToken - notebook
62598eeef7d966606f746784
class RequestVarsDebugPanel(DebugPanel): <NEW_LINE> <INDENT> name = 'HttpVars' <NEW_LINE> def title(self): <NEW_LINE> <INDENT> return 'Request Variables' <NEW_LINE> <DEDENT> def url(self): <NEW_LINE> <INDENT> return '' <NEW_LINE> <DEDENT> def content(self): <NEW_LINE> <INDENT> context = { 'get': [(k, self.request.GET.g...
A panel to display HTTP variables (POST/GET).
62598eee01c39578d7f11536
class OcclusionAreaFilter: <NEW_LINE> <INDENT> def __init__(self, visible_range=(0, float('Inf'))): <NEW_LINE> <INDENT> self.visible_range = visible_range <NEW_LINE> <DEDENT> def __call__(self, box): <NEW_LINE> <INDENT> if not box.occluded: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> area_visible = box.visible_...
Checks if the visible fraction of an object, falls in a given range. Args: visible_range (list, optional): [min, max] ratios the visible fraction has to be in; Default **[0, Inf]** Returns: Boolean: **True** if the visible area of a bounding box divided by its total area is inside the visible range Note: ...
62598eee99cbb53fe682f63f
class DailyVerify(Verify): <NEW_LINE> <INDENT> def __init__(self,dataset): <NEW_LINE> <INDENT> self.filename = 'verify_amsr2_v7.1.txt' <NEW_LINE> self.ilon1 = 170 <NEW_LINE> self.ilon2 = 175 <NEW_LINE> self.ilat1 = 274 <NEW_LINE> self.ilat2 = 278 <NEW_LINE> self.iasc = 1 <NEW_LINE> self.variables = ['time','sst','windL...
Contains info for verification.
62598eee7d43ff24874267c5
class LocalClassPath(CIMXMLTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(LocalClassPath, self).setUp() <NEW_LINE> self.xml.append(cim_xml.LOCALCLASSPATH( sample_LOCALNAMESPACEPATH_node(), sample_CLASSNAME_node()))
<!ELEMENT LOCALCLASSPATH (LOCALNAMESPACEPATH, CLASSNAME)>
62598eee2c8b7c6e89bd1f53
class NullAdapter(eva.base.adapter.BaseAdapter): <NEW_LINE> <INDENT> def create_job(self, job): <NEW_LINE> <INDENT> job.command = ["/bin/true"] <NEW_LINE> <DEDENT> def finish_job(self, job): <NEW_LINE> <INDENT> job.logger.info('NullAdapter has successfully sent the resource to /dev/null') <NEW_LINE> <DEDENT> def genera...
This adapter will generate jobs that runs ``/bin/true``. Only use this adapter for test purposes.
62598eee236d856c2adc87df
class dikcube(Executable): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Executable.__init__(self, "dikcube", executable="dikcube", spkg="rubiks")
A :class:`~sage.features.Feature` describing the presence of ``dikcube`` EXAMPLES:: sage: from sage.features.rubiks import dikcube sage: dikcube().is_present() # optional - rubiks FeatureTestResult('dikcube', True)
62598eee3317a56b869bd92f
class CodeValueValuesEnum(messages.Enum): <NEW_LINE> <INDENT> DEPRECATED_RESOURCE_USED = 0 <NEW_LINE> DISK_SIZE_LARGER_THAN_IMAGE_SIZE = 1 <NEW_LINE> INJECTED_KERNELS_DEPRECATED = 2 <NEW_LINE> NEXT_HOP_ADDRESS_NOT_ASSIGNED = 3 <NEW_LINE> NEXT_HOP_CANNOT_IP_FORWARD = 4 <NEW_LINE> NEXT_HOP_INSTANCE_NOT_FOUND = 5 <NEW_LIN...
[Output Only] The warning type identifier for this warning. Values: DEPRECATED_RESOURCE_USED: <no description> DISK_SIZE_LARGER_THAN_IMAGE_SIZE: <no description> INJECTED_KERNELS_DEPRECATED: <no description> NEXT_HOP_ADDRESS_NOT_ASSIGNED: <no description> NEXT_HOP_CANNOT_IP_FORWARD: <no description> NEXT_H...
62598eeecb5e8a47e493b542
class GetAllPetsTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> Pet.objects.create( name='Casper', age=3, animal_type='Caucasian Mountain dog', color='Blonde' ) <NEW_LINE> Pet.objects.create( name='Muffin', age=1, animal_type='Guinea Pig', color='Brown' ) <NEW_LINE> Pet.objects.create( name='Ra...
Test module for GET all pets API
62598eeea8370b77170eeb77
class Loader(yamlloader.ordereddict.CLoader): <NEW_LINE> <INDENT> def __init__(self, stream): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self._root = os.path.split(stream.name)[0] <NEW_LINE> <DEDENT> except AttributeError: <NEW_LINE> <INDENT> self._root = os.path.curdir <NEW_LINE> <DEDENT> super(Loader, self).__init_...
YAML Loader with `!include` constructor.
62598eee16aa5153ce3fec93
class Base(CachesMixin, DatabasesMixin, PathsMixin, LogsMixin, SecurityMixin, DebugMixin, WhiteNoiseMixin, Configuration): <NEW_LINE> <INDENT> DEBUG = opts.get('DEBUG', True) <NEW_LINE> BASE_DIR = opts.get('APP_ROOT', None) <NEW_LINE> APP_SLUG = opts.get('APP_SLUG', 'tenerife_japon_status') <NEW_LINE> SITE_ID = 1 <NEW_...
Project settings for development and production.
62598eeeaad79263cf42cf9f
class AssignmentStmt(Node): <NEW_LINE> <INDENT> lvalues = None <NEW_LINE> rvalue = None <NEW_LINE> type = None <NEW_LINE> def __init__(self, lvalues: List[Node], rvalue: Node, type: 'mypy.types.Type' = None) -> None: <NEW_LINE> <INDENT> self.lvalues = lvalues <NEW_LINE> self.rvalue = rvalue <NEW_LINE> self.type = type ...
Assignment statement The same node class is used for single assignment, multiple assignment (e.g. x, y = z) and chained assignment (e.g. x = y = z), assignments that define new names, and assignments with explicit types (# type). An lvalue can be NameExpr, TupleExpr, ListExpr, MemberExpr, IndexExpr.
62598eee44b2445a339b5d34
class ParticleFilter(InferenceModule): <NEW_LINE> <INDENT> def __init__(self, ghostAgent, numParticles=300): <NEW_LINE> <INDENT> InferenceModule.__init__(self, ghostAgent); <NEW_LINE> self.setNumParticles(numParticles) <NEW_LINE> <DEDENT> def setNumParticles(self, numParticles): <NEW_LINE> <INDENT> self.numParticles = ...
A particle filter for approximately tracking a single ghost. Useful helper functions will include random.choice, which chooses an element from a list uniformly at random, and util.sample, which samples a key from a Counter by treating its values as probabilities.
62598eee67a9b606de544761
class Normalize(object): <NEW_LINE> <INDENT> parameters = [] <NEW_LINE> def __init__(self, observed, npol): <NEW_LINE> <INDENT> self.observed = observed <NEW_LINE> if getattr(observed, 'uncertainty', None) is None: <NEW_LINE> <INDENT> self.uncertainty = 1. <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.uncertainty ...
Normalize a model spectrum to an observed one using a polynomial Parameters ---------- observed : Spectrum1D object The observed spectrum to which the model should be matched npol : int The degree of the polynomial
62598eeef548e778e5969d1e
class StraightScreen(Screen): <NEW_LINE> <INDENT> pass
Screen for the straight stairs
62598eee57b8e32f525074cd
class ShowSteps(object): <NEW_LINE> <INDENT> def __init__(self, model_pk, steps): <NEW_LINE> <INDENT> self.step_messages = steps <NEW_LINE> self.n_total = len(steps) <NEW_LINE> self.n_step = 0 <NEW_LINE> self.model_pk = model_pk <NEW_LINE> <DEDENT> def update(self, step): <NEW_LINE> <INDENT> self.n_step = step <NEW_LIN...
Show model training progress
62598eee56ac1b37e630097f
class Point(object): <NEW_LINE> <INDENT> def __init__(self, x, y): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> <DEDENT> def __add__(self, rhs): <NEW_LINE> <INDENT> return Point(self.x + rhs.x, self.y + rhs.y) <NEW_LINE> <DEDENT> def __sub__(self, rhs): <NEW_LINE> <INDENT> return Point(self.x - rhs.x...
2D point coordinates/size type
62598eee23849d37ff84f84b
class SslCertsListResponse(messages.Message): <NEW_LINE> <INDENT> items = messages.MessageField('SslCert', 1, repeated=True) <NEW_LINE> kind = messages.StringField(2, default=u'sql#sslCertsList')
SslCerts list response. Fields: items: List of client certificates for the instance. kind: This is always sql#sslCertsList.
62598eeee5267d203ee6a09b
@mx.operator.register('quota_sampler') <NEW_LINE> class QuotaSamplerProp(mx.operator.CustomOpProp): <NEW_LINE> <INDENT> def __init__(self, num_sample, pos_thresh, neg_thresh_high=0.5, neg_thresh_low=0., pos_ratio=0.5, neg_ratio=None, fill_negative=True): <NEW_LINE> <INDENT> super(QuotaSamplerProp, self).__init__(need_t...
Property for QuotaSampleOp. Parameters ---------- num_sample : int, default is 128 Number of samples for RCNN targets. pos_iou_thresh : float, default is 0.5 Proposal whose IOU larger than ``pos_iou_thresh`` is regarded as positive samples. neg_iou_thresh_high : float, default is 0.5 Proposal whose IOU sma...
62598eee4c34283577618a79
class FloatParser(data_parser.DataToNumpyParser): <NEW_LINE> <INDENT> def __init__(self, field_name): <NEW_LINE> <INDENT> self.field_name = field_name <NEW_LINE> <DEDENT> def parse(self, tf_example): <NEW_LINE> <INDENT> return np.array( tf_example.features.feature[self.field_name].float_list.value, dtype=np.float).tran...
Tensorflow Example float parser.
62598eee851cf427c66b6a5d
class PollOption(Object): <NEW_LINE> <INDENT> def __init__( self, *, client: "pyrogram.BaseClient" = None, text: str, voter_count: int, data: bytes ): <NEW_LINE> <INDENT> super().__init__(client) <NEW_LINE> self.text = text <NEW_LINE> self.voter_count = voter_count <NEW_LINE> self.data = data
Contains information about one answer option in a poll. Parameters: text (``str``): Option text, 1-100 characters. voter_count (``int``): Number of users that voted for this option. Equals to 0 until you vote. data (``bytes``): The data this poll option is holding.
62598eee38b623060ffa7831
class BaseGradientDescent(object): <NEW_LINE> <INDENT> def __init__(self, learning_rate=0.01): <NEW_LINE> <INDENT> self.learning_rate = learning_rate <NEW_LINE> <DEDENT> def apply_gradients(self, grads_and_vars): <NEW_LINE> <INDENT> for gradient, variable in grads_and_vars: <NEW_LINE> <INDENT> update = self._get_update...
A class represinting optimization algorithm. Atributes --------- learning_rate : float learnin rate or step size momentum : float [0, 1] cosntant used in velocity unpdate: velocity = momentum * velocity - learning_rate * gradient parameter = parameter + velocity Methods ------- Update paramete...
62598eee99cbb53fe682f641
class cached_classmethod(dict): <NEW_LINE> <INDENT> def __init__(self, fn): <NEW_LINE> <INDENT> self.fn = fn <NEW_LINE> functools.update_wrapper(self, fn) <NEW_LINE> <DEDENT> def __get__(self, instance, owner): <NEW_LINE> <INDENT> return self[owner] <NEW_LINE> <DEDENT> def __missing__(self, cls): <NEW_LINE> <INDENT> va...
Cache the result of a no-arg class method. .. code-block:: python class Foo(object): @cached_classmethod def bar(cls): # Some expensive computation return 'baz' Similar to ``@lru_cache``, but the cache is per-class, stores a single value, and thus doesn't fill up; where as ``...
62598eee091ae356687033ac
@pytest.mark.django_db <NEW_LINE> @patch.object(PostArea.objects, 'find_by_name', side_effect=findbn) <NEW_LINE> class TestValidData: <NEW_LINE> <INDENT> def test_when_end_date_is_before_start_date(self, mock_find): <NEW_LINE> <INDENT> with pytest.raises(InvalidDateOrder): <NEW_LINE> <INDENT> use_case = CreateJob( JobR...
Test the is_valid method on RegisterUserAccount use case
62598eee283ffb24f3cf2045
class CachedUserNameMixin(object): <NEW_LINE> <INDENT> _user_name = meta_property('user_name') <NEW_LINE> @property <NEW_LINE> def user_name(self): <NEW_LINE> <INDENT> if self.user: <NEW_LINE> <INDENT> return self.user.realname or self.user.username <NEW_LINE> <DEDENT> return '({})'.format(self._user_name) if self._use...
Mixin providing a cached version of the user name. There needs to be: - a ``user`` relationship (which has no dynamic backref) - a meta column The observer needs to be registered in the children: @observes('user', 'user.realname', 'user.username') def user_observer(self, user, realname, username): if hasattr(self...
62598eee1f037a2d8b9e289d
class TestZacksApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = intrinio_sdk.api.zacks_api.ZacksApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_get_zacks_analyst_ratings(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def...
ZacksApi unit test stubs
62598eeee5267d203ee6a09c
class TestReplicaSetClientAgainstStandalone(AsyncIOTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestReplicaSetClientAgainstStandalone, self).setUp() <NEW_LINE> if test.env.is_replica_set: <NEW_LINE> <INDENT> raise SkipTest( "Connected to a replica set, not a standalone mongod") <NEW_LINE> <...
This is a funny beast -- we want to run tests for a replica set AsyncIOMotorClient but only if the database at DB_IP and DB_PORT is a standalone.
62598eeea8370b77170eeb79
class TestBinaryAttribute: <NEW_LINE> <INDENT> def test_binary_attribute(self): <NEW_LINE> <INDENT> attr = BinaryAttribute() <NEW_LINE> assert attr is not None <NEW_LINE> assert attr.attr_type == BINARY <NEW_LINE> attr = BinaryAttribute(default=b'foo') <NEW_LINE> assert attr.default == b'foo' <NEW_LINE> <DEDENT> def te...
Tests binary attributes
62598eeeeab8aa0e5d30a511
class UserProfileFeedViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> authentication_classes= (TokenAuthentication,) <NEW_LINE> serializer_class=serializers.ProfileFeedItemSerializer <NEW_LINE> queryset = models.ProfileFeedItem.objects.all() <NEW_LINE> permission_classes = (permissions.UpdateOwnStatus,IsAuthenticate...
Handles creating reading and updating profile feed items
62598eee67a9b606de544763
class modify(logging): <NEW_LINE> <INDENT> logfile='' <NEW_LINE> level='0' <NEW_LINE> loghandler="" <NEW_LINE> numWarn=0 <NEW_LINE> width=5 <NEW_LINE> def __init__(self, level, logfile): <NEW_LINE> <INDENT> def invokeLogging(logfile, mode="important"): <NEW_LINE> <INDENT> if logfile==[]: <NEW_LINE> <INDENT> log=open("c...
This class is meant to be used to warn the user about modifications done on the data during the calculations. By this, the user gets control, how much 'repair' should be done and whether he will be notified about it.
62598eee57b8e32f525074ce
class WordBiCutRev: <NEW_LINE> <INDENT> hash_table = {} <NEW_LINE> MAX_WORDLEN = 17 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> with open(CIKU, encoding='UTF-8', mode='r') as fr: <NEW_LINE> <INDENT> for word in fr.readlines(): <NEW_LINE> <INDENT> word = word.strip() <NEW_LINE> if word[:1] not in self.hash_table....
基于整词二分的逆向最大匹配算法 结构同正向的整词二分算法 1. 使用汉字国标区位码创建词语首字哈希表 2. 哈希表项包含以该字开头的词语个数,指针 3. 指针指向的有序列表可使用二分查找 例:{'字':{'words':['字词']}, ...}
62598eee23849d37ff84f84d
class BinaryTree(Tree): <NEW_LINE> <INDENT> def left(self, p): <NEW_LINE> <INDENT> raise NotImplementedError("must be implemented by subclass") <NEW_LINE> <DEDENT> def right(self, p): <NEW_LINE> <INDENT> raise NotImplementedError("must be implemented by subclass") <NEW_LINE> <DEDENT> def sibling(self, p): <NEW_LINE> <I...
Abstract base class for binary trees.
62598eee4a966d76dd5ed670
class mode(OrderedSetAgg): <NEW_LINE> <INDENT> inherit_cache = True
Implement the ``mode`` ordered-set aggregate function. This function must be used with the :meth:`.FunctionElement.within_group` modifier to supply a sort expression to operate upon. The return type of this function is the same as the sort expression. .. versionadded:: 1.1
62598eee167d2b6e312b572e
class BuildInvalidator(object): <NEW_LINE> <INDENT> def __init__(self, root): <NEW_LINE> <INDENT> self._root = os.path.join(root, GLOBAL_CACHE_KEY_GEN_VERSION) <NEW_LINE> safe_mkdir(self._root) <NEW_LINE> <DEDENT> def previous_key(self, cache_key): <NEW_LINE> <INDENT> previous_hash = self._read_sha(cache_key) <NEW_LINE...
Invalidates build targets based on the SHA1 hash of source files and other inputs.
62598eeea219f33f346c4fd1
class Code(BaseModel): <NEW_LINE> <INDENT> bf : str
Brainfuckコード
62598eeed7e4931a7ef3a835
class apr_hash_t: <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, apr_hash_t, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, apr_hash_t, name) <NEW_LINE> def __init__(self, *args, **kwar...
Proxy of C apr_hash_t struct
62598eee097d151d1a2bf7b3
class SupraGrid(SupraGraph): <NEW_LINE> <INDENT> def __init__(self, dg: Optional[nx.DiGraph] = None): <NEW_LINE> <INDENT> if not dg: <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> super().__init__(dg) <NEW_LINE> <DEDENT> self.conversions = None <NEW_LINE> self.types = None <NEW_LIN...
Power grid modelled as supra-graph. Warning: Modification is impossible for now. Attributes: conversions (DataFrame): .. csv-table:: :header: name, dtype, definition name (index), object, name of the element. bus, object, buses to which the element is attached ...
62598eeeb7558d5895461ddc
class Ant: <NEW_LINE> <INDENT> def __init__(self, _start_node): <NEW_LINE> <INDENT> self.visited_list = [_start_node] <NEW_LINE> self.visibility_list = [] <NEW_LINE> self.result_value = None <NEW_LINE> self.visibility_list_update() <NEW_LINE> <DEDENT> def result_generate(self): <NEW_LINE> <INDENT> while self.visibility...
Class representing one cycle of iteration and the result_permutation of this cycle
62598eee63b5f9789fe838f3
class retry(object): <NEW_LINE> <INDENT> def __init__(self, tries=3, delay=1): <NEW_LINE> <INDENT> self.tries = tries <NEW_LINE> self.delay = delay <NEW_LINE> <DEDENT> def __call__(self, f): <NEW_LINE> <INDENT> def wrapped_f(*args, **kwargs): <NEW_LINE> <INDENT> for i in range(self.tries): <NEW_LINE> <INDENT> try: <NEW...
Retries a function or method until it returns True value. delay sets the initial delay in seconds, and backoff sets the factor by which the delay should lengthen after each failure. Tries must be at least 0, and delay greater than 0.
62598eee63d6d428bbee0f63
class PRLinkedIssuePublicAPI(TestCase): <NEW_LINE> <INDENT> def setUp(self) -> None: <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> self.g = GithubSingleton.get() <NEW_LINE> <DEDENT> def test_view_linked_issues_hashtag(self): <NEW_LINE> <INDENT> repo_name = 'JuliaPlots/Plots.jl' <NEW_LINE> repo = self.g.get_r...
Tests for PR Linked Issue public API
62598eee5166f23b2e241b6f
class AppCommand(object): <NEW_LINE> <INDENT> def __init__(self, engine, name, command_dict): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.engine = engine <NEW_LINE> self.properties = command_dict["properties"] <NEW_LINE> self.callback = command_dict["callback"] <NEW_LINE> self.favourite = False <NEW_LINE> self...
Wraps around a single command that you get from engine.commands
62598eee85dfad0860cbee32
class DataStackNotFoundException(MaterializationEngineException): <NEW_LINE> <INDENT> pass
error raised when a datastack is not found
62598eee090684286d592aad
class HeaderHandler(object): <NEW_LINE> <INDENT> def SetHeaders(self, client): <NEW_LINE> <INDENT> raise NotImplementedError('You must subclass HeaderHandler.')
A generic header handler interface that must be subclassed by each API.
62598eee4527f215b58e8694
class TVMCSuppressedArgumentParser(argparse.ArgumentParser): <NEW_LINE> <INDENT> def __init__(self, parent, **kwargs): <NEW_LINE> <INDENT> super().__init__(parents=[parent], add_help=False, usage=argparse.SUPPRESS, **kwargs) <NEW_LINE> <DEDENT> def exit(self, status=0, message=None): <NEW_LINE> <INDENT> raise TVMCExcep...
A silent ArgumentParser class. This class is meant to be used as a helper for creating dynamic parsers in TVMC. It will create a "supressed" parser based on an existing one (parent) which does not include a help message, does not print a usage message (even when -h or --help is passed) and does not exit on invalid choi...
62598eeeaad79263cf42cfa2
class DateTimeEpochTest(unittest.TestCase): <NEW_LINE> <INDENT> def testInitialize(self): <NEW_LINE> <INDENT> date_time_epoch = interface.DateTimeEpoch(1970, 1, 1) <NEW_LINE> self.assertIsNotNone(date_time_epoch)
Tests for the date and time epoch interface.
62598eee4e4d562566370bab
class check_privilege_load(): <NEW_LINE> <INDENT> TITLE = 'LOADAUTH Role' <NEW_LINE> CATEGORY = 'Privilege' <NEW_LINE> TYPE = 'sql' <NEW_LINE> SQL = "SELECT DISTINCT grantee, granteetype FROM syscat.dbauth WHERE loadauth='Y'" <NEW_LINE> verbose = False <NEW_LINE> skip = False <NEW_LINE> result = {} <...
check_privilege_load: The IMPLSCHEMA (implicit schema) role grants the authority to a user to create objects without specifying a schema that already exists. It is recommended that the implschema role be granted to authorized user.
62598eeebe383301e0251f70
class ModelParams(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ModelParams, self).__init__() <NEW_LINE> pass
Fixed parameters used in the subsurface fracture model Fixed model parameters that the user should not adjust and that are used by the subsurface fracture model. These include parameters such as entrainment coefficients and other model constants that have been fit to data and are not considered calibration coefficie...
62598eee7b25080760ed5c31
class itkBinaryProjectionImageFilterID3ID3_Superclass(itkImageToImageFilterAPython.itkImageToImageFilterID3ID3): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> def __init__(self, *args, **kwargs): raise AttributeError("No constructo...
Proxy of C++ itkBinaryProjectionImageFilterID3ID3_Superclass class
62598eeeaad79263cf42cfa3
class StateDetail(generics.RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> queryset = State.objects.all() <NEW_LINE> permission_classes = (IsAuthenticated, IsStaffOrReadOnly) <NEW_LINE> serializer_class = StateSerializer
get: Retorna Estado. put: Modifica Estado. delete: Elimina Estado.
62598eee44b2445a339b5d36
class AnimationValueAttrib: <NEW_LINE> <INDENT> def set_calcMode(self, calcMode): <NEW_LINE> <INDENT> self._attributes['calcMode'] = calcMode <NEW_LINE> <DEDENT> def get_calcMode(self): <NEW_LINE> <INDENT> return self._attributes.get('calcMode') <NEW_LINE> <DEDENT> def set_values(self, values): <NEW_LINE> <INDENT> self...
The AnimationValueAttrib class defines the AnimationValue.attrib attribute set.
62598eeebe8e80087fbbd7e7
class ExperienceReplay: <NEW_LINE> <INDENT> def __init__(self, size): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> self.currentPosition = 0 <NEW_LINE> self.buffer = [] <NEW_LINE> <DEDENT> def add_memory(self, state, action, reward, next_state, is_done): <NEW_LINE> <INDENT> exp = Experience(state, action, reward, is_...
This class provides an abstraction to store the [s, a, r, s'] elements of each iteration. using Experience object which contains the s-a-r-s-a transition information in an object oriented way
62598eee57b8e32f525074cf
class Settings(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.screen_width = 1024 <NEW_LINE> self.screen_height = 720 <NEW_LINE> self.bg_color = (41,41,61) <NEW_LINE> self.ship_speed_multiplier = 1.5 <NEW_LINE> self.bullet_speed_factor = 1 <NEW_LINE> self.bullet_width = 3 <NEW_LINE> self.bullet_hei...
class to store the game's settings
62598eee71ff763f4b5e5ef5
class Specialty(models.Model): <NEW_LINE> <INDENT> name = models.CharField(_(u"الاسم"), max_length=50) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = _(u"تخصص") <NEW_LINE> verbose_name_plural = _(u"تخصصات")
A specialty like Medicine or Nursing.
62598eeea219f33f346c4fd3
class SpectrumData(NDData): <NEW_LINE> <INDENT> def __init__(self, name, data, *args, **kwargs): <NEW_LINE> <INDENT> super(SpectrumData, self).__init__(data, *args, **kwargs) <NEW_LINE> self.meta['name'] = name
Basic Spectrum
62598eee3cc13d1c6d463f0a
class JailDependantStart(JailEvent): <NEW_LINE> <INDENT> pass
Start one dependant jail.
62598eeeff9c53063f518dfc
class MainView(generic.TemplateView): <NEW_LINE> <INDENT> template_name = 'main.html'
Loads the main page.
62598eee1b99ca400228e8d9
class ProgrammingError(ProgrammingError): <NEW_LINE> <INDENT> pass
Exception raised for programming errors, e.g. table not found or already exists, syntax error in the SQL statement, wrong number of parameters specified, etc.
62598eee7047854f4633db6a
class ReadUnreadViewlet(ViewletBase): <NEW_LINE> <INDENT> def available(self): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def get_status(self): <NEW_LINE> <INDENT> return get_ru_status(self.context)
This viewlet displays available documents to generate.
62598eee7047854f4633db6b
class BondLight(BondBaseLight, BondEntity, LightEntity): <NEW_LINE> <INDENT> def __init__( self, hub: BondHub, device: BondDevice, bpup_subs: BPUPSubscriptions, sub_device: str | None = None, ) -> None: <NEW_LINE> <INDENT> super().__init__(hub, device, bpup_subs, sub_device) <NEW_LINE> if device.supports_set_brightness...
Representation of a Bond light.
62598eee090684286d592aae