code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class RaftServicer(object): <NEW_LINE> <INDENT> def RequestVote(self, request, context): <NEW_LINE> <INDENT> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!') <NEW_LINE> <DEDENT> def AppendEntries(sel... | Raft gRPC implementation
| 62598eeaaad79263cf42cf32 |
class RunTestGDBNativeGDBServer_c32t32(BuildAndTestGDBFactory): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.extra_CFLAGS = ["-m32"] <NEW_LINE> self.extra_CXXFLAGS = self.extra_CFLAGS <NEW_LINE> self.extra_make_check_flags = [ "RUNTESTFLAGS=--target_board native-gdbserver/-m32" ] <NEW_LINE... | Compiling on 32-bit, testing native-gdbserver on 32-bit. | 62598eea66656f66f7d58b08 |
class Debugger(addons.AddOn): <NEW_LINE> <INDENT> def __init__(self, app): <NEW_LINE> <INDENT> self.variables = dict( app=app, chandler=chandler, peak=peak, wx=imports.lazyModule('wx'), ) | Application add-on that lets you publish variables to debug tools | 62598eea23849d37ff84f7de |
class DentistsIndexView(DentalSystemListView): <NEW_LINE> <INDENT> template_name = 'dentists/index.html' <NEW_LINE> page_title = 'Dentists Dashboard' <NEW_LINE> order_by_default = ['-created_time', '-id'] <NEW_LINE> def dispatch(self, request, *args, **kwargs): <NEW_LINE> <INDENT> return super(DentistsIndexView, self).... | handle product category list
/products/ | 62598eea2ae34c7f260a980e |
class CompositeForm(forms.Form): <NEW_LINE> <INDENT> form_list = None <NEW_LINE> def __init__(self, data=None, files=None, field_order=None, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(data, files, field_order=None, *args, **kwargs) <NEW_LINE> self._form_instances = OrderedDict() <NEW_LINE> for form in self.... | Helper class to handle form composition.
Usage::
class ProfileForm(CompositeForm):
form_list = [ProfileAddressForm, ProfileBirthDayForm]
Ripped from https://github.com/t0ster/django-composite-form | 62598eea7b25080760ed5bc1 |
class TestCrfItemMetadataRpc(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return CrfItemMetad... | CrfItemMetadataRpc unit test stubs | 62598eea99fddb7c1ca62198 |
class PetitionTypeDAO(): <NEW_LINE> <INDENT> __instance__ = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> if PetitionTypeDAO.__instance__ is None: <NEW_LINE> <INDENT> PetitionTypeDAO.__instance__ = self <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise Exception("You cannot create another PetitionTypeDAO cl... | Class to handle all database operations
for models.PetitionType class. | 62598eeab7558d5895461d6d |
class Proposal(_SimpleAttr): <NEW_LINE> <INDENT> def __init__(self, proposal_id: str): <NEW_LINE> <INDENT> super().__init__(proposal_id) | Unique identifier for a proposal.
.. note::
One `~dkist.net.attrs.Proposal` can consist of many
`~dkist.net.attrs.Experiment` which can consist of many datasets.
Parameters
----------
proposal_id : `str`
A unique identifier for a proposal. | 62598eea63d6d428bbee0ef5 |
class HomeAssistantTCPSite(web.BaseSite): <NEW_LINE> <INDENT> __slots__ = ("_host", "_port", "_reuse_address", "_reuse_port", "_hosturl") <NEW_LINE> def __init__( self, runner: web.BaseRunner, host: None | str | list[str], port: int, *, shutdown_timeout: float = 10.0, ssl_context: SSLContext | None = None, backlog: int... | HomeAssistant specific aiohttp Site.
Vanilla TCPSite accepts only str as host. However, the underlying asyncio's
create_server() implementation does take a list of strings to bind to multiple
host IP's. To support multiple server_host entries (e.g. to enable dual-stack
explicitly), we would like to pass an array of st... | 62598eea26068e7796d4b083 |
class AsistenteConfirmacion(Asistente): <NEW_LINE> <INDENT> def __init__(self, controlador, data, data_key=None, repetir=True): <NEW_LINE> <INDENT> if len(data) == 1: <NEW_LINE> <INDENT> self.controlador = controlador <NEW_LINE> self.elegir(None) <NEW_LINE> self.es_interactivo = False <NEW_LINE> <DEDENT> else: <NEW_LIN... | Asistente para confirmacion de voto. | 62598eea8da39b475be018d3 |
class PortUtilityTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.mock_portutil = Mock(spec=PortUtil) <NEW_LINE> self.mock_portutil.num_ports = 3 <NEW_LINE> self.mock_portutil.auto_ports = '/dev/cu.usbmodem7321' <NEW_LINE> self.mock_portutil.count_ports.return_value = self.mock_por... | Test for PortUtil methods | 62598eeadd821e528d6d766c |
class LabelVolume(ISimpleITKImageMetric): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.metric = "LBLVOL" <NEW_LINE> <DEDENT> def calculate(self): <NEW_LINE> <INDENT> return _calculate_volume(self.ground_truth) | Represents a label (ground truth) volume metric. | 62598eea91f36d47f2230237 |
class Capitalize(Raw): <NEW_LINE> <INDENT> def format(self, value): <NEW_LINE> <INDENT> return str(value).capitalize() | Capitalizes the first letter of the string | 62598eea3d592f4c4edb961e |
class TestAutoScalingModuleWarmup(googletest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> api_server.test_setup_stubs() <NEW_LINE> self.mox = mox.Mox() <NEW_LINE> self.mox.StubOutWithMock(module.Module, 'build_request_environ') <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self.mox.... | Tests for module.AutoScalingModule._warmup. | 62598eea3539df3088eca9d9 |
class Adam(): <NEW_LINE> <INDENT> def __init__(self, learning_rate = 1e-3, beta_1 = 0.9, beta_2 = 0.999, epsilon = 1e-8): <NEW_LINE> <INDENT> self.learning_rate = learning_rate <NEW_LINE> self.beta_1 = beta_1 <NEW_LINE> self.beta_2 = beta_2 <NEW_LINE> self.epsilon = epsilon <NEW_LINE> self.m = None <NEW_LINE> self.v = ... | Class that implements an Adam optimisation.
It is currently the recommended optimisation methods to update the weights.
It is often worth trying out the Nesterov momentum SGD as an alternative. | 62598eeae5267d203ee6a02e |
class Clusters(object): <NEW_LINE> <INDENT> def __init__(self, n_clusters, cluster_labels, name): <NEW_LINE> <INDENT> self._n_clusters = n_clusters <NEW_LINE> self._cluster_labels = cluster_labels <NEW_LINE> self._unique_labels = set(cluster_labels) <NEW_LINE> self._name = name <NEW_LINE> <DEDENT> def __str__(self): <N... | Cluster object containing all information
to seperate hosts in several clusters
This is the abstract main class, one should instanciate one of its subclass
either KmeansClusters or DbscanClusters | 62598eea99cbb53fe682f5da |
class CommonClkEnable(CommonClkBase): <NEW_LINE> <INDENT> unique_word = "clock_enable:" | Corresponds to Linux kernel trace event clock_enable | 62598eea7047854f4633dafc |
class InternalError(DatabaseError): <NEW_LINE> <INDENT> pass | Exception raised for internal errors reported by the database. | 62598eeaaad79263cf42cf33 |
class ConsistencyWarning(Warning): <NEW_LINE> <INDENT> pass | Warns for a problem in the consistency of data | 62598eea442bda511e95ab8a |
class Bucketlist(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'bucketlists' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String(80)) <NEW_LINE> created_by = db.Column(db.Integer, db.ForeignKey('users.email')) <NEW_LINE> date_created = db.Column(db.DateTime, default=datetime.u... | creates bucket lists | 62598eea851cf427c66b69ef |
class ClamPizza(CheesePizza): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ClamPizza, self).__init__() <NEW_LINE> self.name = 'clam pizza' <NEW_LINE> self.toppings.append('clam') | Clam and cheese pizza | 62598eea56ac1b37e6300916 |
class NonNullSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> def to_representation(self, instance): <NEW_LINE> <INDENT> ret = OrderedDict() <NEW_LINE> fields = [field for field in self.fields.values() if not field.write_only] <NEW_LINE> for field in fields: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> attr... | This overrides the ModelSerializer to skip keys with null values.
http://stackoverflow.com/a/28870066/373402 | 62598eea57b8e32f52507499 |
class CERNEDMSSearchEngine(SortedFieldsSearchEngine): <NEW_LINE> <INDENT> def __init__(self, configuration): <NEW_LINE> <INDENT> super(CERNEDMSSearchEngine, self).__init__(configuration) <NEW_LINE> self.base_url = 'http://edms.cern.ch' <NEW_LINE> self.search_url = 'http://edms.cern.ch/search?' <NEW_LINE> self.fields = ... | CERN EDMS | 62598eea56b00c62f0fb0ff9 |
class TensorIteratorLSTM(MiddleReplacementPattern): <NEW_LINE> <INDENT> enabled = False <NEW_LINE> def run_after(self): <NEW_LINE> <INDENT> return [TensorIteratorMerge, LSTMSequenceNormalize, LSTMSequenceTensorIterator, TensorFlowLSTMtoGeneric] <NEW_LINE> <DEDENT> def pattern(self): <NEW_LINE> <INDENT> return dict( nod... | Detects TensorIterator with LSTMCell of supported form.
Collect original operation names of supported LSTMCells in
the list LSTMCell.instances_supported_by_IE. It will be used at the second
round of the network translation. Mark all supported LSTMCell with flag
supported_by_IE to have a chance to detect all not-suppor... | 62598eea4428ac0f6e656c7c |
class Fixed(_LearningRate): <NEW_LINE> <INDENT> pass | The simplest type of learning rate. It is just a fixed value. | 62598eea1f037a2d8b9e2830 |
@unittest.skipUnless(hasattr(os, 'fwalk'), "Test needs os.fwalk()") <NEW_LINE> class FwalkTests(WalkTests): <NEW_LINE> <INDENT> def _compare_to_walk(self, walk_kwargs, fwalk_kwargs): <NEW_LINE> <INDENT> for topdown, followlinks in itertools.product((True, False), repeat=2): <NEW_LINE> <INDENT> d = {'topdown': topdown, ... | Tests for os.fwalk(). | 62598eeaeab8aa0e5d30a4a4 |
class pyMutantIterator(object): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def __init__(self, base: 'GenoIterator', begin: 'size_t', end: 'size_t', step: 'size_t'): <NEW_LINE> <INDENT> _simuPOP_l... | Details:
this class implements a Python itertor class that can be used to
iterate through individuals in a (sub)population. If allInds are
true, visiblility of individuals will not be checked. Otherwise, a
functor will be used to check if indiviudals belong to a specified
virtual subpopulation. An... | 62598eea4e4d562566370b43 |
class LocalTaubQwalkSubmitter(LocalTaubSubmitter): <NEW_LINE> <INDENT> def _submit_job(self,inpfns,outfn="stdout",jobname="",loc=""): <NEW_LINE> <INDENT> prep_commands=[] <NEW_LINE> final_commands=[] <NEW_LINE> qid=[] <NEW_LINE> for f in inpfns: <NEW_LINE> <INDENT> exe = self.bin+"qwalk %s"%f <NEW_LINE> fulloutfn = f+o... | Fully defined submission class. Defines interaction with specific
program to be run. | 62598eeaf548e778e5969cb5 |
class Query(object): <NEW_LINE> <INDENT> def query_box(self,ra, dec, base, height, catalog): <NEW_LINE> <INDENT> base_str, height_str = str(base) + 'deg', str(height) + 'deg' <NEW_LINE> catalog = str(catalog) <NEW_LINE> query_result = Vizier.query_region(coord.SkyCoord(ra=ra, dec=dec, frame='icrs'), width=base_str, hei... | Querying galaxy within an user-defined FoV. | 62598eeafff4ab517ebcbf01 |
class White(Token): <NEW_LINE> <INDENT> whiteStrs = { " " : "<SPC>", "\t": "<TAB>", "\n": "<LF>", "\r": "<CR>", "\f": "<FF>", } <NEW_LINE> def __init__(self, ws=" \t\r\n", min=1, max=0, exact=0): <NEW_LINE> <INDENT> super(White,self).__init__() <NEW_LINE> self.matchWhite = ws <NEW_LINE> self.setWhitespaceChars( "".join... | Special matching class for matching whitespace. Normally, whitespace is ignored
by pyparsing grammars. This class is included when some whitespace structures
are significant. Define with a string containing the whitespace characters to be
matched; default is C{" \t\r\n"}. Also takes optional C{min}, C{max}, and C{e... | 62598eea5fdd1c0f98e5c6cb |
class AttributeVariation: <NEW_LINE> <INDENT> def __init__(self, iterable=(), **kwargs): <NEW_LINE> <INDENT> self.val_step = None <NEW_LINE> self.__dict__.update(iterable, **kwargs) <NEW_LINE> assert hasattr(self, "comp_name"), "comp_name missing" <NEW_LINE> assert hasattr(self, "comp_attribute"), "{}: comp_attribute m... | Class that contains all information about an attribute that is varied by the genetic algorithm
:param comp_name: name of component that gets varied
:type comp_name: string
:param comp_attribute: component attribute that gets varied
:type comp_attribute: string
:param val_min: minimum value of component attribute
:type... | 62598eea8c0ade5d55dc2a16 |
class _SelfCallCollector(ast.NodeVisitor): <NEW_LINE> <INDENT> def __init__(self, class_): <NEW_LINE> <INDENT> super(_SelfCallCollector, self).__init__() <NEW_LINE> self.self_calls = defaultdict(list) <NEW_LINE> self.class_ = class_ <NEW_LINE> self.mro = inspect.getmro(class_) <NEW_LINE> self.mro_names = set([c.__name_... | An ast.NodeVisitor that records calls to self.* methods. | 62598eeaa8370b77170eeb0d |
class Gmake(AutotoolsPackage): <NEW_LINE> <INDENT> homepage = "https://www.gnu.org/software/make/" <NEW_LINE> url = "https://ftp.gnu.org/gnu/make/make-4.2.1.tar.gz" <NEW_LINE> version('4.2.1', '7d0dcb6c474b258aab4d54098f2cf5a7') <NEW_LINE> version('4.0', 'b5e558f981326d9ca1bfdb841640721a') <NEW_LINE> variant('gu... | GNU Make is a tool which controls the generation of executables and
other non-source files of a program from the program's source files. | 62598eea8da39b475be018d5 |
class MozillianResponse(object): <NEW_LINE> <INDENT> def __init__(self, content=None, status_code=200): <NEW_LINE> <INDENT> self.content = content <NEW_LINE> self.status_code = status_code | Mozillians Response. | 62598eea3d592f4c4edb9620 |
class RealEnvROS2(gym.Env): <NEW_LINE> <INDENT> metadata = {'render.modes': ['human']} <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> rclpy.init(args=None) <NEW_LINE> self.node = rclpy.create_node('real_env_ros2') <NEW_LINE> <DEDENT> def _step(self, action): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> ... | Superclass for all Gazebo environments.
| 62598eeae5267d203ee6a030 |
class CompileRest(PageCompiler): <NEW_LINE> <INDENT> name = "rest" <NEW_LINE> def compile_html(self, source, dest): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> os.makedirs(os.path.dirname(dest)) <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> error_level = 100 <NEW_LINE> with codecs.open(dest,... | Compile reSt into HTML. | 62598eea7cff6e4e811b4118 |
class FFT(Node): <NEW_LINE> <INDENT> def __init__(self, needs=None, axis=-1, padding_samples=0): <NEW_LINE> <INDENT> super(FFT, self).__init__(needs=needs) <NEW_LINE> self._axis = axis <NEW_LINE> self._padding_samples = padding_samples <NEW_LINE> <DEDENT> def _process(self, data): <NEW_LINE> <INDENT> yield fft(data, ax... | A processing node that performs an FFT of a real-valued signal
Args:
axis (int): The axis over which the FFT should be computed
padding_samples (int): number of zero samples to pad each window with
before applying the FFT
needs (Node): a processing node on which this one depends
See Also:
:cla... | 62598eea4527f215b58e8631 |
@final <NEW_LINE> class EmptyCommentViolation(TokenizeViolation): <NEW_LINE> <INDENT> error_template = 'Found empty comment' <NEW_LINE> code = 464 | Forbid empty comments.
Empty comments are only allowed in between valid comments.
Reasoning:
Empty comments that do not help formatting should be excluded.
Solution:
Remove the empty comments.
Example::
# Correct:
# First line
#
# Samples:
# One
# Two
my_var = 1
# Wrong:
... | 62598eea99cbb53fe682f5dc |
class ExternalRequestsGet(BaseHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> v = self.get_argument('v', '2.10.0') <NEW_LINE> self.write(ex_requests.test_external_requests_get(v)) | :param v: 作为参数传入,控制版本
:return: | 62598eea21bff66bcd72137e |
class SiteContactMessageModelTest(EmailSendingTestCaseMixin, TestCase): <NEW_LINE> <INDENT> def test_email_sent_on_save(self): <NEW_LINE> <INDENT> self.check_backend() <NEW_LINE> name = 'Jane Doe' <NEW_LINE> email = 'jane@doe.com' <NEW_LINE> phone = '123-456-7890' <NEW_LINE> message_body = ("I am interested in your sit... | Test methods of the SiteContactMessge model | 62598eea32920d7e50bc4756 |
class Fib(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Fib, self).__init__() <NEW_LINE> self._a = 0 <NEW_LINE> self._b = 1 <NEW_LINE> <DEDENT> def __call__(self): <NEW_LINE> <INDENT> self._a, self._b = self._b, self._a + self._b <NEW_LINE> return self._a, self._b | docstring for Fib | 62598eea851cf427c66b69f2 |
class Calc: <NEW_LINE> <INDENT> def __init__(self, odds_oracle: OddsOracle): <NEW_LINE> <INDENT> self.odds_oracle = odds_oracle <NEW_LINE> self.pql = Pql(self.odds_oracle) <NEW_LINE> <DEDENT> def equity(self, players: list, board: str = None, dead: str = None, hero_only: bool = False): <NEW_LINE> <INDENT> if hero_only:... | Class to make various general calculations | 62598eeadc8b845886d51cee |
class NlaClient(object): <NEW_LINE> <INDENT> def __init__(self, ID=None, key=None, level=None, keyword_level=None): <NEW_LINE> <INDENT> self.version = STT_VERSION <NEW_LINE> self.ID = ID <NEW_LINE> self.key = key <NEW_LINE> self.level = level <NEW_LINE> self.keyword_level = keyword_level <NEW_LINE> self.sttUrl = API_FR... | Class for Natural Language Analysis
| 62598eea10dbd63aa1c6f29f |
class Employee(UserMixin, db.Model): <NEW_LINE> <INDENT> __tablename__ = 'employees' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> email = db.Column(db.String(60), index=True, unique=True) <NEW_LINE> username = db.Column(db.String(60), index=True, unique=True) <NEW_LINE> first_name = db.Column(db.S... | Create an Employee table | 62598eea4428ac0f6e656c7e |
class LstDataset(object): <NEW_LINE> <INDENT> def __init__(self, lst_file, label_parser, flag=1, transform=None): <NEW_LINE> <INDENT> self._flag = flag <NEW_LINE> self._transform = transform <NEW_LINE> self._label_dict = {} <NEW_LINE> self._exts = ['.png', '.jpg', '.bmp'] <NEW_LINE> self.synsets = [] <NEW_LINE> self.it... | A dataset for loading from lst files, line store (image_path, label_path) pair fomat like::
/home/user/dataset/test1.jpg /home/user/dataset/test2.txt
/home/user/dataset/help1.png /home/user/dataset/help2.txt
......
/home/user/dataset2/help1.png /home/user/dataset2/help2.txt
path have no constaint in fo... | 62598eea92d797404e387f10 |
class EventLog(models.Model): <NEW_LINE> <INDENT> name = models.CharField(u'事件名称', max_length=100) <NEW_LINE> event_type_choices = ( (1, u'硬件变更'), (2, u'新增配件'), (3, u'设备下线'), (4, u'设备上线'), (5, u'定期维护'), (6, u'业务上线\更新\变更'), (7, u'其它') ) <NEW_LINE> event_type = models.SmallIntegerField(u'事件类型', choices=event_type_choices... | 事件日志信息 | 62598eeaaad79263cf42cf36 |
class PropertyGenerator(QueryGenerator): <NEW_LINE> <INDENT> def __init__(self, prop: str, **kwargs): <NEW_LINE> <INDENT> kwargs = self._clean_kwargs(kwargs, prop=prop) <NEW_LINE> super().__init__(**kwargs) <NEW_LINE> self._props = frozenset(prop.split('|')) <NEW_LINE> self.resultkey = 'pages' <NEW_LINE> <DEDENT> @prop... | Iterator for queries of type action=query&prop=foo.
See the API documentation for types of page properties that can be
queried.
This iterator yields one or more dict object(s) corresponding
to each "page" item(s) from the API response; the calling module has to
decide what to do with the contents of the dict. There w... | 62598eea1f037a2d8b9e2832 |
class Site: <NEW_LINE> <INDENT> def __init__(self, row=None, col=None): <NEW_LINE> <INDENT> self.row = row <NEW_LINE> self.col = col <NEW_LINE> self.content = None <NEW_LINE> self.text_id = None <NEW_LINE> self.rect_id = None <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '[{}]'.format(self.content) ... | Class representing a cell site.
Data attributes:
row - row number in the cell layout
col - column number in the cell layout
content - pointer to Node element if occupied, None otherwise
text_id - canvas ID of site label, set to the Node number of content
rect_id - canvas ID of site rectangle | 62598eea5166f23b2e241b03 |
class ForceReply(ReplyMarkup): <NEW_LINE> <INDENT> def __init__(self, force_reply, selective=None): <NEW_LINE> <INDENT> super(ForceReply, self).__init__() <NEW_LINE> assert_type_or_raise(force_reply, bool, parameter_name="force_reply") <NEW_LINE> self.force_reply = force_reply <NEW_LINE> assert_type_or_raise(selective,... | Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot‘s message and tapped ’Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.
Example: A po... | 62598eea4e4d562566370b45 |
class UsbTest(BaseTest): <NEW_LINE> <INDENT> exec_dir = '' <NEW_LINE> exec_file = 'dd' <NEW_LINE> times_over = 5 <NEW_LINE> kbit_rates = (2500, 3000, 5000, 6000, ) <NEW_LINE> usbDevice = '/dev/sda2' <NEW_LINE> count =10 <NEW_LINE> s_block_size = '16M' <NEW_LINE> directions = { 'input': {'source' : usbDevice , 'destina... | Class 'UsbTest' is based on 'BaseTest'. Only functions which relate to program
'dd' and its output are subclassed. Most of the intelligence and
"housekeeping" is inherited straight from the base class.
A lot of stuff is defined at class level; this is done to facilitate
tweaking of parameters (e.g. 'spiPort') in derive... | 62598eeaf548e778e5969cb7 |
class Event: <NEW_LINE> <INDENT> def __getitem__(self, item): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> def import_dict(self, dic): <NEW_LINE> <INDENT> self.euid = str(dic["euid"]) <NEW_LINE> self.uuid = str(dic["uuid"]) <NEW_LINE> self.timestamp = dic["timestamp"] <NEW_LINE> self.level = dic["level"] <NEW_LI... | This class defines an Event. | 62598eea63b5f9789fe83888 |
class DeprecateHelpFormatter(argparse.HelpFormatter): <NEW_LINE> <INDENT> def add_usage(self, usage, actions, groups, prefix=None): <NEW_LINE> <INDENT> helpers.deprecate_warn_cmd('info', 'iotlab-status', 19) <NEW_LINE> return super().add_usage(usage, actions, groups, prefix) | Add drepecate help formatter | 62598eea460517430c430bb3 |
class ParserMacroCapture(jinja2.Undefined): <NEW_LINE> <INDENT> def __init__(self, hint=None, obj=None, name=None, exc=None): <NEW_LINE> <INDENT> super(ParserMacroCapture, self).__init__(hint=hint, name=name) <NEW_LINE> self.node = node <NEW_LINE> self.name = name <NEW_LINE> self.package_name = node.get('package_name')... | This class sets up the parser to capture macros. | 62598eeaa8ecb0332586f915 |
class Template(BuiltinTemplate, MacrosTemplate): <NEW_LINE> <INDENT> def compile(klass, *args, **kwargs): <NEW_LINE> <INDENT> def replacer(match): <NEW_LINE> <INDENT> return "$SNIPPET('%s')" % match.group(1) <NEW_LINE> <DEDENT> def preprocess(source, file): <NEW_LINE> <INDENT> if source is None: <NEW_LINE> <INDENT> if ... | This class will allow us to include any pure python builtin functions.
It derives from the cheetah-compiled class above. This way, we can include
both types (cheetah and pure python) of builtins in the same base template.
We don't need to override __init__ | 62598eea3cc13d1c6d463e9c |
class Cf2ConfigDialog(QtGui.QWidget, service_dialog_class): <NEW_LINE> <INDENT> connected_signal = pyqtSignal(str) <NEW_LINE> disconnected_signal = pyqtSignal(str) <NEW_LINE> def __init__(self, helper, *args): <NEW_LINE> <INDENT> super(Cf2ConfigDialog, self).__init__(*args) <NEW_LINE> self.setupUi(self) <NEW_LINE> self... | Tab for update the Crazyflie firmware and for reading/writing the config
block in flash | 62598eea71ff763f4b5e5e89 |
class ServiceRequestTimeoutError(ServiceRequestError): <NEW_LINE> <INDENT> pass | Error raised when timeout happens | 62598eeacc0a2c1114479730 |
class BatchError(Error): <NEW_LINE> <INDENT> pass | Error occured during batch operations. | 62598eea009cb60464cffc7a |
class RequestType(Enum): <NEW_LINE> <INDENT> UPDATE = 1 <NEW_LINE> CHECK_POLICIES = 2 <NEW_LINE> CHECK_POLICY_COMPLIANCE = 3 | Enumeration of the service available methods. | 62598eeaaad79263cf42cf37 |
class Encoder(object, metaclass=RegisterMeta): <NEW_LINE> <INDENT> R <NEW_LINE> def __init__(self, *args): <NEW_LINE> <INDENT> self.args = args <NEW_LINE> <DEDENT> def encode(self): <NEW_LINE> <INDENT> return json.dumps({ 'class': self.__class__.__name__, 'args': self.args, }) | 派生クラスをJSON形式へエンコードする | 62598eea4c34283577618a10 |
class commonModels: <NEW_LINE> <INDENT> class StillLifes: <NEW_LINE> <INDENT> Block = PrototypeGame.buildPlayground("AA,AA") <NEW_LINE> Beehive = PrototypeGame.buildPlayground("DAA,ADDA,ADDA,DAA") <NEW_LINE> Loaf = PrototypeGame.buildPlayground("DAA,ADDA,DADA,DDA") <NEW_LINE> Boat = PrototypeGame.buildPlayground("AA,AD... | A library of the most common structures in the Conway's Game of Life.
Source: https://conwaylife.com/wiki/Category:Lists_of_patterns | 62598eead486a94d0ba2a6fa |
class CellHelpers(object): <NEW_LINE> <INDENT> def __init__(self, sheet, resizerInstance=None): <NEW_LINE> <INDENT> self.sheet = sheet <NEW_LINE> self.resizer = resizerInstance <NEW_LINE> self.row = -1 <NEW_LINE> self.col = -1 <NEW_LINE> <DEDENT> def snapTo(self, row, col): <NEW_LINE> <INDENT> if row>=0 and ((row!=self... | CellHelpers is a container include CellResizer that will shows up
whenever the Ctrl key is hold down and the mouse hovers the cell. | 62598eeabe8e80087fbbd77c |
class Group(Base, AutoInitMixin): <NEW_LINE> <INDENT> __tablename__ = 'group_group' <NEW_LINE> __searchable__ = True <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> slug = Column(SlugType(field='title'), nullable=False, unique=True) <NEW_LINE> creator_id = Column(Integer, ForeignKey(User.id), nullable=True... | The group model. | 62598eea85dfad0860cbedfe |
class RemoteUserCustomTest(RemoteUserTest): <NEW_LINE> <INDENT> backend = 'django.contrib.auth.tests.remote_user.CustomRemoteUserBackend' <NEW_LINE> known_user = 'knownuser@example.com' <NEW_LINE> known_user2 = 'knownuser2@example.com' <NEW_LINE> def test_known_user(self): <NEW_LINE> <INDENT> super(RemoteUserCus... | Tests a custom RemoteUserBackend subclass that overrides the clean_username
and configure_user methods. | 62598eea2c8b7c6e89bd1eee |
class Webhook(object): <NEW_LINE> <INDENT> exposed = True <NEW_LINE> tag_base = ['salt', 'netapi', 'hook'] <NEW_LINE> _cp_config = dict(LowDataAdapter._cp_config, **{ 'tools.lowdata_fmt.on': True, 'tools.salt_token.on': True, 'tools.salt_auth.on': True, }) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.opts = ... | A generic web hook entry point that fires an event on Salt's event bus
External services can POST data to this URL to trigger an event in Salt.
For example, Amazon SNS, Jenkins-CI or Travis-CI, or GitHub web hooks.
.. note:: Be mindful of security
Salt's Reactor can run any code. A Reactor SLS that responds to a... | 62598eeaeab8aa0e5d30a4a8 |
class Grid(): <NEW_LINE> <INDENT> def __init__(self, size): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> self.data = np.zeros(self.size.get_vals(), dtype=np.uint8) <NEW_LINE> self.max_steps = 0 <NEW_LINE> <DEDENT> def get_val(self, location): <NEW_LINE> <INDENT> return self.data[location.x_val, location.y_val] <NEW_... | Stores the data about the grid and tree | 62598eeaf548e778e5969cb8 |
class FetchURL(object): <NEW_LINE> <INDENT> def __init__(self, url, pmdaObject=None, timeout=TIMEOUT): <NEW_LINE> <INDENT> self.url = url <NEW_LINE> self.pmda = pmdaObject <NEW_LINE> self.timeout = timeout <NEW_LINE> self.code = None <NEW_LINE> self.resp = None <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> def... | External threaded class to fetch a url | 62598eea99cbb53fe682f5df |
class MicrosoftProvider(Provider): <NEW_LINE> <INDENT> def __init__(self, apikey, lang, gender, ttype, rate, volume, pitch, contour): <NEW_LINE> <INDENT> self._apikey = apikey <NEW_LINE> self._lang = lang <NEW_LINE> self._gender = gender <NEW_LINE> self._type = ttype <NEW_LINE> self._output = DEFAULT_OUTPUT <NEW_LINE> ... | The Microsoft speech API provider. | 62598eeaadb09d7d5dc08cf5 |
class AdminSiteWithExternalAuth(AdminExternalAuthMixin, AdminSite): <NEW_LINE> <INDENT> pass | A Django ``AdminSite`` that uses project-level authentication views. | 62598eebb7558d5895461d73 |
class TestObservation: <NEW_LINE> <INDENT> def test_string(self, observation): <NEW_LINE> <INDENT> assert observation.__str__() == observation.motif <NEW_LINE> <DEDENT> def test_save(self): <NEW_LINE> <INDENT> observation = FacObservation() <NEW_LINE> import time <NEW_LINE> time.sleep(1 / 100) <NEW_LINE> observation.sa... | Class to test observtion model | 62598eeb435de62698e9a502 |
class Link(LinkBase): <NEW_LINE> <INDENT> def __init__( self, context: "SpanContext", attributes: types.Attributes = None, ) -> None: <NEW_LINE> <INDENT> super().__init__(context) <NEW_LINE> self._attributes = attributes <NEW_LINE> <DEDENT> @property <NEW_LINE> def attributes(self) -> types.Attributes: <NEW_LINE> <INDE... | A link to a `Span`.
Args:
context: `SpanContext` of the `Span` to link to.
attributes: Link's attributes. | 62598eebfff4ab517ebcbf05 |
class RandomFlip(object): <NEW_LINE> <INDENT> def __init__(self, threshold): <NEW_LINE> <INDENT> self.flip_t = threshold <NEW_LINE> <DEDENT> def __call__(self, sample): <NEW_LINE> <INDENT> image, segmentation = sample['image'], sample['segmentation'] <NEW_LINE> if np.random.rand() < self.flip_t: <NEW_LINE> <INDENT> ima... | Randomly flip image | 62598eeb8da39b475be018d9 |
class CreateTargetInput(graphene.InputObjectType): <NEW_LINE> <INDENT> name = graphene.String(required=True, description="Target name.") <NEW_LINE> hosts = graphene.List( graphene.String, required=True, description="List of hosts to scan" ) <NEW_LINE> exclude_hosts = graphene.List( graphene.String, description="List of... | Input object for createTarget | 62598eeb30bbd72246468361 |
class CloudErrorBody(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } <NEW_LINE> def __init__( self, *, code: ... | An error response from the Batch service.
:param code: An identifier for the error. Codes are invariant and are intended to be consumed
programmatically.
:type code: str
:param message: A message describing the error, intended to be suitable for display in a user
interface.
:type message: str
:param target: The targ... | 62598eeb3346ee7daa3369ff |
class HighImpactAssociationsGraphContext(object): <NEW_LINE> <INDENT> openapi_types = { 'nps_column_header_id': 'int' } <NEW_LINE> attribute_map = { 'nps_column_header_id': 'npsColumnHeaderId' } <NEW_LINE> def __init__(self, nps_column_header_id=None, local_vars_configuration=None): <NEW_LINE> <INDENT> if local_vars_co... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598eebd486a94d0ba2a6fb |
class UserProfile(AbstractUser): <NEW_LINE> <INDENT> nick_name = models.CharField(max_length=20,null=True,blank=True) <NEW_LINE> permissions = models.IntegerField(default=3,blank=True,null=True) | 用户 | 62598eebd7e4931a7ef3a7cc |
class SetRetirementDate(Base): <NEW_LINE> <INDENT> _date_edit_field_locator = (By.CSS_SELECTOR, "input#miq_date_1") <NEW_LINE> _retirement_warning_edit_field_locator = (By.CSS_SELECTOR, "select#retirement_warn") <NEW_LINE> _save_button_locator = (By.CSS_SELECTOR, "ul#form_buttons > li > img[title='Save Changes']") <NEW... | Class to set retirement dates of vms | 62598eeb71ff763f4b5e5e8b |
class BatchedTasksListGenerator(object): <NEW_LINE> <INDENT> OLD_SUFFIX = '.old' <NEW_LINE> def __init__(self, tasks_per_node): <NEW_LINE> <INDENT> self._tasks_per_node = int(tasks_per_node) <NEW_LINE> <DEDENT> def _write_batched_task_config(self, bconfig, configfile): <NEW_LINE> <INDENT> if os.path.isfile(configfile):... | Creates Batched Jobs List file used by chmrunner.py
| 62598eeb4e4d562566370b48 |
class Utils: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def base64(data): <NEW_LINE> <INDENT> return base64.b64encode(data.encode()).decode() | Extra utils for url builder. | 62598eeb7047854f4633db02 |
class EndpointServicesListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[EndpointServiceResult]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, value: Optional[List["EndpointServiceResult"]] = None, next_link: Option... | Response for the ListAvailableEndpointServices API service call.
:param value: List of available endpoint services in a region.
:type value: list[~azure.mgmt.network.v2018_11_01.models.EndpointServiceResult]
:param next_link: The URL to get the next set of results.
:type next_link: str | 62598eeb9c8ee8231303f4f0 |
class BooleanSerializePipeline(SerializePipeline): <NEW_LINE> <INDENT> pass | BooleanSerializePipeline
.. seealso::
:class:`kim.pipelines.serialization.SerializePipeline` | 62598eeb851cf427c66b69f5 |
class Trickerton(Simpleton): <NEW_LINE> <INDENT> def _vote(self, team): <NEW_LINE> <INDENT> return self == self.game.leader or random.choice([True, False]) <NEW_LINE> <DEDENT> def sabotage(self): <NEW_LINE> <INDENT> return self.game.turn > 1 | A configuration-based logical reasoning bot with better spy behavior. | 62598eeb7d847024c075aafc |
class IndexedFileDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, filename, index_filename=None, extract_target_fn=None, transform=None, target_transform=None, loader=image_loader): <NEW_LINE> <INDENT> super(IndexedFileDataset, self).__init__() <NEW_LINE> if index_filename is None: <NEW_LINE> <INDENT> index_fil... | A dataset that consists of an indexed file (with sample offsets in
another file). For example, a .tar that contains image files.
The dataset does not extract the samples, but works with the indexed
file directly.
NOTE: The index file is assumed to be a pickled list of 3-tuples:
(name, offset, size). | 62598eeb38b623060ffa77c9 |
class Distinct(TableExpr): <NEW_LINE> <INDENT> __slots__ = 'child', <NEW_LINE> @property <NEW_LINE> def schema(self): <NEW_LINE> <INDENT> return self.child.schema <NEW_LINE> <DEDENT> @property <NEW_LINE> def iscolumn(self): <NEW_LINE> <INDENT> return self.child.iscolumn | Distinct elements filter
>>> t = TableSymbol('t', '{name: string, amount: int, id: int}')
>>> e = distinct(t)
>>> data = [('Alice', 100, 1),
... ('Bob', 200, 2),
... ('Alice', 100, 1)]
>>> from blaze.compute.python import compute
>>> sorted(compute(e, data))
[('Alice', 100, 1), ('Bob', 200, 2)] | 62598eebaad79263cf42cf3a |
class BouncingBalls(TemporalSeries): <NEW_LINE> <INDENT> def load(self, path): <NEW_LINE> <INDENT> data = np.load(path) <NEW_LINE> X = data[:, :-1, :] <NEW_LINE> y = data[:, 1:, :] <NEW_LINE> return (X, y) <NEW_LINE> <DEDENT> def theano_vars(self): <NEW_LINE> <INDENT> return [T.ftensor3('x'), T.ftensor3('y')] | Bouncing balls batch provider
Parameters
----------
.. todo:: | 62598eeb92d797404e387f12 |
class MajorVersionMismatchError(OnionPyError): <NEW_LINE> <INDENT> def __init__(self, msg): <NEW_LINE> <INDENT> self.msg = msg <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.msg | Raised when OnionOO response major version is higher than supported major version | 62598eeb85dfad0860cbedff |
class UpdateAlarmRequest(JDCloudRequest): <NEW_LINE> <INDENT> def __init__(self, parameters, header=None, version="v2"): <NEW_LINE> <INDENT> super(UpdateAlarmRequest, self).__init__( '/groupAlarms/{alarmId}', 'PUT', header, version) <NEW_LINE> self.parameters = parameters | 修改已创建的报警规则 | 62598eeb66656f66f7d58b10 |
class Comment(MainHandler, PostsHandler, CommentsHandler): <NEW_LINE> <INDENT> def get(self, post_id): <NEW_LINE> <INDENT> user_id, user = self.get_user() <NEW_LINE> if not user: <NEW_LINE> <INDENT> self.redirect('/blog/login') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> post = self.get_post(post_id) <NEW_LINE> if no... | Posts new comments on blog posts. | 62598eeb2ae34c7f260a9816 |
class BitType16(BitType): <NEW_LINE> <INDENT> _size_ = 2 <NEW_LINE> _ctype_ = _int_type_ = c_int16 | A bit type represented by a signed 16-bit integer. | 62598eeb5fdd1c0f98e5c6d0 |
class Meta: <NEW_LINE> <INDENT> table_name = "announcement" | announcement table metadata | 62598eeb2ae34c7f260a9817 |
class SignalCallWarning(Warning): <NEW_LINE> <INDENT> pass | signal method called normally or regular method called as signal | 62598eebfff4ab517ebcbf07 |
class FablogPayments(models.Model): <NEW_LINE> <INDENT> fablog = models.ForeignKey( Fablog, on_delete=models.SET_NULL, null=True) <NEW_LINE> payment = models.OneToOneField( "cashier.Payment", on_delete=models.PROTECT) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = _('associated Payment') <NEW_LINE> verbose_n... | intermediate table linking Fablogs and Payments | 62598eebbaa26c4b54d4d9fd |
class RequiredParametersError(ValueError): <NEW_LINE> <INDENT> pass | Custom error to denote when the proper parameters are not present | 62598eeba8ecb0332586f919 |
class SPUser(AbstractUser): <NEW_LINE> <INDENT> pass | A custom user model. (inherits from default django user model) | 62598eeb4e4d562566370b4a |
class RegPull(EvalMetric): <NEW_LINE> <INDENT> def __init__(self, return_mean:bool, use_bootstrap:bool=False, use_pull:bool=True, name:Optional[str]=None, main_metric:bool=True): <NEW_LINE> <INDENT> if name is None: <NEW_LINE> <INDENT> name = 'pull' if use_pull else 'delta' <NEW_LINE> <DEDENT> super().__init__(name=nam... | Compute mean or standard deviation of delta or pull of some feature which is being directly regressed to.
Optionally, use bootstrap resampling on validation data.
Arguments:
return_mean: whether to return the mean or the standard deviation
use_bootstrap: whether to bootstrap resamples validation fold when comp... | 62598eebf9cc0f698b1c4666 |
class FlaskRequestAttribute(logging.Filter): <NEW_LINE> <INDENT> def __init__(self, attributes=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.attributes = attributes if attributes else list() <NEW_LINE> <DEDENT> def filter(self, record): <NEW_LINE> <INDENT> for attribute in self.attributes: <NEW_LINE> <I... | Logging Flask attributes record
This filter adds Flask request context attributes to the log record.
Flask request attributes are added as record attributes with the 'flask_request_' prefix. | 62598eebcb5e8a47e493b511 |
class module_organizer(): <NEW_LINE> <INDENT> def organize_modules(self): <NEW_LINE> <INDENT> for root, dir, fil in os.walk(data_folder): <NEW_LINE> <INDENT> for directory in dir: <NEW_LINE> <INDENT> for fname in os.listdir(root + os.sep + directory): <NEW_LINE> <INDENT> abs_path = root + os.sep + directory + os.sep + ... | This class performs functionality takes the processed logs from a new computer and adds them
to an existing data folder so that we do not have to recompute the dataframe from scratch again | 62598eebdc8b845886d51cf4 |
class PubSub(FolioApi): <NEW_LINE> <INDENT> def get_eventTypes(self): <NEW_LINE> <INDENT> return self.call("GET", "/pubsub/event-types") <NEW_LINE> <DEDENT> def set_eventType(self, eventType: dict): <NEW_LINE> <INDENT> return self.call("POST", "/pubsub/event-types", data=eventType) <NEW_LINE> <DEDENT> def get_eventType... | PubSub API
API for event-driven approach | 62598eeb10dbd63aa1c6f2a5 |
class SumOfParams(Cost): <NEW_LINE> <INDENT> def __call__(self, model, X, Y = None): <NEW_LINE> <INDENT> assert Y is None <NEW_LINE> return sum(param.sum() for param in model.get_params()) | A cost that is just the sum of all parameters, so the gradient
on every parameter is 1. | 62598eeb4428ac0f6e656c84 |
class OneSampleDifferenceMeans(ClassicalHypothesis): <NEW_LINE> <INDENT> def __init__(self, hyp_mean, mean, n, stddev, alpha, rejection): <NEW_LINE> <INDENT> ClassicalHypothesis.__init__(self, hyp_mean, mean, n, stddev, alpha, rejection) <NEW_LINE> self.hyp_mean = hyp_mean <NEW_LINE> self.mean = mean | Compares a random sample mean to a popsulation mean for
difference.
Requirements
------------
1. Random sample
2. Population from which sample is drawn is normally distributed.
3. Variable is measured at interval or ratio scale.
Null Hypthothesis
-----------------
sample mean = hythothesized mean
Test Statistic
---... | 62598eeb32920d7e50bc475c |
class TagSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Tag <NEW_LINE> fields = ('id', 'name') <NEW_LINE> read_only_fields = ('id',) | Serializer for tag objects. | 62598eeb379a373c97d97727 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.