code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class ActionType: <NEW_LINE> <INDENT> CREATE = 'create' <NEW_LINE> UPDATE = 'update' <NEW_LINE> DELETE = 'delete' <NEW_LINE> CHOICES = ( (CREATE, _('Created')), (UPDATE, _('Updated')), (DELETE, _('Deleted')) )
Available action types for ``History``
625990835fcc89381b266ee3
class Answer_5_3(): <NEW_LINE> <INDENT> inputFileName = '/home/inoue/python/python.txt' <NEW_LINE> def Step1(self): <NEW_LINE> <INDENT> with open(self.inputFileName) as txt: <NEW_LINE> <INDENT> for line in txt: <NEW_LINE> <INDENT> result = re.match(r'[A-Z].*',line) <NEW_LINE> if result: <NEW_LINE> <INDENT> print(result...
正規表現の解答
6259908399fddb7c1ca63b60
class InverseTransform(Transform): <NEW_LINE> <INDENT> def __init__(self, transform): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._transform = transform <NEW_LINE> <DEDENT> def forward(self, inputs, context=None): <NEW_LINE> <INDENT> return self._transform.inverse(inputs, context) <NEW_LINE> <DEDENT> def inv...
Creates a transform that is the inverse of a given transform.
625990837d847024c075deea
class ListenerMixin(object): <NEW_LINE> <INDENT> _EVENTS = tuple() <NEW_LINE> _EVENT_PARSER = Xlib.protocol.rq.EventField(None) <NEW_LINE> def _run(self): <NEW_LINE> <INDENT> self._display_stop = Xlib.display.Display() <NEW_LINE> self._display_record = Xlib.display.Display() <NEW_LINE> with display_manager(self._displa...
A mixin for *X* event listeners. Subclasses should set a value for :attr:`_EVENTS` and implement :meth:`_handle`.
6259908397e22403b383ca0c
class ProgressBar(object): <NEW_LINE> <INDENT> colorList = { "red": 1, "yellow": 3, "green": 2, "magenta": 5, } <NEW_LINE> def __init__(self, number): <NEW_LINE> <INDENT> self.__current = 0 <NEW_LINE> self.__max = number <NEW_LINE> self.__done = {} <NEW_LINE> <DEDENT> def incMax(self, number): <NEW_LINE> <INDENT> self....
Progress bar definition (used in console mode)
625990835fc7496912d48ff1
class LocalsDictNodeNG(LookupMixIn, NodeNG): <NEW_LINE> <INDENT> def qname(self): <NEW_LINE> <INDENT> if self.parent is None: <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> return '%s.%s' % (self.parent.frame().qname(), self.name) <NEW_LINE> <DEDENT> def frame(self): <NEW_LINE> <INDENT> return self <NEW_LINE>...
this class provides locals handling common to Module, Function and Class nodes, including a dict like interface for direct access to locals information
62599083d8ef3951e32c8be5
class LockError(Exception): <NEW_LINE> <INDENT> pass
Raised for any errors related to locks.
625990834428ac0f6e65a03c
class StupidGit(object): <NEW_LINE> <INDENT> def abuse(self, a, b, c): <NEW_LINE> <INDENT> self.argue(a, b, c) <NEW_LINE> <DEDENT> def argue(self, a, b, c): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> spam(a, b, c) <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> self.ex = sys.exc_info() <NEW_LINE> self.tr = inspect2.t...
A longer, indented docstring.
625990837b180e01f3e49deb
class TrainClassificatorView(grok.View): <NEW_LINE> <INDENT> grok.context(IAMQPErrorClassificationFolder) <NEW_LINE> grok.require('zope2.View') <NEW_LINE> grok.name('train-classificator') <NEW_LINE> def __call__(self): <NEW_LINE> <INDENT> context = self.context.aq_inner <NEW_LINE> form = UploadForm(context, self.reques...
sample view class
6259908366673b3332c31f0d
class GetSensitiveOpSettingRequest(JDCloudRequest): <NEW_LINE> <INDENT> def __init__(self, parameters, header=None, version="v1"): <NEW_LINE> <INDENT> super(GetSensitiveOpSettingRequest, self).__init__( '/regions/{regionId}/sensitiveOpSetting', 'GET', header, version) <NEW_LINE> self.parameters = parameters
获取操作保护设置信息
6259908326068e7796d4e450
class TestConnectionManagerTimings(Base): <NEW_LINE> <INDENT> @defer.inlineCallbacks <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> yield super(TestConnectionManagerTimings, self).setUp() <NEW_LINE> self.sm.connection.handshake_timeout = 0 <NEW_LINE> <DEDENT> def check(self, n_from, event, result): <NEW_LINE> <INDENT>...
Times handled by ConnectionManager.
62599083796e427e53850289
class RefundOverflowException(PrException): <NEW_LINE> <INDENT> error_code = 61 <NEW_LINE> error_msg = "the sum of refunds for a payment may not exceed the " + "payment's original amount"
refund overflow
62599083099cdd3c63676181
class Key(Validator): <NEW_LINE> <INDENT> tag = 'key' <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(Key, self).__init__(*args, **kwargs) <NEW_LINE> self.key_name = args[0] <NEW_LINE> <DEDENT> def _is_valid(self, value): <NEW_LINE> <INDENT> if self.key_name in value: <NEW_LINE> <INDENT> retur...
Custom Key validator
625990833317a56b869bf2cb
class Data(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> filename = os.path.join(_data_dir, 'snapshot_*.json') <NEW_LINE> self.filenames = glob.glob(filename) + glob.glob(filename + '.gz') <NEW_LINE> self.data = None <NEW_LINE> <DEDENT> def load(self, n_files=None): <NEW_LINE> <INDENT> d = list() <NEW_...
Processing the json snapshots. There are the following records in snapshot: ['curr', 'instr', 'orderbook', 'lasttrades', 'summary'] Each of these are per-instrument records. summary: can be flattened, only need to lookup strike and maturity from instr. This should be starting point. orderbook: lasttrad...
625990833617ad0b5ee07c5f
class Version: <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.__dict__.update(kwargs) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> keys = sorted(self.__dict__) <NEW_LINE> items = ("{}={!r}".format(k, self.__dict__[k]) for k in keys) <NEW_LINE> return "{}({})".format(type(self)...
Helper class for version info.
62599083283ffb24f3cf53b0
class Inline(Raw, ResourceBound): <NEW_LINE> <INDENT> def __init__(self, resource, patchable=False, **kwargs): <NEW_LINE> <INDENT> self.target_reference = ResourceReference(resource) <NEW_LINE> self.patchable = patchable <NEW_LINE> def schema(): <NEW_LINE> <INDENT> def _response_schema(): <NEW_LINE> <INDENT> if self.re...
Formats and converts items in a :class:`ModelResource` using the resource's ``schema``. :param resource: a resource reference as in :class:`ToOne` :param bool patch_instance: whether to allow partial objects
62599083656771135c48adb8
class VehicleDeleteView(CustomUserMixin, DeleteView): <NEW_LINE> <INDENT> model = Vehicle <NEW_LINE> template_name = 'buildings/administrative/vehicles/vehicle_delete_confirm.html' <NEW_LINE> def test_func(self): <NEW_LINE> <INDENT> return BuildingPermissions.can_edit_unit( user=self.request.user, building=self.get_obj...
Vehicle delete view. Users are redirected to a view in which they will be asked about confirmation for delete a vehicle definitely.
6259908392d797404e3898e4
class ShrunkCovariance(EmpiricalCovariance): <NEW_LINE> <INDENT> def __init__(self, store_precision=True, shrinkage=0.1): <NEW_LINE> <INDENT> self.store_precision = store_precision <NEW_LINE> self.shrinkage = shrinkage <NEW_LINE> <DEDENT> def fit(self, X, assume_centered=False): <NEW_LINE> <INDENT> empirical_cov = empi...
Covariance estimator with shrinkage Parameters ---------- store_precision : bool Specify if the estimated precision is stored shrinkage: float, 0 <= shrinkage <= 1 coefficient in the convex combination used for the computation of the shrunk estimate. Attributes ---------- `covariance_` : array-like, shape (n_f...
625990837c178a314d78e972
class SoftDeadlineExceeded(Exception): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(SoftDeadlineExceeded, self).__init__( 'Operation exceeded deadline.')
Raised when an overall client operation takes too long.
62599083167d2b6e312b831e
class FrontmatterExtractor(FrontmatterComposerMixin): <NEW_LINE> <INDENT> def extract(self, source_file): <NEW_LINE> <INDENT> data, source = self.get_data(source_file) <NEW_LINE> return data
Extract frontmatter from a source file.
62599083aad79263cf4302cc
class ItemRuleBuilderLower(ItemRuleBuilder): <NEW_LINE> <INDENT> def __init__(self, tokenizer=None, keyword_processor=None, kp_lower=None): <NEW_LINE> <INDENT> super(ItemRuleBuilderLower, self).__init__(tokenizer, keyword_processor) <NEW_LINE> self.kp_lower = self.build_kp(case_sensitive=False) i...
docstring for ItemRuleBuilderLower
62599083283ffb24f3cf53b2
class ContextsServicer(object): <NEW_LINE> <INDENT> def ListContexts(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 GetContext(s...
Manages contexts. Refer to the [Dialogflow documentation](https://dialogflow.com/docs/contexts) for more details about contexts. #
62599083ec188e330fdfa3bc
class InputFnOps(collections.namedtuple('InputFnOps', ['features', 'labels', 'default_inputs'])): <NEW_LINE> <INDENT> pass
A return type for an input_fn (deprecated). THIS CLASS IS DEPRECATED. Please use tf.estimator.export.ServingInputReceiver instead. This return type is currently only supported for serving input_fn. Training and eval input_fn should return a `(features, labels)` tuple. The expected return values are: features: A di...
6259908397e22403b383ca0f
class ComplexConv1d(_ComplexConvNd): <NEW_LINE> <INDENT> def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1): <NEW_LINE> <INDENT> kernel_size = single(kernel_size) <NEW_LINE> stride = single(stride) <NEW_LINE> padding = padding <NEW_LINE> dilation = single(dilation) <NEW_LINE> su...
Complex Convolution 1d
62599083656771135c48adb9
class FlowList(ListResource): <NEW_LINE> <INDENT> def __init__(self, version): <NEW_LINE> <INDENT> super(FlowList, self).__init__(version) <NEW_LINE> self._solution = {} <NEW_LINE> self._uri = '/Flows'.format(**self._solution) <NEW_LINE> <DEDENT> def stream(self, limit=None, page_size=None): <NEW_LINE> <INDENT> limits ...
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
62599083adb09d7d5dc0c06c
class OneTimeBootDevice(ManagedObject): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> ManagedObject.__init__(self, "OneTimeBootDevice") <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def class_id(): <NEW_LINE> <INDENT> return "oneTimeBootDevice" <NEW_LINE> <DEDENT> DEVICE = "Device" <NEW_LINE> DN = "Dn" <NE...
This class contains the relevant properties and constant supported by this MO.
625990833346ee7daa3383eb
class PForTestCase(test.TestCase): <NEW_LINE> <INDENT> def _run_targets(self, targets1, targets2=None, run_init=True): <NEW_LINE> <INDENT> targets1 = nest.flatten(targets1) <NEW_LINE> targets2 = ([] if targets2 is None else nest.flatten(targets2)) <NEW_LINE> assert len(targets1) == len(targets2) or not targets2 <NEW_LI...
Base class for test cases.
62599083167d2b6e312b831f
class ExecutionHandler(object): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> @abstractmethod <NEW_LINE> def execute_order(self, event): <NEW_LINE> <INDENT> raise NotImplementedError("Abstract Method supports no implement.")
The ExecutionHandler abstract class handles the interaction between a set of order objects generated by a Portfolio and the ultimate set of Fill objects that actually occur in the market. The handlers can be used to subclass simulated brokerages or live brokerages, with identical interfaces. This allows strategies to b...
62599083dc8b845886d550cd
class RedHatLdap(Ldap, RedHatPlugin): <NEW_LINE> <INDENT> packages = ('openldap', 'nss-pam-ldapd') <NEW_LINE> files = ('/etc/ldap.conf', '/etc/pam_ldap.conf') <NEW_LINE> def setup(self): <NEW_LINE> <INDENT> super(RedHatLdap, self).setup() <NEW_LINE> self.add_copy_specs([ "/etc/openldap", "/etc/nslcd.conf", "/etc/pam_ld...
LDAP related information for RedHat based distribution
625990835fdd1c0f98e5fa93
class TestDisallowLongAbbreviationAllowsShortGroupingPrefix(ParserTestCase): <NEW_LINE> <INDENT> parser_signature = Sig(prefix_chars='+', allow_abbrev=False) <NEW_LINE> argument_signatures = [ Sig('+r'), Sig('+c', action='count'), ] <NEW_LINE> failures = ['+r', '+c +r'] <NEW_LINE> successes = [ ('', NS(r=None, c=None))...
Short option grouping works with custom prefix and allow_abbrev=False
6259908371ff763f4b5e92c0
class Point(object): <NEW_LINE> <INDENT> def __init__(self, x, y, z=0): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.z = z <NEW_LINE> <DEDENT> def get_x(self): <NEW_LINE> <INDENT> return self.x <NEW_LINE> <DEDENT> def get_y(self): <NEW_LINE> <INDENT> return self.y <NEW_LINE> <DEDENT> def get_z(s...
Simple geometric point class. That is all.
625990834428ac0f6e65a042
class X509(certificate.Certificate): <NEW_LINE> <INDENT> def __init__(self, data, name=None, created=None, id=None): <NEW_LINE> <INDENT> self._data = data <NEW_LINE> super().__init__(name=name, created=created, id=id) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def managed_type(cls): <NEW_LINE> <INDENT> return "certifi...
This class represents X.509 certificates.
6259908392d797404e3898e6
class BlueprintOptionsFlowHandler(config_entries.OptionsFlow): <NEW_LINE> <INDENT> def __init__(self, config_entry: ConfigEntry): <NEW_LINE> <INDENT> self.config_entry = config_entry <NEW_LINE> self.options = dict(config_entry.options) <NEW_LINE> <DEDENT> async def async_step_init(self, user_input: Optional[ConfigType]...
Blueprint config flow options handler.
62599083adb09d7d5dc0c06e
class AbortException(Exception): <NEW_LINE> <INDENT> pass
This exception is used for when the user wants to quit algorithms mid-way. The `AbortException` can for instance be sent by pygame input, and caught by whatever is running the algorithm.
62599083283ffb24f3cf53b5
class TestSystem(unittest.TestCase): <NEW_LINE> <INDENT> BOOK_EXAMPLE = [[1, -2, 11, 3], [1, 3, -2, -5], [1, -1/1, -3, 8/2], [1, 2, 0, -3]] <NEW_LINE> BANERJEE2 = [[1, -2, 11, 3], [1, 3, -2, -5], [1, -1, -3, 4], [1, 4, 0, -6]] <NEW_LINE> def setUp(self): <NEW_LINE>...
this is not a true unit test set, more a driver to check that it works
625990834a966d76dd5f09fa
class SubunitLogObserver(logobserver.LogLineObserver, TestResult): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> logobserver.LogLineObserver.__init__(self) <NEW_LINE> TestResult.__init__(self) <NEW_LINE> try: <NEW_LINE> <INDENT> from subunit import TestProtocolServer, PROGRESS_CUR, PROGRESS_SET <NEW_LINE>...
Observe a log that may contain subunit output. This class extends TestResult to receive the callbacks from the subunit parser in the most direct fashion.
6259908360cbc95b06365af6
class ConnectionProxy(object): <NEW_LINE> <INDENT> def execute(self, conn, execute, clauseelement, *multiparams, **params): <NEW_LINE> <INDENT> return execute(clauseelement, *multiparams, **params) <NEW_LINE> <DEDENT> def cursor_execute(self, execute, cursor, statement, parameters, context, executemany): <NEW_LINE> <IN...
Allows interception of statement execution by Connections. Either or both of the ``execute()`` and ``cursor_execute()`` may be implemented to intercept compiled statement and cursor level executions, e.g.:: class MyProxy(ConnectionProxy): def execute(self, conn, execute, clauseelement, *multiparams, **par...
62599083dc8b845886d550cf
class FollowUser(object): <NEW_LINE> <INDENT> def __init__(self, Repository): <NEW_LINE> <INDENT> self.repository = Repository <NEW_LINE> <DEDENT> def execute(self, User, userToFollow): <NEW_LINE> <INDENT> user = self.repository.getUserById(User) <NEW_LINE> try: <NEW_LINE> <INDENT> uToFollow = self.repository.getUserBy...
docstring for followTo.
625990835fdd1c0f98e5fa95
class CapitalizeStr: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> from weakref import WeakKeyDictionary <NEW_LINE> self._instance_data = WeakKeyDictionary() <NEW_LINE> <DEDENT> def __get__(self, instance, owner): <NEW_LINE> <INDENT> if instance is None: <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT>...
Descriptor
62599083ad47b63b2c5a9367
class Options: <NEW_LINE> <INDENT> def __init__(self, rs): <NEW_LINE> <INDENT> self.rs = rs <NEW_LINE> self.selectedOpts = set() <NEW_LINE> <DEDENT> def selection(self): <NEW_LINE> <INDENT> return self.selectedOpts <NEW_LINE> <DEDENT> def toggle(self, option): <NEW_LINE> <INDENT> if option not in self.selectedOpts: <NE...
Options represents the state of RuleSet and enables selection and deselection of options in the RuleSet. It maintains a set of selected options. Attributes: rs: A RuleSet object to use. selectedOpts: A set of selected options at any point.
625990837cff6e4e811b7557
class TokenManager(BaseTokenManager): <NEW_LINE> <INDENT> def __init__(self, file_location, log): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.file_location = file_location <NEW_LINE> self.log = log <NEW_LINE> <DEDENT> def post_refresh_callback(self, authorizer): <NEW_LINE> <INDENT> config = configparser.Conf...
Custom token manager for new Reddit/PRAW refresh token managing
6259908376e4537e8c3f1095
class SortishSampler(Sampler): <NEW_LINE> <INDENT> def __init__(self, data_source, key, bs): <NEW_LINE> <INDENT> self.data_source,self.key,self.bs = data_source,key,bs <NEW_LINE> <DEDENT> def __len__(self): return len(self.data_source) <NEW_LINE> def __iter__(self): <NEW_LINE> <INDENT> idxs = np.random.permutation(len(...
Returns an iterator that traverses the the data in randomly ordered batches that are approximately the same size. The max key size batch is always returned in the first call because of pytorch cuda memory allocation sequencing. Without that max key returned first multiple buffers may be allocated when the first created...
62599083e1aae11d1e7cf59e
@unique <NEW_LINE> class WebAuthNUserVerificationRequirement(IntEnum): <NEW_LINE> <INDENT> ANY = 0 <NEW_LINE> REQUIRED = 1 <NEW_LINE> PREFERRED = 2 <NEW_LINE> DISCOURAGED = 3 <NEW_LINE> @classmethod <NEW_LINE> def from_string(cls, value): <NEW_LINE> <INDENT> return getattr(cls, value.upper().replace("-", "_"))
Maps to WEBAUTHN_USER_VERIFICATION_REQUIREMENT_*. https://github.com/microsoft/webauthn/blob/master/webauthn.h#L335
625990837047854f46340ecc
class Image(models.Model): <NEW_LINE> <INDENT> url = models.URLField() <NEW_LINE> picture = models.ImageField(upload_to=FULL, max_length=500) <NEW_LINE> gallery = models.ForeignKey('Gallery', related_name='images') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = _('Image') <NEW_LINE> verbose_name_plural = _('...
An Image model for a specific gallery, it represents an image with multiple thumbnails
625990835fdd1c0f98e5fa96
class OpenWeatherApi: <NEW_LINE> <INDENT> def __init__(self, city_name: str, country_slug: str): <NEW_LINE> <INDENT> self.base_url = settings.OPEN_WEATHER_API_BASE_URL <NEW_LINE> self.city_name = city_name <NEW_LINE> self.country_slug = country_slug <NEW_LINE> <DEDENT> def get_country_city_weather_data(self) -> (int, d...
Class to handle request to open weather map API
6259908397e22403b383ca15
class MajorBlues(MajorPentatonic): <NEW_LINE> <INDENT> @property <NEW_LINE> def intervals(self): <NEW_LINE> <INDENT> intervals = super(MajorBlues, self).intervals <NEW_LINE> intervals.insert(2, Dim(4)) <NEW_LINE> return intervals
Major Blues is the same as the Major Pentatonic but it adds a diminished 4th and consists of 6 notes.
625990838a349b6b43687d75
class RingBuffer1d(object): <NEW_LINE> <INDENT> def __init__(self, length, dtype=None): <NEW_LINE> <INDENT> self.offset = 0 <NEW_LINE> self._data = np.zeros(length, dtype=dtype) <NEW_LINE> self.stored = 0 <NEW_LINE> <DEDENT> def fill(self, number): <NEW_LINE> <INDENT> self._data.fill(number) <NEW_LINE> self.offset = 0 ...
This class implements an array being written in as a ring and that can be read from continuously ending with the newest data or starting with the oldest. It returns a numpy array copy of the data;
6259908355399d3f0562802b
class House(Model, BaseModel): <NEW_LINE> <INDENT> owner = ForeignKey(Merchant) <NEW_LINE> landlord = CharField(max_length=255) <NEW_LINE> landphone = CharField(max_length=20) <NEW_LINE> house_type = CharField(max_length=255) <NEW_LINE> house_address = CharField(max_length=255) <NEW_LINE> house_square = CharField(max_l...
Merchant have many houses to renter
6259908371ff763f4b5e92c4
@implementer(IArchiver) <NEW_LINE> class MailArchive: <NEW_LINE> <INDENT> name = 'mail-archive' <NEW_LINE> @staticmethod <NEW_LINE> def list_url(mlist): <NEW_LINE> <INDENT> if mlist.archive_policy is ArchivePolicy.public: <NEW_LINE> <INDENT> return urljoin(config.archiver.mail_archive.base_url, quote(mlist.posting_addr...
Public archiver at the Mail-Archive.com. Messages get archived at http://go.mail-archive.com.
625990834428ac0f6e65a046
class FrameMoveCenter(ActionMoveCenter): <NEW_LINE> <INDENT> def __init__(self, main_frame, smbedit): <NEW_LINE> <INDENT> super(FrameMoveCenter, self).__init__(main_frame, smbedit) <NEW_LINE> self.setTitle("Move Center") <NEW_LINE> v_box = QVBoxLayout() <NEW_LINE> self._gui_move_center_by_block_id(v_box) <NEW_LINE> sel...
@type button_block_id: QPushButton @type button_vector: QPushButton
6259908399fddb7c1ca63b66
class SyndicatedFeed(object): <NEW_LINE> <INDENT> __slots__ = [ '__title', '__items', ] <NEW_LINE> def __init__(self, content_stream: io.BytesIO): <NEW_LINE> <INDENT> assert hasattr(content_stream, 'read'), "Input must be a stream." <NEW_LINE> parsed_feed = feedparser.parse(content_stream) <NEW_LINE> if not parsed_feed...
Parsed feed object.
6259908363b5f9789fe86c81
class getSquareChatMember_args(object): <NEW_LINE> <INDENT> def __init__(self, request=None,): <NEW_LINE> <INDENT> self.request = request <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is no...
Attributes: - request
62599083be7bc26dc9252be2
class AlignedVolumeNotFoundException(MaterializationEngineException): <NEW_LINE> <INDENT> pass
error raised when a aligned_volume is not found
625990837047854f46340ece
class CrawlinoManager(metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> def __init__(self, running_config: RunningConfig): <NEW_LINE> <INDENT> current_config.running_config = running_config <NEW_LINE> <DEDENT> def update_global_config(self, crawler): <NEW_LINE> <INDENT> current_config.add_crawler_crawler(crawler)
Abstract class for run managers This class also manages the app config contexts
625990833317a56b869bf2d0
class Temperature(db.Model, CRUDMixin): <NEW_LINE> <INDENT> id = db.Column(db.Integer(), primary_key=True) <NEW_LINE> mac_address = db.Column(db.String(17)) <NEW_LINE> android_id = db.Column(db.String(16)) <NEW_LINE> device_id = db.Column(db.String(16)) <NEW_LINE> system_time = db.Column(db.DateTime) <NEW_LINE> time_st...
A Temperature is a single temperature log for a specific device/participant
62599083ec188e330fdfa3c4
@hashable_attrs <NEW_LINE> class MixTableChange(object): <NEW_LINE> <INDENT> instrument = attr.ib(default=None) <NEW_LINE> rse = attr.ib(default=None) <NEW_LINE> volume = attr.ib(default=None) <NEW_LINE> balance = attr.ib(default=None) <NEW_LINE> chorus = attr.ib(default=None) <NEW_LINE> reverb = attr.ib(default=None) ...
A MixTableChange describes a change in mix parameters.
62599083d8ef3951e32c8beb
class TeacherDetailView(View): <NEW_LINE> <INDENT> def get(self, request, teacher_id): <NEW_LINE> <INDENT> teacher = Teacher.objects.get(id=int(teacher_id)) <NEW_LINE> teacher_courses = Course.objects.filter(teacher=teacher) <NEW_LINE> teacher.click_nums += 1 <NEW_LINE> teacher.save() <NEW_LINE> hot_teachers = Teacher....
讲师详情
62599083fff4ab517ebcf32f
class TestRepository: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__list = [] <NEW_LINE> <DEDENT> def save(self,test): <NEW_LINE> <INDENT> self.__list.append(test) <NEW_LINE> <DEDENT> def listTests(self): <NEW_LINE> <INDENT> return self.__list
Descriere
62599083a05bb46b3848beb4
class Bool(CTLS.Bool, PathFormula): <NEW_LINE> <INDENT> pass
A class representing LTL Boolean atomic propositions.
625990834428ac0f6e65a048
class UserGroup(Base, SikrModelMixin): <NEW_LINE> <INDENT> name = Column(String) <NEW_LINE> users = relationship("User", secondary=user_group_table, backref="groups") <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return f"<Group: {self.name}"
Basic model to group users.
6259908371ff763f4b5e92c6
class ArchiveView(ArchiveListViewMixin, ListView): <NEW_LINE> <INDENT> def __parse_int_or_none(self, maybe_int): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return int(maybe_int) <NEW_LINE> <DEDENT> except (TypeError, ValueError): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> <DEDENT> def setup(self, request, *a...
View for http://ubyssey.ca/archive/ Bugs: Cannot click on "All years" or "All sections" once you have selected a particular year or section
6259908355399d3f0562802e
class ParameterValueError(WXpayException): <NEW_LINE> <INDENT> pass
Raised when parameter value is incorrect
6259908397e22403b383ca18
class Article: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__init__(None, 0, '', '', '', '', '', '', '') <NEW_LINE> <DEDENT> def __init__(self, id, category_id, title, thumb, download_links_http, download_links_thunder, update_time, orig_article_url, orig_thumb): <NEW_LINE> <INDENT> self.id = id <N...
文章数据
62599083adb09d7d5dc0c074
class Plot1DWithPlugins(Plot1D): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> Plot1D.__init__(self, parent) <NEW_LINE> self._plotType = "SCAN" <NEW_LINE> self._toolbar = qt.QToolBar(self) <NEW_LINE> self.addToolBar(self._toolbar) <NEW_LINE> pluginsToolButton = PluginsToolButton(plot=self, pa...
Add a plugin toolbutton to a Plot1D
6259908376e4537e8c3f1099
class agilentMSOX3024A(agilent3000A): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.__dict__.setdefault('_instrument_id', 'MSO-X 3024A') <NEW_LINE> super(agilentMSOX3024A, self).__init__(*args, **kwargs) <NEW_LINE> self._analog_channel_count = 4 <NEW_LINE> self._digital_channel_count...
Agilent InfiniiVision MSOX3024A IVI oscilloscope driver
625990833346ee7daa3383ef
class _ScalarAccessIndexer(NDFrameIndexerBase): <NEW_LINE> <INDENT> def _convert_key(self, key): <NEW_LINE> <INDENT> raise AbstractMethodError(self) <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> if not isinstance(key, tuple): <NEW_LINE> <INDENT> if not is_list_like_indexer(key): <NEW_LINE> <INDENT...
Access scalars quickly.
625990835fcc89381b266eea
class TMC2100(): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.__channel = channel <NEW_LINE> self.registers = TMC2100_register <NEW_LINE> self.fields = TMC2100_fields <NEW_LINE> self.variants = TMC2100_register_variant <NEW_LINE> self.MOTORS = 2 <NEW_LINE> <DEDENT> def showChipI...
Class for the TMC2100 IC
625990833617ad0b5ee07c6b
class Update(Base): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> install_helper = PkgInstall(self.settings, self.options, self.index, self.repo_cache, True) <NEW_LINE> pkg_names = self.options["<package>"] <NEW_LINE> for pkg_name in pkg_names: <NEW_LINE> <INDENT> install_helper.install(pkg_name, self.base_pkg...
Updates a package!
625990837b180e01f3e49df2
class BootstrapInfo: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.LIST, 'profiles', (TType.STRUCT,(BootstrapProfile, BootstrapProfile.thrift_spec)), None, ), ) <NEW_LINE> def __init__(self, profiles=None,): <NEW_LINE> <INDENT> self.profiles = profiles <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT...
This structure describes a collection of bootstrap profiles. <dl> <dt>profiles:</dt> <dd> List of one or more bootstrap profiles, in descending preference order. </dd> </dl> Attributes: - profiles
62599083fff4ab517ebcf332
class TypedObject(backend.TypedObject): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_new(cls, *args, **kwargs): <NEW_LINE> <INDENT> obj = super(TypedObject, cls).from_new(*args, **kwargs) <NEW_LINE> if db.exists(obj.key): <NEW_LINE> <INDENT> raise PersistentObjectError("Key already exists in DB") <NEW_LINE> <DE...
Typed Redis Object Class
62599083adb09d7d5dc0c076
class BasicAutoEncoder(nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(BasicAutoEncoder, self).__init__() <NEW_LINE> self.encoder = nn.Sequential( nn.Conv2d(in_channels=1, out_channels=32, kernel_size=5, stride=4, padding=2), nn.ELU(), nn.Conv2d(in_channels=32, out_channels=1, kernel_size=...
Basic auto encoder as stated in: "Jointly Learning Convolutional Representations to Compress Radiological Images and Classify Thoracic Diseases in the Compressed Domain" https://dl.acm.org/doi/abs/10.1145/3293353.3293408
6259908399fddb7c1ca63b68
class Googletest(CMakePackage): <NEW_LINE> <INDENT> homepage = "https://github.com/google/googletest" <NEW_LINE> url = "https://github.com/google/googletest/tarball/release-1.7.0" <NEW_LINE> version('1.8.1', sha256='8e40a005e098b1ba917d64104549e3da274e31261dedc57d6250fe91391b2e84') <NEW_LINE> version('1.8.0', sha2...
Google test framework for C++. Also called gtest.
62599083091ae3566870675d
class OraclePlatformVelocityHardLimitException(OracleException): <NEW_LINE> <INDENT> pass
This transaction is over platform-wide velocity limit. Consider increasing velocity limits.
625990837047854f46340ed2
class FaceDetector: <NEW_LINE> <INDENT> def __init__(self, dnn_proto_text='assets/deploy.prototxt', dnn_model='assets/res10_300x300_ssd_iter_140000.caffemodel'): <NEW_LINE> <INDENT> self.face_net = cv2.dnn.readNetFromCaffe(dnn_proto_text, dnn_model) <NEW_LINE> self.detection_result = None <NEW_LINE> <DEDENT> def get_fa...
Detect human face from image
625990833317a56b869bf2d2
class ClientError(Exception): <NEW_LINE> <INDENT> pass
Exception that represents errors in the client, regardless of implementation.
625990833617ad0b5ee07c6d
class MotifFinder(object): <NEW_LINE> <INDENT> def __init__(self, alphabet_strict=1): <NEW_LINE> <INDENT> self.alphabet_strict = alphabet_strict <NEW_LINE> <DEDENT> def find(self, seq_records, motif_size): <NEW_LINE> <INDENT> motif_info = self._get_motif_dict(seq_records, motif_size) <NEW_LINE> return PatternRepository...
Find motifs in a set of Sequence Records.
625990835fdd1c0f98e5fa9c
class CallbackServer(object): <NEW_LINE> <INDENT> def __init__(self, pool, gateway_client, port=DEFAULT_PYTHON_PROXY_PORT): <NEW_LINE> <INDENT> super(CallbackServer, self).__init__() <NEW_LINE> self.gateway_client = gateway_client <NEW_LINE> self.port = port <NEW_LINE> self.pool = pool <NEW_LINE> self.connections = [] ...
The CallbackServer is responsible for receiving call back connection requests from the JVM. Usually connections are reused on the Java side, but there is at least one connection per concurrent thread.
625990834527f215b58eb72e
class _FixedFindCallerLogger(logging.Logger): <NEW_LINE> <INDENT> def findCaller(self, stack_info=False): <NEW_LINE> <INDENT> f, name = _find_first_app_frame_and_name(['logging']) <NEW_LINE> if PY3: <NEW_LINE> <INDENT> if stack_info: <NEW_LINE> <INDENT> sinfo = _format_stack(f) <NEW_LINE> <DEDENT> else: <NEW_LINE> <IND...
Change the behavior of findCaller to cope with structlog's extra frames.
62599083ad47b63b2c5a936f
class CUBClassDataset(BaseCUBDataset): <NEW_LINE> <INDENT> def __init__(self, param, mode): <NEW_LINE> <INDENT> super(CUBClassDataset, self).__init__(param, mode) <NEW_LINE> self.used_class = self.param.data['use_classes'][0] <NEW_LINE> self.path_dir = os.path.join('/media/john/D/projects/platonicgan', param.data.path_...
Dataset for single bird class in CUB
6259908392d797404e3898eb
class BitAndOpExprTests(WithModuleTests): <NEW_LINE> <INDENT> def test_bit_and_op_expr_is_bit_and_op(self): <NEW_LINE> <INDENT> bit_and_op_expr = self.get_expr('1 & 2', 'int') <NEW_LINE> self.assertTrue(bit_and_op_expr.is_bit_and_op()) <NEW_LINE> <DEDENT> def test_bit_and_op_expr_is_no_other_expr(self): <NEW_LINE> <IND...
Tests for `BitAndOpExpr`.
6259908350812a4eaa621953
class Profile(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField(User) <NEW_LINE> partner = models.ForeignKey(Partner, null=True, related_name='user_profiles') <NEW_LINE> full_name = models.CharField(verbose_name=_("Full name"), max_length=128, null=True) <NEW_LINE> change_password = models.BooleanField(def...
Extension for the user class
62599083796e427e53850299
class WagtailMvcView(DetailView): <NEW_LINE> <INDENT> page = None <NEW_LINE> def dispatch(self, request, *args, **kwargs): <NEW_LINE> <INDENT> self.page = kwargs.pop('page') <NEW_LINE> return super(WagtailMvcView, self).dispatch(request, *args, **kwargs) <NEW_LINE> <DEDENT> def get_template_names(self): <NEW_LINE> <IND...
Basic default wagtail mvc view class
62599083091ae3566870675f
class StackNotFound(ManausException): <NEW_LINE> <INDENT> def __init__(self, name: str): <NEW_LINE> <INDENT> super().__init__("CloudFormation Stack not found: {}".format(name))
Error raised when the CloudFormation Stack is not found
62599083aad79263cf4302d9
class Vehicle_Attachment( CSV_Attachment ): <NEW_LINE> <INDENT> source_name= 'vid' <NEW_LINE> gtf_name= 'bus'
A :class:`CSV_Attachment` for the vehicle mapping.
625990837b180e01f3e49df4
@dataclass(eq=False, repr=False) <NEW_LINE> class Resource(betterproto.Message): <NEW_LINE> <INDENT> type: "ResourceType" = betterproto.enum_field(1) <NEW_LINE> name: str = betterproto.string_field(2)
Resource represents any resource that has role-bindings in the system
625990835fdd1c0f98e5fa9f
class CheckboxPainter(Painter): <NEW_LINE> <INDENT> DEFAULT_SIZING = DefaultPoliciesViaClass(UseSizeHint) <NEW_LINE> def __init__(self, content): <NEW_LINE> <INDENT> Painter.__init__(self) <NEW_LINE> self.content = content <NEW_LINE> <DEDENT> def buildQWidget(self, widget): <NEW_LINE> <INDENT> checkbox = QCheckBox(self...
Handles creation of the Qt widget for drawing a checkbox
62599083dc8b845886d550d9
class OnProcessIO(EventHandler): <NEW_LINE> <INDENT> def __init__( self, *, target_action: Optional['ExecuteProcess'] = None, on_stdin: Callable[[ProcessIO], Optional[SomeActionsType]] = None, on_stdout: Callable[[ProcessIO], Optional[SomeActionsType]] = None, on_stderr: Callable[[ProcessIO], Optional[SomeActionsType]]...
Convenience class for handling I/O from processes via events.
625990837cff6e4e811b7561
class Solution: <NEW_LINE> <INDENT> def trap(self, height: List[int]) -> int: <NEW_LINE> <INDENT> left = 0 <NEW_LINE> right= len(height)-1 <NEW_LINE> answer = 0 <NEW_LINE> for idx,wall in enumerate(height): <NEW_LINE> <INDENT> left_max = max(height[:idx+1]) <NEW_LINE> right_max = max(height[idx:]) <NEW_LINE> min_wall =...
brute force
625990833346ee7daa3383f2
class EntityType(type): <NEW_LINE> <INDENT> def __new__(cls, name, parent, prop): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> mod, sep, cm_cls = environ.DATAGATOR_CACHE_BACKEND.rpartition(".") <NEW_LINE> CacheManagerBackend = getattr(importlib.import_module(mod), cm_cls) <NEW_LINE> assert(issubclass(CacheManagerBacken...
Meta class for initializing class members of the Entity class
62599083091ae35668706761
class WsgiLogErrors(object): <NEW_LINE> <INDENT> omit_exceptions = [ PermissionDenied, Http404, ] <NEW_LINE> def process_exception(self, request, exception): <NEW_LINE> <INDENT> if not type(exception) in self.omit_exceptions: <NEW_LINE> <INDENT> tb_text = traceback.format_exc() <NEW_LINE> url = request.build_absolute_u...
Log all but the omitted exceptions w tracebacks to web server error_log via wsgi.errors.
625990835fcc89381b266eed
class StopGroupRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.GroupId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.GroupId = params.get("GroupId")
StopGroup请求参数结构体
62599083099cdd3c6367618a
class Auth(BaseAuth): <NEW_LINE> <INDENT> def login(self, user, password): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> host = self.configuration.get('auth', 'imap_host') <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> host = '' <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> secure = _convert_to_bool(self.config...
Authenticate user with IMAP. Configuration: [auth] type = radicale_imap imap_host = example.com:143 imap_secure = True
62599083aad79263cf4302dc
class Invoice(models.Model): <NEW_LINE> <INDENT> _inherit = 'account.invoice' <NEW_LINE> subs = fields.Boolean(related='invoice_line_ids.subs', string='subs', help="It indicates that the invoice is an Subscription Invoice.", store=True)
Inherits invoice and adds ad boolean to invoice to flag Subscription-invoices
625990835fdd1c0f98e5faa1
class RouteFilterRule(SubResource): <NEW_LINE> <INDENT> _validation = { 'etag': {'readonly': True}, 'provisioning_state': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'etag': {'key': 'etag'...
Route Filter Rule Resource. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :param name: The name of the resource that is unique within a resource group. This name can be used to access the resource. :type name: str :param location: Resour...
6259908360cbc95b06365afc
class CategoryAdminForm(forms.ModelForm): <NEW_LINE> <INDENT> parent = TreeNodeChoiceField(label=_('parent category').capitalize(), required=False, empty_label=_('No parent category'), queryset=Category.tree.all(), level_indicator=u'|--') <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(Categor...
Form for Category's Admin
62599083f548e778e596d0ad
class CartpolePolicy(ParameterCreatingPolicy): <NEW_LINE> <INDENT> def act(self, observation): <NEW_LINE> <INDENT> self.current_parameter = 0 <NEW_LINE> p = self.param <NEW_LINE> x, x_dot, theta, theta_dot = observation <NEW_LINE> go_right = (p(0) * x + p(0) * x_dot + p(0) * theta + p(0) * theta_dot) > 0 <NEW_LINE> ret...
A policy to solve CartPole-v0
6259908371ff763f4b5e92ce
class AberrationPhantom(BaseMaterial): <NEW_LINE> <INDENT> def __init__(self, temperature: float): <NEW_LINE> <INDENT> super().__init__(temperature) <NEW_LINE> <DEDENT> @property <NEW_LINE> def constant_of_attenuation(self) -> float: <NEW_LINE> <INDENT> temperatures = numpy.array([20.0, 30.0]) <NEW_LINE> measurements =...
AberrationPhantom TODO Need unit tests
625990835fdd1c0f98e5faa2
class RoleMetadata(Base): <NEW_LINE> <INDENT> _allow_duplicates = FieldAttribute(isa='bool', default=False) <NEW_LINE> _dependencies = FieldAttribute(isa='list', default=list) <NEW_LINE> _galaxy_info = FieldAttribute(isa='GalaxyInfo') <NEW_LINE> def __init__(self, owner=None): <NEW_LINE> <INDENT> self._owner = owner <N...
This class wraps the parsing and validation of the optional metadata within each Role (meta/main.yml).
625990837b180e01f3e49df6
class SparseUniformNeighborSampler(object): <NEW_LINE> <INDENT> def __init__(self, adj,): <NEW_LINE> <INDENT> assert sparse.issparse(adj), "SparseUniformNeighborSampler: not sparse.issparse(adj)" <NEW_LINE> self.adj = adj <NEW_LINE> idx, partial_degrees = np.unique(adj.nonzero()[0], return_counts=True) <NEW_LINE> self....
Samples from "sparse 2D edgelist", which looks like [ [0, 0, 0, 0, ..., 0], [1, 2, 3, 0, ..., 0], [1, 3, 0, 0, ..., 0], ... ] stored as a scipy.sparse.csr_matrix. The first row is a "dummy node", so there's an "off-by-one" issue vs `feats`. Have to increment/decrement by 1 in ...
62599083fff4ab517ebcf33a
class ConvertToASCIIPreprocessorTestCase(ChatBotTestCase): <NEW_LINE> <INDENT> def test_convert_to_ascii(self): <NEW_LINE> <INDENT> statement = Statement(text=u'Klüft skräms inför på fédéral électoral große') <NEW_LINE> cleaned = preprocessors.convert_to_ascii(statement) <NEW_LINE> normal_text = 'Kluft skrams infor pa ...
Make sure that ChatterBot's ASCII conversion preprocessor works as expected.
6259908392d797404e3898ee