code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Plugin: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._schemeSubPlugin = _SchemeReplPlugin() <NEW_LINE> self._smlSubPlugin = _SmlReplPlugin() <NEW_LINE> self._pythonSubPlugin = _PythonReplPlugin() <NEW_LINE> <DEDENT> def terminate(self): <NEW_LINE> <INDENT> self._schemeSubPlugin.terminate() <NE... | Module implementation
| 62598ef63539df3088ecab45 |
class User(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> name = models.CharField(verbose_name='user name', max_length=255, unique=True) <NEW_LINE> email = models.EmailField(verbose_name='email address', max_length=100, unique=True) <NEW_LINE> created_at = models.DateTimeField(verbose_name='注册日期', auto_now_ad... | 重写user类 | 62598ef630bbd722464684ce |
class StandardResultsSetPagination(LimitOffsetPagination): <NEW_LINE> <INDENT> default_limit = 10 <NEW_LINE> max_limit = 1000 <NEW_LINE> @staticmethod <NEW_LINE> def link_rewrite(request, link): <NEW_LINE> <INDENT> url = link <NEW_LINE> version = "v{}/".format(API_VERSION) <NEW_LINE> if PATH_INFO in request.META: <NEW_... | Create standard paginiation class with page size. | 62598ef62c8b7c6e89bd205e |
class LocalFileSystem(FileSystem): <NEW_LINE> <INDENT> def __init__(self, base_path): <NEW_LINE> <INDENT> self._base_path = _ConvertToFilepath(base_path) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def Create(): <NEW_LINE> <INDENT> return LocalFileSystem(os.path.join(sys.path[0], os.pardir, os.pardir)) <NEW_LINE> <DED... | FileSystem implementation which fetches resources from the local
filesystem. | 62598ef663b5f9789fe839f7 |
class WatchedFile(FileWrapper): <NEW_LINE> <INDENT> def __init__(self,file,fs,path,mode=None): <NEW_LINE> <INDENT> super(WatchedFile,self).__init__(file,mode) <NEW_LINE> self.fs = fs <NEW_LINE> self.path = path <NEW_LINE> self.was_modified = False <NEW_LINE> <DEDENT> def _write(self,string,flushing=False): <NEW_LINE> <... | File wrapper for use with WatchableFS.
This file wrapper provides access to a file opened from a WatchableFS
instance, and fires MODIFIED events when the file is modified. | 62598ef621bff66bcd7214ef |
class Solution: <NEW_LINE> <INDENT> node_vals = [] <NEW_LINE> def traver(self, root): <NEW_LINE> <INDENT> if root == None: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> self.traver(root.left) <NEW_LINE> self.node_vals.append(root.val) <NEW_LINE> self.traver(root.right) <NEW_LINE> <DEDENT> def inorderTraversal(self, ro... | @param root: A Tree
@return: Inorder in ArrayList which contains node values. | 62598ef6cc0a2c1114479899 |
class CollectionInvalid(PyMongoError): <NEW_LINE> <INDENT> pass | Raised when collection validation fails. | 62598ef691f36d47f22302f0 |
class ManageTerm(QWidget): <NEW_LINE> <INDENT> def __init__(self, gridview): <NEW_LINE> <INDENT> self.grid_view = gridview <NEW_LINE> super().__init__() <NEW_LINE> vbox = QVBoxLayout(self) <NEW_LINE> self.group_select = KeySelect(changed_callback = self.group_changed) <NEW_LINE> vbox.addWidget(QLabel(_GROUP)) <NEW_LINE... | The controls for managing term grades.
| 62598ef6796e427e5384d032 |
class Detection(object): <NEW_LINE> <INDENT> def __init__(self, tlwh, confidence, feature, classIndex): <NEW_LINE> <INDENT> self.tlwh = np.asarray(tlwh, dtype=np.float) <NEW_LINE> self.confidence = float(confidence) <NEW_LINE> self.feature = np.asarray(feature, dtype=np.float32) <NEW_LINE> self.classIndex = classIndex ... | This class represents a bounding box detection in a single image.
Parameters
----------
tlwh : array_like
Bounding box in format `(x, y, w, h)`.
confidence : float
Detector confidence score.
feature : array_like
A feature vector that describes the object contained in this image.
Attributes
----------
tlwh... | 62598ef6aad79263cf42d0a7 |
class TuyaScene(TuyaDevice, Scene): <NEW_LINE> <INDENT> def __init__(self, tuya): <NEW_LINE> <INDENT> super().__init__(tuya) <NEW_LINE> self.entity_id = ENTITY_ID_FORMAT.format(tuya.object_id()) <NEW_LINE> <DEDENT> def activate(self, **kwargs: Any) -> None: <NEW_LINE> <INDENT> self.tuya.activate() | Tuya Scene. | 62598ef676e4537e8c3ede51 |
class Listing(Container): <NEW_LINE> <INDENT> processor = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.parser = InsetParser() <NEW_LINE> self.output = TaggedOutput().settag('div class="listing"', True) <NEW_LINE> self.numbered = None <NEW_LINE> <DEDENT> def process(self): <NEW_LINE> <INDENT> self.counte... | A code listing | 62598ef692d797404e387fc8 |
class ExperimentBox(QFrame, BindingEnabledWidget): <NEW_LINE> <INDENT> remove_requested = pyqtSignal(object) <NEW_LINE> def __init__(self, cannot_be_removed=False, experiment_folder=None, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self._cannot_be_removed = cannot_be_removed <NEW_... | This widget is the visual representation of an experiment box on the experiment frame | 62598ef6656771135c487f23 |
class RecieveSubmittedDocumentView(PrivilegedReceiveObject): <NEW_LINE> <INDENT> def receive(self): <NEW_LINE> <INDENT> document = super(RecieveSubmittedDocumentView, self).receive() <NEW_LINE> history_data = advancedjson.loads(self.request.get('history_data')) <NEW_LINE> response = ProposalResponse.deserialize(history... | Lock submitted documents after recieving them. | 62598ef6bf627c535bcafd0b |
class WingPlotter(TwoDimensionalPlotter): <NEW_LINE> <INDENT> def __init__( self, input_folder, output_folder, save_file, force_flag, display_flag ): <NEW_LINE> <INDENT> super(WingPlotter, self).__init__( input_folder, output_folder, save_file, force_flag, display_flag ) <NEW_LINE> self.axes[0].set_xlabel("T (s)") <NEW... | Plots wing quantities | 62598ef64527f215b58e879b |
class RayTraceMinTemperatureEngine(RayTraceEngine): <NEW_LINE> <INDENT> def __init__(self, family): <NEW_LINE> <INDENT> super(RayTraceMinTemperatureEngine, self).__init__(family, "T2") <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def is_map_engine_for(cls, map_type): <NEW_LINE> <INDENT> return map_type == "mintemperatur... | Computes the minimum temperature along each ray | 62598ef6091ae356687034b2 |
class AngrGDBResetCommand(gdb.Command): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super( AngrGDBResetCommand, self).__init__("angrgdb reset", gdb.COMMAND_USER) <NEW_LINE> <DEDENT> def invoke(self, arg, from_tty): <NEW_LINE> <INDENT> global _ctx <NEW_LINE> self.dont_repeat() <NEW_LINE> _ctx = CommandsC... | Reset the context fo angrgdb | 62598ef65fcc89381b265575 |
class RemoteLauncher(Launcher): <NEW_LINE> <INDENT> def __init__(self, hostname, username): <NEW_LINE> <INDENT> self.ssh = paramiko.SSHClient() <NEW_LINE> self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) <NEW_LINE> self.ssh.connect(hostname, username=username) <NEW_LINE> <DEDENT> def configure_remote_data... | Used to launch shell commands on remote machines via ssh as well
as deal with input file and resulting output file transfers | 62598ef6ff9c53063f518efb |
class CreateToolTip(object): <NEW_LINE> <INDENT> def __init__(self, widget, text='widget info'): <NEW_LINE> <INDENT> self.waittime = 500 <NEW_LINE> self.wraplength = 180 <NEW_LINE> self.widget = widget <NEW_LINE> self.text = text <NEW_LINE> self.widget.bind("<Enter>", self.enter) <NEW_LINE> self.widget.bind("<Leave>", ... | create a tooltip for a given widget | 62598ef67047854f4633dc62 |
class Warrior: <NEW_LINE> <INDENT> health = 50 <NEW_LINE> attack = 5 <NEW_LINE> defense = 0 <NEW_LINE> vampirism = 0 <NEW_LINE> @property <NEW_LINE> def is_alive(self) -> bool: <NEW_LINE> <INDENT> return self.health > 0 <NEW_LINE> <DEDENT> def hit_enemy(self, enemy): <NEW_LINE> <INDENT> enemy.get_damage(self.attack) <N... | Basic warrior unit | 62598ef6fff4ab517ebcc071 |
class VerbosityDirHandler(DirHandler): <NEW_LINE> <INDENT> def __init__(self, a_dict): <NEW_LINE> <INDENT> super(VerbosityDirHandler, self).__init__(a_dict) <NEW_LINE> self.file_name = str(get_cmd_args().verbosity) <NEW_LINE> self[self.file_name] = FileHandler(S_IFREG, 0o444, 1) <NEW_LINE> <DEDENT> def create(self, pat... | Debug Verbosity Directory Handler class
Set and get verbosity level using file system. | 62598ef6adb09d7d5dc08e59 |
class BlurMask(): <NEW_LINE> <INDENT> def __init__(self, blur_type, mask, kernel_ratio, passes=1): <NEW_LINE> <INDENT> logger.trace("Initializing %s: (blur_type: '%s', mask_shape: %s, kernel_ratio: %s, " "passes: %s)", self.__class__.__name__, blur_type, mask.shape, kernel_ratio, passes) <NEW_LINE> self.blur_type = blu... | Factory class to return the correct blur object for requested blur
Works for square images only.
Currently supports Gaussian and Normalized Box Filters | 62598ef6283ffb24f3cf2143 |
class XSLTExtension(object): <NEW_LINE> <INDENT> def apply_templates(self, context, node, output_parent=None, elements_only=False, remove_blank_text=False): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def execute(self, context, self_node, input_node, output_parent): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def pro... | Base class of an XSLT extension element. | 62598ef656ac1b37e6300a86 |
class ClinicalFeatureMetadata(Metadata): <NEW_LINE> <INDENT> pass | This class describes the metadata relating to ClinicalFeatureSet objects.
| 62598ef68a43f66fc4bf0a10 |
class SocialUser(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField('SiteUser', related_name='social_user') <NEW_LINE> site_uid = models.CharField(max_length=128) <NEW_LINE> site_name = models.CharField(max_length=32) <NEW_LINE> objects = SocialUserManager() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> unique... | 第三方帐号 | 62598ef67d847024c075ac69 |
class USResident(Person): <NEW_LINE> <INDENT> def __init__(self, name, status): <NEW_LINE> <INDENT> Person.__init__(self, name) <NEW_LINE> self.status = status <NEW_LINE> if not (status == 'citizen' or status == 'legal_resident' or status == 'illegal_resident'): <NEW_LINE> <INDENT> raise ValueError <NEW_LINE> <DEDENT> ... | A Person who resides in the US. | 62598ef6498bea3a75a563ce |
class MariadbGtidEvent(BinLogEvent): <NEW_LINE> <INDENT> def __init__(self, from_packet, event_size, table_map, ctl_connection, **kwargs): <NEW_LINE> <INDENT> super(MariadbGtidEvent, self).__init__(from_packet, event_size, table_map, ctl_connection, **kwargs) <NEW_LINE> self.server_id = self.packet.server_id <NEW_LINE>... | GTID change in binlog event in MariaDB
https://mariadb.com/kb/en/gtid_event/ | 62598ef6d268445f26638fdd |
class Command(object): <NEW_LINE> <INDENT> def __init__(self, subparsers, name, help_short=None, help_long=None, *args, **kwargs): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.help_short = help_short <NEW_LINE> self.help_long = help_long <NEW_LINE> self.parser = subparsers.add_parser(name, help=help_short, desc... | Base type for commands.
| 62598ef660cbc95b06362bd1 |
class StrPrettyPrinter(pprint.PrettyPrinter): <NEW_LINE> <INDENT> def format(self, object, context, maxlevels, level): <NEW_LINE> <INDENT> if six.PY2 and isinstance(object, six.text_type): <NEW_LINE> <INDENT> object = object.encode('utf-8') <NEW_LINE> <DEDENT> return pprint.PrettyPrinter.format(self, object, context, m... | A PrettyPrinter which produces consistent output on python 2 and 3
| 62598ef692d797404e387fc9 |
class checkAndPut_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), (1, TType.STRUCT, 'io', (TIOError, TIOError.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, success=None, io=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> self.io = io <NEW_LINE> <DEDENT> def r... | Attributes:
- success
- io | 62598ef663d6d428bbee1069 |
class ManifestType (pyxb.binding.basis.complexTypeDefinition): <NEW_LINE> <INDENT> _TypeDefinition = None <NEW_LINE> _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY <NEW_LINE> _Abstract = False <NEW_LINE> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'ManifestType') <NEW_LINE> _XSDL... | Complex type {http://www.w3.org/2000/09/xmldsig#}ManifestType with content type ELEMENT_ONLY | 62598ef67c178a314d78bd33 |
class ConsoleListener: <NEW_LINE> <INDENT> def __init__(self, stdout=sys.stdout, stderr=sys.stderr): <NEW_LINE> <INDENT> self._stdout = stdout <NEW_LINE> self._stderr = stderr <NEW_LINE> <DEDENT> def all_verifiable_starting(self, all_verifiable): <NEW_LINE> <INDENT> self._print('Verifying: ', end='', to_console=self._s... | Listener for verification messages that prints to the console | 62598ef6d486a94d0ba2a864 |
class ActivationEmailSent(TemplateView): <NEW_LINE> <INDENT> template_name = 'activation_sent.html' | Return template with success text. | 62598ef6fff4ab517ebcc072 |
class GroupChangedCallback(NotificationCallback): <NEW_LINE> <INDENT> __slots__ = NotificationCallback.__slots__ + ("picture", "title") <NEW_LINE> def __init__(self, callback, picture=True, title=True, **kwargs): <NEW_LINE> <INDENT> super(GroupChangedCallback, self).__init__(callback, **kwargs) <NEW_LINE> self.picture ... | Callback for group changed notifications. | 62598ef64527f215b58e879d |
class Constraints: <NEW_LINE> <INDENT> MAX_INT = 2147483647 <NEW_LINE> MIN_INT = -2147483648 <NEW_LINE> def __init__(self, dic: Dict[str, Any], variables: Dict[str, Variable]) -> None: <NEW_LINE> <INDENT> self.min = self.MIN_INT <NEW_LINE> self.max = self.MAX_INT <NEW_LINE> self.min_perf = self.MIN_INT <NEW_LINE> self.... | Constraints values for an integer | 62598ef6dc8b845886d51e61 |
@dc.dataclass(eq=False, repr=False) <NEW_LINE> class AstScope(AstNode): <NEW_LINE> <INDENT> names: Dict[str, AstName] = dc.field(default_factory=dict) | Base class for a node with scope. | 62598ef699fddb7c1ca62251 |
class DepartmentNotSupportedError(SnnuException): <NEW_LINE> <INDENT> pass | Deparment Not Supported Error | 62598ef671ff763f4b5e5ffc |
class TileFormLayout(object): <NEW_LINE> <INDENT> def __init__(self, context, request): <NEW_LINE> <INDENT> self.context = context <NEW_LINE> self.request = request <NEW_LINE> <DEDENT> @property <NEW_LINE> def macros(self): <NEW_LINE> <INDENT> return self.index.macros | Layout view giving access to macro slots
| 62598ef67047854f4633dc64 |
class Dog: <NEW_LINE> <INDENT> def __init__(self,name,age): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.age = age <NEW_LINE> print("Successfully executed and called out") <NEW_LINE> <DEDENT> def sit(self): <NEW_LINE> <INDENT> print(f" {self.name} is sitting") <NEW_LINE> <DEDENT> def rollover(self): <NEW_LINE> ... | A simple attempt to model a dog | 62598ef64f88993c371ef938 |
class TestAddCluster(ClusterTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestAddCluster, self).setUp() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> super(TestAddCluster, self).tearDown() <NEW_LINE> <DEDENT> def test_add_cluster(self): <NEW_LINE> <INDENT> cluster.add_cluster( ... | Test add cluster. | 62598ef6627d3e7fe0e05729 |
class ChildNone(ChildRelation): <NEW_LINE> <INDENT> def sub(self,*node): return [] | 返回空列表作为子节点迭代器(无子节点) | 62598ef61f5feb6acb1614ef |
class AttributeChange(Change): <NEW_LINE> <INDENT> pass | A change to one attribute of a file's metadata | 62598ef64f6381625f19890a |
class BinaryTree(): <NEW_LINE> <INDENT> def __init__(self, root): <NEW_LINE> <INDENT> self.root = TreeNode(root) <NEW_LINE> <DEDENT> def append(self, data): <NEW_LINE> <INDENT> self.root.append(data) <NEW_LINE> <DEDENT> def find(self, data): <NEW_LINE> <INDENT> node = self.root <NEW_LINE> while node: <NEW_LINE> <INDENT... | Binary Tree | 62598ef6283ffb24f3cf2144 |
class SEnvironment(object): <NEW_LINE> <INDENT> def __init__(self, p_vector, precision=1): <NEW_LINE> <INDENT> self.p = np.array(p_vector) <NEW_LINE> self.precision = precision <NEW_LINE> self.best_xmission = max(self.p) <NEW_LINE> <DEDENT> def response(self, depth_index): <NEW_LINE> <INDENT> return self.p[(depth_index... | The S-model Learning Environment. | 62598ef65fc7496912d476c1 |
class BaseSolver(object): <NEW_LINE> <INDENT> def __init__(self, parent=dict(), **kwargs): <NEW_LINE> <INDENT> self.x0 = kwargs.get('x0', parent.get('x0', None)) <NEW_LINE> self.train_model = kwargs.get('train_model', parent.get('train_model', None)) <NEW_LINE> self.parent = parent <NEW_LINE> self.float_dtype = kwargs.... | BaseSolver (class)
Base solver class that provides the essential variables and class
functions that may be needed by child solver classes. Solver
classes find either a local or global minimum of the low-rank
MNE problem on the training set. | 62598ef69f2886367281709a |
class BookApptForm2(Form): <NEW_LINE> <INDENT> pidTwo = TextField('Your ID: ', validators=[validators.required(), validators.Length(min=6, max=6)]) <NEW_LINE> doctorToSee = SelectField('Appointments for: ', validators=[validators.required(), validators.Length(min=0, max=100)]) <NEW_LINE> desiredDate = SelectField('on d... | This is form validation for actually booking the appointment. | 62598ef64527f215b58e879e |
class ZBlock(BlockBitmap): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> BlockBitmap.__init__(self, ((1,1,0), (0,1,1), (0,0,0)), "red") | A ZBlock is a BlockBitmap initialized with the state for the Z-shaped black | 62598ef656ac1b37e6300a88 |
class GoodOperateRecord(models.Model): <NEW_LINE> <INDENT> OPERATE_TYPE = ( ('sale', '出售'), ('return', '退货'), ('damage', '报损') ) <NEW_LINE> ORDER_STATUS = ( ('finish', '完成'), ('return', '退订') ) <NEW_LINE> serial_number = models.CharField( "流水号", max_length=100, db_index=True ) <NEW_LINE> good = models.ForeignKey( Good,... | 商品运营记录 | 62598ef699cbb53fe682f74b |
class CardFactory: <NEW_LINE> <INDENT> card_id_counter = 0 <NEW_LINE> @classmethod <NEW_LINE> def make_card(cls, card_id: int) -> CardAbstract: <NEW_LINE> <INDENT> card_object: CardModel = cls.get_card_object(card_id) <NEW_LINE> card: Optional[CardAbstract] = None <NEW_LINE> if card_object.kind == CardModel.CardKinds.U... | Factory responsible for creating cards | 62598ef6a8370b77170eec80 |
class AlreadyExistsError(DataStoreError): <NEW_LINE> <INDENT> pass | Raised when trying to add an entry that already exists | 62598ef68da39b475be01a4c |
class SpikeSourcePoissonRefractory(StandardCellType): <NEW_LINE> <INDENT> default_parameters = { 'rate': 1.0, 'tau_refrac': 0.0, 'start': 0.0, 'duration': 1e10 } <NEW_LINE> recordable = ['spikes'] <NEW_LINE> injectable = False <NEW_LINE> receptor_types = () <NEW_LINE> units = { 'rate': 'Hz', 'tau_refrac': ... | Spike source, generating spikes according to a Poisson process with dead time | 62598ef6796e427e5384d036 |
class AirConRange(object): <NEW_LINE> <INDENT> swagger_types = { 'modes': 'AirConRangeModes', 'fixed_buttons': 'list[Button]' } <NEW_LINE> attribute_map = { 'modes': 'modes', 'fixed_buttons': 'fixedButtons' } <NEW_LINE> def __init__(self, modes=None, fixed_buttons=None): <NEW_LINE> <INDENT> self._modes = None <NEW_LINE... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598ef623849d37ff84f95a |
class Observer(typing.Observer, typing.Disposable): <NEW_LINE> <INDENT> def __init__(self, on_next: Optional[typing.OnNext] = None, on_error: Optional[typing.OnError] = None, on_completed: Optional[typing.OnCompleted] = None ) -> None: <NEW_LINE> <INDENT> self.is_stopped = False <NEW_LINE> self._handler_on_next = on_ne... | Base class for implementations of the Observer class. This base
class enforces the grammar of observers where OnError and
OnCompleted are terminal messages. | 62598ef666673b3332c2ec4a |
class TestComment(TreeEqualityTestCase): <NEW_LINE> <INDENT> def test_unicode(self): <NEW_LINE> <INDENT> node = Comment("foobar") <NEW_LINE> self.assertEqual("<!--foobar-->", str(node)) <NEW_LINE> <DEDENT> def test_children(self): <NEW_LINE> <INDENT> node = Comment("foobar") <NEW_LINE> gen = node.__children__() <NEW_LI... | Test cases for the Comment node. | 62598ef660cbc95b06362bd3 |
class UfmfSaverV2(UfmfSaverV3): <NEW_LINE> <INDENT> def _get_interface_version(self): <NEW_LINE> <INDENT> return 2 | class to write (save) .ufmf v2 files | 62598ef67c178a314d78bd35 |
class MQRouter(object): <NEW_LINE> <INDENT> def route_for_task(self, task, args=None, kwargs=None): <NEW_LINE> <INDENT> if task == 'cdr_mq_transfer.mq_receiver.GetCDR': <NEW_LINE> <INDENT> return settings.CDR_CONSUMER_MQ <NEW_LINE> <DEDENT> if task == 'cdr_mq_transfer.mq_transfer.SendCDR': <NEW_LINE> <INDENT> return se... | Send CDRs into different MQ broker queue | 62598ef6dc8b845886d51e63 |
class Solution: <NEW_LINE> <INDENT> def climbStairs(self, n): <NEW_LINE> <INDENT> if n <= 2: <NEW_LINE> <INDENT> return n <NEW_LINE> <DEDENT> dp = [0 for _ in range(n + 1)] <NEW_LINE> dp[1] = 1 <NEW_LINE> dp[2] = 2 <NEW_LINE> for i in range(3, n + 1): <NEW_LINE> <INDENT> dp[i] = dp[i-1] + dp[i-2] <NEW_LINE> <DEDENT> re... | @param n: An integer
@return: An integer | 62598ef64527f215b58e879f |
class ICommand(INotifier): <NEW_LINE> <INDENT> def execute(self, notification): <NEW_LINE> <INDENT> raise NotImplementedError(self) | The interface definition for a PureMVC Command.
@see: L{INotification<puremvc.interfaces.INotification>} | 62598ef6adb09d7d5dc08e5c |
class JSONAsDictMixin(object): <NEW_LINE> <INDENT> def default(self, o): <NEW_LINE> <INDENT> if hasattr(o, 'asdict') and callable(getattr(o, 'asdict')): <NEW_LINE> <INDENT> return o.asdict() <NEW_LINE> <DEDENT> return super(JSONAsDictMixin, self).default(o) | A mixin for JSONEncoders, encoding any object with a asdict() method
by calling that method and encoding the return value.
>>> import jsonext
>>> class Foo(object):
... def __init__(self, a, b):
... self.a = a
... self.b = b
... def asdict(self):
... return {'A': self.a, 'B': self.b}
...
>>> items = [F... | 62598ef6377c676e912f61b1 |
class RecordingOptions(_object): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, RecordingOptions, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, RecordingOptions, name) <NEW_LINE> __rep... | The RecordingOptions class allows specifying options for recording.
The RecordingOptions class contains more advance options for recording. It can
be used to specify things like splitting of files and directories.
See also: DataRecorder
C++ includes: RecordingOptions.hpp | 62598ef69c8ee8231303f5aa |
class AESModeOfOperationCTR(AESStreamModeOfOperation): <NEW_LINE> <INDENT> name = "Counter (CTR)" <NEW_LINE> def __init__(self, key, counter = None): <NEW_LINE> <INDENT> AESBlockModeOfOperation.__init__(self, key) <NEW_LINE> if counter is None: <NEW_LINE> <INDENT> counter = Counter(nbits = len(key) * 8) <NEW_LINE> <DED... | AES Counter Mode of Operation.
o A stream-cipher, so input does not need to be padded to blocks,
allowing arbitrary length data.
o The counter must be the same size as the key size (ie. len(key))
o Each block independant of the other, so a corrupt byte will not
damage future blocks.
o Each ... | 62598ef6627d3e7fe0e0572b |
class TestSignupInputVerification(TestBlog): <NEW_LINE> <INDENT> def testUsernameValidation(self): <NEW_LINE> <INDENT> response = self._setPostResponse({blog.USER : ''}) <NEW_LINE> assert response.status_int == 200 <NEW_LINE> self.assertTrue("The username is invalid." in response.body, "Invalid username error msg not p... | Class to test signup form.
| 62598ef6f548e778e5969e2b |
class Submission(Base): <NEW_LINE> <INDENT> __tablename__ = 'submissions' <NEW_LINE> id = Column( Integer, primary_key=True) <NEW_LINE> participation_id = Column( Integer, ForeignKey(Participation.id, onupdate="CASCADE", ondelete="CASCADE"), nullable=False, index=True) <NEW_LINE> participation = relationship( Participa... | Class to store a submission.
| 62598ef697e22403b383978e |
class Service(models.Model): <NEW_LINE> <INDENT> service = models.ForeignKey(ServiceType) <NEW_LINE> profile = models.ForeignKey(Profile) <NEW_LINE> username = models.CharField(_('Name or ID'), max_length=32, help_text="Username or id to be inserted into the service url.") <NEW_LINE> created ... | Service model | 62598ef65166f23b2e241c79 |
class EsphomeBaseEntity(Entity): <NEW_LINE> <INDENT> def __init__(self, entry_id: str, component_key: str, key: int) -> None: <NEW_LINE> <INDENT> self._entry_id = entry_id <NEW_LINE> self._component_key = component_key <NEW_LINE> self._key = key <NEW_LINE> <DEDENT> async def async_added_to_hass(self) -> None: <NEW_LINE... | Define a base esphome entity. | 62598ef663b5f9789fe839fd |
class Create(base_classes.BaseAsyncCreator): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> health_checks_utils.AddTcpRelatedCreationArgs(parser) <NEW_LINE> health_checks_utils.AddProtocolAgnosticCreationArgs(parser, 'TCP') <NEW_LINE> <DEDENT> @property <NEW_LINE> def service(self): ... | Create a TCP health check to monitor load balanced instances. | 62598ef656ac1b37e6300a8a |
class textExtractor(object): <NEW_LINE> <INDENT> def __init__(self, page=None, blockSize=3, image=False): <NEW_LINE> <INDENT> super(textExtractor, self).__init__() <NEW_LINE> self.page = page <NEW_LINE> self.blockSize = blockSize <NEW_LINE> self.saveImage = image <NEW_LINE> self.ctexts = [] <NEW_LINE> self.cblocks = []... | 新闻类网页正文提取 | 62598ef67d847024c075ac6d |
class BudgetRead(object): <NEW_LINE> <INDENT> openapi_types = { 'attributes': 'Budget', 'id': 'int', 'type': 'str' } <NEW_LINE> attribute_map = { 'attributes': 'attributes', 'id': 'id', 'type': 'type' } <NEW_LINE> def __init__(self, attributes=None, id=None, type=None, local_vars_configuration=None): <NEW_LINE> <INDENT... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598ef64c34283577618b84 |
class SendSMS(object): <NEW_LINE> <INDENT> __instance = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.__AccountSid = '8a216da8653147e601653dde3c8d081d' <NEW_LINE> self.__AuthToken = 'e35f681fa62d4eda8e9e827ce067178e' <NEW_LINE> self.__AppID = '8a216da8653147e601653dde3ce70824' <NEW_LINE> self.__RestURL =... | 短讯服务,
This class is a singleton. | 62598ef657b8e32f52507553 |
class LightConvEncoder(FairseqEncoder): <NEW_LINE> <INDENT> def __init__(self, args, dictionary, embed_tokens): <NEW_LINE> <INDENT> super().__init__(dictionary) <NEW_LINE> self.dropout_module = FairseqDropout(args.dropout, module_name=self.__class__.__name__) <NEW_LINE> embed_dim = embed_tokens.embedding_dim <NEW_LINE>... | LightConv encoder consisting of *args.encoder_layers* layers. Each layer
is a :class:`LightConvEncoderLayer`.
Args:
args (argparse.Namespace): parsed command-line arguments
dictionary (~fairseq.data.Dictionary): encoding dictionary
embed_tokens (torch.nn.Embedding): input embedding | 62598ef6656771135c487f29 |
class Condition(_kuber_definitions.Definition): <NEW_LINE> <INDENT> def __init__( self, last_transition_time: str = None, message: str = None, observed_generation: int = None, reason: str = None, status: str = None, type_: str = None, ): <NEW_LINE> <INDENT> super(Condition, self).__init__(api_version="meta/v1", kind="C... | Condition contains details for one aspect of the current
state of this API Resource. | 62598ef64a966d76dd5ed77a |
class NumpyList(NumpyArrayData): <NEW_LINE> <INDENT> DEFAULT_FILENAME = 'numpy_list' <NEW_LINE> DATA_STRS = ['datas'] <NEW_LINE> STEP = 10000 <NEW_LINE> def __init__(self, data_dir='default', data_type=FLOAT_TYPE): <NEW_LINE> <INDENT> super(NumpyList, self).__init__(data_dir) <NEW_LINE> if (data_type == FLOAT_TYPE): <N... | Documentation for NumpyList
| 62598ef699fddb7c1ca62253 |
class Interval(object): <NEW_LINE> <INDENT> def __init__(self, name, duration, period): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.duration = duration <NEW_LINE> self.period = period <NEW_LINE> <DEDENT> def epoch_to_ordinal(self, epoch_time): <NEW_LINE> <INDENT> return int(epoch_time / self.duration) <NEW_LIN... | Represents a unit of time. | 62598ef67047854f4633dc68 |
class Patient(object): <NEW_LINE> <INDENT> def __init__(self, viruses, maxPop): <NEW_LINE> <INDENT> self.viruses = viruses <NEW_LINE> self.maxPop = maxPop <NEW_LINE> <DEDENT> def getViruses(self): <NEW_LINE> <INDENT> return self.viruses <NEW_LINE> <DEDENT> def getMaxPop(self): <NEW_LINE> <INDENT> return self.maxPop <NE... | Representation of a simplified patient. The patient does not take any drugs
and his/her virus populations have no drug resistance. | 62598ef6236d856c2adc8868 |
class PTCitizenCardNumberField(Field): <NEW_LINE> <INDENT> default_error_messages = { 'badchecksum': _('The specified value is not a valid Citizen Card number.'), 'invalid': _('Citizen Card numbers have the format XXXXXXXXXYYX or XXXXXXXX-XYYX ' '(where X is a digit and Y is an alphanumeric character).'), } <NEW_LINE> ... | A field which validates Portuguese Citizen Card numbers (locally CC - 'Cartão do Cidadão').
- Citizen Card numbers have the format XXXXXXXXXYYX or XXXXXXXX-XYYX
(where X is a digit and Y is an alphanumeric character).
- Citizen Card numbers validate as per http://bit.ly/RP0BzW.
- The input string may or may not ha... | 62598ef62c8b7c6e89bd2065 |
class component(object): <NEW_LINE> <INDENT> def _init_(self, state, gpio): <NEW_LINE> <INDENT> self.state = state <NEW_LINE> self.gpio = gpio <NEW_LINE> <DEDENT> @property <NEW_LINE> def state(self): <NEW_LINE> <INDENT> return self._state <NEW_LINE> <DEDENT> @property <NEW_LINE> def gpio(self): <NEW_LINE> <INDENT> ret... | contains generic behavior for component objects | 62598ef63539df3088ecab4d |
class DatedModel(models.Model): <NEW_LINE> <INDENT> ctime = models.DateTimeField(u'作成日時', default=datetime.now, db_index=True) <NEW_LINE> utime = models.DateTimeField(u'更新日時', auto_now=True, db_index=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> ordering = ['-ctime'] | 日付が付けたモデル | 62598ef65166f23b2e241c7b |
class InvalidKey(TuyaException): <NEW_LINE> <INDENT> pass | The local key is invalid. | 62598ef644b2445a339b5dbd |
class InvalidFormat(ZagException): <NEW_LINE> <INDENT> pass | Raised when some object/entity is not in the expected format. | 62598ef621bff66bcd7214f7 |
class Reader(object): <NEW_LINE> <INDENT> def __init__(self, table_path): <NEW_LINE> <INDENT> self.table_path = table_path <NEW_LINE> self.describe = arcpy.Describe(self.table_path) <NEW_LINE> self.extent = self.describe.extent <NEW_LINE> self.field_names_all = [fld.name for fld in self.describe.fields] <NEW_LINE> self... | Read records from ESRI feature class. | 62598ef64428ac0f6e656dee |
class UTOptimalDisplaySel(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = 'ut.optimaldisplaysel' <NEW_LINE> bl_label = 'Optimal Display' <NEW_LINE> on = bpy.props.BoolProperty(default=False) <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> for e in bpy.context.selected_objects: <NEW_LINE> <INDENT> try: <... | Disables Optimal Display for all Subsurf modifiers on selected objects | 62598ef6097d151d1a2bf8c4 |
class MockSailthruResponse(object): <NEW_LINE> <INDENT> def __init__(self, json_response, error=None, code=1): <NEW_LINE> <INDENT> self.json = json_response <NEW_LINE> self.error = error <NEW_LINE> self.code = code <NEW_LINE> <DEDENT> def is_ok(self): <NEW_LINE> <INDENT> return self.error is None <NEW_LINE> <DEDENT> de... | Mock object for SailthruResponse | 62598ef660cbc95b06362bd7 |
class Camera(object): <NEW_LINE> <INDENT> def __init__(self, port=ev3.INPUT_2): <NEW_LINE> <INDENT> self.port = port <NEW_LINE> self.sensor = ev3.Sensor(port, driver_name="pixy-lego") <NEW_LINE> assert self.sensor.connected, ("The camera sensor appears to not be connected.\n" + " Check the jack labelled 2. ... | The Pixy camera. | 62598ef64a966d76dd5ed77b |
class Node: <NEW_LINE> <INDENT> def __init__(self, index=0, in_use=True, rel_id=0, prop_id=0, node_type=0): <NEW_LINE> <INDENT> self.index = index <NEW_LINE> self.inUse = in_use <NEW_LINE> self.relId = rel_id <NEW_LINE> self.propId = prop_id <NEW_LINE> self.nodeType = node_type <NEW_LINE> <DEDENT> def __eq__(self, othe... | Stores components of a node:
inUse: Whether the database is using the node
relId: ID of the first relation the node has
propId: ID of the first property the node has
Along with the index where the node is stored | 62598ef6e5267d203ee6a1a5 |
class Pipeline(BasePipeline): <NEW_LINE> <INDENT> def save_items(self, table, items: List[Dict]) -> bool: <NEW_LINE> <INDENT> print("自定义pipeline, 保存数据 >>>>", table, items) <NEW_LINE> return True <NEW_LINE> <DEDENT> def update_items(self, table, items: List[Dict], update_keys=Tuple) -> bool: <NEW_LINE> <INDENT> print("自... | pipeline 是单线程的,批量保存数据的操作,不建议在这里写网络请求代码,如下载图片等 | 62598ef63346ee7daa336ab8 |
class Advisor(Piece): <NEW_LINE> <INDENT> def __init__(self, starting_pos, color): <NEW_LINE> <INDENT> super().__init__(starting_pos, color) <NEW_LINE> self._rank = 'Advisor' <NEW_LINE> <DEDENT> def update_valid_moves(self, other_pieces): <NEW_LINE> <INDENT> team_pieces = [ piece for piece in other_pieces if piece.get_... | Class representing an Advisor piece. | 62598ef666656f66f7d58c86 |
class CloudFeedsObserverTests(SynchronousTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.reactor = object() <NEW_LINE> self.authenticator = object() <NEW_LINE> self.service_configs = {'service': 'configs'} <NEW_LINE> self.log = mock_log() <NEW_LINE> self.make_cf = partial( CloudFeedsObserver, r... | Tests for :obj:`CloudFeedsObserver` | 62598ef62ae34c7f260a9984 |
class SerializerRendererMixin(SiteContextMixin): <NEW_LINE> <INDENT> renderer_classes = (TemplateHTMLRenderer,) <NEW_LINE> if settings.DEBUG: <NEW_LINE> <INDENT> renderer_classes += (BrowsableAPIRenderer, TemplateContextJsonRenderer) <NEW_LINE> <DEDENT> template_name = None <NEW_LINE> lookup_field = 'pk' <NEW_LINE> def... | A view that returns a templated HTML representation of a given user. | 62598ef6f548e778e5969e2e |
class TimeTagFormatter(TagFormatter): <NEW_LINE> <INDENT> def format(self, track, parameters): <NEW_LINE> <INDENT> value = track.get_tag_raw(self.name) <NEW_LINE> format = parameters.get('format', 'short') <NEW_LINE> return self.format_value(value, format) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def format_value(v... | A formatter for a time period | 62598ef6a219f33f346c50d1 |
class AsistenciaForm(FlaskForm): <NEW_LINE> <INDENT> id_miembros = HiddenField(u'idMiembros') <NEW_LINE> id_reunion = HiddenField(u'idReunion') <NEW_LINE> submit = SubmitField(u'Buscar') | Consulta de asistencias | 62598ef6627d3e7fe0e0572f |
class TraceDumper(threading.Thread): <NEW_LINE> <INDENT> def __init__(self,fpath,interval,auto): <NEW_LINE> <INDENT> assert(interval>0.1) <NEW_LINE> self.auto = auto <NEW_LINE> self.interval = interval <NEW_LINE> self.fpath = os.path.abspath(fpath) <NEW_LINE> self.stop_requested = threading.Event() <NEW_LINE> threading... | Dump stack traces into a given file periodically. | 62598ef65fc7496912d476c4 |
class EntityMgr(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.entList = [] <NEW_LINE> self.nodeList = [] <NEW_LINE> self.selected = None <NEW_LINE> <DEDENT> def attachEntity(self, _entity): <NEW_LINE> <INDENT> self.entList.append(_entity) <NEW_LINE> self.selected = 0 <NEW_LINE> <DEDENT> def attach... | An Entity Manager Class | 62598ef62c8b7c6e89bd2067 |
class ADV(ADF): <NEW_LINE> <INDENT> def __init__(self, value, tag=None): <NEW_LINE> <INDENT> if _order == 2: <NEW_LINE> <INDENT> super(ADV, self).__init__(value, {self:1.0}, {self:0.0}, {}, tag=tag) <NEW_LINE> <DEDENT> elif _order == 1: <NEW_LINE> <INDENT> super(ADV, self).__init__(value, {self:1.0}, {self:0.0}, None, ... | A convenience class for distinguishing between FUNCTIONS (ADF) and VARIABLES | 62598ef63d592f4c4edb9790 |
class HelloRequest(HandshakeMsg): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(HelloRequest, self).__init__(HandshakeType.hello_request) <NEW_LINE> <DEDENT> def create(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def write(self): <NEW_LINE> <INDENT> return self.postWrite(Writer()) <NE... | Handling of Hello Request messages. | 62598ef6cc40096d61619629 |
class Partner(models.Model): <NEW_LINE> <INDENT> _inherit = "res.partner" <NEW_LINE> birthdate_date = fields.Date("Birthdate") <NEW_LINE> birthdate = fields.Char( compute="_birthdate_compute", inverse="_birthdate_inverse", store=True) <NEW_LINE> @api.one <NEW_LINE> @api.depends("birthdate_date") <NEW_LINE> def _birthda... | Partner with birth date in date format. | 62598ef6aad79263cf42d0b0 |
class EggPackage(BinaryPackage): <NEW_LINE> <INDENT> def __init__(self, url, **kw): <NEW_LINE> <INDENT> super(EggPackage, self).__init__(url, **kw) <NEW_LINE> filename, ext = os.path.splitext(self.filename) <NEW_LINE> if ext.lower() != '.egg': <NEW_LINE> <INDENT> raise self.InvalidPackage('Not an egg: %s' % filename) <... | A Package representing a built egg. | 62598ef666673b3332c2ec50 |
class ShowTrafficCollecterExternalInterfaceSchema(MetaParser): <NEW_LINE> <INDENT> schema = { 'interface':{ Any():{ 'status': str }, }, } | Schema for show traffic-collector external-interface | 62598ef660cbc95b06362bd9 |
class sigma_max(Atom): <NEW_LINE> <INDENT> def __init__(self, A): <NEW_LINE> <INDENT> super(sigma_max, self).__init__(A) <NEW_LINE> <DEDENT> @Atom.numpy_numeric <NEW_LINE> def numeric(self, values): <NEW_LINE> <INDENT> return LA.norm(values[0], 2) <NEW_LINE> <DEDENT> def shape_from_args(self): <NEW_LINE> <INDENT> retur... | Maximum singular value. | 62598ef692d797404e387fcd |
class TestBetatesterAccess(ModuleStoreTestCase, CourseAccessTestMixin): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestBetatesterAccess, self).setUp() <NEW_LINE> now = datetime.datetime.now(pytz.UTC) <NEW_LINE> tomorrow = now + datetime.timedelta(days=1) <NEW_LINE> self.course = CourseFactory(days_e... | Tests for the beta tester feature | 62598ef67c178a314d78bd3b |
class ValidationError(Exception): <NEW_LINE> <INDENT> pass | Raised by the CommandTemplate validation method | 62598ef65fcc89381b26557a |
class Task(): <NEW_LINE> <INDENT> def __init__(self, init_pose=None, init_velocities=None, init_angle_velocities=None, runtime=5., target_pos=None): <NEW_LINE> <INDENT> self.sim = PhysicsSim(init_pose, init_velocities, init_angle_velocities, runtime) <NEW_LINE> self.action_repeat = 3 <NEW_LINE> self.state_size = self.a... | Task (environment) that defines the goal and provides feedback to the agent. | 62598ef666656f66f7d58c88 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.