code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class AbstractObject(collections.MutableMapping): <NEW_LINE> <INDENT> _default_read_fields = [] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._data = {} <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> return self._data[str(key)] <NEW_LINE> <DEDENT> def __setitem__(self, key, value): <NEW_L...
Represents an abstract object (may or may not have explicitly be a node of the Graph) as a MutableMapping of its data.
62598f3a462c4b4f79dbab31
class RLimma(RPackage): <NEW_LINE> <INDENT> homepage = "https://bioconductor.org/packages/limma" <NEW_LINE> git = "https://git.bioconductor.org/packages/limma.git" <NEW_LINE> version('3.46.0', commit='ff03542231827f39ebde6464cdbba0110e24364e') <NEW_LINE> version('3.40.6', commit='3ae0767ecf7a764030e7b7d0b1d0f292c0...
Linear Models for Microarray Data Data analysis, linear models and differential expression for microarray data.
62598f3a3cc13d1c6d4648ab
class CommentView(LoginRequiredMixin, View): <NEW_LINE> <INDENT> def get(self, request, order_id): <NEW_LINE> <INDENT> user = request.user <NEW_LINE> if not order_id: <NEW_LINE> <INDENT> return redirect(reverse('user:order', kwargs={'page': 1})) <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> order = OrderInfo.objects.get...
订单评论
62598f3a0a366e3fb87dbb0f
class ClassNode: <NEW_LINE> <INDENT> def __init__(self, name, super_classes=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.attributes = [] <NEW_LINE> self.functions = [] <NEW_LINE> if super_classes is None: <NEW_LINE> <INDENT> self.super_classes = [] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.super...
Class object containing attributes and functions Author: Braeden Contributor: Peter >>> ClassNode("Class One", []).name 'Class One' >>> class_one = ClassNode("Class One", []) >>> class_one.add_attribute("Attribute One") >>> class_one.add_attribute("Attribute Two") >>> len(class_one.attributes) 2
62598f3aeab8aa0e5d30aeb9
class Solution2: <NEW_LINE> <INDENT> def __init__(self, arg): <NEW_LINE> <INDENT> super(Solution2,self).__init__() <NEW_LINE> self.arg = arg <NEW_LINE> <DEDENT> def preorderTraversal(self, root): <NEW_LINE> <INDENT> stack, res = [root], [] <NEW_LINE> while stack: <NEW_LINE> <INDENT> node = stack.pop() <NEW_LINE> if nod...
docstring for Solution
62598f3a0a366e3fb87dbb13
class PropCompApproxGrad(PropagatorComputer): <NEW_LINE> <INDENT> def reset(self): <NEW_LINE> <INDENT> PropagatorComputer.reset(self) <NEW_LINE> self.id_text = 'APPROX' <NEW_LINE> self.grad_exact = False <NEW_LINE> self.apply_params() <NEW_LINE> <DEDENT> def _compute_diff_prop(self, k, j, epsilon): <NEW_LINE> <INDENT> ...
This subclass can be used when the propagator is calculated simply by expm of the dynamics generator, i.e. when gradients will be calculated using approximate methods.
62598f3aeab8aa0e5d30aebf
class VimarLight(VimarEntity, LightEntity): <NEW_LINE> <INDENT> _platform = "light" <NEW_LINE> def __init__(self, device_id, vimarconnection, vimarproject, coordinator): <NEW_LINE> <INDENT> VimarEntity.__init__(self, device_id, vimarconnection, vimarproject, coordinator) <NEW_LINE> <DEDENT> @property <NEW_LINE> def is_...
Provides a Vimar lights.
62598f3a4c3428357761941b
class SerializeMixin(InspectionMixin): <NEW_LINE> <INDENT> __abstract__ = True <NEW_LINE> def to_dict(self,nested = False, hybrid_attributes = False, exclude = None): <NEW_LINE> <INDENT> result = dict() <NEW_LINE> if exclude is None: <NEW_LINE> <INDENT> view_cols = self.columns <NEW_LINE> <DEDENT> else : <NEW_LINE> <IN...
Mixin to make model serializable.
62598f3a0a366e3fb87dbb1d
class Field (object): <NEW_LINE> <INDENT> def __init__ (self, name, spec=None, default=0, missingok=False): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.spec = spec <NEW_LINE> self.default = default <NEW_LINE> self.missingok = missingok <NEW_LINE> <DEDENT> def unpack(self, bits): <NEW_LINE> <INDENT> return self...
Represents a field in a binary structure.
62598f3a627d3e7fe0e05fd6
class Composite(_Elastic): <NEW_LINE> <INDENT> __image__ = "desktop/images/object.gif" <NEW_LINE> __props__ = {'displayName': datatypes.RequiredString} <NEW_LINE> _eventHandlers = [] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._id = misc.generate_oid() <NEW_LINE> self._pid = None <NEW_LINE> self._isDeleted ...
Objects within Objects... Think of this as an embedded item. This class is useful for implementing compositions. Instances of this class are embedded into other items. Note that instances of this class have no security descriptor since they are embedded into other items. The L{security} property of such instances is a...
62598f3a15fb5d323ce7de79
class Sequential(torch.nn.Module): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(Sequential, self).__init__() <NEW_LINE> if len(args) == 1 and isinstance(args[0], OrderedDict): <NEW_LINE> <INDENT> for key, module in args[0].items(): <NEW_LINE> <INDENT> self.add_module(key, module) <...
A sequential container. Modules will be added to it in the order they are passed in the constructor. Alternatively, an ordered dict of modules can also be passed in. To make it easier to understand, given is a small example:: # Example of using Sequential model = Sequential( nn.Conv2d(1,20,5), ...
62598f3a0a366e3fb87dbb25
class DescribeTargetsRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.LoadBalancerId = None <NEW_LINE> self.ListenerIds = None <NEW_LINE> self.Protocol = None <NEW_LINE> self.Port = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.LoadBalancerId =...
DescribeTargets请求参数结构体
62598f3a0a366e3fb87dbb27
class Equity(Asset): <NEW_LINE> <INDENT> def __init__( self, name, symbol, tax_exempt=True ): <NEW_LINE> <INDENT> self.cash_like = False <NEW_LINE> self.name = name <NEW_LINE> self.symbol = symbol <NEW_LINE> self.tax_exempt = tax_exempt <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return ( "Equity(name='...
Stores meta data about an equity common stock or ETF. Parameters ---------- name : `str` The asset's name (e.g. the company name and/or share class). symbol : `str` The asset's original ticker symbol. TODO: This will require modification to handle proper ticker mapping. tax_exempt: `boolean`, optio...
62598f3b3cc13d1c6d4648c7
class NovelConverter: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.tree = ElementTree(self) <NEW_LINE> <DEDENT> def build_registry(self): <NEW_LINE> <INDENT> self.inlineparser = build_inlineparser() <NEW_LINE> self.blockparser = build_blockparser() <NEW_LINE> self.renderer = build_renderer() <NEW_LI...
A Novel Converter. Convert syntax for multiple Web-Novel sites. Example: novelconv = NovelConverter() novelconv.build_registry() result = novelconv.convert(source)
62598f3b627d3e7fe0e05fe0
class Commissioner(object): <NEW_LINE> <INDENT> def __init__(self, person): <NEW_LINE> <INDENT> self.person = person <NEW_LINE> person.commissioner = self <NEW_LINE> self.career = CommissionerCareer(commissioner=self)
The baseball-commissioner layer of a person's being.
62598f3b462c4b4f79dbab53
class Transaction(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.customerNumber = 0 <NEW_LINE> self.streetAddress = "" <NEW_LINE> self.city="" <NEW_LINE> self.state = "" <NEW_LINE> self.zip = "" <NEW_LINE> self.latitude = 0 <NEW_LINE> self.longitude = 0 <NEW_LINE> self.transactionTimestamp = ...
A customer of with a checking account. Customers have the following properties: Attributes: name: A string representing the customer's name. balance: A float tracking the current balance of the customer's account.
62598f3b15fb5d323ce7de81
class Client(object): <NEW_LINE> <INDENT> def __init__(self, transport=None): <NEW_LINE> <INDENT> if transport is None: <NEW_LINE> <INDENT> transport = riemann_client.transport.TCPTransport() <NEW_LINE> <DEDENT> self.transport = transport <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self.transport.conne...
An abstract Riemann client
62598f3b0a366e3fb87dbb2d
class PDFHandler(BaseHandler): <NEW_LINE> <INDENT> output = 'output.pdf' <NEW_LINE> def run(self, link, meta, args): <NEW_LINE> <INDENT> if meta["sensible-type"] == "pdf": <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> cmdargs = [ args.chrome_binary, "--headless", "--no-sandbox", "--print-to-pdf", link ] <NEW_LINE> sub...
Handler using Chrome/Chromium to create a PDF out of a link.
62598f3b4c3428357761942e
class presence_of_element_located(object): <NEW_LINE> <INDENT> def __init__(self, locator): <NEW_LINE> <INDENT> self.locator = locator <NEW_LINE> <DEDENT> def __call__(self, driver): <NEW_LINE> <INDENT> return driver.find_element(*self.locator)
An expectation for checking that an element is present on the DOM of a page. This does not necessarily mean that the element is visible. locator - used to find the element returns the WebElement once it is located
62598f3b3cc13d1c6d4648cd
class SphinxEngineCase(unittest.TestCase): <NEW_LINE> <INDENT> log = logging.getLogger("engine") <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.engine = get_engine("sphinx") <NEW_LINE> self.engine.config.TRAINING_DATA_DIR = "" <NEW_LINE> self.engine.config.START_ASLEEP = False <NEW_LINE> self.engine.config.WAKE_P...
Base TestCase class for Sphinx engine tests
62598f3b627d3e7fe0e05fe6
class TileWidget(urwid.WidgetWrap): <NEW_LINE> <INDENT> signals = ["left_click", "right_click"] <NEW_LINE> def __init__( self, position: Coordinate, tile: Tile, on_left_click: TileWidgetCallback, on_right_click: TileWidgetCallback, *args: Any, **kwargs: Any, ) -> None: <NEW_LINE> <INDENT> self.position = position <NEW_...
A PySweeper tile widget.
62598f3b4c34283577619430
class PermissionError(BoltError): <NEW_LINE> <INDENT> def __init__(self, message=u'Access is denied.'): <NEW_LINE> <INDENT> super(PermissionError, self).__init__(message)
Wrye Bash doesn't have permission to access the specified file/directory.
62598f3b15fb5d323ce7de8b
class TestNewUpstreamVersionMutiMap(Base): <NEW_LINE> <INDENT> expected_title = "anitya.project.version.update" <NEW_LINE> expected_subti = ('A new version of "SQLAlchemy" has been detected: ' '"1.0.0b1" newer than "0.9.9", packaged as ' '"python-sqlalchemy and python-sqlalchemy0.5"') <NEW_LINE> expected_link = "https...
The purpose of anitya is to monitor upstream projects and to try and detect when they release new tarballs. *These* messages are the ones that get published when a tarball is found that is newer than the one last seen in the `anitya <https://release-monitoring.org>`_ database.
62598f3b15fb5d323ce7de8d
class TestAllPackagesBuildCompleteSuccess(Base): <NEW_LINE> <INDENT> expected_title = "ci.pipeline.allpackages-build.complete" <NEW_LINE> expected_subti = 'Koji task "34126640" of package rpms/nmstate passed ' 'the All Packages (Build) CI pipeline ' 'on branch f28' <NEW_LINE> expected_link = "https://jenk...
These messages are published when the Allpackages (build) CI pipeline announces having completed running the entire pipeline on a build of a package.
62598f3b3cc13d1c6d4648d7
class ResourceCollaborator(ObjectCollaboratorMixin): <NEW_LINE> <INDENT> collaborator = models.ForeignKey( get_user_model(), on_delete=models.CASCADE, related_name="resource_collaborators", verbose_name=_("Collaborator") ) <NEW_LINE> resource = models.ForeignKey( Resource, on_delete=models.CASCADE, related_name="resour...
The concrete class to express the collaboration link for a user on a resource.
62598f3beab8aa0e5d30aee1
class ServerSideErrorTest(JavaTest): <NEW_LINE> <INDENT> order = 30 <NEW_LINE> testClass="org.apache.accumulo.test.functional.ServerSideErrorTest"
Verify clients throw exception when there is unexpected exception on server side
62598f3b462c4b4f79dbab65
class PostInstallScriptRule(Rule): <NEW_LINE> <INDENT> def __init__(self, script): <NEW_LINE> <INDENT> self._script = script if isinstance(script, list) else script.split('\n') <NEW_LINE> <DEDENT> def apply(self, package, context): <NEW_LINE> <INDENT> context.postinst_commands += self._script
Post installation script rule. Allows the execution of one or more shell script lines after installation has succeeded.
62598f3beab8aa0e5d30aee3
class FlipVectorAxisTransform(AbstractTransform): <NEW_LINE> <INDENT> def __init__(self, axes=(2, 3, 4), data_key="data"): <NEW_LINE> <INDENT> self.data_key = data_key <NEW_LINE> self.axes = axes <NEW_LINE> <DEDENT> def __call__(self, **data_dict): <NEW_LINE> <INDENT> data_dict[self.data_key] = flip_vector_axis(data=da...
Expects as input an image with 3 3D-vectors at each voxels, encoded as a nine-channel image. Will randomly flip sign of one dimension of all 3 vectors (x, y or z).
62598f3b462c4b4f79dbab67
class algorithms: <NEW_LINE> <INDENT> ip_hash = IpHash <NEW_LINE> least_reference_count = LeastReferenceCount <NEW_LINE> weighted_least_reference_count = WeightedLeastReferenceCount <NEW_LINE> weighted_round_robin = WeightedRoundRobin
Balancing algorithms available to use with ``subscribe``.
62598f3b0a366e3fb87dbb3f
class HomeView(generic.TemplateView): <NEW_LINE> <INDENT> template_name = "index.html" <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super().get_context_data(**kwargs) <NEW_LINE> context['num_books'] = Book.objects.all().count() <NEW_LINE> context['num_instances'] = BookInstance.objects...
Template based view for the main page.
62598f3b462c4b4f79dbab69
class ConfigSchema(BaseModel): <NEW_LINE> <INDENT> class Config: <NEW_LINE> <INDENT> extra = Extra.forbid <NEW_LINE> <DEDENT> github_repo: constr(regex=u"^([A-Za-z0-9-_]*)\/([A-Za-z0-9-_]*)$") <NEW_LINE> allow_prereleases: bool = False <NEW_LINE> source_regex: str <NEW_LINE> version_regex: str = "(.*)" <NEW_LINE> versi...
Config Schema.
62598f3b4c34283577619440
class DeconzDevice(DeconzBase, Entity): <NEW_LINE> <INDENT> def __init__(self, device, gateway): <NEW_LINE> <INDENT> super().__init__(device, gateway) <NEW_LINE> self.unsub_dispatcher = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def entity_registry_enabled_default(self): <NEW_LINE> <INDENT> if self._device.type == "...
Representation of a deCONZ device.
62598f3b15fb5d323ce7de97
class Upload(models.Model): <NEW_LINE> <INDENT> id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) <NEW_LINE> timestamp = models.DateTimeField(auto_now_add=True) <NEW_LINE> owner = models.ForeignKey( User, null=True, blank=True, on_delete=models.PROTECT ) <NEW_LINE> canonical = models.URLField(...
An image upload.
62598f3b462c4b4f79dbab6b
@pytest.mark.usefixtures('admin_only') <NEW_LINE> class TestAdminOnly(object): <NEW_LINE> <INDENT> @pytest.mark.idempotent_id('bbf4f0d8-527c-11e7-a611-a756d7b535ce') <NEW_LINE> def test_import_key_pair_quota_exceeded(self, keypair, update_defaults, keypairs_steps_ui): <NEW_LINE> <INDENT> update_defaults({'key_pairs': 1...
Tests for admin only.
62598f3b627d3e7fe0e05ffa
class TransportInternalError(InternalError): <NEW_LINE> <INDENT> pass
Raised if there is a transport error that is raised to an internal error (e.g. a transport method called without opening the channel first).
62598f3b462c4b4f79dbab6f
@attr.s(frozen=True) <NEW_LINE> class JvmClass: <NEW_LINE> <INDENT> name = attr.ib() <NEW_LINE> name_of_base = attr.ib() <NEW_LINE> constants = attr.ib() <NEW_LINE> interfaces = attr.ib(converter=tuple, default=()) <NEW_LINE> fields = attr.ib(converter=dict, default=()) <NEW_LINE> methods = attr.ib(converter=dict, defa...
A class at runtime name: str, the name of this class name_of_base: str, the name of the super class interfaces: Iterable[str], the names of the interfaces this class implements fields: Mapping[str, JvmType], the names and types of the instance fields in this class methods: Mapping[MethodKey, BytecodeMethod], the keys ...
62598f3b4c34283577619446
class RemoteInstanceMask(InstanceMaskBase, RemoteFileMixin): <NEW_LINE> <INDENT> _T = TypeVar("_T", bound="RemoteInstanceMask") <NEW_LINE> @classmethod <NEW_LINE> def from_response_body(cls: Type[_T], body: Dict[str, Any]) -> _T: <NEW_LINE> <INDENT> mask = cls(body["remotePath"]) <NEW_LINE> if "info" in body: <NEW_LINE...
RemoteInstanceMask is a class for the remote instance mask label. Attributes: all_attributes: The dict of the attributes in this mask, which key is the instance id, and the value is the corresponding attributes.
62598f3b3cc13d1c6d4648e5
class TestSetting(Setting): <NEW_LINE> <INDENT> def __init__(self, config=None, name='TestSetting'): <NEW_LINE> <INDENT> super(TestSetting, self).__init__(name, config) <NEW_LINE> <DEDENT> def _initialize_attrib(self): <NEW_LINE> <INDENT> self.para_file = '' <NEW_LINE> self.device_id = 0 <NEW_LINE> self.batch_size = 1 ...
Settings for testing control.
62598f3c4c3428357761944a
class GeneralDirector(): <NEW_LINE> <INDENT> def __init__(self, AbstractBuilder): <NEW_LINE> <INDENT> self.AbstractBuilder = AbstractBuilder <NEW_LINE> self.build_methods = self.get_build_methods() <NEW_LINE> self.concrete_builder = None <NEW_LINE> <DEDENT> def get_build_methods(self): <NEW_LINE> <INDENT> method_list =...
A generalized director that can handle various abstract builders. It is also common practice to implement directors specifically designed to handle only certain types of builders. The key is to ensure that it acts as the sole interface to the builders.
62598f3c3cc13d1c6d4648e9
class FuncIncreaseMaxHP(SkillFunction): <NEW_LINE> <INDENT> key = "max_hp" <NEW_LINE> const = False <NEW_LINE> def func(self): <NEW_LINE> <INDENT> if not self.args: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> effect = self.args[0] <NEW_LINE> if effect <= 0: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> self.caller....
Passive skill, increase the caller's max_hp. Args: args[0]: (int) the max_hp value to increase. Returns: None
62598f3c627d3e7fe0e06002
class JSTranslations(MobileViewletBase): <NEW_LINE> <INDENT> grok.name('gomobiletheme.basic.viewlets.JSTranslations') <NEW_LINE> def update(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def render(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> lang = self.request.get('LANGUAGE', 'en') <NEW_LINE> <DEDENT> exc...
Used to pass translated strings to JS.
62598f3c4c3428357761944c
class ProdConfig(Config): <NEW_LINE> <INDENT> ENV = 'PRODUCTION' <NEW_LINE> DEBUG = False
Production configuration.
62598f3c462c4b4f79dbab79
class DataflowJobStatus: <NEW_LINE> <INDENT> JOB_STATE_DONE = "JOB_STATE_DONE" <NEW_LINE> JOB_STATE_RUNNING = "JOB_STATE_RUNNING" <NEW_LINE> JOB_STATE_FAILED = "JOB_STATE_FAILED" <NEW_LINE> JOB_STATE_CANCELLED = "JOB_STATE_CANCELLED" <NEW_LINE> JOB_STATE_PENDING = "JOB_STATE_PENDING" <NEW_LINE> FAILED_END_STATES = {JOB...
Helper class with Dataflow job statuses.
62598f3c3cc13d1c6d4648ef
class RecordSteps(DeviceTask): <NEW_LINE> <INDENT> def setup(self): <NEW_LINE> <INDENT> self.lastTime = 0 <NEW_LINE> deviceName = self.device.name <NEW_LINE> self.logger = logging.getLogger(name='Quadsim.{}'.format(deviceName)) <NEW_LINE> return 0 <NEW_LINE> <DEDENT> def loop(self): <NEW_LINE> <INDENT> now = self.envir...
Record vibration from geophone
62598f3c4c34283577619452
class TenjinWhitespacePreprocessorTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_whitespace(self): <NEW_LINE> <INDENT> from wheezy.html.ext.tenjin import whitespace_preprocessor <NEW_LINE> assert " x" == whitespace_preprocessor(" x") <NEW_LINE> assert "x" == whitespace_preprocessor(" \n x \n ") <NEW_LINE> ...
Test the ``whitespace_preprocessor``.
62598f3c3cc13d1c6d4648f3
class BridgeTransport(Transport): <NEW_LINE> <INDENT> PATH_PREFIX = "bridge" <NEW_LINE> HEADERS = {"Origin": "https://python.trezor.io"} <NEW_LINE> def __init__(self, device): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.device = device <NEW_LINE> self.conn = requests.Session() <NEW_LINE> self.session = None ...
BridgeTransport implements transport through TREZOR Bridge (aka trezord).
62598f3c3cc13d1c6d4648fb
class EmailAuthenticationForm(AuthenticationForm): <NEW_LINE> <INDENT> username = forms.EmailField(label=_("Email"), max_length=75)
Base class for authenticating users. Extend this to get a form that accepts username/password logins.
62598f3c15fb5d323ce7deb3
class Author(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField(User, on_delete=models.CASCADE) <NEW_LINE> phone_number = models.CharField(max_length=10) <NEW_LINE> def get_absolute_url(self): <NEW_LINE> <INDENT> return reverse('author-detail', args=[str(self.id)]) <NEW_LINE> <DEDENT> def __str__(self): <NE...
Model Class Representing a User of the App. Extended from the base User class in Django, with additions added on such as phone number.
62598f3c462c4b4f79dbab87
class ModelVariant2: <NEW_LINE> <INDENT> def __init__(self, hidden_sizes, dropout): <NEW_LINE> <INDENT> self.hidden_sizes = hidden_sizes <NEW_LINE> self.dropout = dropout
A dummy model variant 2, which could, e.g., be a certain model or baseline in practice.
62598f3ceab8aa0e5d30af04
class BlazeConsensusEstimatesLoader(BlazeEventsLoader): <NEW_LINE> <INDENT> __doc__ = __doc__.format( TS_FIELD_NAME=TS_FIELD_NAME, SID_FIELD_NAME=SID_FIELD_NAME, RELEASE_DATE_FIELD_NAME=RELEASE_DATE_FIELD_NAME, STANDARD_DEVIATION_FIELD_NAME=STANDARD_DEVIATION_FIELD_NAME, COUNT_FIELD_NAME=COUNT_FIELD_NAME, FISCAL_QUARTE...
A pipeline loader for the ``ConsensusEstimates`` dataset that loads data from a blaze expression. Parameters ---------- expr : Expr The expression representing the data to load. resources : dict, optional Mapping from the loadable terms of ``expr`` to actual data resources. odo_kwargs : dict, optional Extr...
62598f3c15fb5d323ce7deb7
class EbpfMetadata(SimpleInstance): <NEW_LINE> <INDENT> def __init__(self, hlirMetadataInstance, factory): <NEW_LINE> <INDENT> super(EbpfMetadata, self).__init__(hlirMetadataInstance, factory, True) <NEW_LINE> if not hlirMetadataInstance.metadata: <NEW_LINE> <INDENT> raise CompilationException( True, "Header instance p...
Represents a metadata instance from a P4 program
62598f3c3cc13d1c6d464901
class Command(DingoImportCommand): <NEW_LINE> <INDENT> Importer = OpenIOC_Import() <NEW_LINE> help = 'Imports OpenIOC XML files of specified paths into DINGO'
This class implements the command for importing a OpenIOC XML files into DINGO.
62598f3c0a366e3fb87dbb63
class Particles(renpy.display.core.Displayable): <NEW_LINE> <INDENT> nosave = [ 'particles' ] <NEW_LINE> def after_setstate(self): <NEW_LINE> <INDENT> self.particles = None <NEW_LINE> <DEDENT> def __init__(self, factory, style='default', **properties): <NEW_LINE> <INDENT> super(Particles, self).__init__(style=style, **...
Supports particle motion.
62598f3c3cc13d1c6d464903
class BgeeEntity(BgeeType): <NEW_LINE> <INDENT> def __init__(self, val = ""): <NEW_LINE> <INDENT> self.value = val <NEW_LINE> self.type = "bgeeentity"
Name of an entity to use as a pointer
62598f3d15fb5d323ce7dec1
@dataclass <NEW_LINE> class Template: <NEW_LINE> <INDENT> blocks: List[TemplateBlock] <NEW_LINE> def render(self, symbols): <NEW_LINE> <INDENT> return render(self, symbols)
A compiled text
62598f3d462c4b4f79dbab95
class Order(object): <NEW_LINE> <INDENT> PAYMENT_METHOD = { PAYMENT_BY_CARD: 'card', PAYMENT_BY_CASH: 'cash', } <NEW_LINE> @property <NEW_LINE> def payment(self): <NEW_LINE> <INDENT> return self.PAYMENT_METHOD.get(self.payment_method) <NEW_LINE> <DEDENT> def __init__(self): <NEW_LINE> <INDENT> self.pizza = None <NEW_LI...
Object for keep information about user's order and implements methods for state machine transaction.
62598f3d462c4b4f79dbab99
class JSONConfigException(Exception): <NEW_LINE> <INDENT> pass
This is the base of every exception that is raised during parsing or config querying in this library.
62598f3d3cc13d1c6d46490f
class SgitGateway(BaseGateway): <NEW_LINE> <INDENT> default_setting: Dict[str, str] = { "用户名": "", "密码": "", "交易服务器": "", "行情服务器": "", "产品名称": "", "授权编码": "" } <NEW_LINE> exchanges: List[Exchange] = list(EXCHANGE_SGIT2VT.values()) <NEW_LINE> def __init__(self, event_engine): <NEW_LINE> <INDENT> super().__init__(event_e...
VN Trader Gateway for SGIT .
62598f3d462c4b4f79dbab9b
class InvitationSerializer(ReadOnlyModelSerializer): <NEW_LINE> <INDENT> firm_name = serializers.SerializerMethodField() <NEW_LINE> firm_logo = serializers.SerializerMethodField() <NEW_LINE> firm_colored_logo = serializers.SerializerMethodField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = EmailInvite <NEW_LINE>...
A user in the middle of onboarding will use this serializer, pre-registration and non-authenticated
62598f3deab8aa0e5d30af18
class DummyExecutor(Executor): <NEW_LINE> <INDENT> def run_script(self, script): <NEW_LINE> <INDENT> self.stream = StringIO(script) <NEW_LINE> <DEDENT> def get_exit_code(self): <NEW_LINE> <INDENT> return 0
just echoes back the script passed to run
62598f3d4c34283577619474
class ParserConfig(object): <NEW_LINE> <INDENT> __stacks = threading.local() <NEW_LINE> def __init__(self, *managers, **config): <NEW_LINE> <INDENT> self.managers = managers <NEW_LINE> self.context = {k: v for k, v in config.items() if v is not None} <NEW_LINE> super(ParserConfig, self).__init__() <NEW_LINE> <DEDENT> @...
Context manager for handling parser configurations.
62598f3d15fb5d323ce7decb
class EnsureDesiredPropertiesStage(PipelineStage): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.last_version_seen = None <NEW_LINE> self.pending_get_request = None <NEW_LINE> super().__init__() <NEW_LINE> <DEDENT> @pipeline_thread.runs_on_pipeline_thread <NEW_LINE> def _run_op(self, op): <NEW_LINE> ...
Pipeline stage Responsible for making sure that desired properties are always kept up to date. It does this by sending diwn a GetTwinOperation after a connection is reestablished, and, if the desired properties have changed since the last time a patch was received, it will send up an artificial patch event to send thos...
62598f3d462c4b4f79dbab9f
class IntrospectNode(command.Command): <NEW_LINE> <INDENT> log = logging.getLogger(__name__ + ".IntrospectNode") <NEW_LINE> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(IntrospectNode, self).get_parser(prog_name) <NEW_LINE> group = parser.add_mutually_exclusive_group(required=True) <NEW_LINE> gro...
Introspect specified nodes or all nodes in 'manageable' state.
62598f3d627d3e7fe0e06030
class BaseCellFactory(ABC): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def __call__(self, num_units, activation, kernel_init, dropout, layer_norm): <NEW_LINE> <INDENT> pass
Abstract base class for all cell factories.
62598f3d4c3428357761947b
class Iperf3Sensor(RestoreEntity): <NEW_LINE> <INDENT> def __init__(self, iperf3_data, sensor_type): <NEW_LINE> <INDENT> self._name = f"{SENSOR_TYPES[sensor_type][0]} {iperf3_data.host}" <NEW_LINE> self._state = None <NEW_LINE> self._sensor_type = sensor_type <NEW_LINE> self._unit_of_measurement = SENSOR_TYPES[sensor_t...
A Iperf3 sensor implementation.
62598f3d3cc13d1c6d46491b
class XmippScript(): <NEW_LINE> <INDENT> def __init__(self, runWithoutArgs=False): <NEW_LINE> <INDENT> self._prog = Program(runWithoutArgs) <NEW_LINE> <DEDENT> def defineParams(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def readParams(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def checkParam(self, par...
This class will serve as wrapper around the XmippProgram class to have same facilities from Python scripts
62598f3d15fb5d323ce7ded7
class ChapterAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ('title', 'number', 'book', 'pages', 'doi') <NEW_LINE> list_filter = ('book',) <NEW_LINE> search_fields = ('title',) <NEW_LINE> raw_id_fields = ('book',) <NEW_LINE> filter_horizontal = ('contributors',)
Displays objects in the Django admin interface.
62598f3d4c34283577619481
class UnknownBox(Jp2kBox): <NEW_LINE> <INDENT> def __init__(self, box_id, length=0, offset=-1, longname=''): <NEW_LINE> <INDENT> Jp2kBox.__init__(self) <NEW_LINE> self.longname = longname <NEW_LINE> self.box_id = box_id <NEW_LINE> self.length = length <NEW_LINE> self.offset = offset <NEW_LINE> <DEDENT> def __repr__(sel...
Container for unrecognized boxes. Attributes ---------- box_id : str 4-character identifier for the box. length : int length of the box in bytes. offset : int offset of the box from the start of the file. longname : str more verbose description of the box.
62598f3d3cc13d1c6d464921
class OWLProperty(OWLPropertyExpression, OWLLogicalEntity): <NEW_LINE> <INDENT> pass
A marker interface for properties that aren't expression i.e. named properties. By definition, properties are either data properties or object properties.
62598f3d462c4b4f79dbabb0
class Response(ResponseBase): <NEW_LINE> <INDENT> def __init__(self, refund_id: str=None, refund: RefundInfo=None, *args, **kwargs): <NEW_LINE> <INDENT> self.refundid = refund_id <NEW_LINE> self.refund = refund <NEW_LINE> super().__init__(**kwargs) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return str(...
Response object for the Refund::info API :param str refund_id: Refund ID :param RefundInfo refund: Refund information
62598f3deab8aa0e5d30af2e
class ProfilerToolbarPanel(ToolbarPanel): <NEW_LINE> <INDENT> name = 'Profiler' <NEW_LINE> user_activate = True <NEW_LINE> def __init__(self, jinja_env, context={}): <NEW_LINE> <INDENT> ToolbarPanel.__init__(self, jinja_env, context=context) <NEW_LINE> if current_app.config.get('TB_PROFILER_ENABLED'): <NEW_LINE> <INDEN...
Panel that displays the time a response took with cProfile output.
62598f3d3cc13d1c6d464927
class ExpandableModelViewSet(ExpandableQuerySerializerMixin, ModelViewSet): <NEW_LINE> <INDENT> pass
A viewset that provides automatically eagerloadsany subfields that are expanded via querystring. For queryset to be expanded, either :py:class:`rest_witchcraft.serializers.ExpandableModelSerializer` needs to be used in ``serializer_class`` or ``query_serializer_class`` can be manually provided.
62598f3d627d3e7fe0e06040
class PutResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_HTTPLog(self): <NEW_LINE> <INDENT> return self._output.get('HTTPLog', None) <NEW_LINE> <DEDENT> def get_ResponseStatusCode(self): <NEW_LINE> <INDENT> return self._o...
A ResultSet with methods tailored to the values returned by the Put Choreo. The ResultSet object is used to retrieve the results of a Choreo execution.
62598f3e4c3428357761948a
class Velocity(object): <NEW_LINE> <INDENT> def __init__(self, linear_x=0., linear_y=0., angular=0.): <NEW_LINE> <INDENT> self.linear_x = linear_x <NEW_LINE> self.linear_y = linear_y <NEW_LINE> self.angular = angular
Defines a velocity vector. Author -- Aleksandar Mitrevski
62598f3e0a366e3fb87dbb8b
class WampWebSocketClientProtocol(WampWebSocketProtocol): <NEW_LINE> <INDENT> STRICT_PROTOCOL_NEGOTIATION = True <NEW_LINE> def onConnect(self, response): <NEW_LINE> <INDENT> if response.protocol not in self.factory.protocols: <NEW_LINE> <INDENT> if self.STRICT_PROTOCOL_NEGOTIATION: <NEW_LINE> <INDENT> raise Exception(...
Mixin for WAMP-over-WebSocket client transports.
62598f3e462c4b4f79dbabb6
class BertPretrainLossAndMetricLayer(tf.keras.layers.Layer): <NEW_LINE> <INDENT> def _add_metrics(self, lm_output, lm_labels, lm_label_weights, lm_example_loss): <NEW_LINE> <INDENT> accuracy = tf.keras.metrics.sparse_categorical_accuracy( lm_labels, lm_output) <NEW_LINE> numerator = tf.reduce_sum(accuracy * lm_label_we...
Returns layer that computes custom loss and metrics for pretraining.
62598f3e627d3e7fe0e06046
class TMemoryBuffer(TTransportBase): <NEW_LINE> <INDENT> def __init__(self, value=None): <NEW_LINE> <INDENT> self._buffer = BytesIO(value) if value is not None else BytesIO() <NEW_LINE> self._pos = 0 <NEW_LINE> <DEDENT> def isOpen(self): <NEW_LINE> <INDENT> return not self._buffer.closed <NEW_LINE> <DEDENT> def open(se...
Wraps a BytesIO object as a TTransport.
62598f3eeab8aa0e5d30af36
class Command: <NEW_LINE> <INDENT> SLEEP_TIME = 0.01 <NEW_LINE> @classmethod <NEW_LINE> async def execute(cls, bot_logic, update_content): <NEW_LINE> <INDENT> if cls.is_running(bot_logic, update_content): <NEW_LINE> <INDENT> await cls.execute_if_game_in_progress(bot_logic, update_content) <NEW_LINE> <DEDENT> else: <NEW...
Base class for all commands
62598f3e0a366e3fb87dbb93
class DiffModelManager(object): <NEW_LINE> <INDENT> def __init__(self, model=None, prefix=diffs_settings['prefix']): <NEW_LINE> <INDENT> self.model = model <NEW_LINE> self.db = get_connection() <NEW_LINE> self.prefix = prefix <NEW_LINE> <DEDENT> def _generate_key(self, pk, model_cls=None): <NEW_LINE> <INDENT> model = m...
Manager class that wraps a DiffSortedSet with a django-like interface
62598f3eeab8aa0e5d30af3a
class DiscussionView(AjaxableResponseMixin, View): <NEW_LINE> <INDENT> template = "timeline/timeline_discussion.html" <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> entry_id = kwargs.get('pk') <NEW_LINE> module_code = kwargs.get('module_pk') <NEW_LINE> entry = TimelineEntry.objects.get(pk=entry...
View to get and post the active discussion for a entry in the timeline.
62598f3e627d3e7fe0e0604e
class AttribManager(object): <NEW_LINE> <INDENT> class NotPresent(Exception): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def filterBody(self, b): <NEW_LINE> <INDENT> raise NotImplemented() <NEW_LINE> <DEDENT> def getAttrib(self, v, what): <NEW_LINE> <INDENT> raise NotImplemented() <NEW_LINE> <DEDENT> def keys(self, v...
Class responsible for reading / writing attributes from vnodes for LeoCursor
62598f3e0a366e3fb87dbb97
class HttpNamespace(AWSObject): <NEW_LINE> <INDENT> resource_type = "AWS::ServiceDiscovery::HttpNamespace" <NEW_LINE> props: PropsDictType = { "Description": (str, False), "Name": (str, True), "Tags": (Tags, False), }
`HttpNamespace <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-servicediscovery-httpnamespace.html>`__
62598f3e3cc13d1c6d464945
class AirOpsTempo(Enum): <NEW_LINE> <INDENT> Sustained = 0 <NEW_LINE> Surge = 1 <NEW_LINE> Inherit = 999
空战节奏
62598f3e3cc13d1c6d464947
class Ball(GEllipse): <NEW_LINE> <INDENT> def get_y_velocity(self): <NEW_LINE> <INDENT> return self._vy <NEW_LINE> <DEDENT> def get_x_velocity(self): <NEW_LINE> <INDENT> return self._vx <NEW_LINE> <DEDENT> def set_y_velocity(self,v): <NEW_LINE> <INDENT> self._vy = v <NEW_LINE> <DEDENT> def set_x_velocity(self, v): <NEW...
Instance is a game ball. We extend GEllipse because a ball must have additional attributes for velocity. This class adds this attributes and manages them. INSTANCE ATTRIBUTES: _vx [int or float]: Velocity in x direction _vy [int or float]: Velocity in y direction The class Gameplay will need to look at the...
62598f3f15fb5d323ce7df02
class Architecture(Base): <NEW_LINE> <INDENT> command_base = 'architecture'
Manipulates Foreman's architecture.
62598f3feab8aa0e5d30af52
@as_singleton_instance <NEW_LINE> class this_is_an_instance(SomeOtherBaseClass): <NEW_LINE> <INDENT> def __call__(self, *args): <NEW_LINE> <INDENT> print("In instance __call__()") <NEW_LINE> <DEDENT> def some_function(self, *args): <NEW_LINE> <INDENT> print("called some_function({0})".format( ", ".join(repr(a) for a in...
this_is_an_instance will be an *instance* of a class named _this_is_an_instance__class, which will have the base classes SomeOtherBaseClass and SomeImplicitBase. All of the methods below will work as expected.
62598f3f0a366e3fb87dbbac
class ABRLD: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.albero=AlberoBinario() <NEW_LINE> <DEDENT> def chiave(self,nodo): <NEW_LINE> <INDENT> if nodo==None: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> return nodo.info[0] <NEW_LINE> <DEDENT> def elemento(self,nodo): <NEW_LINE> <INDENT> if n...
Un albero di ricerca binario (ARB) e' un albero binario, che per essere tale deve soddisfare tre prorpieta' fondamentali: 1-ogni nodo v dell'albero contiene un elemento, che indicheremo con info[1] e una chiave, che indicheremo con info[0]. Le chiavi di ogni nodo sono prese da un universo di chiavi totalmente ordin...
62598f3f462c4b4f79dbabda
class SessionExpiry(object): <NEW_LINE> <INDENT> def process_request(self, request): <NEW_LINE> <INDENT> if getattr(settings, 'SESSION_EXPIRY', None): <NEW_LINE> <INDENT> request.session.set_expiry(settings.SESSION_EXPIRY) <NEW_LINE> <DEDENT> return None
Set the session expiry according to settings
62598f3f627d3e7fe0e0606a
class EchoServer(ChannelServer): <NEW_LINE> <INDENT> def __init__(self, listener, handshake=None): <NEW_LINE> <INDENT> super(EchoServer, self).__init__(listener) <NEW_LINE> self.handshake = handshake <NEW_LINE> logging.info('started') <NEW_LINE> <DEDENT> def sender(self, q, c, f): <NEW_LINE> <INDENT> i = 0 <NEW_LINE> t...
docstring for Handler
62598f3feab8aa0e5d30af5a
class RNNCell(tf.contrib.rnn.RNNCell): <NEW_LINE> <INDENT> def __init__(self, input_size, state_size): <NEW_LINE> <INDENT> self.input_size = input_size <NEW_LINE> self._state_size = state_size <NEW_LINE> <DEDENT> @property <NEW_LINE> def state_size(self): <NEW_LINE> <INDENT> return self._state_size <NEW_LINE> <DEDENT> ...
Wrapper around our RNN cell implementation that allows us to play nicely with TensorFlow.
62598f3f462c4b4f79dbabe0
class ISchemaOrgEvent(ISchemaOrgThing): <NEW_LINE> <INDENT> attendees = schema.Tuple(title=u'Attendees', description=u'A person(s) attending the event', required=False) <NEW_LINE> duration = schema.TextLine(title=u"Duration", description=u"The duration of the item (movie, " u"audio recording, event, etc.) in " u"ISO 86...
See http://schema.org/Event
62598f3f15fb5d323ce7df0c
class TestCpuHealthStatsTimes(): <NEW_LINE> <INDENT> def test_cpu_health_stats_times_serialization(self): <NEW_LINE> <INDENT> cpu_health_stats_times_model_json = {} <NEW_LINE> cpu_health_stats_times_model_json['idle'] = 131397203 <NEW_LINE> cpu_health_stats_times_model_json['irq'] = 6068640 <NEW_LINE> cpu_health_stats_...
Test Class for CpuHealthStatsTimes
62598f3f462c4b4f79dbabe4
class QuestionType(messages.Enum): <NEW_LINE> <INDENT> ASSIGNMENT = 0 <NEW_LINE> RETURN = 1
An Enum to identify the type of question.
62598f3f15fb5d323ce7df10
class absolute(float): <NEW_LINE> <INDENT> __slots__ = [ ]
This represents an absolute float coordinate.
62598f3feab8aa0e5d30af64
class AdPosition(models.Model): <NEW_LINE> <INDENT> slot = models.ForeignKey('adgeletti.AdSlot', verbose_name=_(u'slot')) <NEW_LINE> breakpoint = models.CharField(_(u'breakpoint'), max_length=25, choices=[(bp, bp) for bp in settings.ADGELETTI_BREAKPOINTS]) <NEW_LINE> sizes = models.ManyToManyField(Size, verbose_name=_(...
Configures how a slot is to be displayed for a given breakpoint.
62598f3f3cc13d1c6d46495f
class Ridge(object): <NEW_LINE> <INDENT> def __init__(self, X, y): <NEW_LINE> <INDENT> self.U, self.S, self.V = np.linalg.svd(X, full_matrices = False) <NEW_LINE> self.y = y <NEW_LINE> self.info = {} <NEW_LINE> <DEDENT> def train(self, lambda_par): <NEW_LINE> <INDENT> if lambda_par not in self.info: <NEW_LINE> <INDENT>...
Linear least squares with l2 regularization Parameters ---------- X : {array-like, sparse matrix}, shape = [n_samples, n_features] Training data y : array-like, shape = [n_samples] Training targets
62598f3f0a366e3fb87dbbc4
class TestNoGcab(unittest.TestCase): <NEW_LINE> <INDENT> @mock.patch(IMPORT_MODULE, side_effect=no_gi_import) <NEW_LINE> def test_gi_import_error(self, _): <NEW_LINE> <INDENT> import symstore.cab <NEW_LINE> _reload(symstore.cab) <NEW_LINE> self.assertFalse(symstore.cab.compression_supported)
test the case when we can't import gi.repository.Gcab
62598f3feab8aa0e5d30af6c
class InlineDownExpandingContainer(ConditionalDownExpandingContainerBase): <NEW_LINE> <INDENT> def __init__(self, name, parent, left=None, width=None, right=None, advance_parent=True, place=True): <NEW_LINE> <INDENT> super().__init__(name, None, parent, left=left, top=parent.cursor, width=width, right=right, max_height...
A :class:`DownExpandingContainer` whose top edge is placed at the parent's current cursor position. As flowables are flowed in this container, the parent's cursor also advances (but this behavior can be suppressed). See :class:`Container` about the `name`, `parent`, `left`, `width` and `right` parameters. Setting `adv...
62598f3f462c4b4f79dbabf2
class SectorTime: <NEW_LINE> <INDENT> def __init__(self, time, sector, invalid): <NEW_LINE> <INDENT> self.time = time <NEW_LINE> self.sector = sector <NEW_LINE> self.invalid = False if invalid == 0 else True
Represents a sector time.
62598f3f462c4b4f79dbabf4
class UserParcels(Resource): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.orders = ParcelOrders() <NEW_LINE> self.users = Users() <NEW_LINE> <DEDENT> @authenticate <NEW_LINE> def get(self, id, user_id): <NEW_LINE> <INDENT> message_dict = {message: 'Cannot perform this operation'} <NEW_LINE> status_c...
Handles the route /users/<user_id>/parcels
62598f40627d3e7fe0e06082