code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class SSEClient: <NEW_LINE> <INDENT> def __init__(self, url, last_id=None, http_factory=None, **kwargs): <NEW_LINE> <INDENT> self.url = url <NEW_LINE> self.last_id = last_id <NEW_LINE> self._chunk_size = 10000 <NEW_LINE> if http_factory is None: <NEW_LINE> <INDENT> http_factory = HTTPFactory({}, HTTPConfig()) <NEW_LINE...
A simple Server-Sent Events client. This implementation does not include automatic retrying of a dropped connection; the caller will do that. If a connection ends, the events iterator will simply end.
62598f9bd58c6744b42dc1a0
class Animal(_BaseModel): <NEW_LINE> <INDENT> SEX_CHOICES = ( ('f', 'Female'), ('m', 'Male'), ('h', 'Hermaphrodite'), ) <NEW_LINE> specie = models.ForeignKey(Specie, **_FKEY) <NEW_LINE> race = models.CharField(blank=True, **_CHAR) <NEW_LINE> sex = models.CharField(max_length=2, choices=SEX_CHOICES, blank=True) <NEW_LIN...
Animal class represents the animal itself.
62598f9b435de62698e9bb93
class FeedbackForm(PotatoCaptchaForm): <NEW_LINE> <INDENT> feedback = forms.CharField(required=True, label='', widget=forms.Textarea(attrs={'rows': 4})) <NEW_LINE> platform = forms.CharField(required=False, widget=forms.HiddenInput, label='') <NEW_LINE> chromeless = forms.CharField(required=False, widget=forms.HiddenIn...
Site feedback form.
62598f9b8e7ae83300ee8e3d
class CreateRouter(neutronV20.CreateCommand): <NEW_LINE> <INDENT> resource = 'router' <NEW_LINE> _formatters = {'external_gateway_info': _format_external_gateway_info, } <NEW_LINE> def add_known_arguments(self, parser): <NEW_LINE> <INDENT> parser.add_argument( '--admin-state-down', dest='admin_state', action='store_fal...
Create a router for a given tenant.
62598f9b0c0af96317c56121
class Tab(Component): <NEW_LINE> <INDENT> @_explicitize_args <NEW_LINE> def __init__(self, children=None, id=Component.UNDEFINED, style=Component.UNDEFINED, className=Component.UNDEFINED, label=Component.UNDEFINED, tab_id=Component.UNDEFINED, **kwargs): <NEW_LINE> <INDENT> self._prop_names = ['children', 'id', 'style',...
A Tab component. Keyword arguments: - children (a list of or a singular dash component, string or number; optional): The children of this component - id (string; optional): The ID of this component, used to identify dash components in callbacks. The ID needs to be unique across all of the components in an app. - styl...
62598f9be64d504609df9287
class PADSWriteHelper(PADSHelper): <NEW_LINE> <INDENT> def new(self, item_id): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def delete(self, item_id): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def __init__(self, user_id=settings['user_id_signed_out'], **kwargs): <NEW_LINE> <...
Base class for helper classes that store data, whether saving new items or modifying existing ones
62598f9bfff4ab517ebcd58c
class MLens(object): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> raise Exception("Called abstract method get of MLens") <NEW_LINE> <DEDENT> def set(self, _new): <NEW_LINE> <INDENT> raise Exception("Called abstract method set of MLens")
A mutable lens interface. Implementations should respect the lens laws: 1) You get out what you put in: lens.set(a) assert lens.get() == a 2) Putting back what you got changes nothing: { a = lens.get(); lens.set(a) } = {} 3) Writing twice is the same as writing once: { lens.set(a); lens.set(b) } = { lens.s...
62598f9b30dc7b766599f5eb
class CoursewareContextTestCase(ModuleStoreTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(CoursewareContextTestCase, self).setUp(create_user=True) <NEW_LINE> self.course = CourseFactory.create(org="TestX", number="101", display_name="Test Course") <NEW_LINE> self.discussion1 = ItemFactory.cre...
Base testcase class for courseware context for the comment client service integration
62598f9b2ae34c7f260aae7f
class StateManager: <NEW_LINE> <INDENT> def __init__(self, cmd_exec): <NEW_LINE> <INDENT> self.__cmd_exec = cmd_exec <NEW_LINE> self.__state = State.NONE <NEW_LINE> self.__state_obj = StateNone(self.__cmd_exec) <NEW_LINE> <DEDENT> def __update_state(self, next_state, ctrl_points): <NEW_LINE> <INDENT> if next_state == s...
Custom class: Manage state about this feature
62598f9b379a373c97d98db2
class Book(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=200) <NEW_LINE> author = models.ForeignKey('Author', on_delete=models.SET_NULL, null=True) <NEW_LINE> summary = models.TextField(max_length=1000, help_text="Enter a brief description of the book") <NEW_LINE> isbn = models.CharField('ISBN'...
Model representing a book (but not a specific copy of a book).
62598f9b63d6d428bbee2550
class Datum(object): <NEW_LINE> <INDENT> def __init__(self, pos, kind, ln, data): <NEW_LINE> <INDENT> self.pos = pos <NEW_LINE> self.kind = kind <NEW_LINE> self.ln = ln <NEW_LINE> self.data = data <NEW_LINE> self.children = None <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "Datum(%r,%r,%r,%r)" % (...
Holds a single entry from the Data section
62598f9b462c4b4f79dbb7aa
class Conditions: <NEW_LINE> <INDENT> def __init__(self, atoms): <NEW_LINE> <INDENT> self.atoms = atoms <NEW_LINE> self.atoms_symbols = atoms.get_chemical_symbols() <NEW_LINE> self.atoms_labels = atoms.get_chemical_symbols() <NEW_LINE> self.atom_types = [] <NEW_LINE> <DEDENT> def min_distance_rule(self, sym1, sym2, ifc...
Atomic labels for the GULP calculator. This class manages an array similar to atoms.get_chemical_symbols() via get_atoms_labels() method, but with atomic labels in stead of atomic symbols. This is useful when you need to use calculators like GULP or lammps that use force fields. Some force fields can have different a...
62598f9b0c0af96317c56122
class IndyCredDefId(Regexp): <NEW_LINE> <INDENT> EXAMPLE = "WgWxqztrNooG92RXvxSTWv:3:CL:20:tag" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super().__init__( ( rf"([{B58}]{{21,22}})" f":3" f":CL" rf":(([1-9][0-9]*)|([{B58}]{{21,22}}:2:.+:[0-9.]+))" f"(.+)?$" ), error="Value {input} is not an indy credential defi...
Validate value against indy credential definition identifier specification.
62598f9b4a966d76dd5eec80
class AppTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_root_text(self): <NEW_LINE> <INDENT> tester = app.test_client(self) <NEW_LINE> response = tester.get('/') <NEW_LINE> self.assertEqual(response.data, b'Hello world!')
AppTestCase
62598f9ba17c0f6771d5bfda
@singleton <NEW_LINE> class Configurator: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._db_host = 'localhost' <NEW_LINE> self._db_port = 33054 <NEW_LINE> self._db_name = 'ffmpeg' <NEW_LINE> self._db_table = 'appcommand' <NEW_LINE> self._db_user = None <NEW_LINE> self._db_password = '' <NEW_LINE> sel...
Configuration manager
62598f9b96565a6dacd2ce48
class ManyQubitGateFallbacker(Backend): <NEW_LINE> <INDENT> def _run_inner(self, gates, n_qubits) -> List[Operation]: <NEW_LINE> <INDENT> decomposed = [] <NEW_LINE> for gate in gates: <NEW_LINE> <INDENT> if gate.n_qargs > 2: <NEW_LINE> <INDENT> decomposed += self._run_inner(gate.fallback(n_qubits), n_qubits) <NEW_LINE>...
Decomposite more than 2 qubit gate by fallback system.
62598f9b097d151d1a2c0dc5
@resource('/users/bind/auto', _web=True) <NEW_LINE> class BindAuto(Resource): <NEW_LINE> <INDENT> key = 'auto' <NEW_LINE> def add_args(self): <NEW_LINE> <INDENT> super(BindAuto, self).add_args() <NEW_LINE> self.req.add_argument('device', type=unicode, default='') <NEW_LINE> <DEDENT> @login_required <NEW_LINE> def post(...
自动绑定
62598f9b3c8af77a43b67e0d
class ShovelTest_Tool(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.label = "Make Shovel Test Grid" <NEW_LINE> self.description = """Makes a shovel test grid.""" <NEW_LINE> self.canRunInBackground = False <NEW_LINE> self.category = "Wildsong" <NEW_LINE> <DEDENT> def getParameterInfo(self): <...
This class has the methods you need to define to use your code as an ArcGIS Python Tool.
62598f9b009cb60464d012c4
class HistoryPlugin(object): <NEW_LINE> <INDENT> def __init__(self, exaile): <NEW_LINE> <INDENT> self.exaile = exaile <NEW_LINE> save_on_exit = settings.get_option('plugin/history/save_on_exit', history_preferences.save_on_exit_default) <NEW_LINE> shown = settings.get_option('plugin/history/shown', False) <NEW_LINE> se...
Implements logic for plugin
62598f9bbe8e80087fbbedff
class DelugeTransferProtocol(asyncio.Protocol): <NEW_LINE> <INDENT> def __init__(self, message_received_callback): <NEW_LINE> <INDENT> self.transport = None <NEW_LINE> self.message_received = message_received_callback <NEW_LINE> self._buffer = bytes() <NEW_LINE> self._message_length = 0 <NEW_LINE> self.connected = Fals...
Data messages are transferred using very a simple protocol. Data messages are transferred with a header containing the length of the data to be transferred (payload).
62598f9bbaa26c4b54d4f052
class WelcomeHandler(Handler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> user = self.user <NEW_LINE> if not user: <NEW_LINE> <INDENT> self.redirect("/login") <NEW_LINE> return <NEW_LINE> <DEDENT> self.render("welcome.html", username=user.username)
mapping for url ('/welcome')
62598f9b3617ad0b5ee05ef0
class FastDFSStorage(Storage): <NEW_LINE> <INDENT> def _save(self, name, content, max_length=None): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def _open(self, name, mode='rb'): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def url(self, name): <NEW_LINE> <INDENT> return 'http://image.meiduo.site:8888/' + name
自定义文件存储系统
62598f9b0a50d4780f705178
class Unqlite(CMakePackage): <NEW_LINE> <INDENT> homepage = "https://unqlite.org/" <NEW_LINE> url = "https://github.com/symisc/unqlite/archive/v1.1.9.tar.gz" <NEW_LINE> git = 'https://github.com/symisc/unqlite.git' <NEW_LINE> version('master', branch='master') <NEW_LINE> version('1.1.9', sha256='33d5b5e7b2ca223942e77d3...
UnQLite is a in-process software library which implements a self-contained, serverless, zero-configuration, transactional NoSQL database engine.
62598f9b94891a1f408b95c1
@base <NEW_LINE> class CrossSectionStructureVT(VariableTree): <NEW_LINE> <INDENT> s = Float() <NEW_LINE> regions = List(desc='List of names of regions in the cross section') <NEW_LINE> webs = List(desc='List of names of regions in the cross section') <NEW_LINE> materials = Dict(desc='Dictionary of MaterialProps vartree...
Container for a cross-sectional definition of the internal structure of a blade.
62598f9b4428ac0f6e6582cb
class synapseModel(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.name = '' <NEW_LINE> self.srcname = '' <NEW_LINE> self.srcN = 0 <NEW_LINE> self.trgname = '' <NEW_LINE> self.trgN = 0 <NEW_LINE> self.N = 0 <NEW_LINE> self.variables = [] <NEW_LINE> self.variabletypes = [] <NEW_LINE> self.share...
Class that contains all relevant information about a synapse model.
62598f9b627d3e7fe0e06c4b
class AbstractRealTimeVisualizer(AbstractVisualizer): <NEW_LINE> <INDENT> X_SPACING = 1. <NEW_LINE> Z_SPACING = 1. <NEW_LINE> def __init__(self, simulation, axis): <NEW_LINE> <INDENT> super(AbstractRealTimeVisualizer, self).__init__(axis) <NEW_LINE> assert_is_type(simulation, Simulation) <NEW_LINE> self._sim = simulati...
The AbstractRealTimeVisualizer is a class for visualizing motion and animating objects. It can create movies from Simulations and static plots containing frozen moments of an animation.
62598f9b8da39b475be02f84
class RequestController: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.dispatcher = Dispatcher() <NEW_LINE> <DEDENT> def dispatch_request(self, request): <NEW_LINE> <INDENT> if isinstance(request, Request): <NEW_LINE> <INDENT> self.dispatcher.dispatch(request) <NEW_LINE> <DEDENT> else: <NEW_LINE> <IN...
front controller
62598f9b8da39b475be02f85
@implementer(IStep) <NEW_LINE> @attributes(['server_config']) <NEW_LINE> class CreateServer(object): <NEW_LINE> <INDENT> def as_effect(self): <NEW_LINE> <INDENT> eff = Effect(Func(generate_server_name)) <NEW_LINE> def got_name(random_name): <NEW_LINE> <INDENT> server_config = set_server_name(self.server_config, random_...
A server must be created. :ivar pmap server_config: Nova launch configuration.
62598f9bd486a94d0ba2bd75
class NodeTypeSyntaxError(Exception): <NEW_LINE> <INDENT> def __init__(self, message, lineno=None, name=None, filename=None): <NEW_LINE> <INDENT> self.message = message <NEW_LINE> self.lineno = lineno <NEW_LINE> self.name = name <NEW_LINE> self.filename = filename <NEW_LINE> self.source = None <NEW_LINE> super(Exceptio...
Raised to tell the user that there is a problem with the node type.
62598f9b01c39578d7f12b1e
class ListBox(QtWidgets.QListWidget): <NEW_LINE> <INDENT> LISTBOX_WIDTH = 100 <NEW_LINE> LISTBOX_HEIGHT = 250 <NEW_LINE> def __init__(self, parent=None): <NEW_LINE> <INDENT> super().__init__(parent=parent) <NEW_LINE> self.setMinimumSize(QtCore.QSize(self.LISTBOX_WIDTH, self.LISTBOX_HEIGHT)) <NEW_LINE> self.setSizePolic...
Standard list box for CAA image type selection dialog. Keyword Arguments: parent {[type]} -- Parent of the QListWidget object being created (default: {None})
62598f9ba17c0f6771d5bfdb
class AndroidProcess(backends.Process): <NEW_LINE> <INDENT> def __init__(self, device, pid, name): <NEW_LINE> <INDENT> super(AndroidProcess, self).__init__(device, pid, name) <NEW_LINE> self._last_sys_stats = None <NEW_LINE> <DEDENT> def DumpMemoryMaps(self): <NEW_LINE> <INDENT> cmd = '%s %d' % (_MEMDUMP_PATH_ON_DEVICE...
Android-specific implementation of the core |Process| interface.
62598f9bbaa26c4b54d4f053
class OverridePurge(argparse.Action): <NEW_LINE> <INDENT> def __call__(self, parser, namespace, values, option_string=None): <NEW_LINE> <INDENT> libspm.PURGE_PATHS = values <NEW_LINE> setattr(namespace, self.dest, values)
Override paths to be purged
62598f9b3539df3088ecc056
class Message(models.Model): <NEW_LINE> <INDENT> uid = models.BigIntegerField(default=simpleflake, unique=True, db_index=True) <NEW_LINE> message = models.TextField() <NEW_LINE> image = models.CharField(choices=IMAGES, max_length=200) <NEW_LINE> created_date = models.DateTimeField(default=now) <NEW_LINE> def __str__(se...
Encrypted message for a particular user.
62598f9b29b78933be269fad
class PackageDeleteTestCase(BaseTestGenerator): <NEW_LINE> <INDENT> scenarios = [ ('Fetch Package Node URL', dict( url='/browser/package/obj/')) ] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> schema_info = parent_node_dict["schema"][-1] <NEW_LINE> self.schema_id = schema_info["schema_id"] <NEW_LINE> self.schema_name...
This class will delete new package under test schema.
62598f9b0a50d4780f705179
class WriteBatch(object): <NEW_LINE> <INDENT> def __init__(self, client): <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._write_pbs = [] <NEW_LINE> self.write_results = None <NEW_LINE> self.commit_time = None <NEW_LINE> <DEDENT> def _add_write_pbs(self, write_pbs): <NEW_LINE> <INDENT> self._write_pbs.extend(...
Accumulate write operations to be sent in a batch. This has the same set of methods for write operations that :class:`~.firestore_v1beta1.document.DocumentReference` does, e.g. :meth:`~.firestore_v1beta1.document.DocumentReference.create`. Args: client (~.firestore_v1beta1.client.Client): The client that ...
62598f9b07f4c71912baf1eb
class ConditionStage(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_type = Field("ConditionStage", const=True) <NEW_LINE> assessment: typing.List[fhirtypes.ReferenceType] = Field( None, alias="assessment", title="Formal record of assessment", description=( "Reference to a formal record of the evidence o...
Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. Stage/grade, usually assessed formally. Clinical stage or grade of a condition. May include formal severity assessments.
62598f9bfff4ab517ebcd58e
class ShowMenu(InclusionTag): <NEW_LINE> <INDENT> name = 'show_menu' <NEW_LINE> template = 'menu/dummy.html' <NEW_LINE> options = Options( IntegerArgument('from_level', default=0, required=False), IntegerArgument('to_level', default=100, required=False), IntegerArgument('extra_inactive', default=0, required=False), Int...
render a nested list of all children of the pages - from_level: starting level - to_level: max level - extra_inactive: how many levels should be rendered of the not active tree? - extra_active: how deep should the children of the active node be rendered? - namespace: the namespace of the menu. if empty will use all nam...
62598f9b379a373c97d98db4
class Ontology(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.parse_obo() <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "Ontology handler." <NEW_LINE> <DEDENT> def parse_obo(self): <NEW_LINE> <INDENT> from pkg_resources import resource_stream <NEW_LINE> obo = parse_obo(re...
Ontology handler for alchemy.
62598f9bbe383301e0253598
class AuthenticationEntityManagerPlugin(colony.base.system.Plugin): <NEW_LINE> <INDENT> id = "pt.hive.colony.plugins.authentication.entity_manager" <NEW_LINE> name = "Authentication Entity Manager" <NEW_LINE> description = "Authentication Entity Manager Plugin" <NEW_LINE> version = "1.0.0" <NEW_LINE> author = "Hive Sol...
The main class for the Authentication Entity Manager plugin.
62598f9b2ae34c7f260aae82
class WorkerThread(threading.Thread): <NEW_LINE> <INDENT> tombstone = object() <NEW_LINE> def __init__(self, conf, queue): <NEW_LINE> <INDENT> super(WorkerThread, self).__init__() <NEW_LINE> self.queue = queue <NEW_LINE> self.conf = conf <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> while True: <NEW_LINE> <IND...
Thread that executes tasks until the queue provides a tombstone.
62598f9b3eb6a72ae038a3e0
class pipeline(object): <NEW_LINE> <INDENT> def __init__(self, *workers): <NEW_LINE> <INDENT> self.pipe = [] <NEW_LINE> self.connect(*workers) <NEW_LINE> <DEDENT> def __call__(self, next=null): <NEW_LINE> <INDENT> for worker in reversed(self.pipe): <NEW_LINE> <INDENT> next = worker(next=next) <NEW_LINE> <DEDENT> return...
Coroutine pipeline is utility class to connect number of coroutines into single pipeline. The main goal is readability. The following examples of code are equal: .. code-block:: pycon >>> @coroutine ... def collect(target, next=null): ... while True: ... item = yield ... tar...
62598f9bb5575c28eb712b9d
class BasicJobType(object): <NEW_LINE> <INDENT> def __init__(self, config, proxyfilename, logger, workingdir, crabserver, s3tester): <NEW_LINE> <INDENT> self.logger = logger <NEW_LINE> self.proxyfilename = proxyfilename <NEW_LINE> self.automaticAvail = False <NEW_LINE> self.crabserver = crabserver <NEW_LINE> self.s3tes...
BasicJobType TODO: thinking on having a job type help here...
62598f9bb7558d58954633cf
class COLS: <NEW_LINE> <INDENT> ID = 0 <NEW_LINE> VALUE_1 = 2 <NEW_LINE> VALUE_2 = 3 <NEW_LINE> VALUE_3 = 4 <NEW_LINE> VALUE_4 = 5 <NEW_LINE> VALUE_5 = 6
WARNING: These constants must match the zero-based column indexes in the spreadsheet. If they don't, then the wrong data will be harvested and inserted into the database.
62598f9b6fb2d068a7693d04
class ControlPanelAdapter(SchemaAdapterBase): <NEW_LINE> <INDENT> implements(ISettings) <NEW_LINE> def __init__(self, context): <NEW_LINE> <INDENT> super(ControlPanelAdapter, self).__init__(context) <NEW_LINE> self._settings = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def settings(self): <NEW_LINE> <INDENT> if self...
Form adapter
62598f9b1f5feb6acb1629c3
class AlbumManager(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._model = None <NEW_LINE> self._albums = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def model(self): <NEW_LINE> <INDENT> if not self._model: <NEW_LINE> <INDENT> self._model = self._get_model() <NEW_LINE> <DEDENT> return self....
A fake manager
62598f9b55399d3f056262c2
class SetData(base.InnerModel): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> manager = SetDataManager
Represents the ``data`` property of a :py:class:`koordinates.client.Client` instance.
62598f9b442bda511e95c204
class Interpolation(BaseEstimator, DataPreprocessorMixin): <NEW_LINE> <INDENT> def __init__(self, interpolation_model_name, data_type): <NEW_LINE> <INDENT> assert interpolation_model_name in ["linear", "quadratic", "cubic", "spline"] <NEW_LINE> assert data_type == "temporal" <NEW_LINE> self.interpolation_model_name = i...
Temporal data interpolation. Attributes: - interpolation_model_name: 'linear', 'quadratic', 'cubic', 'spline' - data_type: 'temporal'
62598f9bcc0a2c111447adad
class ProjectionGraph(pg.GraphicsWindow): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.setWindowTitle('Average of area') <NEW_LINE> self.setAntialiasing(True) <NEW_LINE> self.npoints = 400 <NEW_LINE> self.data = np.zeros(self.npoints) <NE...
The graph window class
62598f9b7d43ff24874272d2
class BaseModel(object): <NEW_LINE> <INDENT> create_time = db.Column(db.DateTime, default=datetime.now) <NEW_LINE> update_time = db.Column(db.DateTime, default=datetime.now, onupdate=datetime.now)
Base Model
62598f9b99cbb53fe6830c73
class PrimMST(object): <NEW_LINE> <INDENT> def __init__(self, G): <NEW_LINE> <INDENT> import heapq <NEW_LINE> self._mst = [] <NEW_LINE> edges = [] <NEW_LINE> heapq.heapify(edges) <NEW_LINE> visited = set() <NEW_LINE> v = 0 <NEW_LINE> while len(self._mst) < G.V-1: <NEW_LINE> <INDENT> for e in G.adj(v): <NEW_LINE> <INDEN...
Implementation of MST with Prim algoritm
62598f9b3cc13d1c6d46550d
class IncomingFriendshipsResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None)
A ResultSet with methods tailored to the values returned by the IncomingFriendships Choreo. The ResultSet object is used to retrieve the results of a Choreo execution.
62598f9b009cb60464d012c6
class reconcile(BaseUse): <NEW_LINE> <INDENT> def main(self, args, app): <NEW_LINE> <INDENT> params = self.get_params(args) <NEW_LINE> tool = ReconcileHistory(json.load(params.pop('infile'))) <NEW_LINE> return tool.reconciled_history
Reconcile record dependencies from a sequence of pump history Tasks performed by this pass: - Modifies temporary basal duration to account for cancelled and overlapping basals - Duplicates and modifies temporary basal records to account for delivery pauses when suspended
62598f9bd53ae8145f91822f
class EchoTCPRouterClient(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, host): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.daemon = True <NEW_LINE> self._conn = URTCPRouterConnection(host) <NEW_LINE> self._stop = False <NEW_LINE> self._q_start = None <NEW_LINE> <DEDENT> def run(self)...
Echo client for the TCP Router. It stores the first received position and commands this position to thr robot until stopped
62598f9b63d6d428bbee2553
class SimpleVirus(object): <NEW_LINE> <INDENT> def __init__(self, maxBirthProb, clearProb): <NEW_LINE> <INDENT> self.maxBirthProb = maxBirthProb <NEW_LINE> self.clearProb = clearProb <NEW_LINE> <DEDENT> def doesClear(self): <NEW_LINE> <INDENT> if random.random() < self.clearProb: <NEW_LINE> <INDENT> return True <NEW_LI...
Representation of a simple virus (does not model drug effects/resistance).
62598f9b435de62698e9bb96
class CfgEx(Exception): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> super(CfgEx, self).__init__("<unavailable message>") <NEW_LINE> self.value = value <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return repr(self.value)
Configuration Exception. Thrown in case of an invalid configuration.
62598f9b460517430c431f2b
class NuocaMPPlugin(IMultiprocessChildPlugin): <NEW_LINE> <INDENT> def __init__(self, parent_pipe, plugin_name, plugin_type): <NEW_LINE> <INDENT> nuoca_log(logging.INFO, "Creating plugin: %s" % plugin_name) <NEW_LINE> self._parent_pipe = parent_pipe <NEW_LINE> self._plugin_name = plugin_name <NEW_LINE> self._type = plu...
Base class for NuoCA Multi-Process Plugins NuoCA plugins are based on Python Yapsy: http://yapsy.sourceforge.net/
62598f9b0a50d4780f70517a
class SingleSwitchTopo(Topo): <NEW_LINE> <INDENT> def __init__(self, n=2, lossy=True, **opts): <NEW_LINE> <INDENT> Topo.__init__(self, **opts) <NEW_LINE> switch = self.addSwitch('s1') <NEW_LINE> for h in range(n): <NEW_LINE> <INDENT> host = self.addHost('h%s' % (h + 1), cpu=.5 / n) <NEW_LINE> if lossy: <NEW_LINE> <INDE...
Single switch connected to n hosts.
62598f9c4428ac0f6e6582cd
class ShortThrower(ThrowerAnt): <NEW_LINE> <INDENT> min_range = 0 <NEW_LINE> max_range = 3 <NEW_LINE> name = 'Short' <NEW_LINE> food_cost = 3 <NEW_LINE> implemented = True
A ThrowerAnt that only throws leaves at Bees within 3 places.
62598f9c45492302aabfc27a
class ContainerInstanceManagementClient(object): <NEW_LINE> <INDENT> def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: <NEW_LINE> <INDENT> if not base_url: <NEW_LINE> <INDENT> base_url = 'https://management.azure.com' <NEW_LINE> <DEDEN...
ContainerInstanceManagementClient. :ivar container_groups: ContainerGroupsOperations operations :vartype container_groups: azure.mgmt.containerinstance.aio.operations.ContainerGroupsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.containerinstance.aio.operations.Operations :ivar loca...
62598f9cd6c5a102081e1ee6
class TopicPartChooseCallback(BaseTopicIntent, BaseCallbackIntent): <NEW_LINE> <INDENT> def get_keyboard(self): <NEW_LINE> <INDENT> return [ [InlineKeyboardButton(label, callback_data=value) for value, label in inftybot.topics.constants.TOPIC_PART_CHOIES], ] <NEW_LINE> <DEDENT> def handle(self, *args, **kwargs): <NEW_L...
Choose topic part for edit
62598f9c07f4c71912baf1ec
class FillStyleExtended(ChoiceSwitch): <NEW_LINE> <INDENT> _icons = None <NEW_LINE> def __init__(self, setting, parent): <NEW_LINE> <INDENT> if self._icons is None: <NEW_LINE> <INDENT> self._generateIcons() <NEW_LINE> <DEDENT> ChoiceSwitch.__init__(self, setting, False, utils.extfillstyles, parent, icons=self._icons) <...
Extended fill style list.
62598f9c8e71fb1e983bb857
class Document(object): <NEW_LINE> <INDENT> def __init__(self,id,filename): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.filename = filename <NEW_LINE> self.wordlist = self.get_words() <NEW_LINE> if self.wordlist: <NEW_LINE> <INDENT> self.wordlist = self.preprocess() <NEW_LINE> <DEDENT> <DEDENT> def __str__(self): ...
Processes Pubmed OA nxml documents. pubmed_parser is used to parse the nxml files. self.wordlist holds the individual word tokens.
62598f9c7b25080760ed7247
class CrossRefs: <NEW_LINE> <INDENT> def __init__(self, id_index, crossref_markers): <NEW_LINE> <INDENT> self._index = id_index <NEW_LINE> self.markers = crossref_markers <NEW_LINE> <DEDENT> def _process_tag(self, tag, value): <NEW_LINE> <INDENT> if tag not in self.markers: <NEW_LINE> <INDENT> return tag, value <NEW_LI...
Visitor, which points cross references to new entry IDs.
62598f9c1b99ca400228f3fe
class AsrUra(luigi.WrapperTask): <NEW_LINE> <INDENT> def requires(self): <NEW_LINE> <INDENT> file = "asr_ura.json" <NEW_LINE> yield att.AsrTdrTable(file=file, table="db.abonent") <NEW_LINE> yield att.AsrAbonentTable(file=file, table="db.tdr") <NEW_LINE> yield att.AsrDeviceTable(file=file, table="db.device") <NEW_LINE> ...
Задание на выгрузку таблиц из АСР Уральска
62598f9c6e29344779b003fd
class Territory(models.Model): <NEW_LINE> <INDENT> id = models.CharField( max_length=100, null=False, unique=True, primary_key=True, editable=False, ) <NEW_LINE> name = models.CharField( max_length=50, null=False, ) <NEW_LINE> controlled_by_initial = models.ForeignKey( 'Nation', on_delete=models.CASCADE, null=True, rel...
Represents an area in the game map that can be occupied.
62598f9c10dbd63aa1c70958
class Operation(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, 'origin': {'key': 'origin', 'type': 'str'}, 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'service_specification': {'key': '...
Operations. :param name: Name of the operation. :type name: str :param display: Properties displayed for the operation. :type display: ~azure.mgmt.databoxedge.v2020_09_01.models.OperationDisplay :param origin: Origin of the operation. :type origin: str :param is_data_action: Indicates whether the operation is a data a...
62598f9c8c0ade5d55dc3560
class CultureCreateSchema(Schema): <NEW_LINE> <INDENT> name = fields.String(required=True)
POST /api/v1/cultures. Format: { "name": "culture" }
62598f9c851cf427c66b806a
class NotValidBGPPropagation(Exception): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> super(NotValidBGPPropagation, self).__init__(message)
Raised when the requirements violates BGP's propagation rules
62598f9cc432627299fa2d7a
class Oracle(object): <NEW_LINE> <INDENT> def __init__(self, y): <NEW_LINE> <INDENT> self.y = y <NEW_LINE> <DEDENT> def pred(self, k, n): <NEW_LINE> <INDENT> return self.y[k:k+n].reshape((-1,1)) <NEW_LINE> <DEDENT> def real(self, k): <NEW_LINE> <INDENT> return self.y[k].reshape((-1,1))
Perfect predictor of signal y
62598f9c29b78933be269fae
class LogoutAPI(MethodView): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> token = request.headers.get('Authorization').split(' ')[-1] <NEW_LINE> blacklisted = Blacklist({'token': token}).blacklist_token() <NEW_LINE> if blacklisted: <NEW_LINE> <INDENT> response_object = { 'message': '...
Logout Resource
62598f9c925a0f43d25e7ddf
class RecordSpecificationElement( object ): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.recordID = 0 <NEW_LINE> self.recordSetSerialNumber = 0 <NEW_LINE> self.recordLength = 0 <NEW_LINE> self.recordCount = 0 <NEW_LINE> self.recordValues = 0 <NEW_LINE> self.pad4 = 0 <NEW_LINE> <DEDENT> def serialize...
Synthetic record, made up from section 6.2.72. This is used to acheive a repeating variable list element.
62598f9c6fb2d068a7693d05
class SandboxedTestCase(EmptyMrjobConfTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(SandboxedTestCase, self).setUp() <NEW_LINE> self.tmp_dir = mkdtemp() <NEW_LINE> self.addCleanup(rmtree, self.tmp_dir) <NEW_LINE> old_environ = os.environ.copy() <NEW_LINE> self.addCleanup(os.environ.update, o...
Patch mrjob.conf, create a temp directory, and save the environment for each test
62598f9c0c0af96317c56125
class TemplatedNaturalLanguageGenerator(NaturalLanguageGenerator): <NEW_LINE> <INDENT> def __init__(self, templates: Dict[Text, List[Dict[Text, Any]]]) -> None: <NEW_LINE> <INDENT> self.templates = templates <NEW_LINE> <DEDENT> def _random_template_for(self, utter_action: Text, output_channel: Text ) -> Optional[Dict[T...
Natural language generator that generates messages based on templates. The templates can use variables to customize the utterances based on the state of the dialogue.
62598f9c507cdc57c63a4b38
class VendedorViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Vendedor.objects.all().order_by('-id') <NEW_LINE> serializer_class = VendedorSerializer
API endpoint that allows users to be viewed or edited.
62598f9c462c4b4f79dbb7ae
class ESConfig(object): <NEW_LINE> <INDENT> config = None <NEW_LINE> @staticmethod <NEW_LINE> def get_instance(): <NEW_LINE> <INDENT> if ESConfig.config is None: <NEW_LINE> <INDENT> ESConfig.config = ESConfig("config.ini") <NEW_LINE> <DEDENT> return ESConfig.config <NEW_LINE> <DEDENT> def __init__(self, filename): <NEW...
>>> config = ESConfig.get_instance() >>> config.set_device_file(u"中文路径") >>> config.get_device_file() u'中文路径'
62598f9cf8510a7c17d7e049
class HelperJobList(GenericJobList): <NEW_LINE> <INDENT> model = HelperJob <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.title = HelperJob._meta.verbose_name_plural
List all HelperJobs
62598f9c63d6d428bbee2554
class JumpToFileCommand(sublime_plugin.TextCommand): <NEW_LINE> <INDENT> def run(self, edit): <NEW_LINE> <INDENT> ERROR_MESSAGE = "File '{0}' not found. Maybe path to source files " "in your settings is incorrect or file really absent" <NEW_LINE> SDL_LOG_SOURCE = "/sdl_core/src/" <NEW_LINE> FILE_...
Represents go to file.
62598f9c55399d3f056262c4
class CSSPSrv(object): <NEW_LINE> <INDENT> def __init__(self ,listener,transport,target): <NEW_LINE> <INDENT> self.state=0 <NEW_LINE> self._listener=listener <NEW_LINE> self.transport=transport <NEW_LINE> self.wrapped=0 <NEW_LINE> self._relay=RPCRelayClient(target) <NEW_LINE> self._relay.init_connection() <NEW_LINE> se...
@summary: Handle CSSP connection Proxy class for authentication
62598f9c442bda511e95c205
class ProcessCreator(ClassCreator): <NEW_LINE> <INDENT> def __init__( self, name, base='Process', template=None, members=None, procedures=None, author='KratosAppGenerator' ): <NEW_LINE> <INDENT> super(ProcessCreator, self).__init__( name, base, template, members, procedures, author )
TO BE IMPLEMENTED
62598f9c3d592f4c4edbac72
class TestCompareXLSXFiles(ExcelComparisonTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.maxDiff = None <NEW_LINE> filename = 'table07.xlsx' <NEW_LINE> test_dir = 'xlsxwriter/test/comparison/' <NEW_LINE> self.got_filename = test_dir + '_test_' + filename <NEW_LINE> self.exp_filename = test_dir + '...
Test file created by XlsxWriter against a file created by Excel.
62598f9c4f6381625f19938e
class Function(Field): <NEW_LINE> <INDENT> _CHECK_ATTRIBUTE = False <NEW_LINE> def __init__(self, serialize=None, deserialize=None, func=None, **kwargs): <NEW_LINE> <INDENT> if func: <NEW_LINE> <INDENT> warnings.warn('"func" argument of fields.Function is deprecated. ' 'Use the "serialize" argument instead.', RemovedIn...
A field that takes the value returned by a function. :param callable serialize: A callable from which to retrieve the value. The function must take a single argument ``obj`` which is the object to be serialized. It can also optionally take a ``context`` argument, which is a dictionary of context variables ...
62598f9c45492302aabfc27b
class Command(BaseCommand): <NEW_LINE> <INDENT> help = 'reparse all useragents. useful after updating python-ox' <NEW_LINE> args = '' <NEW_LINE> def handle(self, **options): <NEW_LINE> <INDENT> ids = [s['session_key'] for s in models.SessionData.objects.all().values('session_key')] <NEW_LINE> for i in ids: <NEW_LINE> <...
reparse all useragents. useful after updating python-ox
62598f9cf7d966606f747d8b
class OrganizationWithEndsAtByPlanSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> subscriptions = WithEndsAtByPlanSerializer( source='get_ends_at_by_plan', many=True, read_only=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = get_organization_model() <NEW_LINE> fields = ('slug', 'printable_name', '...
Operational information on an Organization, bundled with its active subscriptions.
62598f9ca79ad16197769e07
class _EagerContext(threading.local): <NEW_LINE> <INDENT> def __init__(self, config=None): <NEW_LINE> <INDENT> super(_EagerContext, self).__init__() <NEW_LINE> self.device_spec = pydev.DeviceSpec.from_string("") <NEW_LINE> self.device_name = self.device_spec.to_string() <NEW_LINE> self.mode = default_execution_mode <NE...
Thread local eager context.
62598f9c21bff66bcd722a08
class FileLocked(Exception): <NEW_LINE> <INDENT> def __init__(self, filename, lockfilename): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> self.lockfilename = lockfilename <NEW_LINE> super(FileLocked, self).__init__(filename, lockfilename)
File is already locked.
62598f9c4e4d5625663721c7
@register <NEW_LINE> class MonitorEximQueue(Monitor): <NEW_LINE> <INDENT> monitor_type = "eximqueue" <NEW_LINE> max_length = 10 <NEW_LINE> r = re.compile(r"(?P<count>\d+) matches out of (?P<total>\d+) messages") <NEW_LINE> path = "/usr/local/sbin" <NEW_LINE> def __init__(self, name: str, config_options: dict) -> None: ...
Make sure an exim queue isn't too big.
62598f9cd6c5a102081e1ee8
class DyInfoDlg(QDialog): <NEW_LINE> <INDENT> def __init__(self, title, info, parent=None): <NEW_LINE> <INDENT> super().__init__(parent) <NEW_LINE> self.setWindowTitle(title) <NEW_LINE> self._initUi(info) <NEW_LINE> <DEDENT> def _initUi(self, info): <NEW_LINE> <INDENT> text = info <NEW_LINE> label = QLabel() <NEW_LINE>...
显示信息
62598f9ca05bb46b3848a623
class RamlSecurityScheme(Model): <NEW_LINE> <INDENT> description = String() <NEW_LINE> type = String() <NEW_LINE> describedBy = Reference(RamlSecuritySchemeDescription) <NEW_LINE> settings = Map(String(), Or(String(), List(String())))
http://raml.org/spec.html#security
62598f9c6aa9bd52df0d4c71
class PyQuery(object): <NEW_LINE> <INDENT> def __init__(self, session, queryListener, log): <NEW_LINE> <INDENT> self.session = session <NEW_LINE> self.listener = queryListener <NEW_LINE> self.log = log <NEW_LINE> <DEDENT> def query(self, queryTopic=None, respondTopic=None): <NEW_LINE> <INDENT> if queryTopic is None or ...
classdocs
62598f9c097d151d1a2c0dca
class KMaxPooling(Layer): <NEW_LINE> <INDENT> def __init__(self, k=2, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.input_spec = InputSpec(ndim=3) <NEW_LINE> self.k = k <NEW_LINE> <DEDENT> def compute_output_shape(self, input_shape): <NEW_LINE> <INDENT> return (input_shape[0], (input_shape[2...
K-max pooling layer that extracts the k-highest activations from a sequence (2nd dimension). TensorFlow backend.
62598f9c67a9b606de545d6e
class L3AddressContainer(Persistable): <NEW_LINE> <INDENT> __slots__ = ('container',) <NEW_LINE> def __init__ (self, container=None): <NEW_LINE> <INDENT> super(L3AddressContainer, self).__init__() <NEW_LINE> self.container = container if container is not None else [] <NEW_LINE> <DEDENT> def __getitem__ (self, id): <NEW...
Container class for storing L3 address data.
62598f9c498bea3a75a578c4
class ProxychainsTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_proxychains(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> os.environ['http_proxy'] = '' <NEW_LINE> os.environ['https_proxy'] = '' <NEW_LINE> temp = tempfile.NamedTemporaryFile() <NEW_LINE> url = 'https://wtfismyip.com/text' <NEW_LINE> comm...
Tests for proxychains.
62598f9c627d3e7fe0e06c4f
class IZCTextIndex(Interface): <NEW_LINE> <INDENT> pass
Persistent text index.
62598f9c30dc7b766599f5f1
class RGBColor (UIColor): <NEW_LINE> <INDENT> r = None <NEW_LINE> g = None <NEW_LINE> b = None <NEW_LINE> def __init__(self, r=None, g=None, b=None, rgb=None, color=None): <NEW_LINE> <INDENT> UIColor.__init__(self) <NEW_LINE> if color is not None: <NEW_LINE> <INDENT> r, g, b = color.get_rgb() <NEW_LINE> <DEDENT> if rgb...
Additive Red/Green/Blue representation of a color.
62598f9c379a373c97d98db8
class BetaEmployeeLeaveDaysServiceServicer(object): <NEW_LINE> <INDENT> def EligibleForLeave(self, request, context): <NEW_LINE> <INDENT> context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) <NEW_LINE> <DEDENT> def grantLeave(self, request, context): <NEW_LINE> <INDENT> context.code(beta_interfaces.StatusCode.UNIMPLE...
Service. define the methods that the grpc server can expose to the client.
62598f9ca79ad16197769e08
class NoOutputOnStdout(GlslCTest): <NEW_LINE> <INDENT> def check_no_output_on_stdout(self, status): <NEW_LINE> <INDENT> if status.stdout: <NEW_LINE> <INDENT> return False, 'Non empty stdout: {out}\n'.format(out=status.stdout) <NEW_LINE> <DEDENT> return True, ''
Mixin class for checking that there is no output on stdout.
62598f9c442bda511e95c206
class SqlConnection: <NEW_LINE> <INDENT> def __init__(self, host, dbname, user, passw, port): <NEW_LINE> <INDENT> self.host = host <NEW_LINE> self.dbname = dbname <NEW_LINE> self.user = user <NEW_LINE> self.passw = passw <NEW_LINE> self.port = port <NEW_LINE> self.con_str = f'postgresql://{self.user}:{self.passw}@{self...
A connection class for a sql database. Define host, name of database, username, password and port.
62598f9c99cbb53fe6830c76
class MonthlySingleDiseaseReportTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.input_file_name = "../data/2017.07.csv" <NEW_LINE> self.output_file_name = "../report/2017.07_diagnosis_report.txt" <NEW_LINE> self.data = MonthlySingleDiseaseReport( input_file_name=self.input_file_name, outpu...
The test cases to test code in monthly.py.
62598f9c3d592f4c4edbac74
class YoochooseBuys(YoochooseClicksOrBuys): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_csv(cls, filename = buys_filename): <NEW_LINE> <INDENT> return cls(pd.read_csv(filename, header = None, names = ['Session ID', 'Timestamp', 'Item ID', 'Price', 'Quantity'], parse_dates = [1]))
Data frame subclass for buy events.
62598f9c56ac1b37e6301f8f
class Topic(db.Model): <NEW_LINE> <INDENT> __tablename__ = "topic" <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> user_id = db.Column(db.Integer, db.ForeignKey('user.id')) <NEW_LINE> title = db.Column(db.String(64)) <NEW_LINE> body = db.Column(db.String(512)) <NEW_LINE> time = datetime.utcnow().strf...
The table for storing the information about each topic
62598f9c460517430c431f2d