code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class ByteCountFragment(AbstractNbeFragment): <NEW_LINE> <INDENT> def getNamespaceUri(): <NEW_LINE> <INDENT> return adveneNS <NEW_LINE> <DEDENT> getNamespaceUri = staticmethod(getNamespaceUri) <NEW_LINE> def getLocalName(): <NEW_LINE> <INDENT> return "bytecount-fragment" <NEW_LINE> <DEDENT> getLocalName = staticmethod(... | ByteCount fragment class.
| 62598f80a17c0f6771d5bc65 |
class KMSException(Exception): <NEW_LINE> <INDENT> pass | Base exception for all KMS exceptions. | 62598f808e71fb1e983bb4da |
class AllSubDevicesGetSupportedParameters(TestMixins.AllSubDevicesGetMixin, ResponderTestFixture): <NEW_LINE> <INDENT> CATEGORY = TestCategory.SUB_DEVICES <NEW_LINE> PID = 'SUPPORTED_PARAMETERS' | Send a Get SUPPORTED_PARAMETERS to ALL_SUB_DEVICES. | 62598f806aa9bd52df0d48fc |
class SERVICE_ACTION: <NEW_LINE> <INDENT> ADD = 'add' <NEW_LINE> DEL = 'del' <NEW_LINE> UPDATE = 'update' <NEW_LINE> NONE = 'none' | service 变更操作 | 62598f800383005118f6d124 |
class UtmMixin(models.AbstractModel): <NEW_LINE> <INDENT> _name = 'utm.mixin' <NEW_LINE> campaign_id = fields.Many2one('utm.campaign', 'Campaign', help="This is a name that helps you keep track of your different campaign efforts Ex: Fall_Drive, Christmas_Special") <NEW_LINE> source_id = fields.Many2one('utm.source', 'S... | Mixin class for objects which can be tracked by marketing. | 62598f80baa26c4b54d4ecd5 |
class DatasetPluginManager(object): <NEW_LINE> <INDENT> def __init__(self, plugin, doc, fields): <NEW_LINE> <INDENT> self.plugin = plugin <NEW_LINE> self.document = doc <NEW_LINE> self.helper = DatasetPluginHelper(doc) <NEW_LINE> self.fields = dict(fields) <NEW_LINE> self.changeset = -1 <NEW_LINE> self.fixMissingFields... | Manage datasets generated by plugin. | 62598f8010dbd63aa1c705d4 |
class erf(_Function): <NEW_LINE> <INDENT> def __init__(self, fn=None, *args, **kwargs): <NEW_LINE> <INDENT> self._fn = _Function.convert(fn) <NEW_LINE> fncself = None <NEW_LINE> if self._fn: <NEW_LINE> <INDENT> fncself = self._fn._fncself <NEW_LINE> <DEDENT> self._fncself = _cfn.MathUnary_erf( fncself ) <NEW_LINE> supe... | Computes the error function of its argument function.
Parameters
----------
fn: underworld.function.Function (or convertible).
Optionally provided for function composition.
Example
-------
>>> import math as sysmath
>>> import numpy as np
>>> func = erf()
>>> np.allclose( func.evaluate(0.1234), sysmath.erf(0.1234... | 62598f80bde94217f3707377 |
class CmdLineToLocation(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def makeLocation(locStr_): <NEW_LINE> <INDENT> if locStr_.count('/') >= 2: <NEW_LINE> <INDENT> locPartList = locStr_.split('/') <NEW_LINE> return Location(str(locPartList[0]).strip(), str(locPartList[1]).strip(), str(locPartList[2]).strip()) | Convert from command line strings to Location objects.
Command line strings can be in the following format -
Country/State/County | 62598f8007f4c71912baee71 |
class Person(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.age = 0 | 人 | 62598f8063b5f9789fe84b94 |
class CidCursorWrapper(object): <NEW_LINE> <INDENT> def __init__(self, cursor): <NEW_LINE> <INDENT> self.cursor = cursor <NEW_LINE> <DEDENT> def __getattr__(self, attr): <NEW_LINE> <INDENT> if attr in self.__dict__: <NEW_LINE> <INDENT> return self.__dict__[attr] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return geta... | A cursor wrapper that attempts to add a cid comment to each query | 62598f80d4950a0f3b110b46 |
class AuthSamlIdp(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.required=[] <NEW_LINE> self.b_key = "auth-saml-idp" <NEW_LINE> self.a10_url="/axapi/v3/file/auth-saml-idp/oper" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> self.oper = {} <NEW_LINE>... | Class Description::
Operational Status for the object auth-saml-idp.
Class auth-saml-idp supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param DeviceProxy: The device proxy for REST operations and session handling. Refer to `common/device_proxy.p... | 62598f807b25080760ed6ec8 |
class BindMountsRulesTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_init(self): <NEW_LINE> <INDENT> with self.assertRaises(TypeError): <NEW_LINE> <INDENT> Rules(None) <NEW_LINE> <DEDENT> with self.assertRaises(TypeError): <NEW_LINE> <INDENT> Rules("-/.*") <NEW_LINE> <DEDENT> with self.assertRaises(TypeError): <... | Validation of :cls:`docker_leash.checks.BindMountsRules`
| 62598f806e29344779b00086 |
class NameTooLong(exception.FormError): <NEW_LINE> <INDENT> pass | A DNS name is > 255 octets long. | 62598f80a17c0f6771d5bc67 |
class TestReady(Boolean): <NEW_LINE> <INDENT> def _convert_value(self, raw_value): <NEW_LINE> <INDENT> return not raw_value | Encapsulates test "ready" values in OBD responses;
for some insane reason, 0 = "ready", and 1 = not ready | 62598f8073bcbd0ca4bc9c74 |
class LinuxbridgeMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase): <NEW_LINE> <INDENT> supported_qos_rule_types = [qos_consts.RULE_TYPE_BANDWIDTH_LIMIT, qos_consts.RULE_TYPE_DSCP_MARKING] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> sg_enabled = securitygroups_rpc.is_firewall_enabled() <NEW_LINE> super(... | Attach to networks using linuxbridge L2 agent.
The LinuxbridgeMechanismDriver integrates the ml2 plugin with the
linuxbridge L2 agent. Port binding with this driver requires the
linuxbridge agent to be running on the port's host, and that agent
to have connectivity to at least one segment of the port's
network. | 62598f800fa83653e46f4913 |
class RepoLanguage(db.Model): <NEW_LINE> <INDENT> __tablename__ = "repo_languages" <NEW_LINE> repo_language_id = db.Column(db.Integer, autoincrement=True, primary_key=True) <NEW_LINE> repo_id = db.Column(db.Integer, db.ForeignKey("repos.repo_id"), nullable=False) <NEW_LINE> language_id = db.Column(db.Integer, db.Foreig... | Association table between Repository and Language. | 62598f8015baa723494619a2 |
class IProposeTextField(IChoice): <NEW_LINE> <INDENT> pass | textarea with vocabulary as proposition inputs.
| 62598f808e05c05ec3f6eb59 |
class Sarsa(ReinforceLearning): <NEW_LINE> <INDENT> def __init__(self, actions, lr=0.1, gamma=0.9, epsilon=0.9): <NEW_LINE> <INDENT> super(Sarsa, self).__init__(actions=actions, lr=lr, gamma=gamma, epsilon=epsilon) <NEW_LINE> <DEDENT> def learn(self, s, a, r, s_, a_): <NEW_LINE> <INDENT> self.check_state_exits(s_) <NEW... | The basic class is ReinforceLearning | 62598f8071ff763f4b5e7191 |
class DeviceInfoViewSet(ModelViewSet): <NEW_LINE> <INDENT> perms_map = ( {'*': 'admin'}, {'*': 'device_all'}, {'get': 'device_list'}, {'post': 'device_create'}, {'put': 'device_edit'}, {'delete': 'device_delete'}) <NEW_LINE> queryset = DeviceInfo.objects.all() <NEW_LINE> serializer_class = DeviceInfoSerializer <NEW_LIN... | 字典管理:增删改查 | 62598f80009cb60464d00f51 |
class IxnDeviceGroupEmulation(IxnEmulationHost): <NEW_LINE> <INDENT> def __init__(self, ixnhttp): <NEW_LINE> <INDENT> super(IxnDeviceGroupEmulation, self).__init__(ixnhttp) <NEW_LINE> <DEDENT> def find(self, vport_name=None, emulation_host=None, **filters): <NEW_LINE> <INDENT> return super(IxnDeviceGroupEmulation, self... | Generated NGPF deviceGroup emulation host | 62598f80f7d966606f747a0c |
class MockKeystoneClient: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.exceptions = MockExceptions() | Mock of keystoneclient module | 62598f8007d97122c42166c7 |
class NullChoicesFilterSpec(ChoicesFilterSpec): <NEW_LINE> <INDENT> def __init__(self, f, request, params, model, model_admin, field_path=None): <NEW_LINE> <INDENT> super(NullChoicesFilterSpec, self).__init__(f, request, params, model, model_admin, field_path=field_path) <NEW_LINE> self.lookup_null_kwarg = '%s__isnull'... | This is similar to the built-in related choices but includes an option to
select NULL values | 62598f80596a897236127695 |
class DescribeDBLogFilesResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.InstanceId = None <NEW_LINE> self.Type = None <NEW_LINE> self.Total = None <NEW_LINE> self.Files = None <NEW_LINE> self.VpcPrefix = None <NEW_LINE> self.NormalPrefix = None <NEW_LINE> self.ShardId = None <N... | DescribeDBLogFiles返回参数结构体
| 62598f8063f4b57ef0085a80 |
class InternalError(DatabaseError): <NEW_LINE> <INDENT> pass | When a non-DatabaseError exception type is not caught. | 62598f8026068e7796d4c380 |
class ColorPalette(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=100, blank=True) <NEW_LINE> colors = models.ManyToManyField('Color') <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> @models.permalink <NEW_LINE> def get_absolute_url(self): <NEW_LINE> <IN... | Provide various colors for the graphs | 62598f80bde94217f3707378 |
class LoadResults(object): <NEW_LINE> <INDENT> def run(self, mapping): <NEW_LINE> <INDENT> election_id = mapping['generated_filename'] <NEW_LINE> if 'precinct' in election_id: <NEW_LINE> <INDENT> loader = MOPrecinctLoader() <NEW_LINE> <DEDENT> elif 'special' in election_id: <NEW_LINE> <INDENT> loader = MOSpecialLoader(... | Entry point for data loading.
Determines appropriate loader for file and triggers load process. | 62598f8094891a1f408b9401 |
class WriteNginxConfig(BaseWriterTask): <NEW_LINE> <INDENT> name = 'write_nginx' <NEW_LINE> def get_context(self, project_slug, developer): <NEW_LINE> <INDENT> server_name = self.get_server_name(project_slug, developer) <NEW_LINE> return { 'SERVER_NAME': server_name, 'SERVER_IP': socket.gethostbyname(env.hosts), 'SOCKE... | Write nginx config for project+developer and reload nginx | 62598f808c3a8732951f5f6b |
class Brake: <NEW_LINE> <INDENT> def __init__(self, type): <NEW_LINE> <INDENT> self.type = type <NEW_LINE> <DEDENT> def apply(self): <NEW_LINE> <INDENT> print("Brake has been applied") | Docstring | 62598f805f7d997b871f90ea |
class EnumFunc: <NEW_LINE> <INDENT> def __init__(self, func: callable) -> None: <NEW_LINE> <INDENT> self.func = func <NEW_LINE> update_wrapper(self, func) <NEW_LINE> <DEDENT> def __call__(self, *args, **kwargs) -> Any: <NEW_LINE> <INDENT> return self.func(*args, **kwargs) <NEW_LINE> <DEDENT> def __repr__(self) -> str: ... | Wrapper class that enables usage and proper representation for functions in Enums. | 62598f8023849d37ff850ae2 |
class DataProcSparkSqlOperator(BaseOperator): <NEW_LINE> <INDENT> template_fields = ['query', 'variables'] <NEW_LINE> template_ext = ('.q',) <NEW_LINE> ui_color = '#0273d4' <NEW_LINE> @apply_defaults <NEW_LINE> def __init__( self, query, variables=None, dataproc_cluster='cluster-1', dataproc_spark_properties=None, data... | Start a Spark SQL query Job on a Cloud DataProc cluster. | 62598f8063b5f9789fe84b96 |
class TestAuxiliary(TestCase): <NEW_LINE> <INDENT> @mock.patch('vsc.filesystem.quota.tools.getpwall') <NEW_LINE> def test_map_uids_to_names(self, mock_getpwall): <NEW_LINE> <INDENT> uids = [(1, 2, 3), (4, 5, 6), (7, 8, 9)] <NEW_LINE> mock_getpwall.return_value = uids <NEW_LINE> res = tools.map_uids_to_names() <NEW_LINE... | Stuff that does not belong anywhere else :) | 62598f808a349b6b43685c69 |
class SystemIntf(Object): <NEW_LINE> <INDENT> class _syscon(_BaseIntf): <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> return "SystemIntf[syscon](id={})".format(repr(self.id_)) <NEW_LINE> <DEDENT> <DEDENT> class _reg_piton(_BaseIntf, _AbstractByteAddressedIntf): <NEW_LINE> <INDENT> def __repr__(self): <NEW... | System interfaces collection.
Currently all system interfaces are hardcoded. | 62598f80c432627299fa29f4 |
@admin.register(GoogleSearch) <NEW_LINE> class GoogleSearchAdmin(ImportMixin, admin.ModelAdmin): <NEW_LINE> <INDENT> resource_class = GoogleSearchResource <NEW_LINE> search_fields = ['q'] <NEW_LINE> list_display = ['q', '_results', 'result_count', 'success', 'date_updated'] <NEW_LINE> list_filter = ['success'] <NEW_LIN... | model admin for google search | 62598f804e696a045264db13 |
class IconManagerNavigateIcon(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "icon_manager.navigate" <NEW_LINE> bl_label = "Navigate icons" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> direction = StringProperty(name='direction') <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> iconManager = ... | Navigate Icons | 62598f8066673b3332c2fdeb |
class Partname(object): <NEW_LINE> <INDENT> __filename_re = re.compile('([a-zA-Z]+)([1-9][0-9]*)?') <NEW_LINE> def __init__(self, partname): <NEW_LINE> <INDENT> super(Partname, self).__init__() <NEW_LINE> self.__partname = partname <NEW_LINE> <DEDENT> @property <NEW_LINE> def baseURI(self): <NEW_LINE> <INDENT> return o... | Provides access to partname components such as the baseURI and the part
index. | 62598f80e64d504609df90c3 |
class MapIteratorPrinter(AbstractRBTreeIteratorPrinter): <NEW_LINE> <INDENT> def __init__(self, val): <NEW_LINE> <INDENT> self._initialize(val["__i_"], _remove_generics(_prettify_typename(val.type))) <NEW_LINE> <DEDENT> def _get_node_value(self, node): <NEW_LINE> <INDENT> return node["__value_"]["__cc"] | Print a std::(multi)map iterator. | 62598f807c178a314d78ced1 |
class NewStatusedEntity(SimpleEntity, StatusMixin): <NEW_LINE> <INDENT> __tablename__ = 'NewStatusedEntities' <NEW_LINE> __mapper_args__ = {'polymorphic_identity': 'NewStatusedEntity'} <NEW_LINE> new_statused_entity_id = Column('id', Integer, ForeignKey('SimpleEntities.id'), primary_key=True) | The new statused entity class, which is a new simpleEntity with status
abilities. | 62598f8023e79379d538bf1f |
class PID_dep_a(BaseUniquePID): <NEW_LINE> <INDENT> _name = "I_dep_a" <NEW_LINE> @staticmethod <NEW_LINE> def _measure(d, inputs, output): <NEW_LINE> <INDENT> var_to_index = {var: i for i, var in enumerate(inputs+(output,))} <NEW_LINE> d = d.coalesce(list(sorted(var_to_index.keys(), key=lambda k: var_to_index[k]))) <NE... | The dependency partial information decomposition, as defined by James at al.
Notes
-----
This alternative method behaves oddly with three or more inputs. | 62598f80f7d966606f747a0e |
class BetaFactorizationServiceStub(object): <NEW_LINE> <INDENT> pass <NEW_LINE> def getMultipliers(self, request, timeout, metadata=None, with_call=False, protocol_options=None): <NEW_LINE> <INDENT> pass <NEW_LINE> raise NotImplementedError() <NEW_LINE> <DEDENT> getMultipliers.future = None | The Beta API is deprecated for 0.15.0 and later.
It is recommended to use the GA API (classes and functions in this
file not marked beta) for all further purposes. This class was generated
only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0. | 62598f8007d97122c42166c9 |
class Model_reaction(models.Model): <NEW_LINE> <INDENT> model_id = models.CharField(max_length = 100) <NEW_LINE> name = models.CharField(max_length = 2000) <NEW_LINE> source = models.ForeignKey(Source) <NEW_LINE> gpr = models.CharField(max_length = 10000) <NEW_LINE> substrates = models.ManyToManyField(Model_metabolite,... | Reaction present in the model being developed.
- Includes source for reaction (original model/prediction source).
- Includes link to DB reaction where possible.
- Includes plain text GPR for reaction - to get prediction GPRs.
- Includes links to all metabolites involved but without more information (for quick compariso... | 62598f80baa26c4b54d4ecd9 |
class Randomizer(metaclass=ABCMeta): <NEW_LINE> <INDENT> def __iter__(self): <NEW_LINE> <INDENT> while True: <NEW_LINE> <INDENT> yield next(self) <NEW_LINE> <DEDENT> <DEDENT> def __next__(self): <NEW_LINE> <INDENT> return self.next({}) <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def next(self, data=None): <NEW_LINE>... | Abstract node for generating arbitrary data | 62598f8029b78933be269dee |
class RCtc(RPackage): <NEW_LINE> <INDENT> homepage = "https://www.bioconductor.org/packages/release/bioc/html/ctc.html" <NEW_LINE> git = "https://git.bioconductor.org/packages/ctc.git" <NEW_LINE> version('1.54.0', commit='0c3df81dfc8fabe12e11884bed44b64e11fd6d4e') <NEW_LINE> depends_on('r-amap', type=('build', 'ru... | Tools for export and import classification trees and clusters
to other programs | 62598f80ac7a0e7691f71f40 |
class Builder(object): <NEW_LINE> <INDENT> def __init__(self, ignore=[]): <NEW_LINE> <INDENT> self.ignore = ignore <NEW_LINE> self.basedir = sys.path[0] <NEW_LINE> <DEDENT> def create_node(self, name, yml, path=[]): <NEW_LINE> <INDENT> module_path = os.path.join(self.basedir, 'citadel', 'nodes', name + '.py') <NEW_LINE... | Build a tree of CITADel nodes. | 62598f8023e79379d538bf20 |
class FreeSearchForm2(FilterForm): <NEW_LINE> <INDENT> searchx = forms.CharField(max_length=100, required=False, label="Free-form search", help_text="Use 'or' to search for multiple names") <NEW_LINE> def filter(self, request, queryset): <NEW_LINE> <INDENT> searchx = self.cleaned_data['searchx'].strip() <NEW_LINE> if s... | concrete implementation of filter form
TO DO: add ability to search for multiple search terms separated by 'or' | 62598f803c8af77a43b67c47 |
class HomeAssistantHTTPServer(ThreadingMixIn, HTTPServer): <NEW_LINE> <INDENT> allow_reuse_address = True <NEW_LINE> daemon_threads = True <NEW_LINE> def __init__(self, server_address, request_handler_class, hass, api_password, development, no_password_set): <NEW_LINE> <INDENT> super().__init__(server_address, request_... | Handle HTTP requests in a threaded fashion. | 62598f80d53ae8145f917eb5 |
class InvalidAPIException(Exception): <NEW_LINE> <INDENT> pass | This exception is raised when API key(s) used for authentication
is invalid. | 62598f80d4950a0f3b110b48 |
class UncompressedMX(MXBase): <NEW_LINE> <INDENT> def to_wire(self, file, compress = None, origin = None): <NEW_LINE> <INDENT> super(UncompressedMX, self).to_wire(file, None, origin) <NEW_LINE> <DEDENT> def to_digestable(self, origin = None): <NEW_LINE> <INDENT> return self.to_wire(f, None, origin) | Base class for rdata that is like an MX record, but whose name
is not compressed when converted to DNS wire format, and whose
digestable form is not downcased. | 62598f800383005118f6d129 |
class Debate(models.Model): <NEW_LINE> <INDENT> title = models.CharField(_('Title'), max_length=200, unique=True) <NEW_LINE> description = models.TextField(_('Description'), blank=True, null=True) <NEW_LINE> theme = models.CharField(_('Theme'), blank=True, null=True, max_length=100) <NEW_LINE> space = models.ForeignKey... | Debate object. In every space there can be unlimited debates, each one of
them holds all the related notes. Debates are filtered by space. Start/End
dates are for letting users use the debate or not.
.. versionadded:: 0.1b | 62598f801f037a2d8b9e3b10 |
class UDPTransmitter(mqttsn.Client): <NEW_LINE> <INDENT> def __init__(self, topics, url=None, port=None): <NEW_LINE> <INDENT> mqttsn.Client.__init__( self, host=(url or UDP_URL), port=(port or UDP_PORT) ) <NEW_LINE> self.output_topics = topics <NEW_LINE> <DEDENT> @ensure_udp_connection <NEW_LINE> def send(self, message... | Handler for MQTT-SN publishing
Args:
topics (dict):
keys identify the topic,s for the mqtt topic
names to publish | 62598f8050485f2cf55da999 |
class Point(namedtuple('Point', ['x', 'y'])): <NEW_LINE> <INDENT> def __new__(cls, x, y=None): <NEW_LINE> <INDENT> if isinstance(x, (list, tuple)) and y is None: <NEW_LINE> <INDENT> x, y = x <NEW_LINE> <DEDENT> if isinstance(x, basestring) and y is None: <NEW_LINE> <INDENT> return Point.from_alg(x) <NEW_LINE> <DEDENT> ... | A subclass of Tuple with different operations.
Adding/subtracting two Points yields a new one, and so does multiplying by
a number.
>>> p1 = Point(1,2)
>>> p2 = Point(x=4, y=5)
>>> p1
Point(x=1, y=2)
>>> p2
Point(x=4, y=5)
>>> (p1+p2*6)*2 + p2
Point(x=54, y=69)
>>> Point(0, 0).as_alg()
'a1'
>>> Point.from_alg('b3')
P... | 62598f80b57a9660fecd14a4 |
class ScaledDotProductAttention(nn.Module): <NEW_LINE> <INDENT> def __init__(self, temperature, attn_dropout=0.1): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.temperature = temperature <NEW_LINE> self.dropout = nn.Dropout(attn_dropout) <NEW_LINE> self.softmax = nn.Softmax(dim=2) <NEW_LINE> <DEDENT> def forwa... | Scaled Dot-Product Attention | 62598f80d99f1b3c44d050d5 |
class ProgressItem(models.Model): <NEW_LINE> <INDENT> member = models.ForeignKey('mig_main.MemberProfile') <NEW_LINE> term = models.ForeignKey('mig_main.AcademicTerm') <NEW_LINE> related_event = models.ForeignKey( 'event_cal.CalendarEvent', null=True, blank=True ) <NEW_LINE> event_type = models.ForeignKey(EventCategory... | A unit of progress toward satisfying a requirement.
Ties together members and requirements in a particular term. | 62598f80b830903b9686e185 |
class QWeb(models.AbstractModel): <NEW_LINE> <INDENT> _inherit = 'ir.qweb' <NEW_LINE> URL_ATTRS = { 'form': 'action', 'a': 'href', 'link': 'href', 'script': 'src', 'img': 'src', } <NEW_LINE> def get_asset_bundle(self, xmlid, files, remains=None, env=None): <NEW_LINE> <INDENT> return AssetsBundleMultiWebsite... | QWeb object for rendering stuff in the website context | 62598f80c432627299fa29f6 |
class MultiDark(NbodySimulation): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(MultiDark, self).__init__(simname = 'multidark', Lbox = 1000., particle_mass = 8.721e9, num_ptcl_per_dim = 2048, softening_length = 7., initial_redshift = 65., cosmology = cosmology.WMAP5) <NEW_LINE> self.orig_ascii_web_... | Cosmological N-body simulation of WMAP5 cosmology
with Lbox = 1Gpc/h and particle mass of ~1e10 Msun/h.
For a detailed description of the
simulation specs, see http://www.cosmosim.org/cms/simulations/multidark-project/mdr1. | 62598f80004d5f362081ed0f |
class TreeMatcher: <NEW_LINE> <INDENT> def __init__(self, parser): <NEW_LINE> <INDENT> assert parser.options.maybe_placeholders == False <NEW_LINE> self.tokens, rules, _extra = parser.grammar.compile(parser.options.start, set()) <NEW_LINE> self.rules_for_root = defaultdict(list) <NEW_LINE> self.rules = list(self._build... | Match the elements of a tree node, based on an ontology
provided by a Lark grammar.
Supports templates and inlined rules (`rule{a, b,..}` and `_rule`)
Initiialize with an instance of Lark. | 62598f8050485f2cf55da99a |
class MockInstallProfile(object): <NEW_LINE> <INDENT> disk = None <NEW_LINE> original_disk = None | Mocks an InstallProfile | 62598f807c178a314d78ced3 |
class StayLeftSearchAgent(SearchAgent): <NEW_LINE> <INDENT> def prepare(self, gstate: gamestate.Gamestate) -> None: <NEW_LINE> <INDENT> super().prepare(gstate) <NEW_LINE> def cost_fn(pos: util.Vector): <NEW_LINE> <INDENT> return 2 ** pos.x <NEW_LINE> <DEDENT> representation = search.PositionSearchRepresentation(gstate,... | This SearchAgent prefers to stay left,
and achieves this through an appropriate SearchRepresentation. | 62598f80dc8b845886d52fdf |
class TestFixtureBuilder(unittest.TestCase): <NEW_LINE> <INDENT> def test_retrieve_fixtures(self): <NEW_LINE> <INDENT> dirpath = os.path.join("build", "multiversionfixture") <NEW_LINE> expected_standalone = os.path.join("buildscripts", "tests", "resmokelib", "testing", "fixtures", "retrieved_fixture.txt") <NEW_LINE> _b... | Class that test retrieve_fixtures methods. | 62598f8029b78933be269def |
class AsyncHttpProtocol(asyncio.Protocol): <NEW_LINE> <INDENT> def __init__(self, content): <NEW_LINE> <INDENT> self._content = content <NEW_LINE> self.finished = False <NEW_LINE> self.response = b'' <NEW_LINE> self._transport = None <NEW_LINE> self._start_time = time.time() <NEW_LINE> self._end_time = None <NEW_LINE> ... | TCP protocol instance that immediately writes content to the socket. | 62598f801d351010ab8f3567 |
class PatternConfig: <NEW_LINE> <INDENT> on_parse_failure_options = {"ERROR", "WARN"} <NEW_LINE> def __init__(self, path=None, patterns_path=None): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.patterns_path = patterns_path <NEW_LINE> self.pattern_files = set() <NEW_LINE> self.settings = { "on_parse_failure": "E... | Configuration file containing difference code patterns and global pattern
comparison settings.
Difference patterns can be used during module comparison to prevent
the reporting of known and desired semantic differences. | 62598f80bde94217f370737a |
class FakeSessionForMigrationTests(fake.SessionBase): <NEW_LINE> <INDENT> def __init__(self, uri): <NEW_LINE> <INDENT> super(FakeSessionForMigrationTests, self).__init__(uri) <NEW_LINE> <DEDENT> def VDI_get_by_uuid(self, *args): <NEW_LINE> <INDENT> return 'hurr' <NEW_LINE> <DEDENT> def VDI_resize_online(self, *args): <... | Stubs out a XenAPISession for Migration tests | 62598f80a4f1c619b294e016 |
class NoEnoughData(pywikibot.Error): <NEW_LINE> <INDENT> pass | Error class for when the user doesn't specified all the data needed | 62598f8007d97122c42166cc |
class Server(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> def __init__(self, element): <NEW_LINE> <INDENT> self.element = element <NEW_LINE> self.servername = element.get('SERVERNAME') <NEW_LINE> self.ip = element.xpath('./IPADDR')[0].text <NEW_LINE> self.rds = element... | Objet représentant un serveur et ses détails | 62598f801f037a2d8b9e3b12 |
class Refer(Extension): <NEW_LINE> <INDENT> tags = set(['refer']) <NEW_LINE> def parse(self, parser): <NEW_LINE> <INDENT> token = parser.stream.next() <NEW_LINE> lineno = token.lineno <NEW_LINE> tag = token.value <NEW_LINE> parser.stream.expect('name:to') <NEW_LINE> template = parser.parse_expression() <NEW_LINE> parse... | Imports content blocks specified in the referred template as
variables in a given namespace. | 62598f8091af0d3eaad39834 |
class WebsocketServer(ThreadingMixIn, TCPServer, API): <NEW_LINE> <INDENT> def __init__(self, port, host='127.0.0.1', loglevel=logging.WARNING): <NEW_LINE> <INDENT> logger.setLevel(loglevel) <NEW_LINE> self.port = port <NEW_LINE> TCPServer.__init__(self, (host, port), WebSocketHandler) <NEW_LINE> self.allow_reuse_addre... | A websocket server waiting for clients to connect.
Args:
port(int): Port to bind to
host(str): Hostname or IP to listen for connections. By default 127.0.0.1
is being used. To accept connections from any client, you should use
0.0.0.0.
loglevel: Logging level from logging module to use for ... | 62598f80fb3f5b602db47ec5 |
class Callbacks(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.populate_started = CallbackList() <NEW_LINE> self.device_scanned = CallbackList() <NEW_LINE> self.device_added = CallbackList() <NEW_LINE> self.device_removed = CallbackList() <NEW_LINE> self.format_added = CallbackList() <NEW_LIN... | A collection of callbacks for various events
Each trigger/event gets a list of callbacks to run, represented by an
instance of :class:`~.callbacks.CallbackList`. | 62598f8030dc7b766599f282 |
class IndividualRealTimeDimAction(IndividualAction): <NEW_LINE> <INDENT> def __init__(self, dim_speed: int, dim_light_value: int, delay: int, pin_numbers_on: List[int], pin_numbers_off: List[int], arduino: Arduino, button: ButtonPin): <NEW_LINE> <INDENT> super(IndividualAction).__init__(delay, pin_numbers_on, pin_numbe... | Represents a dimmer action for a single arduino | 62598f80c432627299fa29f8 |
class RosaParse(object): <NEW_LINE> <INDENT> def pnodes(self, nodes): <NEW_LINE> <INDENT> for osmid, tags, coord in nodes: <NEW_LINE> <INDENT> if 'amenity' in tags: <NEW_LINE> <INDENT> if tags['amenity'] == "bicycle_rental": <NEW_LINE> <INDENT> create_bicycle_rental(osmid, tags, coord) <NEW_LINE> <DEDENT> <DEDENT> if '... | The OSM parser rules
| 62598f8071ff763f4b5e7197 |
class AITrayIcon(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.makeIndicator() <NEW_LINE> self.thread = GtkThread() <NEW_LINE> self.thread.start() <NEW_LINE> logging.debug("GtkThread started. Do you see AppIndicator?") <NEW_LINE> NotificationCenter().addObserver(self,self.willQuit,"beforeQui... | Adapter and decorator for AppIndicator | 62598f80711fe17d825e0112 |
class StickShaker(MultistateDerivedParameterNode): <NEW_LINE> <INDENT> values_mapping = { 0: '-', 1: 'Shake', } <NEW_LINE> @classmethod <NEW_LINE> def can_operate(cls, available): <NEW_LINE> <INDENT> return any_of(( 'Stick Shaker (L)', 'Stick Shaker (R)', 'Stick Shaker (1)', 'Stick Shaker (2)', 'Stick Shaker (3)', 'Sti... | This accounts for the different types of stick shaker system. Where two
systems are recorded the results are OR'd to make a single parameter which
operates in response to either system triggering. | 62598f8066673b3332c2fdef |
class BodySource(models.Model): <NEW_LINE> <INDENT> def find_source(self): <NEW_LINE> <INDENT> for elem in dir(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> if elem.startswith('_'): <NEW_LINE> <INDENT> continue <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> attribute = getattr(self, elem) <NEW_LINE> <DEDENT> except... | Relation table, used for linking the ServableContent with the multiple
types of sources (file, string and URL) | 62598f80009cb60464d00f57 |
class AndSubstitutePostprocessor(Postprocessor): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def run(self, text): <NEW_LINE> <INDENT> text = text.replace(markdown.AMP_SUBSTITUTE, "&") <NEW_LINE> return text | Restore valid entities | 62598f80a79ad16197769a8b |
class MRunnable: <NEW_LINE> <INDENT> def __init__(self, auto_start=False): <NEW_LINE> <INDENT> self.__running = auto_start <NEW_LINE> <DEDENT> def start(self): <NEW_LINE> <INDENT> self.__running = True <NEW_LINE> <DEDENT> def stop(self): <NEW_LINE> <INDENT> self.__running = False <NEW_LINE> <DEDENT> @property <NEW_LINE... | Provides a runnable mixin to subclasses.
| 62598f801d351010ab8f3569 |
class EventAdmin(TranslatableAdmin): <NEW_LINE> <INDENT> list_display = ['get_title', 'start_date', 'user', 'all_translations', 'get_is_published'] <NEW_LINE> list_select_related = [] <NEW_LINE> def get_title(self, obj): <NEW_LINE> <INDENT> return obj.title <NEW_LINE> <DEDENT> get_title.short_description = _('Title') <... | Admin class for the ``Event`` model. | 62598f80be383301e0253224 |
class TestGetContainingDossier(IntegrationTestCase): <NEW_LINE> <INDENT> features = ( 'bumblebee', ) <NEW_LINE> def test_returns_the_containing_dossier(self): <NEW_LINE> <INDENT> self.login(self.regular_user) <NEW_LINE> adapter = getMultiAdapter((self.document, self.request), IBumblebeeOverlay) <NEW_LINE> self.assertEq... | Test we correctly fetch the immediate parent dossier. | 62598f8007f4c71912baee77 |
class FritzDeviceBinarySensorMock(FritzDeviceBaseMock): <NEW_LINE> <INDENT> alert_state = "fake_state" <NEW_LINE> battery_level = 23 <NEW_LINE> fw_version = "1.2.3" <NEW_LINE> has_alarm = True <NEW_LINE> has_powermeter = False <NEW_LINE> has_switch = False <NEW_LINE> has_lightbulb = False <NEW_LINE> has_temperature_sen... | Mock of a AVM Fritz!Box binary sensor device. | 62598f805f7d997b871f90ed |
class RandomGenerator: <NEW_LINE> <INDENT> def __init__(self, sampling_weights): <NEW_LINE> <INDENT> self.population = list(range(len(sampling_weights))) <NEW_LINE> self.sampling_weights = sampling_weights <NEW_LINE> self.candidates = [] <NEW_LINE> self.i = 0 <NEW_LINE> <DEDENT> def draw(self): <NEW_LINE> <INDENT> if s... | Draw a random int in [0, n] according to n sampling weights. | 62598f8066656f66f7d59e1f |
class Tool(cbmc.Tool): <NEW_LINE> <INDENT> REQUIRED_PATHS = [ "jbmc", "jbmc-binary", "core-models.jar" ] <NEW_LINE> def executable(self): <NEW_LINE> <INDENT> return util.find_executable('jbmc') <NEW_LINE> <DEDENT> def name(self): <NEW_LINE> <INDENT> return 'JBMC' | Tool info for JBMC (http://www.cprover.org/cbmc/).
It always adds --xml-ui to the command-line arguments for easier parsing of
the output, unless a propertyfile is passed -- in which case running under
SV-COMP conditions is assumed. | 62598f80f8510a7c17d7de8d |
class classproperty(property): <NEW_LINE> <INDENT> def __get__(self, cls, owner): <NEW_LINE> <INDENT> return self.fget.__get__(None, owner)() | Declare properties for classes. | 62598f80d6c5a102081e1b73 |
class UserRegistrationFailed(Exception): <NEW_LINE> <INDENT> def __init__(self, response_code, message): <NEW_LINE> <INDENT> super(UserRegistrationFailed, self).__init__(message) <NEW_LINE> self.response_code = response_code | Failed to register the user with the homeserver. | 62598f80507cdc57c63a47b8 |
class BaseGeometry(): <NEW_LINE> <INDENT> def area(self): <NEW_LINE> <INDENT> raise Exception("area() is not implemented") <NEW_LINE> <DEDENT> def integer_validator(self, name, value): <NEW_LINE> <INDENT> if type(value) != int: <NEW_LINE> <INDENT> raise TypeError("{:s} must be an integer".format(name)) <NEW_LINE> <DEDE... | BaseGeometry class | 62598f804e696a045264db16 |
class AbstractList(MessageElement): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(AbstractList, self).__init__(**kwargs) <NEW_LINE> self.items = [] <NEW_LINE> for item in args: <NEW_LINE> <INDENT> self.add(item) <NEW_LINE> <DEDENT> <DEDENT> def add(self, item): <NEW_LINE> <INDENT> i... | A class to model free text in the messaging system | 62598f80004d5f362081ed11 |
class ProductsListView(generics.ListCreateAPIView): <NEW_LINE> <INDENT> serializer_class = ProductSerializer <NEW_LINE> parser_classes = (MultiPartParser,) <NEW_LINE> filter_backends = (DjangoFilterBackend,) <NEW_LINE> filter_fields = ('active',) <NEW_LINE> def get_queryset(self, *args, **kwargs): <NEW_LINE> <INDENT> q... | CBV for all products | 62598f8030c21e258be98236 |
class SlidingWindowScalableBloomFilter(object): <NEW_LINE> <INDENT> def __init__(self, initial_capacity=1000, window_period = "10_Min"): <NEW_LINE> <INDENT> self.initial_capacity = initial_capacity <NEW_LINE> self.error_rate = 0.01 <NEW_LINE> self._setup_window_period(window_period) <NEW_LINE> <DEDENT> def _setup_windo... | Sliding Window Bloom Filter using a coarse expiration | 62598f80c432627299fa29fb |
class AssetFirstSourceField(serializers.URLField): <NEW_LINE> <INDENT> def to_native(self, value): <NEW_LINE> <INDENT> if value.instance.sources.all()[0] is not None: <NEW_LINE> <INDENT> return value.instance.sources.all()[0].file.url <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return None | Serializes the first asset source to a source URL | 62598f80be383301e0253226 |
class LoopTerminator(object): <NEW_LINE> <INDENT> def __init__(self, loop): <NEW_LINE> <INDENT> super(LoopTerminator, self).__init__() <NEW_LINE> self.loop = loop <NEW_LINE> self.exp = loop.exp <NEW_LINE> loop.terminator = self <NEW_LINE> <DEDENT> @property <NEW_LINE> def xml(self): <NEW_LINE> <INDENT> element = Elemen... | A simple class for inserting into the flow.
This is created automatically when the loop is created | 62598f800383005118f6d12e |
@register_snippet <NEW_LINE> class Subject(ClusterableModel, index.Indexed): <NEW_LINE> <INDENT> name = models.CharField(max_length=255, blank=False) <NEW_LINE> libguide_url = models.URLField( max_length=255, null=True, blank=True) <NEW_LINE> display_in_dropdown = models.BooleanField(default=False) <NEW_LINE> panels = ... | Snippet for subjects. | 62598f808da39b475be02c11 |
class Cell(_FortranObjectWithID): <NEW_LINE> <INDENT> __instances = WeakValueDictionary() <NEW_LINE> def __new__(cls, uid=None, new=True, index=None): <NEW_LINE> <INDENT> mapping = cells <NEW_LINE> if index is None: <NEW_LINE> <INDENT> if new: <NEW_LINE> <INDENT> if uid is None: <NEW_LINE> <INDENT> try: <NEW_LINE> <IND... | Cell stored internally.
This class exposes a cell that is stored internally in the OpenMC
library. To obtain a view of a cell with a given ID, use the
:data:`openmc.capi.nuclides` mapping.
Parameters
----------
index : int
Index in the `cells` array.
Attributes
----------
id : int
ID of the cell | 62598f80bde94217f370737c |
class PickledWidget(Textarea): <NEW_LINE> <INDENT> def render(self, name, value, attrs=None, renderer=None): <NEW_LINE> <INDENT> repr_value = repr(value) <NEW_LINE> if attrs is not None: <NEW_LINE> <INDENT> attrs["name"] = name <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> attrs = {"name": name} <NEW_LINE> <DEDENT> att... | This is responsible for outputting HTML representing a given field. | 62598f80fbf16365ca793ad5 |
class Node: <NEW_LINE> <INDENT> def __init__(self, token, term_type): <NEW_LINE> <INDENT> self.token = token <NEW_LINE> self.term_type = term_type | Узел синтаксического дерева | 62598f8016aa5153ce3fff2d |
class SnapCenterWith(SnapBase): <NEW_LINE> <INDENT> def getPosition(self, text: TargetWrapper) -> (int, int): <NEW_LINE> <INDENT> return np.array(text.get_transform().transform(text.target.get_position())) <NEW_LINE> <DEDENT> def getPosition2(self, axes: TargetWrapper) -> int: <NEW_LINE> <INDENT> pos = np.array(axes.fi... | A snap that checks if a text is centered with an axes | 62598f80d10714528d69d8fc |
class ChangePasswordForm(forms.Form): <NEW_LINE> <INDENT> old = forms.CharField(label='Old Password',widget=forms.PasswordInput, required=True) <NEW_LINE> new1 = forms.CharField(label='New Password',widget=forms.PasswordInput, required=True) <NEW_LINE> new2 = forms.CharField(label='Confirm New Password',widget=forms.Pa... | Form to change the password | 62598f80d53ae8145f917ebb |
class Server(session.Session): <NEW_LINE> <INDENT> def __init__(self, dispatcher, loop=None, builder=tcp, pack_encoding='utf-8', unpack_encoding=None): <NEW_LINE> <INDENT> self._loop = loop or Loop() <NEW_LINE> self._builder = builder <NEW_LINE> self._encodings = (pack_encoding, unpack_encoding) <NEW_LINE> self._listen... | Server is usaful for MessagePack RPC Server.
| 62598f8063b5f9789fe84b9e |
class ContentError(Exception): <NEW_LINE> <INDENT> pass | Base class for exceptions in this module. | 62598f80e76e3b2f99fd8461 |
class VarianceRNN(VarianceBaseModule): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__( params=["bias_ih_l0", "bias_hh_l0", "weight_ih_l0", "weight_hh_l0"], grad_extension=GradRNN(), sgs_extension=SGSRNN(), ) | Extension for RNN, calculating variance. | 62598f806e29344779b00090 |
class EncodedTupleMatcher: <NEW_LINE> <INDENT> def __init__(self, text_trainer, tuple_matcher_params: Dict): <NEW_LINE> <INDENT> self.text_trainer = text_trainer <NEW_LINE> if tuple_matcher_params is None: <NEW_LINE> <INDENT> tuple_matcher_params = {} <NEW_LINE> <DEDENT> tuple_matcher_choice = pop_choice_with_default(t... | ``EncodedTupleMatchers`` operate on tuples with shape ``(batch_size, num_slots, embed dimension)``.
In order to do so, this class encodes the original tuple input (using a ``TextTrainer`` object),
then passes it off to an underlying ``Layer`` that computes the match between two tuples with the
above shape.
Parameters
... | 62598f80a17c0f6771d5bc71 |
class click_button_by_text_result: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRUCT, 'actionEx', (ServerActEx, ServerActEx.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, actionEx=None,): <NEW_LINE> <INDENT> self.actionEx = actionEx <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if ipro... | Attributes:
- actionEx | 62598f80d99f1b3c44d050da |
class MultiCommand(Command): <NEW_LINE> <INDENT> allow_extra_args = True <NEW_LINE> def __init__(self, name=None, invoke_without_command=False, no_args_is_help=None, subcommand_metavar='COMMAND [ARGS]...', **attrs): <NEW_LINE> <INDENT> Command.__init__(self, name, **attrs) <NEW_LINE> if no_args_is_help is None: <NEW_LI... | A multi command is the basic implementation of a command that
dispatches to subcommands. The most common version is the
:class:`Command`.
:param invoke_without_command: this controls how the multi command itself
is invoked. By default it's only invoked
if... | 62598f8015baa723494619ac |
class Pause(Command): <NEW_LINE> <INDENT> def execute(self): <NEW_LINE> <INDENT> if not self.character.paused: <NEW_LINE> <INDENT> return self | Command used to occupy a character while they are responding to an
attempted kiss from Eric. | 62598f80c432627299fa29fc |
class Mashup(models.Model): <NEW_LINE> <INDENT> image_file = models.ImageField(upload_to=unique_mashup) <NEW_LINE> title = models.TextField() <NEW_LINE> timestamp = models.DateTimeField(auto_now_add=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return 'Mashup(id={!r}, title={!r})'.format( self.id, self.title) | Stores a mashed-up combination of two images. | 62598f8066673b3332c2fdf3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.