code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class TargetSystem(Protocol): <NEW_LINE> <INDENT> address: str <NEW_LINE> port: int | A target system where attacker commands can be forwarded to. | 62598f7c287bf620b627156a |
class RemoteCaller: <NEW_LINE> <INDENT> def __init__(self, url_prefix: str, auth: Optional[requests.auth.AuthBase] = None) -> None: <NEW_LINE> <INDENT> self.url_prefix = url_prefix <NEW_LINE> self.auth = auth <NEW_LINE> <DEDENT> def put_channel(self, channel: Channel) -> bytes: <NEW_LINE> <INDENT> url = self.url_prefix... | Executes the remote calls to the server. | 62598f7c1d351010ab8f34f0 |
class BoundColumn(LoadableTerm): <NEW_LINE> <INDENT> mask = AssetExists() <NEW_LINE> extra_input_rows = 0 <NEW_LINE> inputs = () <NEW_LINE> def __new__(cls, dtype, missing_value, dataset, name): <NEW_LINE> <INDENT> return super(BoundColumn, cls).__new__( cls, domain=dataset.domain, dtype=dtype, missing_value=missing_va... | A column of data that's been concretely bound to a particular dataset.
Instances of this class are dynamically created upon access to attributes
of DataSets (for example, USEquityPricing.close is an instance of this
class).
Attributes
----------
dtype : numpy.dtype
The dtype of data produced when this column is l... | 62598f7c0a366e3fb87dc37d |
class AbrahamsonEtAl2014NSHMPLower(AbrahamsonEtAl2014): <NEW_LINE> <INDENT> def get_mean_and_stddevs(self, sctx, rctx, dctx, imt, stddev_types): <NEW_LINE> <INDENT> mean, stddevs = super(AbrahamsonEtAl2014NSHMPLower, self). get_mean_and_stddevs(sctx, rctx, dctx, imt, stddev_types) <NEW_LINE> return mean - ng... | Implements the negative NSHMP adjustment factor for the Abrahamson et al.
(2014) NGA West 2 GMPE | 62598f7cac7a0e7691f71eca |
class SolarisBundleVisitor(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.known_classes = ["none", "manifest"] <NEW_LINE> self.errors = set() <NEW_LINE> self.warnings = set() <NEW_LINE> self.visited = False <NEW_LINE> <DEDENT> def visit(self, bundle): <NEW_LINE> <INDENT> if not bundle.pkg: <N... | Used to gather information about the SVR4 packages we visit | 62598f7c10dbd63aa1c70563 |
class And(UserDefinedExpress): <NEW_LINE> <INDENT> def __init__(self, bit_a, bit_b): <NEW_LINE> <INDENT> hamiltonian = bit_a * bit_b <NEW_LINE> super().__init__(hamiltonian) | Logical AND of inputs.
Args:
bit_a (:class:`Express`): expression to be binary
bit_b (:class:`Express`): expression to be binary
Examples:
>>> from pyqubo import Binary, And
>>> import itertools
>>> a, b = Binary('a'), Binary('b')
>>> exp = And(a, b)
>>> model = exp.compile()
>>> ... | 62598f7c1f037a2d8b9e3a9c |
class DummyTable(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.estimator_name = "dummy_table" <NEW_LINE> <DEDENT> def primitive_action_supported(self, interface): <NEW_LINE> <INDENT> supported = 1 <NEW_LINE> return 0.1 if supported else 0 <NEW_LINE> <DEDENT> def estimate... | A dummy estimation plug-in
Note that this plug-in is just a placeholder to illustrate the estimation plug-in interface
It can be used as a template for creating user-defined plug-ins
The energy values returned by this plug-in is not meaningful | 62598f7c1f5feb6acb1625e8 |
class ConnectionInterfaceContactList(dbus.service.Interface): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._interfaces.add('org.freedesktop.Telepathy.Connection.Interface.ContactList') <NEW_LINE> <DEDENT> @dbus.service.method('org.freedesktop.Telepathy.Connection.Interface.ContactList', in_signature... | An interface for connections that have any concept of a list of
known contacts (roster, buddy list, friends list etc.)
On many protocols, there's a server-side roster (as in XMPP),
or a set of server-side lists that can be combined to form a
roster (as in MSN).
In some protocols (like link-local XMPP),... | 62598f7c3eb6a72ae0389ff4 |
class FF_numeric (FundamentalFacet): <NEW_LINE> <INDENT> _Name = 'numeric' <NEW_LINE> _ValueDatatype = datatypes.boolean | Specifies that the associated type represents a number.
See U{http://www.w3.org/TR/xmlschema-2/#rf-numeric} | 62598f7c29b78933be269db4 |
class TestDiveAir40m50min(TestDiveAir, TMethodsMixin): <NEW_LINE> <INDENT> params = ((40, 50), ) | Test air 40m 50min. | 62598f7c50485f2cf55da924 |
class itkGrayscaleGrindPeakImageFilterIF2IF2(itkImageToImageFilterAPython.itkImageToImageFilterIF2IF2): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined... | Proxy of C++ itkGrayscaleGrindPeakImageFilterIF2IF2 class | 62598f7c8e05c05ec3f6eb20 |
class ClientAuth(_BaseAuth): <NEW_LINE> <INDENT> def __init__(self, pkg_name, client_name = None, auth_info = None, targetspn = None, scflags=None, datarep=sspicon.SECURITY_NETWORK_DREP): <NEW_LINE> <INDENT> if scflags is None: <NEW_LINE> <INDENT> scflags = sspicon.ISC_REQ_INTEGRITY|sspicon.ISC_REQ_SEQUENCE_DETECT| ... | Manages the client side of an SSPI authentication handshake
| 62598f7c7b25080760ed6e56 |
class Synthesis_prior_net(nn.Module): <NEW_LINE> <INDENT> def __init__(self, out_channel_N=192, out_channel_M=320): <NEW_LINE> <INDENT> super(Synthesis_prior_net, self).__init__() <NEW_LINE> self.deconv1 = nn.ConvTranspose2d(out_channel_N, out_channel_N, 5, stride=2, padding=2, output_padding=1) <NEW_LINE> torch.nn.ini... | Decode synthesis prior | 62598f7cb830903b9686e14b |
class ScriptPermission(models.Model): <NEW_LINE> <INDENT> script = models.ForeignKey(to=Script, related_name='permissions', null=False, blank=False) <NEW_LINE> user = models.ForeignKey(to=settings.AUTH_USER_MODEL, null=False, blank=False) <NEW_LINE> permission = models.ForeignKey( to='auth.Permission', null=False, blan... | Script permission | 62598f7cd6c5a102081e1afb |
class CgroupFileExtractor(SourceFileExtractor): <NEW_LINE> <INDENT> filename = os.path.join(BPFTOOL_DIR, 'cgroup.c') <NEW_LINE> def get_prog_attach_help(self): <NEW_LINE> <INDENT> return self.get_help_list('ATTACH_TYPE') | An extractor for bpftool's cgroup.c. | 62598f7c07f4c71912baee01 |
class Vector: <NEW_LINE> <INDENT> def __init__(self, x, y, z): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.z = z <NEW_LINE> <DEDENT> def fi(self): <NEW_LINE> <INDENT> return atan2(self.y, self.x) <NEW_LINE> <DEDENT> def theta(self): <NEW_LINE> <INDENT> return acos(self.z / self.modulo()) <NEW_L... | @ Vector: Define un objeto vector en 3D. Contiene los parametros [X,Y,Z] que
permiten ubicarse en el espacio 3D. Provee metodos para transformar entre
sistemas de coordenadas esfericas, cilindricas y cartesianas.
@ Param: x, y, z - componentes del vector, enteros o reales. | 62598f7ca4f1c619b294dfa0 |
class CpuUtilization(Utilization): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Utilization.__init__(self) <NEW_LINE> self.util_calc = CpuUtilizationCalculator(0) <NEW_LINE> <DEDENT> def is_metric(self, values_obj): <NEW_LINE> <INDENT> return (values_obj.plugin == "aggregation" and values_obj.type == "cp... | CpuUtilization gives a 0 <=gauge <=100 of the overall utilization of cpu. | 62598f7c6aa9bd52df0d488d |
class DictWrapper(dict): <NEW_LINE> <INDENT> def __getattr__(self, key): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return wrap(self[key]) <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> return NoneWrapper() <NEW_LINE> <DEDENT> <DEDENT> def __call__(self, path, default = None): <NEW_LINE> <INDENT> v = self <... | A wrapper for :class:`dict` in configurations.
This class allows accessing values using ``self.key``. If ``key`` is not in
``self``, and instance of :class:`NoneWrapper` is returned.
Values can also be accessed by calling this instance thus:
``self('path.to.key', default_value)``.
Values read using ``self.key`` and ... | 62598f7cac7a0e7691f71ecc |
class Default(SimpleFormatter): <NEW_LINE> <INDENT> error_format = "%(path)s:%(row)d:%(col)d: %(code)s %(text)s" <NEW_LINE> def after_init(self) -> None: <NEW_LINE> <INDENT> if self.options.format.lower() != "default": <NEW_LINE> <INDENT> self.error_format = self.options.format | Default formatter for Flake8.
This also handles backwards compatibility for people specifying a custom
format string. | 62598f7c0a366e3fb87dc37f |
class RHRegistrationsExportCSV(RHRegistrationsExportBase): <NEW_LINE> <INDENT> def _process(self): <NEW_LINE> <INDENT> csv_file = generate_csv_from_registrations(self.registrations, self.regform_items, self.special_item_ids) <NEW_LINE> return send_file('registrations.csv', csv_file, 'text/csv') | Export registration list to a CSV file | 62598f7c73bcbd0ca4bc9c04 |
class func_concave(object): <NEW_LINE> <INDENT> def func_value(self,u): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def gradient(self,u): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def conjugate_value(self,y): <NEW_LINE> <INDENT> raise NotImplementedError() | Parent class for all concave functions | 62598f7cf8510a7c17d7de52 |
class MirroredVariable(DistributedVariable, Mirrored, checkpointable.CheckpointableBase): <NEW_LINE> <INDENT> def __init__( self, strategy, device_map, values, aggregation, logical_device=None): <NEW_LINE> <INDENT> super(MirroredVariable, self).__init__( strategy, device_map, values, logical_device=logical_device) <NEW... | Holds a map from device to variables whose values are kept in sync. | 62598f7cec188e330fdf8253 |
class TestOr(TestNFSMBase): <NEW_LINE> <INDENT> def test_or(self): <NEW_LINE> <INDENT> r = NFSM("A|C", 1, "ABC") <NEW_LINE> self.assert_no_references(r) <NEW_LINE> self.assertIn([set("A")], r.chains) <NEW_LINE> self.assertIn([set("C")], r.chains) <NEW_LINE> self.assertEqual(2, len(r.chains)) <NEW_LINE> <DEDENT> def tes... | Tests involving more than one chain but no quantifiers | 62598f7c8a349b6b43685bf7 |
class destroyTable_IDL_args(object): <NEW_LINE> <INDENT> thrift_spec = (None, (1, TType.I32, 'domain_id', None, None), (2, TType.I32, 'table_id', None, None)) <NEW_LINE> def __init__(self, domain_id = None, table_id = None): <NEW_LINE> <INDENT> self.domain_id = domain_id <NEW_LINE> self.table_id = table_id <NEW_LINE> <... | Attributes:
- domain_id
- table_id | 62598f7c596a897236127627 |
class PaginatedTableMixin(SortableTableMixin, FilterMixin): <NEW_LINE> <INDENT> pass | A paginated table mixin (without ajax support, cannot use "Load More"). | 62598f7c50485f2cf55da925 |
class Types_manage(extensions.ExtensionDescriptor): <NEW_LINE> <INDENT> name = "TypesManage" <NEW_LINE> alias = "os-types-manage" <NEW_LINE> updated = "2011-08-24T00:00:00+00:00" <NEW_LINE> def get_controller_extensions(self): <NEW_LINE> <INDENT> controller = ShareTypesManageController() <NEW_LINE> extension = extensio... | Types manage support. | 62598f7cf7d966606f74799c |
class Emoji(commands.Cog): <NEW_LINE> <INDENT> def __init__(self, bot: Bot): <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> self.emoji = re.compile(r"<:.{2,32}:[0-9]{17,19}>") <NEW_LINE> self.exempt = ["Administrator"] <NEW_LINE> <DEDENT> def is_exempt(self, member: discord.Member): <NEW_LINE> <INDENT> roles = [role.nam... | Stop that pesky emoji spam | 62598f7c38b623060ffa8a4c |
class MSSQLHelper(): <NEW_LINE> <INDENT> def __init__(self, host, user, pwd, db): <NEW_LINE> <INDENT> self.host = host <NEW_LINE> self.user = user <NEW_LINE> self.pwd = pwd <NEW_LINE> self.db = db <NEW_LINE> <DEDENT> def __GetConnect(self): <NEW_LINE> <INDENT> if not self.db: <NEW_LINE> <INDENT> raise (NameError, "没有设置... | docstring for MSSQLHelper | 62598f7c8e05c05ec3f6eb21 |
class ScanFromTemplate(ExperimentSetMaker): <NEW_LINE> <INDENT> BATCHFILE = 'batch.sh' <NEW_LINE> VASPINPUTS = ['INCAR', 'KPOINTS', 'POTCAR', 'POSCAR'] <NEW_LINE> def __init__(self, src_dir): <NEW_LINE> <INDENT> assert(os.path.isdir(src_dir)) <NEW_LINE> self.src_dir = src_dir <NEW_LINE> <DEDENT> def make(self, param_li... | alter existing template files to make a set of experiments | 62598f7ca17c0f6771d5bbf8 |
class Feedforward(base.Layer): <NEW_LINE> <INDENT> def transform(self, inputs): <NEW_LINE> <INDENT> def _dot(x, y): <NEW_LINE> <INDENT> if isinstance(x, SS.SparseVariable): <NEW_LINE> <INDENT> return SS.structured_dot(x, y) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return TT.dot(x, y) <NEW_LINE> <DEDENT> <DEDENT> d... | A feedforward neural network layer performs a transform of its input.
More precisely, feedforward layers as implemented here perform an affine
transformation of their input, followed by a potentially nonlinear
"activation" function performed elementwise on the transformed input.
Feedforward layers are the fundamental... | 62598f7c3eb6a72ae0389ff6 |
class _RequestConfig(object): <NEW_LINE> <INDENT> __shared_state = threadinglocal.local() <NEW_LINE> def __getattr__(self, name): <NEW_LINE> <INDENT> return getattr(self.__shared_state, name) <NEW_LINE> <DEDENT> def __setattr__(self, name, value): <NEW_LINE> <INDENT> if name == 'environ': <NEW_LINE> <INDENT> self.load_... | RequestConfig thread-local singleton
The Routes RequestConfig object is a thread-local singleton that should be initialized by
the web framework that is utilizing Routes. | 62598f7c23e79379d538beae |
class TestUserRelationship(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def testUserRelationship(self): <NEW_LINE> <INDENT> pass | UserRelationship unit test stubs | 62598f7c23e79379d538beaf |
class ChapelSpecializer(BaseSpecializer): <NEW_LINE> <INDENT> def __init__(self, template_paths, sfile_paths, bfile_paths): <NEW_LINE> <INDENT> super(ChapelSpecializer, self).__init__( template_paths, sfile_paths, bfile_paths ) <NEW_LINE> <DEDENT> def specialize(self, externs, prefix=True): <NEW_LINE> <INDENT> source =... | Specializer for Chapel code. | 62598f7c07d97122c4216657 |
class List(BaseNode, _SequenceNode): <NEW_LINE> <INDENT> __slots__ = () | The recursion in this rule is flatted into a sequence.
separator_op is a & or ;.
Grammar rules:
list: list separator_op and_or | and_or;
compound_list: term | newline_list term | term separator |
newline_list term separator;
newline_list: NEWLINE | newline_list NEWLINE;
separator: separator_op linebreak | newline_... | 62598f7c4e696a045264dadb |
class RouteCheckSettings(config.Settings): <NEW_LINE> <INDENT> def __init__(self, dest, on_error, non_null=False, nexthops_any=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> if nexthops_any and not non_null: <NEW_LINE> <INDENT> self.logger.info("route to %s has required nexthops, forcing non_null", dest) <NEW... | RouteCheck settings. | 62598f7cb57a9660fecd1433 |
class RuntimeConfig(validation.ValidatedDict): <NEW_LINE> <INDENT> KEY_VALIDATOR = validation.Regex('[a-zA-Z_][a-zA-Z0-9_]*') <NEW_LINE> VALUE_VALIDATOR = str | Class for "vanilla" runtime configuration.
Fields used vary by runtime, so validation is delegated to the per-runtime
build processes.
These are intended to be used during Dockerfile generation, not after VM boot. | 62598f7c287bf620b627156e |
class LogRule(_UnaryFunctionRule): <NEW_LINE> <INDENT> func_name = 'log' | Return new bounds for log. | 62598f7c30c21e258be981be |
class RootController(BaseController): <NEW_LINE> <INDENT> error = ErrorController() <NEW_LINE> movie = MovieController() <NEW_LINE> def _before(self, *args, **kw): <NEW_LINE> <INDENT> tmpl_context.project_name = "myapp" <NEW_LINE> <DEDENT> @expose('myapp.templates.index') <NEW_LINE> def index(self): <NEW_LINE> <INDENT>... | The root controller for the myapp application.
All the other controllers and WSGI applications should be mounted on this
controller. For example::
panel = ControlPanelController()
another_app = AnotherWSGIApplication()
Keep in mind that WSGI applications shouldn't be mounted directly: They
must be wrapped ar... | 62598f7c23849d37ff850a72 |
class EditAuthorForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Author <NEW_LINE> fields = ('name', 'bio') <NEW_LINE> <DEDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(EditAuthorForm, self).__init__(*args, **kwargs) | Form for handling asset updates | 62598f7ce76e3b2f99fd83e9 |
class RegisterModelForm(forms.ModelForm): <NEW_LINE> <INDENT> password1 = forms.CharField(max_length=16, min_length=6, error_messages={ 'required': '密码必填', 'max_length': '密码长度不能大于16个字符', 'min_length': '密码长度必须大于6个字符', } ) <NEW_LINE> password2 = forms.CharField(error_messages={'required': "确认密码必填"}) <NEW_LINE> verify_cod... | 注册表单, 验证 | 62598f7c0a366e3fb87dc381 |
class bm_mt_read_counter_result(object): <NEW_LINE> <INDENT> def __init__(self, success=None, ouch=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> self.ouch = ouch <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReada... | Attributes:
- success
- ouch | 62598f7c21bff66bcd72261c |
class Spider: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.page = 1 <NEW_LINE> self.switch = True <NEW_LINE> <DEDENT> def load_page(self): <NEW_LINE> <INDENT> url = "https://www.neihan8.com/article/list_5_" + str(self.page) + ".html" <NEW_LINE> headers = our_headers <NEW_LINE> req = urllib.request.R... | 爬网站笑话,并进行简单的正则处理 | 62598f7c6fece00bbaccb33d |
class DailyLogParser: <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> self.newstyle_parser = NewStyleLineParser() <NEW_LINE> self.oldstyle_parser = OldStyleLineParser() <NEW_LINE> <DEDENT> def _parse_date(self, event_date_raw: str) -> date: <NEW_LINE> <INDENT> yy = int(event_date_raw[:2]) <NEW_LINE>... | Parses the daily log file. | 62598f7cf8510a7c17d7de53 |
class ModifyRouteTableAttributeResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.RequestId = params.get("RequestId") | ModifyRouteTableAttribute返回参数结构体
| 62598f7cd164cc617582092c |
class _ConsoleLoggingFormatterMuxer(logging.Formatter): <NEW_LINE> <INDENT> def __init__(self, structured_formatter, stream_writter, default_formatter=None): <NEW_LINE> <INDENT> logging.Formatter.__init__(self) <NEW_LINE> self.default_formatter = default_formatter or logging.Formatter <NEW_LINE> self.structured_formatt... | Logging Formatter Composed of other formatters. | 62598f7c07d97122c4216658 |
class Handler: <NEW_LINE> <INDENT> _name = None <NEW_LINE> def get_name(self): <NEW_LINE> <INDENT> if self._name is None: <NEW_LINE> <INDENT> return '{} instance'.format(self.__class__.__name__) <NEW_LINE> <DEDENT> return self._name <NEW_LINE> <DEDENT> def set_name(self, value): <NEW_LINE> <INDENT> self._name = value <... | Handles a mobile page request
This objects knows how to generate the HTTP response for a
specific page on the mobile site. It's a basis for more
specialized services such as moplates. | 62598f7c96565a6dacd2cc54 |
class Time(StartPage,tk.Frame): <NEW_LINE> <INDENT> def __init__(self, parent, controller): <NEW_LINE> <INDENT> tk.Frame.__init__(self, parent) <NEW_LINE> label = tk.Label(self, text="Time", font=LARGE_FONT) <NEW_LINE> label.pack(pady=10,padx=10) <NEW_LINE> data=super(Time,self).getAPI() <NEW_LINE> self.newspr('Time',d... | get articles of particular paper | 62598f7c15baa72349461935 |
class Automation(models.Model): <NEW_LINE> <INDENT> subteam = models.ForeignKey('users.Subteam', blank=True, null=True) <NEW_LINE> human_resource = models.ForeignKey('users.HumanResource', blank=True, null=True) <NEW_LINE> tests_run = models.PositiveIntegerField(default=0) <NEW_LINE> last_success = models.DateTimeField... | Let user upload python script to automatically fetch data from Server: JIRA, ISR, Confluence, Pheme etc. | 62598f7c596a897236127629 |
class RunAtLoad(BoolPair): <NEW_LINE> <INDENT> pass | RunAtLoad config
Example::
config = RunAtLoad() | 62598f7c71ff763f4b5e7122 |
class CustomPropertyValueSchema(AuditingSchema): <NEW_LINE> <INDENT> id = ma.fields.UUID(required=False) <NEW_LINE> value = ma.fields.Str(required=True) <NEW_LINE> definition = ma.fields.Nested(CustomPropertyDefinitionCondensedSchema, many=False, required=True) <NEW_LINE> @ma.pre_dump() <NEW_LINE> def pre_dump(self, da... | A marshmallow schema corresponding to a Qlik Sense Custom Property Value object | 62598f7c94891a1f408b93ca |
class GroupAction(object): <NEW_LINE> <INDENT> def __init__(self, seq): <NEW_LINE> <INDENT> self.seq = seq <NEW_LINE> self.buffer = seq.actions[0].buffer <NEW_LINE> <DEDENT> def undo(self): <NEW_LINE> <INDENT> actions = [] <NEW_LINE> while self.seq.can_undo(): <NEW_LINE> <INDENT> actions.extend(self.seq.undo()) <NEW_LI... | A group action combines several actions into one logical action.
| 62598f7cd99f1b3c44d05063 |
class ConnectionException(CueException): <NEW_LINE> <INDENT> failMsg = 'Unable to contact grpc server. {details}' <NEW_LINE> retryMsg = 'Unable to contact grpc server, checking again...' <NEW_LINE> retryable = True | Raised when unable to connect to grpc server. | 62598f7d16aa5153ce3ffeb6 |
class TestXFrameFromXArray(XFrameUnitTestCase): <NEW_LINE> <INDENT> def test_from_xarray(self): <NEW_LINE> <INDENT> a = XArray([1, 2, 3]) <NEW_LINE> res = XFrame.from_xarray(a, 'id') <NEW_LINE> self.assertEqualLen(3, res) <NEW_LINE> self.assertListEqual(['id'], res.column_names()) <NEW_LINE> self.assertListEqual([int],... | Tests XFrame from_xarray | 62598f7d8e71fb1e983bb46e |
class ResNetV1(ResNet): <NEW_LINE> <INDENT> def __init__(self, block, layers, channels, classes=1000, initial_layers="imagenet", **kwargs): <NEW_LINE> <INDENT> super(ResNetV1, self).__init__(channels, classes, **kwargs) <NEW_LINE> assert len(layers) == len(channels) - 1 <NEW_LINE> self.features.add(nn.BatchNorm(scale=F... | ResNet V1 model from
`"Deep Residual Learning for Image Recognition"
<http://arxiv.org/abs/1512.03385>`_ paper.
Parameters
----------
block : HybridBlock
Class for the residual block. Options are BasicBlockV1, BottleneckV1.
layers : list of int
Numbers of layers in each block
channels : list of int
Numbers... | 62598f7d07d97122c4216659 |
class CorruptedDataSet(Exception): <NEW_LINE> <INDENT> def __init__(self, dataset_name): <NEW_LINE> <INDENT> self.dataset_name = dataset_name | Raised in TimeLineManager when time scale name is not found (is empty)
Attributes:
ts_name -- time scale name | 62598f7d7b25080760ed6e5a |
class Ipv6(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.required = [ "ipv6_subnet","ipv6_start_ip"] <NEW_LINE> self.b_key = "ipv6" <NEW_LINE> self.a10_url="/axapi/v3/classification/ip-list/{listname}/ipv6/{ipv6_subnet}+{ipv6_start_ip}" <NEW_LIN... | Class Description::
Add IPv6 address range to the current IP list.
Class ipv6 supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param ipv6_subnet: {"optional": false, "type": "string", "description": "Specify IPv6 subnet range", "format": "ipv6-add... | 62598f7da05bb46b3848a233 |
class windowTransform(VegaSchema): <NEW_LINE> <INDENT> _schema = {'$ref': '#/defs/windowTransform'} <NEW_LINE> def __init__(self, type=Undefined, fields=Undefined, frame=Undefined, groupby=Undefined, ignorePeers=Undefined, ops=Undefined, params=Undefined, signal=Undefined, sort=Undefined, **kwds): <NEW_LINE> <INDENT> s... | windowTransform schema wrapper
Mapping(required=[type])
Attributes
----------
type : enum('window')
fields : oneOf(List(oneOf(:class:`scaleField`, :class:`paramField`, :class:`expr`, None)),
:class:`signal`)
frame : oneOf(List(anyOf(float, :class:`signal`, None)), :class:`signal`)
groupby : oneOf(List(oneOf(:clas... | 62598f7db57a9660fecd1435 |
class ESTestCase(TestCase): <NEW_LINE> <INDENT> index_name = 'elasticutilstest' <NEW_LINE> mapping_type_name = 'elasticutilsmappingtype' <NEW_LINE> es_settings = { 'urls': ['http://localhost:9200'] } <NEW_LINE> mapping = {} <NEW_LINE> data = [] <NEW_LINE> @classmethod <NEW_LINE> def setup_class(cls): <NEW_LINE> <INDENT... | Superclass for Elasticsearch-using test cases.
:property es_settings: settings to use to build a elasticsearch
Elasticsearch object
:property index_name: Name of the index to use for theses tests
:property mapping_type_name: The mapping type name for the mapping
you want created
:property mapping: The mapping ... | 62598f7d30c21e258be981c1 |
class CountVector(object): <NEW_LINE> <INDENT> def __init__(self, d, l, c, count=1, events=None): <NEW_LINE> <INDENT> self.d = d <NEW_LINE> self.l = l <NEW_LINE> self.c = c <NEW_LINE> self.count = count <NEW_LINE> if events is None: <NEW_LINE> <INDENT> events = Counter() <NEW_LINE> <DEDENT> self.events = [events] <NEW_... | A count vector is in the following format:
d(uplication), l(oss), c(oalescence)
Additionally, this class keeps track of the count,
(number of reconciliations with the count vector). | 62598f7dd99f1b3c44d05064 |
class MaskConvBlock1d(Chain): <NEW_LINE> <INDENT> def __init__(self, in_channels, out_channels, ksize, stride, pad, dilate=1, groups=1, use_bias=False, use_bn=True, bn_eps=1e-5, activation=(lambda: F.relu), dropout_rate=0.0, **kwargs): <NEW_LINE> <INDENT> super(MaskConvBlock1d, self).__init__(**kwargs) <NEW_LINE> self.... | Masked 1D convolution block with batch normalization, activation, and dropout.
Parameters:
----------
in_channels : int
Number of input channels.
out_channels : int
Number of output channels.
ksize : int
Convolution window size.
stride : int
Stride of the convolution.
pad : int
Padding value for co... | 62598f7d6e29344779b00019 |
class RemoteUnixClient(object): <NEW_LINE> <INDENT> def __init__(self, loop, fd, bot): <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> self.fd = fd <NEW_LINE> self.data = b"" <NEW_LINE> self.loop = loop <NEW_LINE> <DEDENT> def on_eof(self): <NEW_LINE> <INDENT> l = self.data.split(b"\n", 1) <NEW_LINE> if len(l) != 2: <NEW... | Represent the other end of a UNIX socket, we read data until EOF, and
then we “parse” it to send the message into the correct room, using bot
instance | 62598f7d82261d6c5272fbaf |
class HookedDriver(object): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self.config = config <NEW_LINE> cmd_ret = exec_command(config, "init") <NEW_LINE> log.info("Init() => {}".format(cmd_ret)) <NEW_LINE> <DEDENT> def create(self, volname, options): <NEW_LINE> <INDENT> if not volname: <NEW_LINE... | Use external commands to implement your plugin | 62598f7d0a366e3fb87dc383 |
class AuthorBiographyManager(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.biographies = {} <NEW_LINE> <DEDENT> def add(self, biography): <NEW_LINE> <INDENT> if not isinstance(biography, AuthorBiography): <NEW_LINE> <INDENT> raise Exception( "This manager only accepts 'AuthorBiography' objec... | Manager for easy access to biography objects in templates. | 62598f7d21a7993f00c65928 |
class PriorityFilter(BaseFilter): <NEW_LINE> <INDENT> def __init__(self, priority): <NEW_LINE> <INDENT> BaseFilter.__init__(self, priority) <NEW_LINE> <DEDENT> def isMatch(self, task): <NEW_LINE> <INDENT> return self.text in task.priority <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "PriorityFilter... | Task list filter allowing only tasks with a certain priority | 62598f7d45492302aabfbe96 |
class ManuallySortedModel(models.Model): <NEW_LINE> <INDENT> sort_priority = models.PositiveSmallIntegerField(default=0) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = True | A model, which can have it's display order manually changed via the admin interface
| 62598f7dd164cc617582092e |
class UncodedError(BoltError): <NEW_LINE> <INDENT> def __init__(self, message=u'Section is not coded yet.'): <NEW_LINE> <INDENT> super(UncodedError, self).__init__(message) | Coding Error: Call to section of code that hasn't been written. | 62598f7da4f1c619b294dfa5 |
class JSON_Encoder(json.JSONEncoder): <NEW_LINE> <INDENT> def default(self, obj): <NEW_LINE> <INDENT> return obj.to_json_dict() | Topo_Diff is not a plain dict, so we provide a json encoder | 62598f7d15fb5d323ce7e6e2 |
class Address(object): <NEW_LINE> <INDENT> def __init__(self, address=None, pubkey=None, prefix="CREA"): <NEW_LINE> <INDENT> self.prefix = prefix <NEW_LINE> if pubkey is not None: <NEW_LINE> <INDENT> self._pubkey = Base58(pubkey, prefix=prefix) <NEW_LINE> self._address = None <NEW_LINE> <DEDENT> elif address is not Non... | Address class
This class serves as an address representation for Public Keys.
:param str address: Base58 encoded address (defaults to ``None``)
:param str pubkey: Base58 encoded pubkey (defaults to ``None``)
:param str prefix: Network prefix (defaults to ``GPH``)
Example::
Address("GPHFN9r6VYzBK8EKtMewfNbfiGCr56... | 62598f7db5575c28eb7129a2 |
class Student(models.Model): <NEW_LINE> <INDENT> SEX_CHOICES = (('M', 'Male'), ('F', 'Female')) <NEW_LINE> index_no = models.CharField(max_length=128, unique=True) <NEW_LINE> first_name = models.CharField(max_length=32) <NEW_LINE> middle_name = models.CharField(max_length=32, blank=True) <NEW_LINE> last_name = models.C... | Student model object | 62598f7d50485f2cf55da92a |
class GetTargets(EntityConnectionField): <NEW_LINE> <INDENT> entity_type = Target <NEW_LINE> @staticmethod <NEW_LINE> @require_authentication <NEW_LINE> def resolve_entities( _root, info: ResolveInfo, filter_string: FilterString = None, after: str = None, before: str = None, first: int = None, last: int = None, ) -> En... | Gets a list of targets with pagination
Args:
filter_string (str, optional): Optional filter string to be
used with query.
Example:
.. code-block::
query {
targets(filterString: "Target"){
nodes{
name
id
}
... | 62598f7d3eb6a72ae0389ffa |
class TkGUIFactory(object): <NEW_LINE> <INDENT> def make_gui(self): <NEW_LINE> <INDENT> raise NotImplementedError('Tk GUI is not yet implemented!') | Class to construct up the GUI frames in a Tk environment. | 62598f7d7b25080760ed6e5c |
class _hookSocket( _socket, forwarder._psockmixin.SocketMixin ): <NEW_LINE> <INDENT> def __init__( self, family: int = socket.AF_INET, type: int = socket.SOCK_STREAM, proto: int = 0, fileno: Optional[int] = None ): <NEW_LINE> <INDENT> _socket.__init__( self, family, type, proto, fileno ) <NEW_LINE> return <NEW_LINE> <D... | This is a snap-in replacement for the socket.socket class.
The connect() end connect_ex() calls have optional the following
parameters:
proxy: str, bytes or tuple with the connection parameters (address, port)
username: str with the username configured in pyforwarder
password: str with the passwor... | 62598f7d07f4c71912baee07 |
class Problem: <NEW_LINE> <INDENT> def __init__(self, id_): <NEW_LINE> <INDENT> self.id = id_ <NEW_LINE> self._solution_module = None <NEW_LINE> self.package_path = Path("problems", self.id) <NEW_LINE> self.samples = Samples(self) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return f"<Problem {self.id!r}... | A Kattis problem-solution pair. | 62598f7d6aa9bd52df0d4893 |
class TestCaseER(Error): <NEW_LINE> <INDENT> pass | Raised when the input value for test cases is zero | 62598f7d15baa72349461938 |
class ShowCryptoPkiServerSchema(MetaParser): <NEW_LINE> <INDENT> schema = { 'server':{ Any(): { 'status': str, 'state': str, 'issuer': str, 'fingerprint': str, Optional('subca_fingerprint'): str, Optional('ra_fingerprint'): str, Optional('ca_type'): str, Optional('grant_mode'): str, Optional('last_serial_num'): str, 'c... | Schema for show crypto pki server | 62598f7d7c178a314d78ce63 |
class ResourcePoolClosedError(Exception): <NEW_LINE> <INDENT> pass | Resource pool closed | 62598f7d10dbd63aa1c7056b |
class GeometryTypes(IntFlag): <NEW_LINE> <INDENT> NONE = 0 <NEW_LINE> POINT = 1 <NEW_LINE> LINESTRING = 2 <NEW_LINE> POLYGON = 4 <NEW_LINE> GEOMETRY = 7 <NEW_LINE> CURVE = 8 <NEW_LINE> MULTIPOINT = 17 <NEW_LINE> MULTILINESTRING = 18 <NEW_LINE> MULTIPOLYGON = 20 <NEW_LINE> GEOMETRYCOLLECTION = 23 | Supported geometry types. | 62598f7d73bcbd0ca4bc9c0a |
class BlockHasNoAddresses(Exception): <NEW_LINE> <INDENT> pass | There was no addresses key in this block | 62598f7d45492302aabfbe98 |
class ImportBo(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def import_translations(file): <NEW_LINE> <INDENT> logger.info('Start of importing translations process') <NEW_LINE> wb = xlrd.open_workbook(file_contents=file.read()) <NEW_LINE> sheet = wb.sheets()[0] <NEW_LINE> init_data_row, id_col, translation_col... | Class that encapsulated the task of importing all the translations from an excel file | 62598f7d6fece00bbaccb341 |
class ScriptError(Error): <NEW_LINE> <INDENT> pass | Base class for script errors. | 62598f7ddc8b845886d52f70 |
class DetectProductBetaRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ImageUrl = None <NEW_LINE> self.ImageBase64 = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.ImageUrl = params.get("ImageUrl") <NEW_LINE> self.ImageBase64 = params.get("Imag... | DetectProductBeta请求参数结构体
| 62598f7d8a43f66fc4bf1b39 |
@dataclasses.dataclass <NEW_LINE> class DPToAttributeMapping: <NEW_LINE> <INDENT> ep_attribute: str <NEW_LINE> attribute_name: str <NEW_LINE> converter: Optional[ Callable[ [ Any, ], Any, ] ] = None <NEW_LINE> endpoint_id: Optional[int] = None | Container for datapoint to cluster attribute update mapping. | 62598f7d94891a1f408b93cc |
class UserException(Exception): <NEW_LINE> <INDENT> CODE = None | For errors which should NOT produce a traceback - they should be caught,
the message written to the CLI, then the program should quit with the specified
error code | 62598f7dbe383301e02531b4 |
class ssd1306(device): <NEW_LINE> <INDENT> def __init__(self, serial_interface=None, width=128, height=64, rotate=0): <NEW_LINE> <INDENT> super(ssd1306, self).__init__(luma.oled.const.ssd1306, serial_interface) <NEW_LINE> self.capabilities(width, height, rotate) <NEW_LINE> settings = { (128, 64): dict(multiplex=0x3F, d... | Encapsulates the serial interface to the monochrome SSD1306 OLED display
hardware. On creation, an initialization sequence is pumped to the display
to properly configure it. Further control commands can then be called to
affect the brightness and other settings. | 62598f7d30c21e258be981c5 |
class CompressionAlgorithm: <NEW_LINE> <INDENT> name = None <NEW_LINE> compression_speed = None <NEW_LINE> compression_ratio = None <NEW_LINE> decompression_speed = None <NEW_LINE> def __init__(self, name, compression_speed, compression_ratio, decompression_speed): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.c... | Describes a compression algorithm. This file should only have public data
members. | 62598f7dd99f1b3c44d05068 |
class ActionInvalid(Exception): <NEW_LINE> <INDENT> def __init__(self, action, message="action must be 0 or 1 or 2"): <NEW_LINE> <INDENT> self.action = action <NEW_LINE> self.message = "action : " + str(action) + " is not valid. \n" + message <NEW_LINE> super().__init__(self.message) | Exception raised for invalid action | 62598f7dac7a0e7691f71ed4 |
class log_with(object): <NEW_LINE> <INDENT> ENTRY_MESSAGE = 'Entering {}' <NEW_LINE> EXIT_MESSAGE = 'Exiting {}' <NEW_LINE> def __init__(self, logger=None): <NEW_LINE> <INDENT> self.logger = logger <NEW_LINE> <DEDENT> def __call__(self, func): <NEW_LINE> <INDENT> if not self.logger: <NEW_LINE> <INDENT> logging.basicCon... | Logging decorator that allows you to log with a
specific logger. | 62598f7dbde94217f3707344 |
class Beta(ScalarLikelihood): <NEW_LINE> <INDENT> def __init__( self, invlink: Callable[[tf.Tensor], tf.Tensor] = inv_probit, scale: float = 1.0, **kwargs: Any, ) -> None: <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.scale = Parameter(scale, transform=positive()) <NEW_LINE> self.invlink = invlink <NEW... | This uses a reparameterisation of the Beta density. We have the mean of the
Beta distribution given by the transformed process:
m = invlink(f)
and a scale parameter. The familiar α, β parameters are given by
m = α / (α + β)
scale = α + β
so:
α = scale * m
β = scale * (1-m) | 62598f7d21a7993f00c6592c |
class Command(BaseCommand): <NEW_LINE> <INDENT> help = ("Example: bin/django lw_task_worker " "--task_code 120 " "--log_level DEBUG " "--worker_nr 1") <NEW_LINE> option_list = BaseCommand.option_list + ( make_option('--task_code', help='task that worker must perform, equals to queue cod... | Run task worker. The worker listens to the queue
with the same code as task code, retrieves message,
performs task, sends logging to 'logging' queue. | 62598f7d30dc7b766599f215 |
class ShowIpOspfMplsTrafficEngLink(ShowIpOspfMplsTrafficEngLink_iosxe): <NEW_LINE> <INDENT> pass | Parser for "show ip ospf mpls traffic-eng link" | 62598f7d8a349b6b43685bff |
class InvalidPartitionNumber(Exception): <NEW_LINE> <INDENT> pass | Raise if the requested partition index is out of range.
| 62598f7d07d97122c421665e |
class CSVolumeManager(DUVolumeManager): <NEW_LINE> <INDENT> def __init__(self, list_path, password_provider=None, dry_run=False): <NEW_LINE> <INDENT> self.list_path = list_path <NEW_LINE> DUVolumeManager.__init__(self, password_provider=password_provider, dry_run=dry_run) <NEW_LINE> <DEDENT> def cs_generate_list_file(s... | CoreStorage volume. | 62598f7d1d351010ab8f34fb |
class IntersectionFilter(TopologyFilter): <NEW_LINE> <INDENT> def filter(self, qs, value): <NEW_LINE> <INDENT> if not value: <NEW_LINE> <INDENT> return qs <NEW_LINE> <DEDENT> return qs.filter(geom__intersects=value.geom) | Inherit from ``TopologyFilter``, just to make sure the widgets
will be initialized the same way. | 62598f7dbe8e80087fbbea1f |
class BitlistRemote(PyLiS): <NEW_LINE> <INDENT> def __init__(self, bitlength, device): <NEW_LINE> <INDENT> super().__init__(device) <NEW_LINE> self.data = [0] * bitlength <NEW_LINE> self.bit_positions = {} <NEW_LINE> <DEDENT> def set_bit_positions(self, **positions): <NEW_LINE> <INDENT> self.bit_positions.update(positi... | Base class for remotes having their own state coded in bits. | 62598f7d507cdc57c63a4748 |
class Meta: <NEW_LINE> <INDENT> ordering = ['position'] | Metadata for Project model fields | 62598f7d8e05c05ec3f6eb25 |
class LimitedStream(io.IOBase): <NEW_LINE> <INDENT> def __init__(self, stream, limit, buf_size=64 * 1024 * 1024): <NEW_LINE> <INDENT> self.stream = stream <NEW_LINE> self.remaining = limit <NEW_LINE> self.buffer = b'' <NEW_LINE> self.buf_size = buf_size <NEW_LINE> <DEDENT> def _read_limited(self, size=None): <NEW_LINE>... | LimitedStream wraps another stream in order to not allow
reading from it past specified amount of bytes.
>>> import io
>>> bio = io.BytesIO(b"some -- long -- byte string")
>>> lbio = LimitedStream(bio, 4)
>>> lbio.read()
b'some'
>>> lbio.read()
b''
>>> bio = io.BytesIO(b"s\nome -- long -- byte string")
>>> lbio = Lim... | 62598f7d29b78933be269db9 |
class TClonesArrayItemAccess(unittest.TestCase): <NEW_LINE> <INDENT> num_elems = 3 <NEW_LINE> def create_tclonesarray_and_list(self): <NEW_LINE> <INDENT> ca = ROOT.TClonesArray("TObject", self.num_elems) <NEW_LINE> l = [ ROOT.TObject() for _ in range(self.num_elems) ] <NEW_LINE> return ca, l <NEW_LINE> <DEDENT> def tes... | Test for the item access method added to TClonesArray:
__setitem__. | 62598f7d004d5f362081ecd9 |
class eventData: <NEW_LINE> <INDENT> def __init__(self , theta , phi , deltaTheta , deltaPhi , angle , angleUncertainty): <NEW_LINE> <INDENT> self.theta = theta * 90 / (np.pi) - 45 <NEW_LINE> self.phi = phi * 90 / (np.pi) <NEW_LINE> self.deltaTheta = deltaTheta * 90 / ( np.pi) <NEW_LINE> self.deltaPhi =... | The minimum information needed for backprojection is the unit direction vector between events, and the Compton cone
angle, as well as the uncertainty in those values. This class acts a simple data structure that holds that information. | 62598f7d63f4b57ef0085a4c |
class _LoggerHook(tf.train.SessionRunHook): <NEW_LINE> <INDENT> def begin(self): <NEW_LINE> <INDENT> self._step = -1 <NEW_LINE> self._start_time = time.time() <NEW_LINE> <DEDENT> def before_run(self, run_context): <NEW_LINE> <INDENT> self._step += 1 <NEW_LINE> return tf.train.SessionRunArgs(loss) <NEW_LINE> <DEDENT> de... | Logs loss and runtime. | 62598f7d38b623060ffa8a54 |
class Obstacle(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, game, x, y, w, h): <NEW_LINE> <INDENT> self._layer = WALL_LAYER <NEW_LINE> self.groups = game.walls <NEW_LINE> pygame.sprite.Sprite.__init__(self, self.groups) <NEW_LINE> self.game = game <NEW_LINE> self.rect = pygame.Rect(x, y, w, h) <NEW_LIN... | this manage wall | 62598f7dd10714528d69d88c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.