code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class LeaderBoardView(GenericAPIView): <NEW_LINE> <INDENT> serializer_class = LeaderBoardSerializer <NEW_LINE> queryset = Profile.objects.all().order_by('-score') <NEW_LINE> response_schema_dict = { "200": openapi.Response( description="Users List In Sorted Order Based on Score For LeaderBoard.", schema=LeaderBoardSeri...
LeaderBoard View
62598f9791f36d47f2230d28
class ToDoList(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.to_do_list = [] <NEW_LINE> <DEDENT> def user_input(self): <NEW_LINE> <INDENT> print("Welcome to the 'To-do list.'") <NEW_LINE> print("Type help() for more information.") <NEW_LINE> print("Type exit() to leave.") <NEW_LINE> while True: <N...
Creates a To-do list.
62598f97507cdc57c63a4aa7
class Base16(ColorSet): <NEW_LINE> <INDENT> black = (0, 0, 0) <NEW_LINE> grey = (128, 128, 128) <NEW_LINE> silver = (192, 192, 192) <NEW_LINE> white = (255, 255, 255) <NEW_LINE> maroon = (128, 0, 0) <NEW_LINE> red = (255, 0, 0) <NEW_LINE> olive = (128, 128, 0) <NEW_LINE> yellow = (255, 255, 0) <...
The basic 16 colors
62598f9763d6d428bbee24d0
class XMLRenderer(BaseRenderer): <NEW_LINE> <INDENT> media_type = 'application/xml' <NEW_LINE> format = 'xml' <NEW_LINE> charset = 'utf-8' <NEW_LINE> item_tag_name = 'list-item' <NEW_LINE> root_tag_name = 'root' <NEW_LINE> generator_class = SimplerXMLGenerator <NEW_LINE> def render(self, data, accepted_media_type=None,...
Renderer which serializes to XML.
62598f97009cb60464d01237
class BaseModel(models.Model): <NEW_LINE> <INDENT> is_delete = models.BooleanField(default=False, verbose_name='删除标记') <NEW_LINE> created_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') <NEW_LINE> update_time = models.DateTimeField(auto_now_add=True, verbose_name='更新时间') <NEW_LINE> class Meta: <NEW_...
模型抽象基类
62598f97442bda511e95c178
class COManageLoginHandler(OAuthLoginHandler, COManageMixin): <NEW_LINE> <INDENT> def authorize_redirect(self, *args, **kwargs): <NEW_LINE> <INDENT> extra_params = kwargs.setdefault('extra_params', {}) <NEW_LINE> if self.authenticator.idp: <NEW_LINE> <INDENT> extra_params["selected_idp"] = self.authenticator.idp <NEW_L...
See http://www.cilogon.org/oidc for general information.
62598f9785dfad0860cbf8fd
class ProductCostRule(orm.Model): <NEW_LINE> <INDENT> _name = 'product.cost.rule' <NEW_LINE> _description = 'Cost rule' <NEW_LINE> _order = 'sequence,id' <NEW_LINE> _columns = { 'sequence': fields.integer('Sequence'), 'name': fields.char('Description', size=64, required=True), 'method_id': fields.many2one( 'product.cos...
Product cost rule
62598f9710dbd63aa1c708c9
class MapObjectReference(MapObject): <NEW_LINE> <INDENT> referencedId = Property(str, 'referenced_id', default=None) <NEW_LINE> referencedType = Property(str, 'referenced_type', default='') <NEW_LINE> autoLoadChanged = qtc.pyqtSignal() <NEW_LINE> autoLoad = Property(bool, 'auto_load', notify=autoLoadChanged, default=Fa...
Holds a reference to another object in the database.
62598f97fff4ab517ebcd500
class MoStaticGenerateTestCase(MoScriptTestCase): <NEW_LINE> <INDENT> def __init__(self, method_name='runTest', script_dir=None, script=None, top_dir=None, this_dir=None, coverage=False): <NEW_LINE> <INDENT> super().__init__(method_name, script_dir, script, top_dir, this_dir, coverage) <NEW_LINE> if this_dir is not Non...
A MoStaticGenerateTestCase object verifies the results of mo-static-generate for given inputs.
62598f976aa9bd52df0d4be0
class IFileAttachment(form.Schema): <NEW_LINE> <INDENT> file = namedfile.NamedBlobFile( title=_(u"File Attachment"), description=u"", required=False, )
Marker/Form interface for File Attachment
62598f9760cbc95b0636405c
class Lock(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._lockFilePath = os.path.join('/tmp/', 'lock.json') <NEW_LINE> self.unlock() <NEW_LINE> <DEDENT> def lock(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> info = {"lock": 1} <NEW_LINE> s = json.dumps(info, ensure_ascii=False, sort_ke...
Lock: lock maintainer
62598f9745492302aabfc1ec
class Bilin(): <NEW_LINE> <INDENT> def __init__(self,x,y,xi,yi,mask=False): <NEW_LINE> <INDENT> self.coefs=bilin_coefs(x,y,xi,yi,mask) <NEW_LINE> <DEDENT> def __call__(self,v,**kargs): <NEW_LINE> <INDENT> return bilin_fast(v,self.coefs,**kargs)
Fast bilinear interpolation. Usage: a=Bilin(x,y,xi,yi,mask=False) vi=a(v) wi=a(w) zi=z(z,**kargs) # is faster but the same as: zi=bilin(x,y,z,xi,yi,**kargs) ... # and: C=bilin_coefs(x,y,xi,yi,mask=False) zi=bilin_fast(z,C,**kargs) ... kargs: extrap: 0,1,'in','out' extrap_method='easy','tri' ...
62598f9755399d3f05626233
class MPIFrameParallelizer(object): <NEW_LINE> <INDENT> def __init__(self, iocomm, cpucomm, cpucomm_startrank, dataframetype=[core.G3FrameType.Timepoint, core.G3FrameType.Scan]): <NEW_LINE> <INDENT> self.iocomm = iocomm <NEW_LINE> self.cpucomm = cpucomm <NEW_LINE> self.cpucomm_startrank = cpucomm_startrank <NEW_LINE> s...
Do parallel I/O and processing across an MPI communicator. The style of parallelism here is that a set of IO processes read files from disk and distribute frames round-robin-style across a worker communicator. Frames will arrive in order on each process, with gaps between time segments, but no guarantees are made about...
62598f97b7558d5895463342
class HomeRule(Rule): <NEW_LINE> <INDENT> def get_strike(self): <NEW_LINE> <INDENT> return 20 <NEW_LINE> <DEDENT> def get_spare(self): <NEW_LINE> <INDENT> return 15
Правила игры для внутреннего рынка
62598f97a79ad16197769d76
class SineWaveWFE(WavefrontError): <NEW_LINE> <INDENT> @utils.quantity_input(spatialfreq=1. / u.meter, amplitude=u.meter) <NEW_LINE> def __init__(self, name='Sine WFE', spatialfreq=1.0, amplitude=1e-6, phaseoffset=0, **kwargs): <NEW_LINE> <INDENT> super(WavefrontError, self).__init__(name=name, **kwargs) <NEW_LINE> sel...
A single sine wave ripple across the optic Specified as a a spatial frequency in cycles per meter, an optional phase offset in cycles, and an amplitude. By default the wave is oriented in the X direction. Like any AnalyticOpticalElement class, you can also specify a rotation parameter to rotate the direction of the s...
62598f97d99f1b3c44d053c4
class request_schema(object): <NEW_LINE> <INDENT> def __init__(self, schema, method_name=None): <NEW_LINE> <INDENT> self.schema = schema <NEW_LINE> self.method_name = method_name <NEW_LINE> <DEDENT> def __call__(self, klass_or_func): <NEW_LINE> <INDENT> if inspect.isclass(klass_or_func): <NEW_LINE> <INDENT> ...
Decorator to specify the JSON schema required for a request.
62598f974428ac0f6e65823f
class ServerFrame(Frame): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> Tk.frame.__init__(self, parent) <NEW_LINE> s = Style() <NEW_LINE> s.theme_use('default') <NEW_LINE> self.parent = parent <NEW_LINE> self.ip_label = Label(parent, text="Local IP Address: " + get_ip(), background='white') <NEW_L...
Singleton GUI frame
62598f974a966d76dd5eebf5
class TestSystemauthenticationApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = graylog.apis.systemauthentication_api.SystemauthenticationApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_create(self): <NEW_LINE> <INDENT> pass <...
SystemauthenticationApi unit test stubs
62598f97baa26c4b54d4efc4
class Href(object): <NEW_LINE> <INDENT> def __init__(self, base='./', charset='utf-8', sort=False, key=None): <NEW_LINE> <INDENT> if not base: <NEW_LINE> <INDENT> base = './' <NEW_LINE> <DEDENT> self.base = base <NEW_LINE> self.charset = charset <NEW_LINE> self.sort = sort <NEW_LINE> self.key = key <NEW_LINE> <DEDENT> ...
Implements a callable that constructs URLs with the given base. The function can be called with any number of positional and keyword arguments which than are used to assemble the URL. Works with URLs and posix paths. Positional arguments are appended as individual segments to the path of the URL: >>> href = Href('/f...
62598f97627d3e7fe0e06bbd
class ProcessPoolException(WMException): <NEW_LINE> <INDENT> pass
_ProcessPoolException_ Raise some exceptions
62598f97be383301e0253510
class ChangeCustomerMixin(FormViewW3Mixin): <NEW_LINE> <INDENT> model = Customer <NEW_LINE> form_class = CustomerForm <NEW_LINE> success_url = reverse_lazy('customer:list')
Mixin for every modifing CustomerView: create, update, delete.
62598f97a219f33f346c652f
class BasicAuth(object): <NEW_LINE> <INDENT> def set_mongo_prefix(self, value): <NEW_LINE> <INDENT> g.mongo_prefix = value <NEW_LINE> <DEDENT> def get_mongo_prefix(self): <NEW_LINE> <INDENT> return g.get('mongo_prefix') <NEW_LINE> <DEDENT> def set_request_auth_value(self, value): <NEW_LINE> <INDENT> g.auth_value = valu...
Implements Basic AUTH logic. Should be subclassed to implement custom authentication checking. .. versionchanged:: 0.6 Add mongo_prefix getter and setter methods. .. versionchanged:: 0.4 ensure all errors returns a parseable body #366. auth.request_auth_value replaced with getter and setter methods which ...
62598f971b99ca400228f3b7
class Snake_Game(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.model = SnakeModel(800, 600) <NEW_LINE> self.view = SnakeView(self.model, 800, 600) <NEW_LINE> self.controller = SnakeController(self.model) <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> last_update_time = time.time() <NEW_LIN...
Main snake class
62598f9763d6d428bbee24d2
class RNA(Nucleotides): <NEW_LINE> <INDENT> def translate(self, stop=False, start=0): <NEW_LINE> <INDENT> protein = [] <NEW_LINE> length = len(self.sequence[start:]) // 3 * 3 <NEW_LINE> for i in range(0, length, 3): <NEW_LINE> <INDENT> aminoacid = codon_table[self.sequence[start + i:start + i + 3]] <NEW_LINE> if stop a...
Class for RNA nucleotides
62598f97009cb60464d01239
class TestEnterprisePolicyApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = esperclient.api.enterprise_policy_api.EnterprisePolicyApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_create_policy(self): <NEW_LINE> <INDENT> pass <N...
EnterprisePolicyApi unit test stubs
62598f97dd821e528d6d8c49
class MaterialsLCView(generics.ListCreateAPIView): <NEW_LINE> <INDENT> queryset = Materials.objects.all() <NEW_LINE> serializer_class = MaterialsSerializer <NEW_LINE> filter_backends = (OrderingFilter, SearchFilter, DjangoFilterBackend,) <NEW_LINE> filter_fields = ('operator', 'grossReport',) <NEW_LINE> ordering_fields...
取材信息 创建 POST 列表 GET
62598f97eab8aa0e5d30ba98
class ScalrLib(toil.provider.base.BaseProvider): <NEW_LINE> <INDENT> def __init__(self, toil, config): <NEW_LINE> <INDENT> super(ScalrLib, self).__init__(toil, config) <NEW_LINE> <DEDENT> def session(self, profile='default'): <NEW_LINE> <INDENT> if profile in self.config: <NEW_LINE> <INDENT> self.configure_proxy() <NEW...
Class for Scalr functionality. Properties : config: dict with configuration data
62598f97090684286d593563
class Quadrature: <NEW_LINE> <INDENT> def __init__(self, a, b, n): <NEW_LINE> <INDENT> self.a = a <NEW_LINE> self.b = b <NEW_LINE> self.n = n <NEW_LINE> self.h = float((b - a)) / n <NEW_LINE> <DEDENT> def integrate(self, f): <NEW_LINE> <INDENT> start = time.time() <NEW_LINE> if (self.weights is None): <NEW_LINE> <INDEN...
This class defines a quadrature method, which is a way to approximate the area under a curve of a function of 1 variable. It uses the general formula integral(f(x)) = sum(c_i*f(x_i)). The function, f(x), should be continuous on the interval of the limits of integrations. It is meant only as a superclass of a Quadratur...
62598f97656771135c489396
@Model.definition <NEW_LINE> class SparseGCAL(ModelGCAL): <NEW_LINE> <INDENT> @Model.SparseCFProjection <NEW_LINE> def V1_afferent(self, src_properties, dest_properties): <NEW_LINE> <INDENT> params = super(SparseGCAL, self).V1_afferent(src_properties, dest_properties) <NEW_LINE> return dict(params[0], cf_type = SparseC...
Reproduces the results of the examples/gcal.ty file using sparse representation.
62598f97a8ecb03325870f1f
class ClosePeriodInit(ModelView): <NEW_LINE> <INDENT> _name = 'ekd.period.close_period.init' <NEW_LINE> _description = __doc__ <NEW_LINE> transfer = fields.Boolean('Transfer Balance of Accounts') <NEW_LINE> skip_closed = fields.Boolean('Skip closed balances') <NEW_LINE> transfer_analytic = fields.Boolean('Transfer Bala...
Close Period Init
62598f976e29344779b00370
class Store(object): <NEW_LINE> <INDENT> def __init__(self, url, user=0, pw=0): <NEW_LINE> <INDENT> if (not user) or (not pw): <NEW_LINE> <INDENT> self.client = pymongo.MongoClient(url) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.client = pymongo.MongoClient(url.format(us=user, password=pw)) <NEW_LINE> <DEDENT> ...
Store message in mongodb server
62598f97bde94217f37074f4
class LogStats(object): <NEW_LINE> <INDENT> def __init__(self, interval=60.0): <NEW_LINE> <INDENT> self.interval = interval <NEW_LINE> self.slots = {} <NEW_LINE> self.multiplier = 60.0 / self.interval <NEW_LINE> dispatcher.connect(self.item_scraped, signal=signals.item_scraped) <NEW_LINE> dispatcher.connect(self.respon...
Log basic scraping stats periodically
62598f973539df3088ecbfd3
class TelloApi: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.tello_address = ('192.168.10.1', 8889) <NEW_LINE> host = '' <NEW_LINE> port = 5002 <NEW_LINE> self.locaddr = (host, port) <NEW_LINE> self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) <NEW_LINE> self.sock.bind(self.locaddr) <NEW_...
Represents tello drone, handles udp connection up and down
62598f97adb09d7d5dc0a29e
class TestGetObservationFile(Endpoint): <NEW_LINE> <INDENT> route: str = '/observation/21/file' <NEW_LINE> method: str = 'get' <NEW_LINE> admin: str = 'superman' <NEW_LINE> user: str = 'tomb_raider' <NEW_LINE> def test_invalid_parameter(self) -> None: <NEW_LINE> <INDENT> admin = self.get_client(self.admin) <NEW_LINE> a...
Tests for GET /observation/<id>/file endpoint.
62598f978e71fb1e983bb7ca
class RequestOptions(AttributeClass): <NEW_LINE> <INDENT> calculation_layers = Attribute( docstring="The calculation layers which may be used to " "estimate the set of physical properties. The order in which " "the layers appears in this list determines the order in which " "the layers will attempt to estimate the data...
The options to use when requesting a set of physical properties be estimated by the server.
62598f97b7558d5895463344
class Genshi(Bcfg2.Server.Lint.ServerPlugin): <NEW_LINE> <INDENT> def Run(self): <NEW_LINE> <INDENT> if 'Cfg' in self.core.plugins: <NEW_LINE> <INDENT> self.check_cfg() <NEW_LINE> <DEDENT> if 'TGenshi' in self.core.plugins: <NEW_LINE> <INDENT> self.check_tgenshi() <NEW_LINE> <DEDENT> if 'Bundler' in self.core.plugins: ...
Check Genshi templates for syntax errors.
62598f9710dbd63aa1c708cc
class import_mesh(bpy.types.Operator, ImportHelper): <NEW_LINE> <INDENT> bl_idname = "bakemyscan.import_mesh" <NEW_LINE> bl_label = "Imports a .mesh file" <NEW_LINE> filter_glob = bpy.props.StringProperty( default="*.mesh", options={'HIDDEN'}, ) <NEW_LINE> check_extension = True <NEW_LINE> filename_ext = ".mesh" <NEW_...
Import a Mesh file
62598f970a50d4780f7050ed
class NetatmoData: <NEW_LINE> <INDENT> def __init__(self, auth, station_data): <NEW_LINE> <INDENT> self.data = {} <NEW_LINE> self.station_data = station_data <NEW_LINE> self.auth = auth <NEW_LINE> <DEDENT> def get_module_infos(self): <NEW_LINE> <INDENT> return self.station_data.getModules() <NEW_LINE> <DEDENT> @Throttl...
Get the latest data from Netatmo.
62598f97925a0f43d25e7d51
class closesProp(SchemaProperty): <NEW_LINE> <INDENT> _prop_schema = 'closes' <NEW_LINE> _expected_schema = 'Time' <NEW_LINE> _enum = False <NEW_LINE> _format_as = "ForeignKey"
SchemaField for closes Usage: Include in SchemaObject SchemaFields as your_django_field = closesProp() schema.org description:The closing hour of the place or service on the given day(s) of the week. prop_schema returns just the property without url# format_as is used by app templatetags based upon schema.org dataty...
62598f978e71fb1e983bb7cb
class PhasePeriodic(Periodic): <NEW_LINE> <INDENT> def __init__(self, rate): <NEW_LINE> <INDENT> Periodic.__init__(self, rate) <NEW_LINE> self.phase_number = 2 <NEW_LINE> self.number_of_moves = 0 <NEW_LINE> <DEDENT> def get_next_move_time(self, game_properties, system, current_time): <NEW_LINE> <INDENT> if current_time...
This is a class that gets allocated by a Player class to a particular server. Need to decide how best to call the 'Check for next move' method.
62598f97498bea3a75a57836
class RetryIterator: <NEW_LINE> <INDENT> def __init__(self, generator, is_temp_failure_fn, args=(), kwargs=None): <NEW_LINE> <INDENT> if not inspect.isgeneratorfunction(generator): <NEW_LINE> <INDENT> raise TypeError('*generator* must be generator function') <NEW_LINE> <DEDENT> self.generator = generator <NEW_LINE> sel...
A RetryIterator instance iterates over the elements produced by any generator function passed to its constructor, i.e. it wraps the iterator obtained by calling the generator function. When retrieving elements from the wrapped iterator, exceptions may occur. Most such exceptions are propagated. However, exceptions for...
62598f97bd1bec0571e14f4f
class CountableSQLAlchemyObjectType(SQLAlchemyObjectType): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def __init_subclass_with_meta__(cls, model=None, registry=None, skip_registry=False, only_fields=(), exclude_fields=(), connection=None, use_connecti...
The custom object type that uses countable connection Reference: https://github.com/graphql-python/graphene-sqlalchemy/issues/58#issuecomment-349050744
62598f9701c39578d7f12a95
class Meta: <NEW_LINE> <INDENT> model = models.DebugTalksModel <NEW_LINE> fields = ("id", "name", "debugtalk", "create_time", "project_id", "project") <NEW_LINE> extra_kwargs = { "create_time": { "read_only": True } }
设置元数据属性
62598f9701c39578d7f12a96
class ConceptDataset: <NEW_LINE> <INDENT> class ConceptDatasetDialect(csv.Dialect): <NEW_LINE> <INDENT> delimiter = '\t' <NEW_LINE> lineterminator = '\r\n' <NEW_LINE> quoting = csv.QUOTE_NONE <NEW_LINE> strict = True <NEW_LINE> <DEDENT> Concept = collections.namedtuple('Concept', [ 'id', 'name', 'german', 'english', 'r...
Handles reading the NorthEuraLex' concept dataset.
62598f975f7d997b871f9268
class SectionDeleteView( LoginRequiredMixin, SectionMixin, DeleteView): <NEW_LINE> <INDENT> context_object_name = 'section' <NEW_LINE> template_name = 'section/delete.html' <NEW_LINE> def get_success_url(self): <NEW_LINE> <INDENT> return reverse('section-list', kwargs={ 'project_slug': self.object.project.slug })
Delete view for Section.
62598f974428ac0f6e658241
class UserReadOnlySerializer(serializers.Serializer): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.configuration = kwargs.pop('configuration', None) <NEW_LINE> if not self.configuration: <NEW_LINE> <INDENT> self.configuration = settings.ACCOUNT_VISIBILITY_CONFIGURATION <NEW_LINE> <D...
Class that serializes the User model and UserProfile model together.
62598f970c0af96317c56099
class CSVReader(object): <NEW_LINE> <INDENT> _file = None <NEW_LINE> device_id = '' <NEW_LINE> def __init__(self, file_name, async_callback=None): <NEW_LINE> <INDENT> self._file_name = file_name <NEW_LINE> self.async_callback = async_callback <NEW_LINE> <DEDENT> def open_csv(self): <NEW_LINE> <INDENT> self._file = open...
Object that reads, and parses ThinkRF RTSA CSV files :param filename: name of the file to be read :param callback: callback to use for async operation (not used if file_name is using a :class:`PlainSocketConnector`)
62598f9771ff763f4b5e748f
class Categoria(models.Model): <NEW_LINE> <INDENT> descricao = models.CharField(max_length=64) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.descricao
Categoria de enfermidade.
62598f9730dc7b766599f563
class Computer: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> print("Naive Computer with minimal cost simplified table-form strategy") <NEW_LINE> pass <NEW_LINE> <DEDENT> def play(self,chessboardinfo): <NEW_LINE> <INDENT> (width,height) = chessboardinfo.shape <NEW_LINE> values = self.__values(chessboardin...
Naive Computer with minimal cost simplified table-form strategy
62598f97379a373c97d98d2a
class Headline(Func): <NEW_LINE> <INDENT> function = "ts_headline" <NEW_LINE> def __init__(self, field, query, config=None, options=None, **extra): <NEW_LINE> <INDENT> expressions = [field, query] <NEW_LINE> if config: <NEW_LINE> <INDENT> expressions.insert(0, Value(config)) <NEW_LINE> <DEDENT> if options: <NEW_LINE> <...
Show postgresql text search matches in context
62598f97462c4b4f79dbb720
class CSBatchUpdateTimesheetRequest(object): <NEW_LINE> <INDENT> swagger_types = { 'timesheets': 'list[CSTimesheet]' } <NEW_LINE> attribute_map = { 'timesheets': 'Timesheets' } <NEW_LINE> def __init__(self, timesheets=None): <NEW_LINE> <INDENT> self._timesheets = None <NEW_LINE> self.discriminator = None <NEW_LINE> if ...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598f9716aa5153ce400214
@DERTag(SET, (set, frozenset), constructed=True) <NEW_LINE> class _Set(DERType): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def encode(value: object) -> bytes: <NEW_LINE> <INDENT> set_value = cast(Union[FrozenSet[object], Set[object]], value) <NEW_LINE> return b''.join(sorted(der_encode(item) for item in set_value)) ...
A set of DER values
62598f9745492302aabfc1ef
class InfantFuNewMed(InfantCrfModelMixin): <NEW_LINE> <INDENT> new_medications = models.CharField( max_length=25, choices=YES_NO, verbose_name="Has the child recieved a NEW course of any of the following medications " "since the last attended scheduled visit", help_text="do not report if the same course was recorded at...
A model completed by the user on the infant's follow up medications.
62598f97a17c0f6771d5bf52
class ContentMixin(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> <DEDENT> name = models.CharField(_('Nombre'), max_length=150) <NEW_LINE> description = models.CharField(_('Descripción'), max_length=255, blank=True,) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return...
Adds name and description fields.
62598f9794891a1f408b957c
class LabelVisitorTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def perform_labeling_on_expression(self, expr): <NEW_LINE> <INDENT> obj = parse(expr) <NEW_LINE> label = LabelVisitor() <NEW_LINE> label.visit(obj) <NEW_LINE> return label
Baseclass for LabelVisitor tests
62598f977cff6e4e811b5736
class AuthorizedSession(requests.Session): <NEW_LINE> <INDENT> def __init__(self, credentials, refresh_status_codes=transport.DEFAULT_REFRESH_STATUS_CODES, max_refresh_attempts=transport.DEFAULT_MAX_REFRESH_ATTEMPTS, refresh_timeout=None, auth_request=None): <NEW_LINE> <INDENT> super(AuthorizedSession, self).__init__()...
A Requests Session class with credentials. This class is used to perform requests to API endpoints that require authorization:: from google.auth.transport.requests import AuthorizedSession authed_session = AuthorizedSession(credentials) response = authed_session.request( 'GET', 'https://www.goog...
62598f974e4d562566372139
class NUUDPProbeTestResultsFetcher(NURESTFetcher): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def managed_class(cls): <NEW_LINE> <INDENT> from .. import NUUDPProbeTestResult <NEW_LINE> return NUUDPProbeTestResult
Represents a NUUDPProbeTestResults fetcher Notes: This fetcher enables to fetch NUUDPProbeTestResult objects. See: bambou.NURESTFetcher
62598f97ac7a0e7691f72223
class _ProductionConfig(_BaseConfig): <NEW_LINE> <INDENT> LOGGING_LEVEL = ERROR
The configuraiton keys and their corresponding settings for a production environment
62598f97f8510a7c17d7e003
class Factory(Base.Factory): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def _get_object_class(): <NEW_LINE> <INDENT> return CharterApplications <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def get_persister(): <NEW_LINE> <INDENT> return Persister()
CharterApplications Factory
62598f974e4d56256637213a
class DatabaseListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[Database]'}, } <NEW_LINE> def __init__( self, *, value: Optional[List["Database"]] = None, **kwargs ): <NEW_LINE> <INDENT> super(DatabaseListResult, self).__init__(**kwargs) <NEW_LINE> self.v...
A List of databases. :ivar value: The list of databases housed in a server. :vartype value: list[~azure.mgmt.rdbms.mysql.models.Database]
62598f972ae34c7f260aadf8
class Client(object): <NEW_LINE> <INDENT> def __init__(self, database=0, ioloop=None): <NEW_LINE> <INDENT> self._ioloop = ioloop or IOLoop.instance() <NEW_LINE> self._database = database <NEW_LINE> self._stream = None <NEW_LINE> <DEDENT> def connect(self, callback=None, host="localhost", port=6379): <NEW_LINE> <INDENT>...
Stupid simple client
62598f97adb09d7d5dc0a2a0
class Collection(BaseResource): <NEW_LINE> <INDENT> @falcon.before(validate_user_create) <NEW_LINE> def on_post(self, req, res): <NEW_LINE> <INDENT> session = req.context['session'] <NEW_LINE> user_req = req.context['data'] <NEW_LINE> if user_req: <NEW_LINE> <INDENT> user = User() <NEW_LINE> user.username = user_req['u...
Handle for endpoint: /v1/users
62598f97004d5f362081ee88
class UserProfileSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = models.UserProfile <NEW_LINE> fields = ('id', 'email', 'name', 'password') <NEW_LINE> extra_kwargs = { 'password': { 'write_only': True } } <NEW_LINE> <DEDENT> def create(self, validated_data): <NEW_LIN...
Serializer for our User Profile Object
62598f9738b623060ffa8da5
class Activity(models.Model): <NEW_LINE> <INDENT> group = models.CharField(max_length=4) <NEW_LINE> grouptype = models.CharField(max_length=100) <NEW_LINE> groupdetail = models.CharField(max_length=100) <NEW_LINE> details = models.CharField(max_length=256) <NEW_LINE> disabled = models.BooleanField() <NEW_LINE> time = m...
Activity encapsulates the idea of a single task for Industrial Engineering purposes. Group: This is the concatenation of the account and the process this is used to find which employees a particular activity is aimed at. Group Type: This is the category in which a particular activity resides Group Detail: This is si...
62598f97dd821e528d6d8c4c
class ValueNotInDataTableColumnValidator(ValueInDataTableColumnValidator): <NEW_LINE> <INDENT> def __init__(self, tool_data_table, metadata_column, message="Value already present.", line_startswith=None): <NEW_LINE> <INDENT> super(ValueNotInDataTableColumnValidator, self).__init__(tool_data_table, metadata_column, mess...
Validator that checks if a value is NOT in a tool data table column.
62598f97d7e4931a7ef3bdb0
class Singleton(type): <NEW_LINE> <INDENT> _instances = {} <NEW_LINE> def __call__(cls, *args, **kwargs): <NEW_LINE> <INDENT> if cls not in cls._instances: <NEW_LINE> <INDENT> cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) <NEW_LINE> <DEDENT> return cls._instances[cls]
The Singleton can turn any class into a singleton just my adding it in the __metaclass__. This overrides all constructors and returns the original instance of the class. example: __metaclass__ = Singleton.Singleton This allows easy implementation and removing of singleton characteristics to any class.
62598f97925a0f43d25e7d53
class Relevance(object): <NEW_LINE> <INDENT> def __init__(self, qid, judged_docid_list, supervised_docid_list, supervised_score_list): <NEW_LINE> <INDENT> self._qid = qid <NEW_LINE> self._judged_docid_list = judged_docid_list <NEW_LINE> self._supervised_docid_list = supervised_docid_list <NEW_LINE> self._supervised_sco...
Incooperation with result file and qrels file Attributes: qid, int, query id judgement_docid_list: list of list, judged docids in TREC qrels supervised_docid_list: list, top docids from unsupervised models, e.g. BM25, QL.
62598f9756b00c62f0fb25c7
class InMemorySession(Session, dict): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(InMemorySession, self).__init__(*args, **kwargs)
Implement Session object using a simple dictionary.
62598f97cb5e8a47e493c000
class TicTacToe(GameBoard): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__(3, 3) <NEW_LINE> <DEDENT> def check_winner(self, row, col): <NEW_LINE> <INDENT> win_cond = [True, True, True, True] <NEW_LINE> i = 0 <NEW_LINE> played_move = self._board[row][col] <NEW_LINE> while (win_cond[0] and i...
A class to represent objects that will replicate a Tic Tac Toe board. This class imports from the GameBoard class.
62598f97a17c0f6771d5bf53
class JSONField(models.TextField): <NEW_LINE> <INDENT> __metaclass__ = models.SubfieldBase <NEW_LINE> def to_python(self, value): <NEW_LINE> <INDENT> if value == "": <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> if isinstance(value, basestring): <NEW_LINE> <INDENT> return json.loads(value...
JSONField is a generic textfield that neatly serializes/unserializes JSON objects seamlessly
62598f97cc0a2c111447ad24
class DetachNetworkInterfaceRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.NetworkInterfaceId = None <NEW_LINE> self.InstanceId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.NetworkInterfaceId = params.get("NetworkInterfaceId") <NEW_LINE> s...
DetachNetworkInterface请求参数结构体
62598f97d58c6744b42dc15c
class UserNameGenerator(generators.FirstNameGenerator, generators.LastNameGenerator): <NEW_LINE> <INDENT> def __init__(self, gender=None): <NEW_LINE> <INDENT> self.gender = gender <NEW_LINE> self.all = self.male + self.female <NEW_LINE> <DEDENT> def generate(self): <NEW_LINE> <INDENT> if self.gender == 'm': <NEW_LINE> ...
Generates a username of the form f_lname
62598f97c432627299fa2ced
class dataTransform: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.goodDataPath = "Training_Raw_files_validated/Good_Raw" <NEW_LINE> self.logger = App_Logger() <NEW_LINE> <DEDENT> def replaceMissingWithNull(self): <NEW_LINE> <INDENT> log_file = open("Training_Logs/dataTransformLog.txt", 'a+') <NEW_LI...
This class shall be used for transforming the Good Raw Training Data before loading it in Database!!. Written By: iNeuron Intelligence Version: 1.0 Revisions: None
62598f975f7d997b871f9269
class ChangePWD(restful.Resource): <NEW_LINE> <INDENT> @allow_cross_domain <NEW_LINE> def post(self): <NEW_LINE> <INDENT> name = request.form["name"] <NEW_LINE> pwd = request.form["pwd"] <NEW_LINE> new = request.form["new"] <NEW_LINE> uo = Userorml() <NEW_LINE> Infoa = uo.changepwd(name,pwd,new) <NEW_LINE> return jsoni...
请求方式: POST 请求参数: usertoken_str : usertoken 返回值: True,成功删除usertoken,None; False,数据库错误,None
62598f97627d3e7fe0e06bc1
class Image: <NEW_LINE> <INDENT> def __init__(self,cnvs,position): <NEW_LINE> <INDENT> self.cnvs =cnvs <NEW_LINE> self.position = position <NEW_LINE> self.id_pntr = None <NEW_LINE> self.direction = 1 <NEW_LINE> self.step = 20 <NEW_LINE> self.maxy = int(cnvs.cget('height')) - 50 <NEW_LINE> self.miny =10 <NEW_LINE> <DEDE...
要出现的字符与图片的抽象父类。
62598f97f7d966606f747cfe
class PermissionError(OAuthException): <NEW_LINE> <INDENT> error_code = 200 <NEW_LINE> error_id = "PERMISSION" <NEW_LINE> error_description = 'Permissions error'
Autogenerated exception class for API error code 200
62598f970a50d4780f7050f0
class SecsS01F02(SecsStreamFunction): <NEW_LINE> <INDENT> _stream = 1 <NEW_LINE> _function = 2 <NEW_LINE> _data_format = [MDLN] <NEW_LINE> _to_host = True <NEW_LINE> _to_equipment = True <NEW_LINE> _has_reply = False <NEW_LINE> _is_reply_required = False <NEW_LINE> _is_multi_block = False
on line data. .. caution:: This Stream/function has different structures depending on the source. If it is sent from the eqipment side it has the structure below, if it is sent from the host it is an empty list. Be sure to fill the array accordingly. **Structure E->H**:: { MDLN: A[20] ...
62598f978e7ae83300ee8db5
class QuestionnaireResponseGroup(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_name = "QuestionnaireResponseGroup" <NEW_LINE> def __init__(self, jsondict=None): <NEW_LINE> <INDENT> self.group = None <NEW_LINE> self.linkId = None <NEW_LINE> self.question = None <NEW_LINE> self.subject = None <NEW_LINE> ...
Grouped questions. A group of questions to a possibly similarly grouped set of questions in the questionnaire response.
62598f972c8b7c6e89bd34e7
class Vote(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(User, related_name='vote', on_delete=models.CASCADE) <NEW_LINE> dish = models.ForeignKey(Dish, related_name='vote', on_delete=models.CASCADE) <NEW_LINE> rate = models.IntegerField()
User: point to the user object made the vote Dish: point to the dish object user voted on
62598f9730dc7b766599f565
class ACLRole(base.Model): <NEW_LINE> <INDENT> __slots__ = ['description', 'name', 'policies', 'service_identities'] <NEW_LINE> __attributes__ = { 'description': { 'key': 'Description', 'type': str, }, 'name': { 'key': 'Name', 'type': str, 'required': True, }, 'policies': { 'key': 'Policies', 'type': list, 'validator':...
Defines the model used for an ACL role.
62598f97fbf16365ca793dcf
class VerificationForm(InvenioBaseForm): <NEW_LINE> <INDENT> send_verification_email = SubmitField(_("Send verification email"))
Form to render a button to request email confirmation.
62598f971f037a2d8b9e3dfc
class preamble_prefixer_scapy(object): <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 constructor defined") <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def make(): <NEW_L...
<+description of block+>
62598f977d847024c075c0eb
class _inputExpression(Expression): <NEW_LINE> <INDENT> def __cinit__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def set(self): <NEW_LINE> <INDENT> pass
Subclass of Expression corresponding to scalar input expressions
62598f97379a373c97d98d2c
class ValidWifiObservationSchema(ValidWifiReportSchema, ValidReportSchema): <NEW_LINE> <INDENT> pass
A schema which validates the fields in wifi observation.
62598f974527f215b58e9bfd
class UbxCfgEsfla(UbxCfgEsfla_): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> <DEDENT> def unpack(self): <NEW_LINE> <INDENT> self.f = Fields() <NEW_LINE> self.f.add(U1('version')) <NEW_LINE> self.f.add(U1('numConfigs')) <NEW_LINE> self.f.add(Padding(2, 'res1')) <NEW_LINE> su...
Reponse frame to poll request Contains all lever arm configurations
62598f97507cdc57c63a4aad
class JsonFilterHikesView(CategoryRegion, ListView): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> regions = self.request.GET.getlist('region') <NEW_LINE> categories = self.request.GET.getlist('category') <NEW_LINE> if len(regions) and len(categories): <NEW_LINE> <INDENT> queryset = Hike.objects.filte...
Filter for hikes in JSON format
62598f9716aa5153ce400216
class MockLight(MockToggleEntity, LightEntity): <NEW_LINE> <INDENT> color_mode = None <NEW_LINE> max_mireds = 500 <NEW_LINE> min_mireds = 153 <NEW_LINE> supported_color_modes = None <NEW_LINE> supported_features = 0 <NEW_LINE> brightness = None <NEW_LINE> color_temp = None <NEW_LINE> hs_color = None <NEW_LINE> rgb_colo...
Mock light class.
62598f9763d6d428bbee24d6
class DocMatcher(object): <NEW_LINE> <INDENT> search = "" <NEW_LINE> parsed_search = None <NEW_LINE> doc_format = '{' + papis.config.get('format-doc-name') + '[DOC_KEY]}' <NEW_LINE> logger = logging.getLogger('DocMatcher') <NEW_LINE> matcher = None <NEW_LINE> @classmethod <NEW_LINE> def return_if_match(cls, doc): <NEW_...
This class implements the mini query language for papis. All its methods are static, it could be also implemented as a separate module. The static methods are to be used as follows: First the search string has to be set, DocMatcher.set_search(search_string) and then the parse method should be called in order to de...
62598f972ae34c7f260aadf9
class AccessToken(ormist.TaggedAttrsModel): <NEW_LINE> <INDENT> id_length = 64 <NEW_LINE> def to_werkzeug_response(self): <NEW_LINE> <INDENT> from werkzeug.wrappers import Response <NEW_LINE> content = self.get_json_content() <NEW_LINE> return Response(json.dumps(content), headers=self.get_headers()) <NEW_LINE> <DEDENT...
Access token object. Persistent object, used to manage clients' access to users' resources. Usually you shouldn't create instances of :class:`AccessToken` directly, using other methods instread. For example, to create access token from code request, use :meth:`CodeRequest.exchange_for_token`. Access token may have ...
62598f9723849d37ff850ddf
class IMobileBehavior(form.Schema): <NEW_LINE> <INDENT> form.fieldset( 'mobile', label=('Mobile'), fields=('mobileFolderListing'), ) <NEW_LINE> mobileFolderListing = schema.Bool(title=_(u"Show folder listing"), description=_(u"Show touch screen friendly listing of the child content at the bottom of the page for this co...
How content and its children react to differt medias
62598f9732920d7e50bc5d70
class Lua(Linter): <NEW_LINE> <INDENT> syntax = 'Lua' <NEW_LINE> cmd = (_exe, '-p', '*', '-') <NEW_LINE> regex = r'^.+?:.+?:(?P<line>\d+): (?P<message>.+?(?:near (?P<near>\'.+\')|$))' <NEW_LINE> error_stream = util.STREAM_STDERR
Provides an interface to luac -p.
62598f9760cbc95b06364062
class EmptyElement(Element): <NEW_LINE> <INDENT> def __unicode__(self): <NEW_LINE> <INDENT> return u"<%s>" % self._openingtag()
HTML elements with an empty content model.
62598f97f7d966606f747cff
class UserProfileViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> serializer_class = serializers.UserProfileSerializer <NEW_LINE> queryset = models.UserProfile.objects.all()
Handle createing and updating profiles
62598f9723e79379d538c21b
class _Pooling3D(Layer): <NEW_LINE> <INDENT> def __init__(self, pool_size=(2, 2, 2), strides=None, padding='valid', data_format=None, **kwargs): <NEW_LINE> <INDENT> super(_Pooling3D, self).__init__(**kwargs) <NEW_LINE> if strides is None: <NEW_LINE> <INDENT> strides = pool_size <NEW_LINE> <DEDENT> self.pool_size = conv...
Abstract class for different pooling 3D layers.
62598f97ac7a0e7691f72225
class ChooseSameAddressTestCase(ComplianceTestCase): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> if len(self.target(1).global_ip(offset='*')) < 2: <NEW_LINE> <INDENT> fail("Cannot Test. The UUT requires two global IP addresses for this test case to be valid.") <NEW_LINE> <DEDENT> self.ui.tell("Please send an...
IPv6 Default Address Selection - Choose Same Address Verify that a node selects a source address that is the same as the destination address if the packet is being sent to the same interface. @private Source: RFC 3484 Section 5, Rule 1
62598f973cc13d1c6d465486
class FormatRangesTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_one_group(self): <NEW_LINE> <INDENT> self.assertEqual(format_ranges([1, 2, 3]), '1-3') <NEW_LINE> <DEDENT> def test_two_groups(self): <NEW_LINE> <INDENT> self.assertEqual( format_ranges([1, 2, 10, 11, 12, 13, 14]), '1-2,10-14' ) <NEW_LINE> <DEDENT...
Tests for format_ranges.
62598f9726068e7796d4c67c
class Items(Base): <NEW_LINE> <INDENT> __tablename__ = "items" <NEW_LINE> __table_args__ = ( UniqueConstraint("category_id", "title", name="un_title"), ) <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> title = Column(String(100, collation="NOCASE"), nullable=False) <NEW_LINE> description = Column(String(20...
O app não permite guardar items com o mesmo nome na mesma categoria visto que os endpoints utilizam os nomes dos mesmos. Por isso foi necessário a inclusão de uma Unique Constraint
62598f9710dbd63aa1c708d0
class AnalysisTracker: <NEW_LINE> <INDENT> def __init__(self, job_config: JobConfig): <NEW_LINE> <INDENT> self._job_config = job_config <NEW_LINE> self._analysis_tracker = dict() <NEW_LINE> self._attribute_tracker = dict() <NEW_LINE> self._attribute_type_tracker = defaultdict(set) <NEW_LINE> <DEDENT> def add_analysis(s...
Tracker for storing the performed analysis results
62598f970fa83653e46f4c04
class FunctionFields(Category): <NEW_LINE> <INDENT> @cached_method <NEW_LINE> def super_categories(self): <NEW_LINE> <INDENT> return[Fields()] <NEW_LINE> <DEDENT> def _call_(self, x): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return x.function_field() <NEW_LINE> <DEDENT> except AttributeError: <NEW_LINE> <INDENT> ra...
The category of function fields. EXAMPLES: We create the category of function fields:: sage: C = FunctionFields() sage: C Category of function fields TESTS:: sage: TestSuite(FunctionFields()).run()
62598f97a17c0f6771d5bf55
class ChannelMode(Message): <NEW_LINE> <INDENT> def __init__(self, channel, mode=None, value=None): <NEW_LINE> <INDENT> self.channel = channel-1 <NEW_LINE> self.mode = mode <NEW_LINE> self.value = value <NEW_LINE> <DEDENT> def setMessage(self, mode, value): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> self.byte_1 ...
This the same code as the Control Change (above), but implements Mode control and special message by using reserved controller numbers 120-127. The commands are defined in the easier inherited classes below. channel 1-16 mode 120-127 value 0-127
62598f97cc0a2c111447ad26