code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Space2Depth(function_node.FunctionNode): <NEW_LINE> <INDENT> def __init__(self, r): <NEW_LINE> <INDENT> self.r = r <NEW_LINE> <DEDENT> def check_type_forward(self, in_types): <NEW_LINE> <INDENT> type_check.expect(in_types.size() == 1) <NEW_LINE> type_check.expect( in_types[0].dtype.kind == 'f', in_types[0].ndim =... | Space to depth transformation. | 62598f958c0ade5d55dc34f1 |
class GUI(App): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> if 'runnable' in kwargs: <NEW_LINE> <INDENT> self.runnable = kwargs['runnable'] <NEW_LINE> del kwargs['runnable'] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise ValueError("Missing ``runnable`` from argument list.") <NEW_LINE> <D... | Main class for moire GUI.
Moire apps should be ran with it in following way::
runnable = YourRunnable()
gui = moire.GUI(runnable=runnable)
gui.run()
The engine is fully relying on your custom runnable class. It
should implement a number of features like perform a simulation
step, render frame etc. See th... | 62598f95be383301e02534ca |
class CodeLengthInvalidException(JudgeException): <NEW_LINE> <INDENT> pass | Code Length Invalid | 62598f954428ac0f6e6581f1 |
class Node(): <NEW_LINE> <INDENT> def __init__(self, value=None, next=None): <NEW_LINE> <INDENT> self.__value = value <NEW_LINE> self.__next = next <NEW_LINE> <DEDENT> @property <NEW_LINE> def value(self): <NEW_LINE> <INDENT> return self.__value <NEW_LINE> <DEDENT> @value.setter <NEW_LINE> def value(self, value): <NEW_... | Single Linked List Node | 62598f95627d3e7fe0e06b6f |
class ModelTestCase(): <NEW_LINE> <INDENT> def set_up(self): <NEW_LINE> <INDENT> self.blockchain_block = None <NEW_LINE> self.blockchain = Blockchain() <NEW_LINE> <DEDENT> def test_model_can_create_a_block(self): <NEW_LINE> <INDENT> old_count = Blockchain.objects.count() <NEW_LINE> self.blockchain.save() <NEW_LINE> new... | Defines the test suite for the Blockchain model. | 62598f950a50d4780f70509e |
class FourierBasis(object): <NEW_LINE> <INDENT> def __init__(self, nvars, min_vals=0, max_vals=None, order=3): <NEW_LINE> <INDENT> self.order = order <NEW_LINE> self.min_vals = min_vals <NEW_LINE> self.max_vals = max_vals <NEW_LINE> terms = itertools.product(range(order + 1), repeat=nvars) <NEW_LINE> self.multipliers =... | Fourier Basis linear function approximation.
Requires the ranges for each dimension, and is thus able to use only sine or
cosine (and uses cosine). So, this has half the coefficients that a full
Fourier approximation would use.
Many thanks to Will Dabney (wdabney@) for this implementation.
From the paper:
G.D. Konid... | 62598f958e7ae83300ee8d64 |
class Solution(object): <NEW_LINE> <INDENT> def arrayNesting(self, nums): <NEW_LINE> <INDENT> rec, aux = set(), set() <NEW_LINE> count = 0 <NEW_LINE> for x in nums: <NEW_LINE> <INDENT> if x in rec: <NEW_LINE> <INDENT> continue <NEW_LINE> <DEDENT> while True: <NEW_LINE> <INDENT> if x not in aux: <NEW_LINE> <INDENT> aux.... | 索引从0开始长度为N的数组A,包含0到N - 1的所有整数。找到并返回最大的集合S,
S[i] = {A[i], A[A[i]], A[A[A[i]]], ... }且遵守以下的规则。
假设选择索引为i的元素A[i]为S的第一个元素,S的下一个元素应该是A[A[i]],
之后是A[A[A[i]]]... 以此类推,不断添加直到S出现重复的元素。
输入: A = [5,4,0,3,1,6,2]
输出: 4
解释:
A[0] = 5, A[1] = 4, A[2] = 0, A[3] = 3, A[4] = 1, A[5] = 6, A[6] = 2.
其中一种最长的 S[K]:
S[0] = {A[0], A[5], A[6], A[... | 62598f9530bbd722464697da |
class MovieParser(BaseParser): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(MovieParser, self).__init__(*args, **kwargs) <NEW_LINE> pattern1 = r'(?P<title>.+)\s\((?P<year>\d+)\)' <NEW_LINE> pattern2 = r'(?P<title>.+)\.' <NEW_LINE> self.patterns = pattern1, pattern2 <NEW_LINE> <DEDE... | Custom parser subclass for parsing data out of Movie filenames.
Currently all of the following patterns are matched:
==================== ====================================
Pattern Example
==================== ====================================
(.+)\s\((\d+)\) Alice in Wonderland (2010).m4... | 62598f95ac7a0e7691f721d3 |
class Context(str, Enum): <NEW_LINE> <INDENT> paper = "paper" <NEW_LINE> notebook = "notebook" <NEW_LINE> talk = "talk" <NEW_LINE> poster = "poster" | Seaborn context set the size of the plot | 62598f9594891a1f408b9554 |
class StudentViewUserStateMixin: <NEW_LINE> <INDENT> NESTED_BLOCKS_KEY = "components" <NEW_LINE> INCLUDE_SCOPES = (Scope.user_state, Scope.user_info, Scope.preferences) <NEW_LINE> USER_STATE_FIELDS = [] <NEW_LINE> def transforms(self): <NEW_LINE> <INDENT> return {} <NEW_LINE> <DEDENT> def build_user_state_data(self, co... | Mixin to provide student_view_user_state view.
To prevent unnecessary overloading of the build_user_state_data method,
you may specify `USER_STATE_FIELDS` to customise build_user_state_data
and student_view_user_state output. | 62598f9524f1403a92685715 |
class UniqueVisitors(Metrics): <NEW_LINE> <INDENT> id = "uvisitors" <NEW_LINE> name = "Unique Visitors" <NEW_LINE> desc = "Number of unique visitors" <NEW_LINE> data_source = DownloadsDS <NEW_LINE> def get_agg(self): <NEW_LINE> <INDENT> return {'uvisitors' : 'null'} <NEW_LINE> <DEDENT> def get_ts(self): <NEW_LINE> <IND... | Number of unique visitors | 62598f95090684286d59353c |
class OptionNameDoubleDash(RegistrationError): <NEW_LINE> <INDENT> pass | Long option name must begin with a double-dash. | 62598f9538b623060ffa8d53 |
class TestJsonFindWorkflowsRequest(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 testJsonFindWorkflowsRequest(self): <NEW_LINE> <INDENT> pass | JsonFindWorkflowsRequest unit test stubs | 62598f95d53ae8145f918154 |
class max_employment_of_retail_food_and_other_services_accessible_from_work_to_home_drive_alone(Variable): <NEW_LINE> <INDENT> def dependencies(self): <NEW_LINE> <INDENT> return [ "psrc_parcel.household_x_building.worker1_employment_of_retail_food_and_other_services_accessible_from_work_to_home_drive_alone", "psrc_parc... | max_employment_of_retail_food_and_other_services_accessible_from_work_to_home_drive_alone between worker1 & worker2 | 62598f9523e79379d538c1c8 |
class UserReviewerExtension(models.Model): <NEW_LINE> <INDENT> _name = "res.users" <NEW_LINE> _inherit = "res.users" <NEW_LINE> assigned_review_ids = fields.One2many('paper_submission.review', 'reviewer_id', string="Assigned Reviews") | Extension of the User model, adding assigned reviews.
Attributes:
_name: name of the model (the same value as _inherit)
_inherit: name of the inheriting model
assigned_reviews_ids: link to the assigned reviews | 62598f9573bcbd0ca4bc9f20 |
class OptimizerManager: <NEW_LINE> <INDENT> def __init__(self, optims): <NEW_LINE> <INDENT> self.optims = optims if isinstance(optims, Iterable) else [optims] <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> for op in self.optims: <NEW_LINE> <INDENT> op.zero_grad() <NEW_LINE> <DEDENT> <DEDENT> def __exit__(... | automatic call op.zero_grad() when enter, call op.step() when exit
usage:
with OptimizerManager(op): # or with OptimizerManager([op1, op2])
b = net.forward(a)
b.backward(torch.ones_like(b)) | 62598f9526068e7796d4c629 |
class TestMediaFileCreation(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.TEST_FILE = os.path.join(TEST_FILE_PATH, 'SIN001 Sinuca.mp4') <NEW_LINE> <DEDENT> def test_nonexistente_file(self): <NEW_LINE> <INDENT> self.assertIsNone(MediaFile(**{'filename': 'NAOEXISTE'})) <NEW_LINE> <DEDE... | Testes das funcionalidades da classe MediaFile | 62598f958e71fb1e983bb77c |
class SetOfStacks: <NEW_LINE> <INDENT> def __init__(self, capacity): <NEW_LINE> <INDENT> self.stacks = [] <NEW_LINE> self.capacity = capacity <NEW_LINE> <DEDENT> def push(self, item): <NEW_LINE> <INDENT> last = self._get_last_stack() <NEW_LINE> if last and not last.is_full(): <NEW_LINE> <INDENT> last.push(item) <NEW_LI... | A class that supports multiple finite sized stacks | 62598f954e4d5625663720ea |
class Encoder(JSONEncoder): <NEW_LINE> <INDENT> def push_date(self, d): <NEW_LINE> <INDENT> return "%04d-%02d-%02d" % (d.year, d.month, d.day) <NEW_LINE> <DEDENT> def push_time(self, t): <NEW_LINE> <INDENT> return "%02d:%02d:%02d" % (t.hour, t.minute, t.second) <NEW_LINE> <DEDENT> def push_datetime(self, dt): <NEW_LINE... | Extends the base simplejson JSONEncoder for date and decimal types. | 62598f95851cf427c66b7f8e |
class OpenConnectionInstanceUser: <NEW_LINE> <INDENT> def __init__(self, open_connection): <NEW_LINE> <INDENT> self.__conn = weakref.proxy(open_connection) <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def __exit__(self, exc_type, exc_val, exc_tb): <NEW_LINE> <INDENT> retu... | helper class to avoid having a user of an open connection closing the connection inadvertently
when used in a context (with ...) | 62598f95d6c5a102081e1e0b |
class Solution: <NEW_LINE> <INDENT> def numSubmat(self, mat: List[List[int]]) -> int: <NEW_LINE> <INDENT> rows = len(mat) <NEW_LINE> cols = len(mat[0]) <NEW_LINE> dp = [[0 for _ in range(cols)] for _ in range(rows)] <NEW_LINE> for i in range(rows): <NEW_LINE> <INDENT> for j in range(cols): <NEW_LINE> <INDENT> if mat[i]... | Given a rows * columns matrix mat of ones and zeros, return how many submatrices have all ones. | 62598f9591af0d3eaad39acf |
class Solution: <NEW_LINE> <INDENT> def triangleCount(self, S): <NEW_LINE> <INDENT> nums = S <NEW_LINE> result = 0 <NEW_LINE> if nums == None or len(nums) < 3: <NEW_LINE> <INDENT> return result <NEW_LINE> <DEDENT> nums.sort() <NEW_LINE> for i in range(2, len(nums)): <NEW_LINE> <INDENT> left, right = 0, i - 1 <NEW_LINE>... | @param S: A list of integers
@return: An integer | 62598f950c0af96317c5604b |
class WithResolverDjangoListObjectField(DjangoListObjectField): <NEW_LINE> <INDENT> def list_resolver(self, resolver, manager, filterset_class, filtering_args, root, info, **kwargs): <NEW_LINE> <INDENT> resolve_queryset = resolver(root, info, **kwargs) <NEW_LINE> qs_factory = queryset_factory(manager, info.field_asts, ... | Allows to define a resolver for the list object field. | 62598f958e7ae83300ee8d65 |
class TurboActivateProductKeyError(TurboActivateError): <NEW_LINE> <INDENT> pass | Invalid product key | 62598f9599cbb53fe6830b97 |
class RegistrationManager(models.Manager): <NEW_LINE> <INDENT> def activate_user(self, activation_key): <NEW_LINE> <INDENT> if SHA1_RE.search(activation_key): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> profile = self.get(activation_key=activation_key) <NEW_LINE> <DEDENT> except self.model.DoesNotExist: <NEW_LINE> <IN... | Custom manager for the ``RegistrationProfile`` model.
The methods defined here provide shortcuts for account creation
and activation (including generation and emailing of activation
keys), and for cleaning out expired inactive accounts. | 62598f957b25080760ed7169 |
class IsUserInUrl(permissions.BasePermission): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> url_username = request.parser_context.get('kwargs', {}).get('username', '') <NEW_LINE> if request.user.username.lower() != url_username.lower(): <NEW_LINE> <INDENT> raise Http404() <NEW_LINE> ... | Permission that checks to see if the request user matches the user in the URL. | 62598f95004d5f362081ee60 |
class CookbookPackageContentSerializer(SingleArtifactContentUploadSerializer): <NEW_LINE> <INDENT> name = serializers.CharField(help_text=_("name of the cookbook"), required=True) <NEW_LINE> version = serializers.CharField(help_text=_("version of the cookbook"), required=False) <NEW_LINE> dependencies = serializers.JSO... | Serializer for the cookbook content. | 62598f95bde94217f37074cd |
@python_2_unicode_compatible <NEW_LINE> class Concept(object): <NEW_LINE> <INDENT> def __init__(self, prefLabel, arity, altLabels=[], closures=[], extension=set()): <NEW_LINE> <INDENT> self.prefLabel = prefLabel <NEW_LINE> self.arity = arity <NEW_LINE> self.altLabels = altLabels <NEW_LINE> self.closures = closures <NEW... | A Concept class, loosely based on SKOS
(http://www.w3.org/TR/swbp-skos-core-guide/). | 62598f952c8b7c6e89bd3497 |
class junitxml(type): <NEW_LINE> <INDENT> def __new__(meta, name, bases, methods): <NEW_LINE> <INDENT> cls = super(junitxml, meta).__new__(meta, name, bases, methods) <NEW_LINE> cls = attributed(cls) <NEW_LINE> return cls | Metaclass to decorate the xml class | 62598f9545492302aabfc1a1 |
class IndexView(generic.ListView): <NEW_LINE> <INDENT> template_name = 'scorecard/index.html' <NEW_LINE> model = Course <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return Course.objects.get_queryset().order_by('-votes') | The index page is a generic ListView.
All Courses are shown in a list | 62598f9510dbd63aa1c7087e |
class Position(object): <NEW_LINE> <INDENT> def __init__(self, line, col): <NEW_LINE> <INDENT> self.line = line <NEW_LINE> self.col = col <NEW_LINE> <DEDENT> def move(self, pivot, delta): <NEW_LINE> <INDENT> if self < pivot: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> if delta.line == 0: <NEW_LINE> <INDENT> if self.... | See module docstring. | 62598f95a219f33f346c64e3 |
class RNA(Alphabet): <NEW_LINE> <INDENT> def __init__(self, unknown_nt=False): <NEW_LINE> <INDENT> if unknown_nt: chars = b'ACGUN'; chars_rc = b'UGCAN' <NEW_LINE> else: chars = b'ACGU'; chars_rc = b'UGCA' <NEW_LINE> encoding = np.arange(len(chars)) <NEW_LINE> encoding += 1 <NEW_LINE> encoding_rc = np.arange... | RNA sequence encoder | 62598f950a50d4780f70509f |
class SMTPHandler(logging.Handler): <NEW_LINE> <INDENT> def __init__(self, mailhost, fromaddr, toaddrs, subject, credentials=None, secure=None): <NEW_LINE> <INDENT> logging.Handler.__init__(self) <NEW_LINE> if isinstance(mailhost, tuple): <NEW_LINE> <INDENT> self.mailhost, self.mailport = mailhost <NEW_LINE> <DEDENT> e... | A handler class which sends an SMTP email for each logging event. | 62598f9516aa5153ce4001c5 |
class RefererHeader(ft.Uri): <NEW_LINE> <INDENT> field_name = "Referer" | The Referer[sic] request-header field allows the client
to specify, for the server's benefit, the address (URI)
of the resource from which the Request-URI was obtained
(the "referrer", although the header field is misspelled.)
Referer = "Referer" ":" ( absoluteURI | relativeURI ) | 62598f95cc0a2c111447acde |
class DiscordHandler(logging.Handler): <NEW_LINE> <INDENT> def __init__(self, bot: commands.Bot, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.client = bot <NEW_LINE> self.log_channel = self.client.get_channel(LOGGING_CHANNEL_ID) <NEW_LINE> <DEDENT> def _level_to_color(self, le... | A class implementing logging.Handler methods to send logs to a Discord channel. | 62598f95c432627299fa2c9d |
class MODIFY_PDP_CONTEXT_REJECT(Layer3): <NEW_LINE> <INDENT> constructorList = [ie for ie in Header(10, 76)] <NEW_LINE> def __init__(self, with_options=True, **kwargs): <NEW_LINE> <INDENT> Layer3.__init__(self) <NEW_LINE> self.extend([ Int('SMCause', Pt=111, Type='uint8', Dict=SMCause_dict), Type4_TLV('ProtC... | Net <-> MS
Global | 62598f9515baa72349461c4a |
class PyPylint(Package): <NEW_LINE> <INDENT> homepage = "https://pypi.python.org/pypi/pylint" <NEW_LINE> url = "https://pypi.python.org/packages/source/p/pylint/pylint-1.4.1.tar.gz" <NEW_LINE> version('1.4.1', 'df7c679bdcce5019389038847e4de622') <NEW_LINE> version('1.4.3', '5924c1c7ca5ca23647812f5971d0ea44') <NEW_... | array processing for numbers, strings, records, and objects. | 62598f9501c39578d7f12a53 |
class ModelerScene(QgsModelGraphicsScene): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> super().__init__(parent) <NEW_LINE> <DEDENT> def createParameterGraphicItem(self, model, param): <NEW_LINE> <INDENT> return ModelerInputGraphicItem(param.clone(), model) <NEW_LINE> <DEDENT> def createChil... | IMPORTANT! This is intentionally a MINIMAL class, only containing code which HAS TO BE HERE
because it contains Python code for compatibility with deprecated methods ONLY.
Don't add anything here -- edit the c++ base class instead! | 62598f958a43f66fc4bf1e45 |
class FieldRef(Field): <NEW_LINE> <INDENT> class_ = 'ref' <NEW_LINE> def __init__(self, name, multiple=False, params=None, value=None): <NEW_LINE> <INDENT> super(FieldRef, self).__init__(name, multiple, params, value) <NEW_LINE> self._validate() <NEW_LINE> parts = self._params['ref'].split('.') <NEW_LINE> self.ref_coll... | Defeines a reference to another field | 62598f9507d97122c421697b |
class UnresolvedDependency(Error): <NEW_LINE> <INDENT> pass | Exception raised when an object has an unresolved dependency | 62598f955f7d997b871f9241 |
class Joinable(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> <DEDENT> member = models.ManyToManyField(settings.AUTH_USER_MODEL, related_name="member_%(class)s", null=True, blank=True) <NEW_LINE> def is_member(self, user): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.... | This class of item can be joined. | 62598f9545492302aabfc1a2 |
class Contentlines(list): <NEW_LINE> <INDENT> def to_ical(self): <NEW_LINE> <INDENT> return b'\r\n'.join(line.to_ical() for line in self if line) + b'\r\n' <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_ical(cls, st): <NEW_LINE> <INDENT> st = to_unicode(st) <NEW_LINE> try: <NEW_LINE> <INDENT> unfolded = uFOLD.sub... | I assume that iCalendar files generally are a few kilobytes in size.
Then this should be efficient. for Huge files, an iterator should probably
be used instead. | 62598f9507f4c71912baf114 |
class PgAgentStatsTestCase(BaseTestGenerator): <NEW_LINE> <INDENT> scenarios = [ ('Check the stats of pgAgent job', dict(url='/browser/pga_job/stats/')) ] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> flag, msg = pgagent_utils.is_valid_server_to_run_pgagent(self) <NEW_LINE> if not flag: <NEW_LINE> <INDENT> self.skipT... | This class will test the stats pgAgent job API | 62598f954e4d5625663720eb |
class UnramifiedExtensionFieldCappedRelative(UnramifiedExtensionGeneric, pAdicCappedRelativeFieldGeneric): <NEW_LINE> <INDENT> def __init__(self, prepoly, poly, prec, halt, print_mode, shift_seed, names, implementation='NTL'): <NEW_LINE> <INDENT> self._shift_seed = None <NEW_LINE> self._pre_poly = prepoly <NEW_LINE> se... | TESTS::
sage: R.<a> = QqCR(27,10000); R == loads(dumps(R))
True | 62598f957d847024c075c09d |
class Default: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.category = FakeType.default | Default data type.
| 62598f950fa83653e46f4bb3 |
@XBlock.needs("i18n") <NEW_LINE> class XModule(HTMLSnippet, XModuleMixin): <NEW_LINE> <INDENT> entry_point = "xmodule.v1" <NEW_LINE> has_score = descriptor_attr('has_score') <NEW_LINE> show_in_read_only_mode = descriptor_attr('show_in_read_only_mode') <NEW_LINE> _field_data_cache = descriptor_attr('_field_data_cache') ... | Implements a generic learning module.
Subclasses must at a minimum provide a definition for get_html in order
to be displayed to users.
See the HTML module for a simple example. | 62598f95009cb60464d011ef |
class ADC(IRead): <NEW_LINE> <INDENT> IO_TYPE = IBase.IO_TYPE_INTEGER <NEW_LINE> IO_CHOICES = ( (0, 'CH0'), (1, 'CH1'), (2, 'CH2'), (3, 'CH3'), (4, 'CH4'), (5, 'CH5'), (6, 'CH6'), (7, 'CH7'), ) <NEW_LINE> class ChannelInUseError(Exception): pass <NEW_LINE> channels_in_use = {} <NEW_LINE> def __init__(self, ch_port): <N... | Maps to ADC using library
Read only implied | 62598f954527f215b58e9bae |
class EmbeddedRosenbrockScheme: <NEW_LINE> <INDENT> def __init__(self, name, A, G, gamma, b, e, p, q): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.A = np.array(A) <NEW_LINE> self.G = np.array(G) <NEW_LINE> self.b = np.array(b) <NEW_LINE> self.gamma = gamma <NEW_LINE> self.p = p <NEW_LINE> self.e = np.array(e) ... | Embedded Rosenbrock scheme (A,G,gamma,b,e) of orders p(q)
p is the order of Rosenbrock scheme (A,G,gamma,b)
q is the order of Rosenbrock scheme (A,G,gamma,b+e) | 62598f95baa26c4b54d4ef79 |
class Meta: <NEW_LINE> <INDENT> model = Bucket <NEW_LINE> fields = ('id', 'name', 'movies', 'date_created', 'date_modified') <NEW_LINE> read_only_fields = ('date_created', 'date_modified') | Meta class to map serializer's fields with the model fields. | 62598f95fbf16365ca793d7f |
class TestAttribute(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> class Person(XmlObj): <NEW_LINE> <INDENT> type = Attribute() <NEW_LINE> source = Attribute() <NEW_LINE> <DEDENT> self.obj = Person.fromstring(INITIAL_DATA) <NEW_LINE> <DEDENT> def test_getattr(self): <NEW_LINE> <INDENT> sel... | Test the attribute access of xmlobj. | 62598f95a79ad16197769d2b |
class GeventDownloader(NewsDownloader): <NEW_LINE> <INDENT> def __init__(self, *arg, **kwargs): <NEW_LINE> <INDENT> super(GeventDownloader, self).__init__() <NEW_LINE> self.num_workers = 4 <NEW_LINE> if 'num_workers' in kwargs: <NEW_LINE> <INDENT> self.num_workers = kwargs['num_workers'] <NEW_LINE> <DEDENT> gevent.monk... | docstring for GeventDownloader | 62598f9596565a6dacd2cddf |
class TestVcnAccountCreateViewAsStaff(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.dict = { 'username': "hbuyse", 'password': "usermodel", 'first_name': "Henri", 'last_name': "Buyse", 'is_staff': True } <NEW_LINE> self.staff = get_user_model().objects.create_user(**self.dict) <NEW_LINE> <DED... | Tests. | 62598f95bde94217f37074ce |
class DynamicHTTPEndpointCase(unittest.TestCase): <NEW_LINE> <INDENT> endpoint_port = 0 <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.log = logging.getLogger(__name__) <NEW_LINE> cls.http_endpoint = tsqa.endpoint.DynamicHTTPEndpoint(port=cls.endpoint_port) <NEW_LINE> cls.http_endpoint.... | This class will set up a dynamic http endpoint that is local to this class | 62598f95a4f1c619b294e2b6 |
class AutoCompleteSelectMultipleWidget(forms.widgets.SelectMultiple): <NEW_LINE> <INDENT> media = property(_media) <NEW_LINE> add_link = None <NEW_LINE> def __init__(self, channel, help_text='', show_help_text=True, plugin_options={}, *args, **kwargs): <NEW_LINE> <INDENT> url_params = kwargs.pop('url_params', None) <NE... | widget to select multiple models | 62598f95507cdc57c63a4a5e |
class GATLayerAdj(nn.Module): <NEW_LINE> <INDENT> def __init__(self,d_i,d_o,act=F.relu,eps=1e-6): <NEW_LINE> <INDENT> super(GATLayerAdj,self).__init__() <NEW_LINE> self.f = nn.Linear(2*d_i,d_o) <NEW_LINE> self.w = nn.Linear(2*d_i,1) <NEW_LINE> self.act = act <NEW_LINE> self._init_weights() <NEW_LINE> <DEDENT> def _init... | More didatic (also memory-hungry) GAT layer | 62598f958c0ade5d55dc34f3 |
class NandGate(_SimpleCombinatorial): <NEW_LINE> <INDENT> def evaluate(self, a, b): <NEW_LINE> <INDENT> if (a == "1") and (b == "1"): <NEW_LINE> <INDENT> return "0" <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return "1" | A Nand Gate. | 62598f95460517430c431ebe |
class LearningAgent(Agent): <NEW_LINE> <INDENT> def __init__(self, env, learning=False, epsilon=1.0, alpha=0.5): <NEW_LINE> <INDENT> super(LearningAgent, self).__init__(env) <NEW_LINE> self.planner = RoutePlanner(self.env, self) <NEW_LINE> self.valid_actions = self.env.valid_actions <NEW_LINE> self.learning = learning ... | An agent that learns to drive in the Smartcab world.
This is the object you will be modifying. | 62598f951b99ca400228f392 |
class SubmitTests(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.challenge = ( "03AHJ_Vutbkv3jolF5JXfJTFf5wtbdkwIJF7WA77WYjLfOUEvKW7eHBiEDKQB__7" "GHtUOmXC13GFYIt09HuS-ZN1j5EuDmC7bzHpHUAlpI5rbOvByypYt1vtskwnN24g" "zwWkrtKj8yGBWRNFljFMvtqYqHeHwJitRktSfKmV4q9VVgLBwkwlbvGUICmGaDrx" "dg5l... | Tests for :func:`bridgedb.txrecaptcha.submit`. | 62598f95627d3e7fe0e06b73 |
class seParticComuEtnicasForm(ModelForm): <NEW_LINE> <INDENT> lists = SelectList() <NEW_LINE> inidnomb = forms.CharField(label = u'Nombre del documento', max_length = 500) <NEW_LINE> inidlocf = forms.CharField(label = u'Ubicación del documento', max_length = 250, required = False) <NEW_LINE> inidanor = forms.ChoiceFie... | Socioeconómico
Participación de comunidades étnicas
Información general | 62598f9530dc7b766599f51d |
class AdministratorDetails(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'first_name': {'key': 'first_name', 'type': 'str'}, 'last_name': {'key': 'last_name', 'type': 'str'}, 'email_address': {'key': 'email', 'type': 'str'}, 'phone': {'key': 'phone', 'type': 'str'}, } <NEW_LINE> def __init__( self... | Details of the organization administrator of the certificate issuer.
:param first_name: First name.
:type first_name: str
:param last_name: Last name.
:type last_name: str
:param email_address: Email address.
:type email_address: str
:param phone: Phone number.
:type phone: str | 62598f958da39b475be02ead |
class DoneApi(object): <NEW_LINE> <INDENT> def __init__(self, token, team): <NEW_LINE> <INDENT> self.team = team <NEW_LINE> self.session = requests.Session() <NEW_LINE> self.session.headers['Authorization'] = 'Token {}'.format(token) <NEW_LINE> <DEDENT> def submit_done(self, done): <NEW_LINE> <INDENT> post_data = {'raw... | Wrapper around some of the functionality provided by idonethis.
:param str token: Your authorization token for the API
:param str team: Name of the team to the user did something on. | 62598f958da39b475be02eae |
class OpTimes: <NEW_LINE> <INDENT> EarliestDep = nptime(5, 45) <NEW_LINE> LatestDep = nptime(0, 30) <NEW_LINE> EarliestArr = nptime(5, 00) <NEW_LINE> LatestArr = nptime(0, 30) <NEW_LINE> @staticmethod <NEW_LINE> def InDepCurfew(t): <NEW_LINE> <INDENT> if not isinstance(t, nptime): <NEW_LINE> <INDENT> return False <NEW_... | avoid takeoffs or landings at times passengers dislike, so we check | 62598f9576e4537e8c3ef27e |
class ScalarGaussian(Distribution): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> def rvs(self,size=None): <NEW_LINE> <INDENT> return np.sqrt(self.sigmasq)*np.random.normal(size=size)+self.mu <NEW_LINE> <DEDENT> def log_likelihood(self,x): <NEW_LINE> <INDENT> x = np.reshape(x,(-1,1)) <NEW_LINE> return (-0.... | Abstract class for all scalar Gaussians. | 62598f9501c39578d7f12a55 |
class BasicDecoderTest(tf.test.TestCase, DecoderTests): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> tf.test.TestCase.setUp(self) <NEW_LINE> tf.logging.set_verbosity(tf.logging.INFO) <NEW_LINE> DecoderTests.__init__(self) <NEW_LINE> <DEDENT> def create_decoder(self, helper, mode): <NEW_LINE> <INDENT> params... | Tests the `BasicDecoder` class.
| 62598f95090684286d59353e |
class ProcessScratchpadResponse(Response): <NEW_LINE> <INDENT> def __init__(self, req_id, gw_id, res, sink_id, **kwargs): <NEW_LINE> <INDENT> super(ProcessScratchpadResponse, self).__init__( req_id, gw_id, res, sink_id, **kwargs ) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_payload(cls, payload): <NEW_LINE> <I... | ProcessScratchpadResponse: Response to answer a ProcessScratchpadRequest
Attributes:
req_id (int): unique request id that this Response is associated
gw_id (str): gw_id (str): gateway unique identifier
res (GatewayResultCode): result of the operation
sink_id (str): id of the sink (dependant on gateway) | 62598f953c8af77a43b67da1 |
class InvalidAPIOperation(NameSiloError): <NEW_LINE> <INDENT> pass | Raised if the API operaiton is invalid. | 62598f958e71fb1e983bb780 |
class additionalTopoGetters(JobProperty): <NEW_LINE> <INDENT> statusOn = True <NEW_LINE> allowedTypes = ['list'] <NEW_LINE> StoredValue = [] | List of PseudoJet getters to add for Topo jets.
E.g. to tag jets with track jets | 62598f9591af0d3eaad39ad3 |
class ListDiagsHandler(PersistentServerConnectionApplication): <NEW_LINE> <INDENT> def __init__(self, command_line=None, command_arg=None): <NEW_LINE> <INDENT> PersistentServerConnectionApplication.__init__(self) <NEW_LINE> self.token = '' <NEW_LINE> self.server_uri = '' <NEW_LINE> <DEDENT> def parse_arg(self, arg): <N... | Lists the status for all known diags on a single server or SHC | 62598f95d486a94d0ba2bca0 |
@description(_("Switch roles of partners in bi-directional replication")) <NEW_LINE> class SwitchCommand(Command): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> self.parent = parent <NEW_LINE> <DEDENT> def run(self, context, args, kwargs, opargs): <NEW_LINE> <INDENT> if not self.parent.entity.get(... | Usage: switch_roles
Example: switch_roles
Switch roles of partners in bi-directional replication. | 62598f95baa26c4b54d4ef7b |
class SerialDevice(Device): <NEW_LINE> <INDENT> def __init__(self, deviceID, serialDevice, baud=9600, **kwargs): <NEW_LINE> <INDENT> super(SerialDevice, self).__init__(deviceID, **kwargs) <NEW_LINE> if isinstance(serialDevice, str) or isinstance(serialDevice, unicode): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.... | A device we connect to over a serial port. | 62598f956fb2d068a7693c99 |
class SwitchInterfaceTranslator(LookupTranslator, USBTranslator): <NEW_LINE> <INDENT> DEVICE_CLASS_ID = usbdevice.DeviceClassID(vendor_id=0x04d8, product_id=0x5900, release_number=0x0000) <NEW_LINE> TRANSLATION_TABLE = LookupTable({ b'\x00': events.ButtonUpEvent, b'\x01': events.ButtonDownEvent}) | Translate USB messages from the switch interface to event. | 62598f95adb09d7d5dc0a254 |
class ConflictError(ConfigError): <NEW_LINE> <INDENT> def __init__(self, actions): <NEW_LINE> <INDENT> actions.sort(key=conflict_keyfunc) <NEW_LINE> self.actions = actions <NEW_LINE> result = [ 'Conflict between:'] <NEW_LINE> for action in actions: <NEW_LINE> <INDENT> codeinfo = action.codeinfo() <NEW_LINE> if codeinfo... | Raised when there is a conflict in configuration.
| 62598f95004d5f362081ee62 |
class JobConfiguration(object): <NEW_LINE> <INDENT> def __init__(self, query=None, load=None): <NEW_LINE> <INDENT> self.query = query <NEW_LINE> self.load = load | https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#jobconfiguration | 62598f950c0af96317c56050 |
class Account(): <NEW_LINE> <INDENT> def __init__(self, account_no, balance): <NEW_LINE> <INDENT> self.__account_no = account_no <NEW_LINE> self.__balance = balance <NEW_LINE> <DEDENT> def get_account_no(self): <NEW_LINE> <INDENT> return self.__account_no <NEW_LINE> <DEDENT> def get_account_balance(self): <NEW_LINE> <I... | Bank account super class | 62598f952ae34c7f260aadb7 |
@registry.register_real_modality("log_poisson_loss") <NEW_LINE> class RealLogPoissonLossModality(RealModality): <NEW_LINE> <INDENT> def loss(self, top_out, targets): <NEW_LINE> <INDENT> predictions = top_out <NEW_LINE> if (len(common_layers.shape_list(top_out)) != len( common_layers.shape_list(targets))): <NEW_LINE> <I... | Modality for real (i.e. float) vectors with log Poisson regression loss. | 62598f957047854f4633f0ac |
class TestSerial(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.serialport = SerialTestClass() <NEW_LINE> logging.basicConfig(level=logging.ERROR) <NEW_LINE> self.setup = SetupTestClass() <NEW_LINE> self.func = HeatmiserAdaptor(self.setup) <NEW_LINE> self.func.serport = self.serialpor... | Low level serial send and recieve message tests | 62598f95a17c0f6771d5bf08 |
class TestHistoryData(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 testHistoryData(self): <NEW_LINE> <INDENT> pass | HistoryData unit test stubs | 62598f95d99f1b3c44d0537c |
class TelegramComms(object): <NEW_LINE> <INDENT> def __init__(self, api_key): <NEW_LINE> <INDENT> self.api_key = api_key <NEW_LINE> self.chat_id = False <NEW_LINE> self.err_msg = '' <NEW_LINE> self.long_polling_timeout = 100 <NEW_LINE> self.URL = "https://api.telegram.org/bot{}/".format(self.api_key) <NEW_LINE> <DEDENT... | Class to send alert messages to Telegram Bot
Arguments:
api_key {mandatory str} -- [API token string from Telegram Bot]
Usage:
api_key = 1283738991:AAHe9eHOP_uCe6773bWjQTNvHT_lKyeGeew"
sender = MessageBot(api_key)
messages = ['Hello World!', 'This is the next line']
if not sender.send_msg(messag... | 62598f95287bf620b627188c |
class SerialKiller(MetaBadge): <NEW_LINE> <INDENT> id= "serialkiller" <NEW_LINE> model = models.History <NEW_LINE> one_time_only = True <NEW_LINE> title = _("Serial Killer") <NEW_LINE> description = _("Cancelled XX objects") <NEW_LINE> link_to_doc = "PLMObject/1_common.html#lifecycle" <NEW_LINE> level = "2" <NEW_LINE> ... | Badge won by user who cancelled XX objects.
(number of object set to 20 here but it can be modified) | 62598f9576e4537e8c3ef280 |
class Ewallet_Router(object): <NEW_LINE> <INDENT> def db_for_read(self, model, **hints): <NEW_LINE> <INDENT> if model._meta.app_label == 'ewallet': <NEW_LINE> <INDENT> return 'ewallet' <NEW_LINE> <DEDENT> return None <NEW_LINE> <DEDENT> def db_for_write(self, model, **hints): <NEW_LINE> <INDENT> if model._meta.app_labe... | A router to control all database operations on models in
the myapp application | 62598f9530dc7b766599f520 |
class Cortex: <NEW_LINE> <INDENT> def __init__(self, config, tensorboard_path): <NEW_LINE> <INDENT> self.posterior_cortex = PosteriorCortex(config['posterior_input_dim'], config['posterior_hidden_dim'], config['posterior_output_dim'], config['lr'][0], config['momentum'][0]) <NEW_LINE> num_stripes = [1] + config['num_st... | Provides a cortex consisting of an autoencoder for preprocessing (posterior cortex)
together with a collection of stripe layers.
Parameters:
config: Dictionary of configs parsed from json used to create the model.
tensorboard_path: Path to where tensorboard event files will be written. | 62598f9563d6d428bbee248b |
class RecentDeploymentsTable(tables.Table): <NEW_LINE> <INDENT> project = tables.Column(accessor='stage.project.name', verbose_name='Project', orderable=False) <NEW_LINE> stage = tables.Column(accessor='stage.name', verbose_name='Stage', orderable=False) <NEW_LINE> task_name = tables.Column(accessor='task.name', verbos... | Table used to show the recent deployments of a user | 62598f95cb5e8a47e493bfda |
class RenderingContextIngredient(Ingredient): <NEW_LINE> <INDENT> def late_init(self, context): <NEW_LINE> <INDENT> context.rc = RenderingContext(context.ansi) | Ingredient that adds a RenderingContext to guacamole. | 62598f9507f4c71912baf118 |
class PythonMissingRequiredUse(results.VersionResult, results.Warning): <NEW_LINE> <INDENT> @property <NEW_LINE> def desc(self): <NEW_LINE> <INDENT> return 'missing REQUIRED_USE="${PYTHON_REQUIRED_USE}"' | Package is missing PYTHON_REQUIRED_USE.
The python-r1 and python-single-r1 eclasses require the packages to
explicitly specify `REQUIRED_USE=${PYTHON_REQUIRED_USE}`. If Python is used
conditionally, it can be wrapped in appropriate USE conditionals. | 62598f9545492302aabfc1a6 |
class ProductViewTest(TestCase): <NEW_LINE> <INDENT> fixtures = ['users.json'] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.code = 'some_product' <NEW_LINE> self.user = { 'username': 'foo@example.com', 'password': 'admin' } <NEW_LINE> self.attrs = { 'return_value.product': object(), 'return_value.get_brands.ret... | Testing product view | 62598f958a43f66fc4bf1e49 |
class Pixel(object): <NEW_LINE> <INDENT> def __init__(self, image, x, y): <NEW_LINE> <INDENT> self.image = image <NEW_LINE> self._x = x <NEW_LINE> self._y = y <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return 'r:' + str(self.red) + ' g:' + str(self.green) + ' b:' + str(self.blue) <NEW_LINE> <DEDENT> @pr... | A pixel at an x,y in a SimpleImage.
Supports set/get .red .green .blue
and get .x .y | 62598f95eab8aa0e5d30ba50 |
class ModifyClusterTagsResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TaskId = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.TaskId = params.get("TaskId") <NEW_LINE> self.RequestId = params.get("RequestId") | ModifyClusterTags返回参数结构体
| 62598f9510dbd63aa1c70883 |
class IssuesReply(models.Model): <NEW_LINE> <INDENT> reply_type_choices = ( (1, '修改记录'), (1, '修改记录'), ) <NEW_LINE> reply_type = models.IntegerField(verbose_name='类型', choices=reply_type_choices) <NEW_LINE> issue = models.ForeignKey(verbose_name='问题', to='Issues', on_delete=models.CASCADE) <NEW_LINE> content = models.Te... | 问题回复 | 62598f9573bcbd0ca4bc9f26 |
@interface <NEW_LINE> class HttpPlugin (object): <NEW_LINE> <INDENT> def handle(self, context): <NEW_LINE> <INDENT> for name, method in self.__class__.__dict__.iteritems(): <NEW_LINE> <INDENT> if hasattr(method, '_url_pattern'): <NEW_LINE> <INDENT> method = getattr(self, name) <NEW_LINE> match = method._url_pattern.mat... | A base plugin class for HTTP request handling::
@plugin
class TerminalHttp (BasePlugin, HttpPlugin):
@url('/ajenti:terminal/(?P<id>\d+)')
def get_page(self, context, id):
if context.session.identity is None:
context.respond_redirect('/')
context.add_heade... | 62598f95fff4ab517ebcd4bb |
class Comments(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'comments' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> comment = db.Column(db.String(255)) <NEW_LINE> user_id = db.Column(db.Integer, db.ForeignKey("users.id")) <NEW_LINE> def __init__(self, comment, users): <NEW_LINE> <INDENT> self.co... | Defining the comment object | 62598f958e7ae83300ee8d6b |
class ICloudTrail(IResource): <NEW_LINE> <INDENT> accounts = zope.schema.List( title="Accounts to enable this CloudTrail in. Leave blank to assume all accounts.", description="", value_type=PacoReference( title="Account Reference", schema_constraint='IAccount' ), required=False, ) <NEW_LINE> cloudwatchlogs_log_group = ... | The ``resource/cloudtrail.yaml`` file specifies CloudTrail resources.
AWS CloudTrail logs all AWS API activity. Monitor and react to changes in your AWS accounts with CloudTrail.
A CloudTrail can be used to set-up a multi-account CloudTrail that sends logs from every account into a single S3 Bucket.
.. code-block:: b... | 62598f956e29344779b00328 |
class FixedStateAlphabetElement(StateAlphabetElement): <NEW_LINE> <INDENT> def __init__(self, oid=None, label=None, symbol=None, token=None, multistate=StateAlphabetElement.SINGLE_STATE, member_states=None): <NEW_LINE> <INDENT> StateAlphabetElement.__init__(self, oid=oid, label=label, symbol=symbol, token=token, multis... | Specialized for fixed state alphabets (e.g. DNA). | 62598f950c0af96317c56051 |
class SimpleOption(Option): <NEW_LINE> <INDENT> gconf_type = gconf.VALUE_INVALID <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.getter = getattr(gconf.Value, 'get_%s' % self.gconf_type.value_nick) <NEW_LINE> self.setter = getattr(gconf.Value, 'set_%s' % self.gconf_type.value_nick) <NEW_LINE> s... | Base class for all types in gconf. | 62598f952ae34c7f260aadb9 |
class FileHandlerFilter(Filter): <NEW_LINE> <INDENT> def filter(self, record): <NEW_LINE> <INDENT> if hasattr(record, 'counts'): <NEW_LINE> <INDENT> return 1 <NEW_LINE> <DEDENT> return 0 | Filter out records that should not be included in JSON or CSV report. | 62598f957047854f4633f0ae |
@icmpv6.register_icmpv6_type(ND_ROUTER_ADVERT) <NEW_LINE> class nd_router_advert(stringify.StringifyMixin): <NEW_LINE> <INDENT> _PACK_STR = '!BBHII' <NEW_LINE> _MIN_LEN = struct.calcsize(_PACK_STR) <NEW_LINE> _ND_OPTION_TYPES = {} <NEW_LINE> @staticmethod <NEW_LINE> def register_nd_option_type(*args): <NEW_LINE> <INDEN... | ICMPv6 sub encoder/decoder class for Router Advertisement messages.
(RFC 4861)
This is used with ryu.lib.packet.icmpv6.icmpv6.
An instance has the following attributes at least.
Most of them are same to the on-wire counterparts but in host byte order.
__init__ takes the corresponding args in this order.
.. tabularco... | 62598f9516aa5153ce4001cb |
class LegacyReader(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> warnings.warn('LegacyReader is a deprecated wrapper and will be removed in a future' + ' release. Use (multiple) Reader(s) each with their own' + ' message handler.', DeprecationWarning) <NEW_LINE> old_params = {} ... | In ``v0.5.0`` we dropped support for "tasks" in the :class:`nsq.Reader` API in
favor of a single message handler.
``LegacyReader`` is a backwards compatible API for clients interacting with ``v0.5.0+`` that
want to continue to use "tasks".
Usage::
from nsq import LegacyReader as Reader | 62598f9530dc7b766599f521 |
class MaiorMenorNumero(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.maior = 0 <NEW_LINE> self.menor = 0 <NEW_LINE> self.lista_de_numeros = [] <NEW_LINE> <DEDENT> def iniciar(self): <NEW_LINE> <INDENT> print(f'{" INDICADOR DE MAIOR E MENOR NÚMEROS ":*^60}') <NEW_LINE> self.recebe_numeros() <NEW_LI... | Entre três números indicados pelo usuário, exibe o maior e o menor. | 62598f95cc0a2c111447ace4 |
class MeasurementsRouter: <NEW_LINE> <INDENT> def db_for_read(self, model, **hints): <NEW_LINE> <INDENT> if model._meta.app_label == 'measurements': <NEW_LINE> <INDENT> return DATABASE_ROUNTING <NEW_LINE> <DEDENT> return None <NEW_LINE> <DEDENT> def db_for_write(self, model, **hints): <NEW_LINE> <INDENT> if model._meta... | A router to control all database operations on models in the
measurements application. | 62598f9576e4537e8c3ef282 |
class ListProductsInProductSetAsyncPager: <NEW_LINE> <INDENT> def __init__( self, method: Callable[ ..., Awaitable[product_search_service.ListProductsInProductSetResponse] ], request: product_search_service.ListProductsInProductSetRequest, response: product_search_service.ListProductsInProductSetResponse, *, metadata: ... | A pager for iterating through ``list_products_in_product_set`` requests.
This class thinly wraps an initial
:class:`google.cloud.vision_v1.types.ListProductsInProductSetResponse` object, and
provides an ``__aiter__`` method to iterate through its
``products`` field.
If there are more pages, the ``__aiter__`` method w... | 62598f9523e79379d538c1d0 |
class STM32RandomWrites(unittest.TestCase): <NEW_LINE> <INDENT> count = 10 <NEW_LINE> blkcount = 5 <NEW_LINE> def runTest(self): <NEW_LINE> <INDENT> kit = devkit.factory(_stm32) <NEW_LINE> memsize = _stm32['BootStart'] <NEW_LINE> randmem = bytearray(memsize) <NEW_LINE> for i in xrange(memsize): <NEW_LINE> <INDENT> rand... | Do self.blkcount random block writes to flash, and check if data
does not corrupt | 62598f95be8e80087fbbed2d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.