code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class ClassicAdapter(wrapt.AdapterFactory): <NEW_LINE> <INDENT> def __init__(self, reason="", version="", action='always', category=DeprecationWarning): <NEW_LINE> <INDENT> self.reason = reason or "" <NEW_LINE> self.version = version or "" <NEW_LINE> self.action = action <NEW_LINE> self.category = category <NEW_LINE> s...
Classic adapter -- *for advanced usage only* This adapter is used to get the deprecation message according to the wrapped object type: class, function, standard method, static method, or class method. This is the base class of the :class:`~deprecated.sphinx.SphinxAdapter` class which is used to update the wrapped obj...
62598fc2a219f33f346c6a7e
class TestPlaceholderMixin(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.form = PlaceholderMixinForm() <NEW_LINE> <DEDENT> def test_placeholder_set_when_defiend(self): <NEW_LINE> <INDENT> self.assertIn('placeholder', self.form.fields['a'].widget.attrs.keys()) <NEW_LINE> self.assertEqual(self....
Tests for the :py:class:`thecut.forms.forms.PlaceholderMixin` class.
62598fc299fddb7c1ca62f28
class GoogleWifiSensor(SensorEntity): <NEW_LINE> <INDENT> def __init__(self, api, name, variable): <NEW_LINE> <INDENT> self._api = api <NEW_LINE> self._name = name <NEW_LINE> self._state = None <NEW_LINE> variable_info = MONITORED_CONDITIONS[variable] <NEW_LINE> self._var_name = variable <NEW_LINE> self._var_units = va...
Representation of a Google Wifi sensor.
62598fc255399d3f0562678e
class ComponentError(Exception): <NEW_LINE> <INDENT> def __init__(self, reason): <NEW_LINE> <INDENT> self.reason = reason <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.reason
Exception type for internal component signalling.
62598fc297e22403b383b181
class Highlight(object): <NEW_LINE> <INDENT> openapi_types = {"slug": "str", "title": "str", "icon_url": "str"} <NEW_LINE> attribute_map = {"slug": "slug", "title": "title", "icon_url": "icon_url"} <NEW_LINE> def __init__( self, slug=None, title=None, icon_url=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.
62598fc27b180e01f3e4918b
class SphinxStandaloneReader(SphinxBaseReader): <NEW_LINE> <INDENT> transforms = [ApplySourceWorkaround, ExtraTranslatableNodes, PreserveTranslatableMessages, Locale, CitationReferences, DefaultSubstitutions, MoveModuleTargets, HandleCodeBlocks, AutoNumbering, AutoIndexUpgrader, SortIds, RemoveTranslatableInline, Prese...
Add our own transforms.
62598fc25166f23b2e243658
class SurfaceOver3D1RangeSeries(SurfaceBaseSeries): <NEW_LINE> <INDENT> def __init__(self, expr, var_start_end_x, var_start_end_z ,var_start_end_y, **kwargs): <NEW_LINE> <INDENT> super(SurfaceOver3D1RangeSeries, self).__init__() <NEW_LINE> self.expr = sympify(expr) <NEW_LINE> self.var_x = sympify(var_start_end_x[0]) <N...
Representation for a 3D surface consisting of an implicit sympy expression and 3D range.
62598fc27d847024c075c634
class BoostingQuery(Query): <NEW_LINE> <INDENT> _internal_name = "boosting" <NEW_LINE> def __init__(self, positive, negative, negative_boost=0.0, boost=1.0, **kwargs): <NEW_LINE> <INDENT> super(BoostingQuery, self).__init__(**kwargs) <NEW_LINE> self.positive = positive <NEW_LINE> self.negative = negative <NEW_LINE> sel...
The boosting query can be used to effectively demote results that match a given query. Unlike the "NOT" clause in bool query, this still selects documents that contain undesirable terms, but reduces their overall score. Example: t = TermQuery('name', 'john') q = BoostingQuery(MatchAllQuery(), t, negative_boost=0.2) r...
62598fc223849d37ff85132b
class PrmEditer(Parametre): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Parametre.__init__(self, "editer", "edit") <NEW_LINE> self.groupe = "administrateur" <NEW_LINE> self.schema = "<nombre> <message>" <NEW_LINE> self.aide_courte = "édite une annonce" <NEW_LINE> self.aide_longue = "Cette sou...
Commande 'annonces editer'.
62598fc2283ffb24f3cf3afc
class Rat: <NEW_LINE> <INDENT> def __init__(self, symbol, row, col): <NEW_LINE> <INDENT> self.symbol = symbol <NEW_LINE> self.row = row <NEW_LINE> self.col = col <NEW_LINE> self.num_sprouts_eaten = 0 <NEW_LINE> <DEDENT> def set_location(self, row, col): <NEW_LINE> <INDENT> self.row = row <NEW_LINE> self.col = col <NEW_...
A rat caught in a maze.
62598fc28a349b6b436864b6
class FollowupMessage(messages.Message): <NEW_LINE> <INDENT> id = messages.IntegerField(1) <NEW_LINE> anno_id = messages.IntegerField(2) <NEW_LINE> creator = messages.MessageField(UserMessage, 3) <NEW_LINE> created = message_types.DateTimeField(4) <NEW_LINE> comment = messages.StringField(5)
Represents follow up message.
62598fc2ff9c53063f51a8c6
class PrologSearch(BackgroundTaskThread): <NEW_LINE> <INDENT> def __init__(self, view): <NEW_LINE> <INDENT> BackgroundTaskThread.__init__(self, "", True) <NEW_LINE> self.view = view <NEW_LINE> self.signatures = { 'Intel x86 function prologue' : ["\x55\x89\xE5\x83\xEC", "\x55\x89\xE5\x57\x56"], 'Intel x86 NOP Instructio...
Class that assists in locating function prologues in flat files binaries such as firmware
62598fc263b5f9789fe853eb
class AvailableProvidersList(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'countries': {'required': True}, } <NEW_LINE> _attribute_map = { 'countries': {'key': 'countries', 'type': '[AvailableProvidersListCountry]'}, } <NEW_LINE> def __init__( self, *, countries: List["AvailableProvidersListCountry"...
List of available countries with details. All required parameters must be populated in order to send to Azure. :param countries: Required. List of available countries. :type countries: list[~azure.mgmt.network.v2019_12_01.models.AvailableProvidersListCountry]
62598fc27b180e01f3e4918c
class ForwardModel(MongoDBModel): <NEW_LINE> <INDENT> coll_name = "forward_doc" <NEW_LINE> fields = ["forward_person_id", "article_id", "create_time", "is_forward"] <NEW_LINE> async def find_or_insert(self, valid_obj): <NEW_LINE> <INDENT> count_docs = await self.collection.count_documents({"forward_person_id": valid_ob...
转发 forward_person_id: 转发人id article_id: 文章id create_time: 创建时间 is_delete:是否删除
62598fc2e1aae11d1e7ce962
class PreferenceEditor(athena.LiveElement): <NEW_LINE> <INDENT> implements(ixmantissa.INavigableFragment) <NEW_LINE> title = 'Settings' <NEW_LINE> fragmentName = 'preference-editor' <NEW_LINE> def __init__(self, aggregator): <NEW_LINE> <INDENT> self.aggregator = aggregator <NEW_LINE> super(PreferenceEditor, self).__ini...
L{xmantissa.ixmantissa.INavigableFragment} adapter for L{xmantissa.prefs.PreferenceAggregator}. Responsible for rendering all installed L{xmantissa.ixmantissa.IPreferenceCollection}s
62598fc25166f23b2e24365a
class SimpleFactory: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def product_cpu(name): <NEW_LINE> <INDENT> if name == 'Inter': <NEW_LINE> <INDENT> return Inter() <NEW_LINE> <DEDENT> elif name == 'Amd': <NEW_LINE> <INDENT> return Amd() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise ValueError("{} not in cpu list"...
简单工厂.工厂根据不同条件生产不同功能的类.
62598fc24a966d76dd5ef14e
class TypeDetector(object): <NEW_LINE> <INDENT> def __init__( self, field_names=None, field_types=DEFAULT_TYPES, fallback_type=TextField, skip_indexes=None, ): <NEW_LINE> <INDENT> self.field_names = field_names or [] <NEW_LINE> self.field_types = list(field_types) <NEW_LINE> self.fallback_type = fallback_type <NEW_LINE...
Detect data types based on a list of Field classes
62598fc266656f66f7d5a66c
class DevConfig(Config): <NEW_LINE> <INDENT> ENV = "development" <NEW_LINE> DEBUG = True <NEW_LINE> TESTING = False <NEW_LINE> SQLALCHEMY_DATABASE_URI = environ.get("DATABASE_URI")
Dev config class for application factory
62598fc2ec188e330fdf8b0e
class E09(VOWarning, ValueError): <NEW_LINE> <INDENT> message_template = "'%s' must have a value attribute" <NEW_LINE> default_args = ('x',)
The ``MIN``, ``MAX`` and ``OPTION`` elements must always have a ``value`` attribute. **References**: `1.1 <http://www.ivoa.net/Documents/VOTable/20040811/REC-VOTable-1.1-20040811.html#sec:values>`__, `1.2 <http://www.ivoa.net/Documents/VOTable/20091130/REC-VOTable-1.2.html#sec:values>`__
62598fc221bff66bcd722ee5
class Expression25(Expression): <NEW_LINE> <INDENT> def get(self, instance): <NEW_LINE> <INDENT> raise NotImplementedError('%s not implemented' % ( self.__class__.__name__))
Aliases->Get Index of Alias Parameters: 0: Enter Name of Alias (String) Return type: Int
62598fc2656771135c4898eb
class ReportCommentInline(admin.StackedInline): <NEW_LINE> <INDENT> model = ReportComment
ReportComment Inline.
62598fc263b5f9789fe853ed
class _FunctionHistogram(_NumpyHistogram): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> _NumpyHistogram.__init__(self) <NEW_LINE> self.y = [] <NEW_LINE> <DEDENT> def step(self,x,y,bins,xmin,xmax): <NEW_LINE> <INDENT> _NumpyHistogram.step(self,x,bins,xmin,xmax) <NEW_LINE> self.y.append(y) <NEW_LINE> <DEDE...
Baseclass for histogrammed functions. A histogrammed function is created by applying a function to all values y that have been accumulated in a bin x.
62598fc24428ac0f6e6587a0
class TPAMConfigError(TPAMError): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> TPAMError.__init__(self, message)
Exception for a fatal client configuration error
62598fc25fdd1c0f98e5e20e
class atomic_file(AtomicLocalFile): <NEW_LINE> <INDENT> def move_to_final_destination(self): <NEW_LINE> <INDENT> os.rename(self.tmp_path, self.path) <NEW_LINE> <DEDENT> def generate_tmp_path(self, path): <NEW_LINE> <INDENT> return path + '-finestrino-tmp-%09d' % random.randrange(0, 1e10)
Simple class that writes to a temp file and moves it on close(). Also cleans up the temp file if close is not invoked.
62598fc2e1aae11d1e7ce963
class Conv2d_tf(nn.Conv2d): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(Conv2d_tf, self).__init__(*args, **kwargs) <NEW_LINE> self.padding = kwargs.get("padding", "SAME") <NEW_LINE> <DEDENT> def _compute_padding(self, input, dim): <NEW_LINE> <INDENT> input_size = input.size(dim + ...
Conv2d with the padding behavior from TF. Used for the ResNet implementation
62598fc2a8370b77170f065d
class MyMessageView(LoginRequiredMixin, View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> all_message = UserMessage.objects.filter(user= request.user.id) <NEW_LINE> all_unread_messages = UserMessage.objects.filter(user=request.user.id , has_read= False) <NEW_LINE> for unread_message in all_unread_m...
我的消息
62598fc257b8e32f5250825c
class BaseHandler(tornado.web.RequestHandler): <NEW_LINE> <INDENT> def load_json(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.request.arguments = json.loads(self.request.body) <NEW_LINE> <DEDENT> except ValueError: <NEW_LINE> <INDENT> msg = "Could not decode JSON: %s" % self.request.body <NEW_LINE> logger.d...
A class to collect common handler methods - all other handlers should subclass this one.
62598fc2be7bc26dc9251f9a
class ContourPlate(Part): <NEW_LINE> <INDENT> def AddContourPoint(self,contourPoint): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Delete(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Insert(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Modify(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> ...
ContourPlate()
62598fc2bf627c535bcb1723
class PrivateMessagesMixin(AuthenticatedReddit): <NEW_LINE> <INDENT> @decorators.restrict_access(scope='privatemessages') <NEW_LINE> def _mark_as_read(self, thing_ids, unread=False): <NEW_LINE> <INDENT> data = {'id': ','.join(thing_ids)} <NEW_LINE> key = 'unread_message' if unread else 'read_message' <NEW_LINE> respons...
Adds methods requiring the 'privatemessages' scope (or login). You should **not** directly instantiate instances of this class. Use :class:`.Reddit` instead.
62598fc2ec188e330fdf8b10
class NGOProjectForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Organization <NEW_LINE> fields = ('projects', )
Add project to the list of projects where given NGO is a mentor.
62598fc24527f215b58ea14c
class UnderscoreClassMethodUser: <NEW_LINE> <INDENT> def __init__(self, last_login): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def _new(cls): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def is_active(self): <NEW_LINE> <INDENT> pass
User domain model.
62598fc263b5f9789fe853ef
class Filter(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.iv = [] <NEW_LINE> self.ia = [] <NEW_LINE> self._filters = [] <NEW_LINE> self.ov = [] <NEW_LINE> self.oa = [] <NEW_LINE> <DEDENT> def _labels_to_str(self, v, a): <NEW_LINE> <INDENT> if not v and a: <NEW_LINE> <INDENT> v = [""] * len(...
>>> f = Filter() >>> f.iv.append("[0:v]") >>> f.add_filter("scale", "600", "400") >>> f.add_filter("setsar", "1") >>> f.ov.append("[v0]") >>> print(f.to_str()) [0:v]scale=600:400,setsar=1[v0] >>> # >>> f = Filter() >>> f.iv.append("[0:v]") >>> f.iv.append("[1:v]") >>> f.add_filter("concat") >>> f.ov.append("[vc0]") >>>...
62598fc255399d3f05626794
class ProgressViewBase(object): <NEW_LINE> <INDENT> def __init__(self, out): <NEW_LINE> <INDENT> self.out = out <NEW_LINE> <DEDENT> def write(self, args): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def flush(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def clear(self):...
a view base for progress reporting
62598fc24428ac0f6e6587a2
class Patch(object): <NEW_LINE> <INDENT> operation_types = { 'add': AddOperation, 'copy': CopyOperation, 'move': MoveOperation, 'remove': RemoveOperation, 'replace': ReplaceOperation, 'test': TestOperation, } <NEW_LINE> def __init__(self, patch): <NEW_LINE> <INDENT> self.patch = patch <NEW_LINE> <DEDENT> def get_operat...
JSON Patch defines a JSON document structure for expressing a sequence of operations to apply to a JavaScript Object Notation (JSON) document; it is suitable for use with the HTTP PATCH method. The "application/json-patch+json" media type is used to identify such patch documents.
62598fc297e22403b383b187
class Adviser(object): <NEW_LINE> <INDENT> name = "" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __del__(self): <NEW_LINE> <INDENT> pass
Representation of an adviser
62598fc260cbc95b063645ba
class getVoteDetail_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'params', None, None, ), ) <NEW_LINE> def __init__(self, params=None,): <NEW_LINE> <INDENT> self.params = params <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccel...
Attributes: - params
62598fc25fdd1c0f98e5e210
class StampsInfoResponse(object): <NEW_LINE> <INDENT> swagger_types = { 'code': 'int', 'status': 'str', 'stamps': 'StampsInfo' } <NEW_LINE> attribute_map = { 'code': 'Code', 'status': 'Status', 'stamps': 'Stamps' } <NEW_LINE> def __init__(self, code=None, status=None, stamps=None): <NEW_LINE> <INDENT> self._code = None...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598fc20fa83653e46f5163
class TestFile: <NEW_LINE> <INDENT> @pytest.fixture(autouse=True) <NEW_LINE> def setup(self): <NEW_LINE> <INDENT> self.t = configtypes.File() <NEW_LINE> <DEDENT> def test_validate_empty(self): <NEW_LINE> <INDENT> with pytest.raises(configexc.ValidationError): <NEW_LINE> <INDENT> self.t.validate("") <NEW_LINE> <DEDENT> ...
Test File.
62598fc2091ae35668704ea5
class ToolkitEditorFactory(BaseColorToolkitEditorFactory): <NEW_LINE> <INDENT> def to_qt4_color(self, editor): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> color = getattr(editor.object, editor.name + "_") <NEW_LINE> <DEDENT> except AttributeError: <NEW_LINE> <INDENT> color = getattr(editor.object, editor.name) <NEW_LI...
PyQt editor factory for color editors.
62598fc2a8370b77170f065f
@requires_data <NEW_LINE> @requires_fits <NEW_LINE> class test_wstat_single_array(SherpaTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self._old_logger_level = logger.getEffectiveLevel() <NEW_LINE> logger.setLevel(logging.ERROR) <NEW_LINE> ui.set_stat('wstat') <NEW_LINE> infile = self.make_path('3c...
Single PHA file with an array of backscal values. This really should use a grating PHA dataset, but it's not obvious we have one (along with the necessary responses) in the sherpa-test-data/ repository. So for now "hack" in one. The statistic values were calculated by changing the backscal by 0.9 but leaving it as a s...
62598fc25fdd1c0f98e5e211
class Get: <NEW_LINE> <INDENT> class Header(Schema): <NEW_LINE> <INDENT> X_GitHub_Media_Type = fields.String(data_key='X-GitHub-Media-Type', description='You can check the current version of media type in responses.\n') <NEW_LINE> Accept = fields.String(description='Is used to set specified media type.') <NEW_LINE> X_R...
List a user's followers
62598fc2adb09d7d5dc0a7fc
class ExceptionsDirEntryData(DataContainer): <NEW_LINE> <INDENT> pass
Holds the data related to SEH (and stack unwinding, in particular) struct an instance of RUNTIME_FUNTION unwindinfo an instance of UNWIND_INFO
62598fc2ec188e330fdf8b12
class Command(BaseCommand): <NEW_LINE> <INDENT> def handle(self, *args, **options): <NEW_LINE> <INDENT> self.stdout.write('waiting for databse...') <NEW_LINE> db_conn = None <NEW_LINE> while not db_conn: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> db_conn = connections['default'] <NEW_LINE> <DEDENT> except Operational...
Django command to pause execution until database is available.
62598fc2796e427e5384ea14
class ShapeFreeCallback(b2.queryCallback): <NEW_LINE> <INDENT> def __init__(self, test_fixtures, pose_a, pose_b=None, whitelist=None): <NEW_LINE> <INDENT> b2.queryCallback.__init__(self) <NEW_LINE> self.test_fixtures = test_fixtures <NEW_LINE> self.whitelist = whitelist if whitelist is not None else [] <NEW_LINE> self....
Callback class for Box2D shape collision detection Used to determine if the straight-line path between two poses of a shape is collision free in a Box2D world. Angles are interpolated linearly, so for large rotations this will be inaccurate. The test is done by casting each of the test_fixtures (one at at time) at ea...
62598fc255399d3f05626796
class NamespaceUpdateSerializer(NamespaceSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = models.Namespace <NEW_LINE> fields = ( 'id', 'name', 'company', 'email', 'avatar_url', 'description', 'links', 'groups', 'resources' ) <NEW_LINE> read_only_fields = ('name', )
NamespaceSerializer but read_only 'name'.
62598fc276e4537e8c3ef825
class Operation(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, 'origin': {'key': 'origin', 'type': 'str'}, 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'OperationPropert...
Network REST API operation definition. :param name: Operation name: {provider}/{resource}/{operation}. :type name: str :param display: Display metadata associated with the operation. :type display: ~azure.mgmt.network.v2021_05_01.models.OperationDisplay :param origin: Origin of the operation. :type origin: str :param ...
62598fc2cc40096d6161a318
class Restful(View): <NEW_LINE> <INDENT> def post(self, request, app_label=None, actor=None, pk=None): <NEW_LINE> <INDENT> rpt = requested_actor(app_label, actor) <NEW_LINE> ar = rpt.request(request=request) <NEW_LINE> instance = ar.create_instance() <NEW_LINE> if ar.actor.handle_uploaded_files is not None: <NEW_LINE> ...
Used to collaborate with a restful Ext.data.Store.
62598fc260cbc95b063645bc
class SineTerrainGenerator(TerrainGenerator): <NEW_LINE> <INDENT> def __init__( self, seed: int, base_height: float = 20.0, period: float = 9.0, amplitude: float = 7.5, x_scale: float = 1.0, y_scale: float = 1.2, ): <NEW_LINE> <INDENT> super().__init__(seed) <NEW_LINE> self.frequency: float = math.pi * 2.0 / period <NE...
A TerrainGenerator implementation that creates wavy terrain using sine waves. Nothing is randomized, so seed is unused. This implementation is not recommended once a better one is available.
62598fc2aad79263cf42ea55
class DescribeProductsResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TotalCount = None <NEW_LINE> self.Products = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.TotalCount = params.get("TotalCount") <NEW_LINE>...
DescribeProducts返回参数结构体
62598fc23d592f4c4edbb138
class ListaCardapio(RestauranteMixin, View): <NEW_LINE> <INDENT> template = 'restaurante/cardapio/lista_cardapio.html' <NEW_LINE> form_class = Form_Cardapio_Default <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> cardapios = self.restaurante.getEvery_menu() <NEW_LINE> form = self.form_class() <NEW_LINE> return r...
Mostra lista de cardapios em template
62598fc271ff763f4b5e79fc
class PianitzaTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.deck = initialize_deck() <NEW_LINE> self.hands = get_hands(self.deck) <NEW_LINE> self.all_active = list(range(4)) <NEW_LINE> self.suit_conflict = [(6,'♣'), (9,'♣'), (7,'♣'), (8,'♣')] <NEW_LINE> self.rare_conflict = ...
Tests for 'jug_artist.py'.
62598fc2091ae35668704ea7
class UserProfileValuesQuerySet(ValuesQuerySet): <NEW_LINE> <INDENT> def _clone(self, *args, **kwargs): <NEW_LINE> <INDENT> c = super(UserProfileValuesQuerySet, self)._clone(*args, **kwargs) <NEW_LINE> c._privacy_level = getattr(self, '_privacy_level', None) <NEW_LINE> return c <NEW_LINE> <DEDENT> def iterator(self): <...
Custom ValuesQuerySet to support privacy. Note that when you specify fields in values() you need to include the related privacy field in your query. E.g. .values('first_name', 'privacy_first_name')
62598fc24a966d76dd5ef154
class OneTimeKeyServlet(RestServlet): <NEW_LINE> <INDENT> PATTERNS = client_patterns("/keys/claim$") <NEW_LINE> def __init__(self, hs): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.auth = hs.get_auth() <NEW_LINE> self.e2e_keys_handler = hs.get_e2e_keys_handler() <NEW_LINE> <DEDENT> async def on_POST(self, req...
POST /keys/claim HTTP/1.1 { "one_time_keys": { "<user_id>": { "<device_id>": "<algorithm>" } } } HTTP/1.1 200 OK { "one_time_keys": { "<user_id>": { "<device_id>": { "<algorithm>:<key_id>": "<key_base64>" } } } }
62598fc23317a56b869be690
class SandboxService(object): <NEW_LINE> <INDENT> def __init__(self, params, service_name, uri='lxc:///'): <NEW_LINE> <INDENT> self.virsh = virsh.Virsh(uri=uri, ignore_status=True) <NEW_LINE> self.command = lvsb_base.SandboxCommandBase(params, service_name) <NEW_LINE> self.command.BINARY_PATH_PARAM = 'virt_sandbox_serv...
Management for a single new/existing sandboxed service
62598fc27c178a314d78d71f
class ModelStorageRelationDomain2Target(ModelSQL): <NEW_LINE> <INDENT> __name__ = 'test.modelstorage.relation_domain2.target' <NEW_LINE> relation2 = fields.Many2One( 'test.modelstorage.relation_domain.target', "Relation 2")
First Target of Model stored containing a relation field with a domain
62598fc27047854f4633f653
class TestExternalProtosComponent(ExternalProtosMixin, TestProtobufLibraryComponent): <NEW_LINE> <INDENT> @property <NEW_LINE> def exists(self): <NEW_LINE> <INDENT> return self.is_external_protos <NEW_LINE> <DEDENT> def generate_target_arguments(self): <NEW_LINE> <INDENT> args = super(MainExternalProtosComponent, self)...
Generates src/test/proto for external-protos.
62598fc25fdd1c0f98e5e213
class ShiftPlugin(plugin_object.GeneralPlugin): <NEW_LINE> <INDENT> implements = [interfaces.DecodingRoutineIdentifier] <NEW_LINE> version = 1.0 <NEW_LINE> def identify(self, vivisect_workspace, fvas): <NEW_LINE> <INDENT> candidate_functions = {} <NEW_LINE> for fva in fvas: <NEW_LINE> <INDENT> f = viv_utils.Function(vi...
Identify shift instructions.
62598fc2ec188e330fdf8b14
class DnsPoliciesDeleteResponse(_messages.Message): <NEW_LINE> <INDENT> pass
An empty DnsPoliciesDelete response.
62598fc2bf627c535bcb1727
class Meta: <NEW_LINE> <INDENT> app_label = 'sample_resource'
Meta class for VtPlanner model.
62598fc2099cdd3c63675522
class IProtocol(IPlugin): <NEW_LINE> <INDENT> metadata = {} <NEW_LINE> @abc.abstractmethod <NEW_LINE> def protocol_parameters_definition(self): <NEW_LINE> <INDENT> return {} <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def controller_parameters_definition(self): <NEW_LINE> <INDENT> return {} <NEW_LINE> <DEDENT> @...
Interface for plugins defining an experimental protocol Usage ===== User-provided protocol plugins should subclass IProtocol, provide traits-based UI for configuration and override next_trial_parameters(), protocol_definition(), event_definition(), data_values(), and process_completed_trial(). Example =======
62598fc2a219f33f346c6a88
class Child(Parent): <NEW_LINE> <INDENT> def childMethod(self): <NEW_LINE> <INDENT> print('calling child method')
childMethod.
62598fc2d486a94d0ba2c252
class Gdm(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): <NEW_LINE> <INDENT> plugin_name = 'gdm' <NEW_LINE> profiles = ('desktop',) <NEW_LINE> def setup(self): <NEW_LINE> <INDENT> self.add_copy_spec("/etc/gdm/*") <NEW_LINE> self.add_journal(units="gdm") <NEW_LINE> self.add_cmd_output("systemctl status gdm.service")
GNOME display manager
62598fc2377c676e912f6eb4
class _RequestCallbackManager(_CallbackManager): <NEW_LINE> <INDENT> def validate_callback(self, callback): <NEW_LINE> <INDENT> super(_RequestCallbackManager, self).validate_callback(callback) <NEW_LINE> if isinstance(callback, (type, types.ClassType)): <NEW_LINE> <INDENT> if not issubclass(callback, RequestCallback): ...
Manager for {@link RequestCallback} message callbacks.
62598fc297e22403b383b18b
class IntCompareFilter(DecimalCompareFilter): <NEW_LINE> <INDENT> fields = [ SimpleCompareField, forms.IntegerField(), ]
x greater, less, etc than int field
62598fc2cc40096d6161a319
class PhysicalSensor(VirtualSensor): <NEW_LINE> <INDENT> def __init__(self, broker, device=None, **kwargs): <NEW_LINE> <INDENT> super(PhysicalSensor, self).__init__(broker, **kwargs) <NEW_LINE> if device is None: <NEW_LINE> <INDENT> device = DeviceDescriptor(self, path=self.path) <NEW_LINE> log.debug("Setting default d...
A PhysicalSensor directly manages a physical sensing device attached to (or on board) the scale client's host. This is mostly a convention for establishing this contract, but in the future it may serve as a point of optimizing physical resource management.
62598fc23617ad0b5ee063c9
class TaxiiConnectorConfigurationException(CommonConfigException): <NEW_LINE> <INDENT> pass
Exception class for usage errors with TAXII configuration.
62598fc27047854f4633f655
class TargetReports(object): <NEW_LINE> <INDENT> swagger_types = { 'reports': 'list[TargetReport]' } <NEW_LINE> attribute_map = { 'reports': 'reports' } <NEW_LINE> def __init__(self, reports=None): <NEW_LINE> <INDENT> self._reports = None <NEW_LINE> self.discriminator = None <NEW_LINE> if reports is not None: <NEW_LINE...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598fc250812a4eaa620d26
class TargetDetector(object): <NEW_LINE> <INDENT> def __init__(self, img): <NEW_LINE> <INDENT> self.img = img <NEW_LINE> self.img_hsv = cv2.cvtColor(self.img, cv2.COLOR_BGR2HSV) <NEW_LINE> <DEDENT> def threshold(self, min, max): <NEW_LINE> <INDENT> THRESHOLD_MIN = np.array(min, np.uint8) <NEW_LINE> THRESHOLD_MAX = np.a...
description of class
62598fc2be7bc26dc9251f9d
class ObservableFunction: <NEW_LINE> <INDENT> def __init__(self, func): <NEW_LINE> <INDENT> functools.update_wrapper(self, func) <NEW_LINE> self.func = func <NEW_LINE> self.observers = {} <NEW_LINE> <DEDENT> def add_observer(self, observer, identify_observed=False): <NEW_LINE> <INDENT> if hasattr(observer, "__self__"):...
A function which can be observed. I wrap a function and allow other callables to register as observers of it. If you have a function func, then ObservableFunction(func) is a wrapper around func which can accept observers. Add and remove observers using: add_observer(observer) registers observer to be called when...
62598fc27cff6e4e811b5ca7
class RecipeImageSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Recipe <NEW_LINE> fields = ('id', 'image') <NEW_LINE> read_only_fields = ('id',)
Serializer from uploading images to recipies
62598fc2099cdd3c63675523
class DismodDBError(CascadeATError): <NEW_LINE> <INDENT> pass
Raised when there is an error with running the dismod_db script.
62598fc2f548e778e596b821
class CachedEventEmitter(EventEmitter): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.use_cache = False <NEW_LINE> self.processed_events = None <NEW_LINE> <DEDENT> def init(self): <NEW_LINE> <INDENT> super().init() <NEW_LINE> self.processed_events = deque() <NEW_LINE> <D...
This class adds cache mechanics to EventEmitter, to allow suspended emmiter buffing the incoming events.
62598fc226068e7796d4cbde
class LowRankMatrix(Base, LatentStructure): <NEW_LINE> <INDENT> def __init__(self, n_samples=100, n_features=100, effective_rank=10, tail_strength=0.5, random_state=None): <NEW_LINE> <INDENT> generator = check_random_state(random_state) <NEW_LINE> n = min(n_samples, n_features) <NEW_LINE> from .utils import qr_economic...
Mostly low rank random matrix with bell-shaped singular values profile. Most of the variance can be explained by a bell-shaped curve of width effective_rank: the low rank part of the singular values profile is:: (1 - tail_strength) * exp(-1.0 * (i / effective_rank) ** 2) The remaining singular values' tail is fa...
62598fc2377c676e912f6eb5
class KeyValueTable(Table): <NEW_LINE> <INDENT> def get_insert_defaults_query(self): <NEW_LINE> <INDENT> sql_method = "_executemany" <NEW_LINE> query = "INSERT OR IGNORE INTO {0} VALUES (?, ?)".format(self.name) <NEW_LINE> args = self.default_values.items() <NEW_LINE> return(sql_method, (query, args)) <NEW_LINE> <DEDEN...
Use this class for a table that use key-value pairs where the value for each key may be a different datatype (i.e. settings)
62598fc25fdd1c0f98e5e216
class BRPostalCodeField(RegexValidator): <NEW_LINE> <INDENT> default_error_messages = { 'invalid': _('Enter a valid postal code in the format XXXXX-XXX.'), } <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(BRPostalCodeField, self).__init__(r'^\d{5}-\d{3}$', *args, **kwargs)
A form field that validates input as a Brazilian zip code, with the format XXXXX-XXX.
62598fc2cc40096d6161a31a
class DeckScreengrid(BaseDeckGLViz): <NEW_LINE> <INDENT> viz_type = "deck_screengrid" <NEW_LINE> verbose_name = _("Deck.gl - Screen Grid") <NEW_LINE> spatial_control_keys = ["spatial"] <NEW_LINE> is_timeseries = True <NEW_LINE> def query_obj(self) -> QueryObjectDict: <NEW_LINE> <INDENT> self.is_timeseries = bool( self....
deck.gl's ScreenGridLayer
62598fc25166f23b2e243664
class RestrictedMultiplyMixin(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(RestrictedMultiplyMixin, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def create_equality_constraint_variable(self, size): <NEW_LINE> <INDENT> v = expression.Variable('', shape.Vector(size)) ...
This implements the restricted multiplication behavior.
62598fc292d797404e388ca4
class MockCypher(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def encrypt(message): <NEW_LINE> <INDENT> return message <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def decrypt(message): <NEW_LINE> <INDENT> return message
This class mocks Crypto.Cipher objects and does nothing.
62598fc25fdd1c0f98e5e217
class ResearchAuthorInline(admin.TabularInline): <NEW_LINE> <INDENT> model = ResearchAuthor
Easy editing of research author entry relations from the author entry page
62598fc27047854f4633f657
class MyBaseHandler(MyOriginBaseHandler): <NEW_LINE> <INDENT> def set_default_headers(self): <NEW_LINE> <INDENT> self.set_header("Access-Control-Allow-Origin", "*") <NEW_LINE> self.set_header("Access-Control-Allow-Headers", "x-requested-with,access_token") <NEW_LINE> self.set_header("Access-Control-Allow-Methods", "POS...
自定义session的类,基于tornado的 - logsession是登录的token,使用mongodb来存储 - sessionid使用redis来存储,以后用token,不用session了
62598fc221bff66bcd722eef
class Tests(IMP.test.TestCase): <NEW_LINE> <INDENT> def setup_filenames(self): <NEW_LINE> <INDENT> self.protein_fns = [ self.get_input_file_name("1z5s_A.pdb"), self.get_input_file_name("1z5s_B.pdb"), self.get_input_file_name("1z5s_C.pdb"), self.get_input_file_name("1z5s_D.pdb")] <NEW_LINE> self.fitting_solutions_fns = ...
Tests for reading fitting solutions
62598fc2796e427e5384ea1a
class ShowIpBgpTemplatePeerSession(ShowIpBgpTemplatePeerSession_iosxe): <NEW_LINE> <INDENT> pass
Parser for show ip bgp template peer-session <WORD>
62598fc24c3428357761a540
class ERSTimeSeries(ASCATTimeSeries): <NEW_LINE> <INDENT> def __init__(self, gpi, lon, lat, cell, data, topo_complex=None, wetland_frac=None, porosity_gldas=None, porosity_hwsd=None): <NEW_LINE> <INDENT> super(ERSTimeSeries, self).__init__(gpi, lon, lat, cell, data, topo_complex=topo_complex, wetland_frac=wetland_frac,...
Extends :class:`pytesmo.io.sat.ascat.ASCATTimeSeries` and provides correct string representation for ERS data
62598fc2d486a94d0ba2c256
class SwitcherBoolean(ToggleEntity): <NEW_LINE> <INDENT> def __init__(self, hass, slug_id, name, initial, entity_config): <NEW_LINE> <INDENT> self.hass = hass <NEW_LINE> self.entity_id = async_generate_entity_id(ENTITY_ID_FORMAT, slug_id, hass=hass) <NEW_LINE> self._name = name <NEW_LINE> self._state = initial <NEW_LIN...
Representation of the input_boolean
62598fc24428ac0f6e6587aa
class AbstractRecognizer: <NEW_LINE> <INDENT> def __init__(self, recognition_endpoint): <NEW_LINE> <INDENT> self.recognition_endpoint = recognition_endpoint <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def recognize(self, image): <NEW_LINE> <INDENT> pass
A base class for facial recognition service interfaces Args: recognition_endpoint (string): The url of the recognition service (theoretically could be something other than a string...maybe an object)
62598fc2aad79263cf42ea5b
class Deck(Hand): <NEW_LINE> <INDENT> def populate(self): <NEW_LINE> <INDENT> for suit in Card.SUITS: <NEW_LINE> <INDENT> for rank in Card.RANKS: <NEW_LINE> <INDENT> self.add(Card(rank, suit)) <NEW_LINE> <DEDENT> <DEDENT> <DEDENT> def shuffle(self): <NEW_LINE> <INDENT> import random <NEW_LINE> random.shuffle(self.cards...
Колода игральных карт.
62598fc266673b3332c30659
class BackendAddressPool(SubResource): <NEW_LINE> <INDENT> _validation = { 'backend_ip_configurations': {'readonly': True}, 'load_balancing_rules': {'readonly': True}, 'outbound_nat_rule': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'backend_ip_configurations': {'key': 'prope...
Pool of backend IP addresses. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :ivar backend_ip_configurations: Gets collection of references to IP addresses defined in network interfaces. :vartype backend_ip_configurations: list[~azure.mg...
62598fc257b8e32f52508261
class GameQuerySet(models.QuerySet): <NEW_LINE> <INDENT> def add_silver(self, silver): <NEW_LINE> <INDENT> game = self._get_game() <NEW_LINE> game.silver += silver <NEW_LINE> game.save(update_fields=['silver']) <NEW_LINE> <DEDENT> def alter_xp(self, bonus_xp): <NEW_LINE> <INDENT> game = self._get_game() <NEW_LINE> game...
Requête de base pour les informations de partie.
62598fc25fdd1c0f98e5e219
class BertTokenizedDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, data_path_words: str, data_path_tags: str, tag_to_ix: Vocab, tokenizer: BertTokenizer) -> None: <NEW_LINE> <INDENT> self.tokenizer = tokenizer <NEW_LINE> self.original_sentences = [sent.strip() for sent in open(data_path_words).readlines()] <NE...
The main class containing the Bert-tokenized dataset. The data is subsequently transferred into a DataLoader object so that it can be iterated over without having to be loaded into memory all at once (see create_bert_datasets() below).
62598fc20fa83653e46f516b
class TestV1ObjectFieldSelector(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 testV1ObjectFieldSelector(self): <NEW_LINE> <INDENT> model = lib_openshift.models.v1_object_field_selector.V1ObjectFi...
V1ObjectFieldSelector unit test stubs
62598fc2656771135c4898f5
class MockRequests: <NEW_LINE> <INDENT> flag = None <NEW_LINE> content = """{"message": "Invalid token", "errors": [{"type": "invalid_token", "subject": "token"}]}""" <NEW_LINE> status_code = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.url = None <NEW_LINE> self.data = None <NEW_LINE> self.kwargs = Non...
Mock smtplib class
62598fc2283ffb24f3cf3b0a
class CreateOperation(VDOOperation): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(CreateOperation, self).__init__(checkBinaries=True) <NEW_LINE> <DEDENT> def preflight(self, args): <NEW_LINE> <INDENT> super(CreateOperation, self).preflight(args) <NEW_LINE> if not args.name: <NEW_LINE> <INDENT> rais...
Implements the create command.
62598fc27047854f4633f65a
class UserDetailSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ( "id", "username", "gender", "birthday", "email", "mobile" )
用户详情序列化类
62598fc2ff9c53063f51a8d4
class FilelistsXMLFileContext(FastForwardXmlFileContext): <NEW_LINE> <INDENT> def __init__(self, working_dir, num_units, checksum_type=None): <NEW_LINE> <INDENT> metadata_file_path = os.path.join(working_dir, REPO_DATA_DIR_NAME, FILE_LISTS_XML_FILE_NAME) <NEW_LINE> self.num_packages = num_units <NEW_LINE> attributes = ...
Context manager for generating the filelists.xml.gz file.
62598fc25fc7496912d483be
class NumericCombo(wx.ComboBox): <NEW_LINE> <INDENT> def __init__(self, parent, choices, precision=3, init=0, width=80): <NEW_LINE> <INDENT> self.fmt = "%%.%if" % precision <NEW_LINE> self.choices = choices <NEW_LINE> schoices = [self.fmt % i for i in self.choices] <NEW_LINE> wx.ComboBox.__init__(self, parent, -1, '',...
Numeric Combo: ComboBox with numeric-only choices
62598fc221bff66bcd722ef1
class TestCompareXLSXFiles(ExcelComparisonTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.maxDiff = None <NEW_LINE> filename = 'textbox17.xlsx' <NEW_LINE> test_dir = 'xlsxwriter/test/comparison/' <NEW_LINE> self.got_filename = test_dir + '_test_' + filename <NEW_LINE> self.exp_filename = test_dir +...
Test file created by XlsxWriter against a file created by Excel.
62598fc2a219f33f346c6a8e
class Log4jAppenderTest(Test): <NEW_LINE> <INDENT> def __init__(self, test_context): <NEW_LINE> <INDENT> super(Log4jAppenderTest, self).__init__(test_context) <NEW_LINE> self.num_zk = 1 <NEW_LINE> self.num_brokers = 1 <NEW_LINE> self.messages_received_count = 0 <NEW_LINE> self.topics = { TOPIC: {'partitions': 1, 'repli...
Tests KafkaLog4jAppender using VerifiableKafkaLog4jAppender that appends increasing ints to a Kafka topic
62598fc2adb09d7d5dc0a803
@implementer(ISchemaField) <NEW_LINE> class SchemaField(Field): <NEW_LINE> <INDENT> def __init__(self, field): <NEW_LINE> <INDENT> super(SchemaField, self).__init__( field.title or None, field.__name__) <NEW_LINE> self.description = field.description <NEW_LINE> self.required = field.required <NEW_LINE> self.readonly = ...
A form field using a zope.schema field as settings.
62598fc2377c676e912f6eb7
class POP3Reader(BaseReader): <NEW_LINE> <INDENT> def __init__(self, args): <NEW_LINE> <INDENT> self.server = args['server'] <NEW_LINE> self.account = args['account'] <NEW_LINE> if args['ssl']: <NEW_LINE> <INDENT> self.pop3 = poplib.POP3_SSL <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.pop3 = poplib.POP3 <NEW_LIN...
This reader is used to monitor an email inbox. WARNING: This reader will retrieve all of your emails, and treat each one as an item. An update will be triggered every time a new email is recieved. If you only want to retrieve meta info, and manually check your email, please use IMAPReader instead (see private option)
62598fc2f548e778e596b825
class Pupitre(Frame): <NEW_LINE> <INDENT> def __init__(self, boss, canon): <NEW_LINE> <INDENT> Frame.__init__(self, bd =3, relief =GROOVE) <NEW_LINE> self.score =0 <NEW_LINE> s =Scale(self, from_ =88, to =65, troughcolor ='dark grey', command =canon.orienter) <NEW_LINE> s.set(45) <NEW_LINE> s.pack(side =LEFT) <NEW_LINE...
Pupitre de pointage associé à un canon
62598fc2a05bb46b3848aaf3