code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class CityServicer(object): <NEW_LINE> <INDENT> def table(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 get_all(self, request, ...
Missing associated documentation comment in .proto file.
62598f938e7ae83300ee8d2c
class DynamicShadowColor(object): <NEW_LINE> <INDENT> def __init__(self, color_info): <NEW_LINE> <INDENT> self.update(color_info) <NEW_LINE> <DEDENT> def update(self, color_info): <NEW_LINE> <INDENT> self.color_info = color_info <NEW_LINE> <DEDENT> def get_color_info(self): <NEW_LINE> <INDENT> return self.color_info
Dynamic shadow color.
62598f9310dbd63aa1c70845
class Char(str): <NEW_LINE> <INDENT> def __new__(cls, stream): <NEW_LINE> <INDENT> pos = stream.tell() <NEW_LINE> obj = str.__new__(cls, chr(struct.unpack(">l", stream.read(4))[0])) <NEW_LINE> obj.position = pos <NEW_LINE> return obj <NEW_LINE> <DEDENT> def pack(self,value): <NEW_LINE> <INDENT> return struct.pack(">l",...
Character from a binary stream, with index
62598f938da39b475be02e68
class Flatten(Nested): <NEW_LINE> <INDENT> def __init__(self, dataset: Dataset, name: str = None): <NEW_LINE> <INDENT> super().__init__(dataset, name) <NEW_LINE> <DEDENT> def generator(self): <NEW_LINE> <INDENT> for chunk in self._dataset: <NEW_LINE> <INDENT> for x in chunk: <NEW_LINE> <INDENT> yield x
Flatten the element of a dataset into multiple elements. The size of this dataset can't be determined in advance because we have to flatten every element from the wrapped dataset to know the exact size after flattening.
62598f9394891a1f408b9533
class Reddit(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> async def init(cls, username: str, password: str, app_id: str, app_secret: str): <NEW_LINE> <INDENT> self = Reddit <NEW_LINE> async with aiohttp.ClientSession() as session: <NEW_LINE> <INDENT> data = {'grant_type': 'password', 'username': username, 'pass...
The class for interacting with the Reddit API. To begin using this class, the ``init`` function needs to be called:: reddit = await Reddit.init('your', 'args', 'go', 'here') :raises ValueError: if the ``init`` function fails to authenticate the bot.
62598f934428ac0f6e6581b0
class DescribeProxyGroupListRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Offset = None <NEW_LINE> self.Limit = None <NEW_LINE> self.ProjectId = None <NEW_LINE> self.Filters = None <NEW_LINE> self.TagSet = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <IN...
DescribeProxyGroupList请求参数结构体
62598f934e4d5625663720a7
class Coarse_game_tree: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.sequence = [] <NEW_LINE> self.children = []
An SGF GameTree. This is a direct representation of the SGF parse tree. It's 'coarse' in the sense that the objects in the tree structure represent node sequences, not individual nodes. Public attributes sequence -- nonempty list of property maps children -- list of Coarse_game_trees The sequence represents the ...
62598f93dd821e528d6d8bba
@ewrap.Wrapper.base_pvm_type <NEW_LINE> class _VClientAdapterMethods(ewrap.Wrapper): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def bld(cls, adapter, slot_num=None): <NEW_LINE> <INDENT> clad = super(_VClientAdapterMethods, cls)._bld_new(adapter, 'Client') <NEW_LINE> if slot_num is not None: <NEW_LINE> <INDENT> clad._l...
Mixin to be used with _VClientStorageAdapter{Element|Entry}.
62598f93287bf620b6271844
class UserContent(models.Model): <NEW_LINE> <INDENT> content_type = models.ForeignKey(ContentType, verbose_name=_('content type'), null=False, related_name='+') <NEW_LINE> object_id = models.PositiveIntegerField(_('object id'), null=False) <NEW_LINE> content_object = generic.GenericForeignKey('content_type', 'object_id...
User/author content object log.
62598f93a8ecb03325870e8e
class WelcomeMessagesDeleteCommand(WelcomeMessagesCommand): <NEW_LINE> <INDENT> def __call__(self, args): <NEW_LINE> <INDENT> super(WelcomeMessagesDeleteCommand, self).__call__(args) <NEW_LINE> cli = self.ls.welcome_messages <NEW_LINE> return self._delete_all(args, cli, args.uuids)
Delete welcome message.
62598f9385dfad0860cbf8b6
class X265PmeSignal: <NEW_LINE> <INDENT> def __init__(self, x265_handlers, inputs_page_handlers): <NEW_LINE> <INDENT> self.x265_handlers = x265_handlers <NEW_LINE> self.inputs_page_handlers = inputs_page_handlers <NEW_LINE> <DEDENT> def on_x265_pme_checkbutton_toggled(self, x265_pme_checkbutton): <NEW_LINE> <INDENT> if...
Handles the signal emitted when the x265 PME option is changed.
62598f9363d6d428bbee2443
class ModuleProgressTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_xmodule_default(self): <NEW_LINE> <INDENT> xm = x_module.XModule(get_test_system(), None, {'location': 'a://b/c/d/e'}) <NEW_LINE> p = xm.get_progress() <NEW_LINE> self.assertEqual(p, None)
Test that get_progress() does the right thing for the different modules
62598f9324f1403a926856f4
class RTAnalyticKey(RTKeyTypeAtom): <NEW_LINE> <INDENT> footerStrip = ':' <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return '<RTAnalyticKey %r>' % self.src
An RTAnalyticKey(RTKeyTypeAtom) only defines a change in the key being analyzed. It does not in itself create a :class:~'music21.key.Key' object. >>> gminor = romanText.rtObjects.RTAnalyticKey('g:') >>> gminor <RTAnalyticKey 'g:'> >>> gminor.getKey() <music21.key.Key of g minor> >>> bminor = romanText.rtObjects.RTAn...
62598f935f7d997b871f921f
class WithPatching: <NEW_LINE> <INDENT> def patch(self, what, with_what): <NEW_LINE> <INDENT> patcher = mock.patch(what, with_what) <NEW_LINE> patcher.start() <NEW_LINE> self.addCleanup(patcher.stop)
A mixin that allows simple patching through ``mock.patch`` in tests during their setup phase.
62598f93656771135c489307
class RallocException(PacmanException): <NEW_LINE> <INDENT> pass
Thrown if a routing-table-entry allocation fails.
62598f93cc0a2c111447ac9a
class Dilate(Transformer): <NEW_LINE> <INDENT> def __init__(self, width, height): <NEW_LINE> <INDENT> Transformer.__init__(self, width, height) <NEW_LINE> self.code = 7 <NEW_LINE> num_iter = random.randrange(1, 9) <NEW_LINE> self.params = [num_iter] <NEW_LINE> <DEDENT> def mutate(self, r=0.0005): <NEW_LINE> <INDENT> if...
Dilate the image.
62598f9396565a6dacd2cdbd
class PageView(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> <DEDENT> date = models.DateTimeField(auto_now=True) <NEW_LINE> ip_address = models.IPAddressField() <NEW_LINE> user = models.ForeignKey(User, null=True) <NEW_LINE> tracking_id = models.CharField(max_length=50, d...
model class for tracking the pages that a customer views
62598f93a17c0f6771d5bec1
class CreateTokenView(ObtainAuthToken): <NEW_LINE> <INDENT> serializer_class = AuthTokenSerializer <NEW_LINE> renderer_classes = api_settings.DEFAULT_RENDERER_CLASSES
create a new auth token for user.
62598f936e29344779b002e0
@ns.route('/todo') <NEW_LINE> class TodoList(Resource): <NEW_LINE> <INDENT> @api.doc('Get all tasks actives') <NEW_LINE> @api.marshal_list_with(complete_task) <NEW_LINE> def get(self): <NEW_LINE> <INDENT> return get_all_tasks() <NEW_LINE> <DEDENT> @api.expect(crete_task) <NEW_LINE> @api.marshal_with(complete_task, code...
Shows a list of all todos, and lets you POST to add new tasks
62598f9307d97122c4216936
class CustomWaffleMiddleware(WaffleMiddleware): <NEW_LINE> <INDENT> def __init__(self, get_response): <NEW_LINE> <INDENT> self.get_response = get_response <NEW_LINE> <DEDENT> def __call__(self, request): <NEW_LINE> <INDENT> for flag in WaffleFlag.objects.filter(testing=True): <NEW_LINE> <INDENT> tc = get_waffle_setting...
Add testing flags to request.waffle_tests. Parent middleware process_response saves waffles and waffle_tests to a cookie in the response.
62598f939b70327d1c57ea29
class TestUser_put(TestUser): <NEW_LINE> <INDENT> def test_put_success(self): <NEW_LINE> <INDENT> user = User('Test User', 'test@test.com', 'password') <NEW_LINE> db.session.add(user) <NEW_LINE> db.session.commit() <NEW_LINE> newUserData = { 'name': 'Updated User', 'password': 'updatedpass' } <NEW_LINE> resp = self.cli...
Test resources for the API put endpoint.
62598f9363b5f9789fe84dfd
class Log: <NEW_LINE> <INDENT> def __init__(self, filename='', is_auto_save=False): <NEW_LINE> <INDENT> self.errList = [] <NEW_LINE> self.fileName = filename <NEW_LINE> self.isAutoSave = is_auto_save <NEW_LINE> <DEDENT> def add(self, severity, msg): <NEW_LINE> <INDENT> if msg is None: <NEW_LINE> <INDENT> raise Exceptio...
Log
62598f930c0af96317c5600d
class RegistrationForm(BaseRegistrationForm): <NEW_LINE> <INDENT> label = _(u'heading_registration_form', default=u'Registration form') <NEW_LINE> description = u"" <NEW_LINE> template = ViewPageTemplateFile('register_form.pt') <NEW_LINE> @property <NEW_LINE> def showForm(self): <NEW_LINE> <INDENT> portal = getUtility(...
Dynamically get fields from user data, through admin config settings.
62598f9330dc7b766599f4d9
@tf_export("name_scope", "keras.backend.name_scope") <NEW_LINE> class name_scope(object): <NEW_LINE> <INDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self._name <NEW_LINE> <DEDENT> def __init__(self, name, default_name=None, values=None): <NEW_LINE> <INDENT> self._name = default_name if name is ...
A context manager for use when defining a Python op. This context manager validates that the given `values` are from the same graph, makes that graph the default graph, and pushes a name scope in that graph (see @{tf.Graph.name_scope} for more details on that). For example, to define a new Python op called `my_op`: ...
62598f9329b78933be269f20
class MeanSquared(RegressionLoss): <NEW_LINE> <INDENT> def loss(self, logits, targets): <NEW_LINE> <INDENT> return tf.square(logits - targets)
Mean squared error between prediction and label
62598f93ac7a0e7691f72194
class DataControllerSave: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.db = TinyDB("db_tournaments.json") <NEW_LINE> self.db_table_tournaments = self.db.table('tournaments') <NEW_LINE> self.db_table_players = self.db.table('players') <NEW_LINE> self.db_table_rounds = self.db.table('rounds') <NEW_LIN...
Before saving, we delete all the data in the JSON files. The tournaments to be saved are in the list (ListObjet). Work with three tables (Tournaments, players, and rounds) Serialization is done directly by object methods, only an index and given as a parameter to index certain data
62598f9376d4e153a661c8a3
class Cancel(base.Command): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> flags.Instance(positional=False, text='The ID of the instance the operation is executing on.' ).AddToParser(parser) <NEW_LINE> flags.Database(positional=False, required=False, text='For a database operation, t...
Cancel a Cloud Spanner operation.
62598f9373bcbd0ca4bc9edf
class PSSE2GRGWarning(Warning): <NEW_LINE> <INDENT> pass
root class for all PSSE2GRG Warnings
62598f933c8af77a43b67d7e
class DirectionValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> DIRECTION_UNSPECIFIED = 0 <NEW_LINE> ASCENDING = 1 <NEW_LINE> DESCENDING = 2
The indexed property's direction. Must not be DIRECTION_UNSPECIFIED. Required. Values: DIRECTION_UNSPECIFIED: The direction is unspecified. ASCENDING: The property's values are indexed so as to support sequencing in ascending order and also query by <, >, <=, >=, and =. DESCENDING: The property's values are...
62598f9332920d7e50bc5ce7
class ThermocyclerDeactivateLidCommand(BaseModel): <NEW_LINE> <INDENT> command: Literal["thermocycler/deactivateLid"] <NEW_LINE> params: ModuleOnlyParams
Thermocycler deactivate lid command. Module will stop actively controlling its lid temperature.
62598f93e64d504609df91fa
class AssignmentTargetIndex(AssignmentTarget): <NEW_LINE> <INDENT> def __init__(self, base: 'Value', index: 'Value') -> None: <NEW_LINE> <INDENT> self.base = base <NEW_LINE> self.index = index <NEW_LINE> self.type = object_rprimitive <NEW_LINE> <DEDENT> def to_str(self, env: 'Environment') -> str: <NEW_LINE> <INDENT> r...
base[index] as assignment target
62598f937b25080760ed7128
class ListBookmarksController(Controller): <NEW_LINE> <INDENT> def __init__(self, usecase, presenter, view): <NEW_LINE> <INDENT> self.usecase = usecase <NEW_LINE> self.presenter = presenter <NEW_LINE> self.view = view <NEW_LINE> <DEDENT> def handle(self, request): <NEW_LINE> <INDENT> self.usecase.list_bookmarks(request...
A default controller
62598f93f8510a7c17d7dfbb
class TaskStart: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.regex = re.compile("\[(.*?)\].*\[Text\]\[cnt:.*") <NEW_LINE> self.short_regx = re.compile("\[Text\]\[cnt:") <NEW_LINE> self.data = [[] for _ in range(2)] <NEW_LINE> <DEDENT> def parse(self, line): <NEW_LINE> <INDENT> short_out = self.shor...
任务开始信息 data[0]: t data[1]: 开始信息内容
62598f930a50d4780f70505d
class HelgaExtension(object): <NEW_LINE> <INDENT> acks = ( 'roger', '10-4', 'no problem %(nick)s', 'will do', 'you got it %(nick)s', 'anything you say %(nick)s', 'sure thing', 'ok', 'right-o', ) <NEW_LINE> add_acks = acks + ( '%(nick)s, added', 'consider it done', ) <NEW_LINE> delete_acks = acks + ( '%(nick)s, deleted'...
Defines a dispatchable API for extensions and extra functionality
62598f93baa26c4b54d4ef37
class JSONPathExpr(Expr): <NEW_LINE> <INDENT> def __init__(self,expr): <NEW_LINE> <INDENT> self.parsed_expr = jsonpath_rw.parse(expr) <NEW_LINE> <DEDENT> def eval(self, data): <NEW_LINE> <INDENT> return [match.value for match in self.parsed_expr.find(data)]
Represents a JSONPath expression. Returns a list of matching values. The expression must start with '$' (that's how it's recognized from attribute names). See python_json_path_rw_ext package for what exactly is supported in JSONPath.
62598f934e696a045264dc4d
class User(AbstractUser): <NEW_LINE> <INDENT> name = CharField(_("Name of User"), blank=True, max_length=255) <NEW_LINE> first_name = None <NEW_LINE> last_name = None <NEW_LINE> def get_absolute_url(self): <NEW_LINE> <INDENT> return reverse("users:detail", kwargs={"username": self.username})
Default user for sba.
62598f930a50d4780f70505e
class RandomProxy(object): <NEW_LINE> <INDENT> def process_request(self,request,spider): <NEW_LINE> <INDENT> proxy = random.choice(PY_PROXY_LIST) <NEW_LINE> if 'user_passwd' in proxy: <NEW_LINE> <INDENT> b64_user_pwd = base64.b64encode(proxy['user_passwd'].encode()) <NEW_LINE> request.headers['Proxy-Authorization'] = '...
代理IP
62598f93a05bb46b3848a507
class Meta: <NEW_LINE> <INDENT> abstract = True
Audit model metadata class
62598f936e29344779b002e2
class Logout(BaseEndpoint): <NEW_LINE> <INDENT> _error = LogoutError <NEW_LINE> def __call__(self, session=None, lightweight=None): <NEW_LINE> <INDENT> (response, elapsed_time) = self.request(session=session) <NEW_LINE> self.client.client_logout() <NEW_LINE> return self.process_response(response, LogoutResource, elapse...
Logout operations.
62598f93a17c0f6771d5bec4
class Rectangle: <NEW_LINE> <INDENT> def __init__(self, width=0, height=0): <NEW_LINE> <INDENT> self.width = width <NEW_LINE> self.height = height <NEW_LINE> <DEDENT> @property <NEW_LINE> def width(self): <NEW_LINE> <INDENT> return self.__width <NEW_LINE> <DEDENT> @width.setter <NEW_LINE> def width(self, value): <NEW_L...
An empty Rectangle class
62598f930fa83653e46f4b73
class FileNotInDiffException(Exception): <NEW_LINE> <INDENT> pass
Raised when the context for a missing file is requested. If you request the context for a line in a file which is not part of the given diff, then this exception is raised.
62598f9360cbc95b06363fd0
class SimpleIntegral(MathCaptcha): <NEW_LINE> <INDENT> def getCaptcha(self): <NEW_LINE> <INDENT> low_boundaries = (-1, 0, 1) <NEW_LINE> lb = random.choice(low_boundaries) <NEW_LINE> high_add = (0, 1, 2, 3) <NEW_LINE> hb = lb+random.choice(high_add) <NEW_LINE> x = sympy.Symbol(random.choice(("x", "y", "z", "q", "p"))) <...
Simple integral. Choice of boundaries guarantees that result is always an integer. NO WAIT IT DOESNT O FUUU
62598f939b70327d1c57ea2a
class reservationStatusProp(SchemaEnumProperty): <NEW_LINE> <INDENT> _enum = True <NEW_LINE> _prop_schema = 'reservationStatus' <NEW_LINE> choices = RESERVATIONSTATUS_CHOICES <NEW_LINE> _format_as = "enum" <NEW_LINE> adapter = { 'RESERVATIONCONFIRMED': 'ReservationConfirmed', 'RESERVATIONHOLD': 'ReservationHold', 'RESE...
Enumeration for reservationStatus Prepoulated with the Schema.org choices
62598f930c0af96317c5600f
class Field_actor_postedtime(acscsv._Field): <NEW_LINE> <INDENT> label = 'User Account Creation Date' <NEW_LINE> path = ['actor', 'postedTime'] <NEW_LINE> def __init__(self, json_record): <NEW_LINE> <INDENT> super( Field_actor_postedtime , self).__init__(json_record) <NEW_LINE> input_fmt = "%Y-%m-%dT%H:%M:%S.000Z" <NEW...
Take a dict, assign to self.value the value of actor.postedTime
62598f9329b78933be269f21
class BaseTestThreadsAuth(object): <NEW_LINE> <INDENT> def _get_connection(self): <NEW_LINE> <INDENT> return get_connection() <NEW_LINE> <DEDENT> def setUp(self): <NEW_LINE> <INDENT> conn = self._get_connection() <NEW_LINE> if not server_started_with_auth(conn): <NEW_LINE> <INDENT> raise SkipTest("Authentication is not...
Base test class for TestThreadsAuth and TestThreadsAuthReplicaSet. (This is not itself a unittest.TestCase, otherwise it'd be run twice -- once when nose imports this module, and once when nose imports test_threads_replica_set_connection.py, which imports this module.)
62598f9307d97122c4216939
class FootingTrapez(FootingBase): <NEW_LINE> <INDENT> def __init__(self,textComment,Base1Trapez,Base2Trapez,HeightTrapez,Hfooting,ThickLeanConcr,excavHeight,excavSlope,fillingHeight,reinfQuant,Lformwork=None,Lexcav=None): <NEW_LINE> <INDENT> perim=round(Base1Trapez+Base2Trapez+2*math.sqrt((abs(Base1Trapez-Base1Trapez)/...
Quantities of a trapeizoidal-based footing foundation. textComment: string to comment each measuremt line generated Base1Trapez: length of base 1 of trapezoid Base2Trapez: length of base 2 of trapezoid HeightTrapez: heigth of trapezoid Hfooting: height of the footing ThickLeanConcr: Thickness of lean concrete under ...
62598f93ac7a0e7691f72196
class _LowLevelFile: <NEW_LINE> <INDENT> def __init__(self, name, mode): <NEW_LINE> <INDENT> mode = { "r": os.O_RDONLY, "w": os.O_WRONLY | os.O_CREAT | os.O_TRUNC, }[mode] <NEW_LINE> with contextlib.suppress(AttributeError): <NEW_LINE> <INDENT> mode |= os.O_BINARY <NEW_LINE> <DEDENT> self.fd = os.open(name, mode, 0o666...
Low-level file object. Supports reading and writing. It is used instead of a regular file object for streaming access.
62598f93d6c5a102081e1dcc
class BoundingBox: <NEW_LINE> <INDENT> def __init__(self, left: float, top: float, width: float, height: float) -> None: <NEW_LINE> <INDENT> self.left = left <NEW_LINE> self.top = top <NEW_LINE> self.width = width <NEW_LINE> self.height = height <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "Top: " ...
Bounding box that defines a region of an image. All required parameters must be populated in order to send to Azure. :param left: Required. Coordinate of the left boundary. :type left: float :param top: Required. Coordinate of the top boundary. :type top: float :param width: Required. Width. :type width: float :param...
62598f93e5267d203ee6b5a2
class AddNewsCoach(tk.Frame,AddNews): <NEW_LINE> <INDENT> def __init__(self, parent, controller): <NEW_LINE> <INDENT> tk.Frame.__init__(self, parent) <NEW_LINE> self.controller = controller <NEW_LINE> """ Widget Declearations """ <NEW_LINE> """ Widget Stlyings """ <NEW_LINE> """ Widget Positions """
Method: __init__ Variables: controller
62598f9391af0d3eaad39a90
class forwardTo(object): <NEW_LINE> <INDENT> def __init__(self, objectName, attrName): <NEW_LINE> <INDENT> self.objectName = objectName <NEW_LINE> self.attrName = attrName <NEW_LINE> <DEDENT> def __get__(self, instance, owner=None): <NEW_LINE> <INDENT> return getattr(getattr(instance, self.objectName), self.attrName) <...
A descriptor based recipe that makes it possible to write shorthands that forward attribute access from one object onto another. >>> class C(object): ... def __init__(self): ... class CC(object): ... def xx(self, extra): ... return 100 + extra ... foo = 42 ... ...
62598f93d99f1b3c44d05338
class DEArcInfoTableType(CoClass): <NEW_LINE> <INDENT> _reg_clsid_ = GUID('{0E3F5CB0-2445-4ABB-BE9A-FCF0492E180A}') <NEW_LINE> _idlflags_ = [] <NEW_LINE> _typelib_path_ = typelib_path <NEW_LINE> _reg_typelib_ = ('{1CE6AC65-43F5-4529-8FC0-D7ED298E4F1A}', 10, 2)
ArcInfo Table Data Element object Type.
62598f934a966d76dd5eeb6a
class CacheStatusTest(Test): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(CacheStatusTest, self).__init__( { "type": "read", "attribute": "cacheStatus", "mbean": "jboss.datagrid-infinispan:type=Cache,name=*,manager=\"clustered\",component=Cache" } ) <NEW_LINE> <DEDENT> def evaluate(self, results): ...
Checks the cache statuses.
62598f93090684286d59351d
@admin.register(models.FBACountry) <NEW_LINE> class FBACountryAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> fields = ["region", "country"] <NEW_LINE> list_display = ["__str__", "region", "country"] <NEW_LINE> list_editable = ["region", "country"]
Model admin for the FBACountry model.
62598f93b7558d58954632b8
class sendmail: <NEW_LINE> <INDENT> pass
sendmail class
62598f93287bf620b6271848
class AppUtil(): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def timeStamp(): <NEW_LINE> <INDENT> return(str(time.strftime('%Y-%m-%dT%H:%M:%S',time.localtime())))
description of class
62598f93adb09d7d5dc0a212
class Solution(object): <NEW_LINE> <INDENT> def convertToBase7(self, num): <NEW_LINE> <INDENT> mark = 0 <NEW_LINE> if num < 0: <NEW_LINE> <INDENT> num = -num <NEW_LINE> mark = 1 <NEW_LINE> <DEDENT> elif num == 0: <NEW_LINE> <INDENT> return str(0) <NEW_LINE> <DEDENT> x = [] <NEW_LINE> while num > 0: <NEW_LINE> <INDENT> ...
给定一个整数,将其转化为7进制,并以字符串形式输出。 输入: 100 输出: "202" 输入: -7 输出: "-10" 注意: 输入范围是 [-1e7, 1e7] 。 链接:https://leetcode-cn.com/problems/base-7/
62598f93656771135c48930b
class TestInlineResponse200Site(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 testInlineResponse200Site(self): <NEW_LINE> <INDENT> pass
InlineResponse200Site unit test stubs
62598f937d847024c075c05d
class AnsiCode: <NEW_LINE> <INDENT> bg_offset = 40 <NEW_LINE> fg_offset = 30 <NEW_LINE> @classmethod <NEW_LINE> def enhanced(cls, r, g, b, ratio): <NEW_LINE> <INDENT> f, lm = (min, 255) if ratio > 1 else (max, 0) <NEW_LINE> if ratio > 1: <NEW_LINE> <INDENT> r = max(8, r) <NEW_LINE> g = max(8, g) <NEW_LINE> b = max(8, b...
Compute ANSI escape codes to use for a given RGB color
62598f931f037a2d8b9e3d6c
class ViewerController(ABC): <NEW_LINE> <INDENT> _v_id: int = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._v_id = generateVId() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> @abstractmethod <NEW_LINE> def fromFile(cls, file: str) -> 'ViewerController': <NEW_LINE> <INDENT> raise NotImplementedError <NEW_L...
Base class for viewer controllers.
62598f93d486a94d0ba2bc5e
class LoginForm(FlaskForm): <NEW_LINE> <INDENT> user_name = StringField(u'用户名', validators=user_name_validators) <NEW_LINE> password = PasswordField(u'密码', validators=password_validators) <NEW_LINE> remember_me = BooleanField(u'记住我') <NEW_LINE> submit = SubmitField(u'登录')
用户登录表单
62598f93b57a9660fecd1705
class Actions(grok.Viewlet): <NEW_LINE> <INDENT> grok.viewletmanager(asm.cmsui.base.MainPageActions) <NEW_LINE> grok.context(asm.cms.interfaces.IEdition) <NEW_LINE> @property <NEW_LINE> def page(self): <NEW_LINE> <INDENT> return self.context.page
Page-related UI actions to perform on editions.
62598f93a17c0f6771d5bec6
@attributes([ "source_path", "target_bucket", "target_key", "files", ]) <NEW_LINE> class UploadToS3Recursively(object): <NEW_LINE> <INDENT> pass
Upload contents of a directory to S3, for given files. Note that this returns a list with the prefixes stripped. :ivar FilePath source_path: Prefix of files to be uploaded. :ivar bytes target_bucket: Name of bucket to upload file to. :ivar bytes target_key: Name S3 key to upload file to. :ivar list files: List of byt...
62598f9329b78933be269f22
class CDMIStore(ObjectStore): <NEW_LINE> <INDENT> pass
TODO: will retrieve objects from a (remote) CDMI enabled Object Storage Service.
62598f93004d5f362081ee41
class SKUImagesViewSet(ModelViewSet): <NEW_LINE> <INDENT> permission_classes = [IsAdminUser] <NEW_LINE> queryset = SKUImage.objects.all() <NEW_LINE> serializer_class = SKUImageSerializer <NEW_LINE> lookup_value_regex = '\d+'
商品图片的增删改查
62598f9307f4c71912baf0d6
class RobotMessage: <NEW_LINE> <INDENT> def __init__(self,destination="controller", destination_device="", source="robot", source_device="", delay_time=0.0, message=""): <NEW_LINE> <INDENT> self.arrival_time = int(time.time()*1000) <NEW_LINE> self.destination = destination <NEW_LINE> self.destination_device = destinati...
Class for handling timestamped messages and converting between the string messages that need to be sent over the web socket.
62598f9373bcbd0ca4bc9ee3
class TokenBucket(object): <NEW_LINE> <INDENT> def __init__(self, capacity=10., fill_rate=10.): <NEW_LINE> <INDENT> self.capacity = float(capacity) <NEW_LINE> self.fill_rate = fill_rate <NEW_LINE> self.tokens = float(capacity) <NEW_LINE> self.timestamp = time.time() <NEW_LINE> <DEDENT> def consume(self, tokens): <NEW_L...
Implementation of the token bucket throttling algorithm.
62598f93379a373c97d98ca0
class UpdateRouteTableAttributeResponseSchema(schema.ResponseSchema): <NEW_LINE> <INDENT> fields = {}
UpdateRouteTableAttribute - 更新路由表基本信息
62598f933c8af77a43b67d80
@PIPELINES.register_module() <NEW_LINE> class ToDataContainer(object): <NEW_LINE> <INDENT> def __init__(self, fields=(dict(key='img', stack=True), dict(key='gt_semantic_seg'))): <NEW_LINE> <INDENT> self.fields = fields <NEW_LINE> <DEDENT> def __call__(self, results): <NEW_LINE> <INDENT> for field in self.fields: <NEW_L...
Convert results to :obj:`mmcv.DataContainer` by given fields. Args: fields (Sequence[dict]): Each field is a dict like ``dict(key='xxx', **kwargs)``. The ``key`` in result will be converted to :obj:`mmcv.DataContainer` with ``**kwargs``. Default: ``(dict(key='img', stack=True), dict...
62598f93b5575c28eb712b13
class Node(Storm): <NEW_LINE> <INDENT> __storm_table__ = u'nodes' <NEW_LINE> node = Unicode(primary=True, allow_none=False) <NEW_LINE> config = ReferenceSet(node, 'NodeConfig.node') <NEW_LINE> items = ReferenceSet(node, 'Item.node') <NEW_LINE> subscriptions = ReferenceSet(node, 'Subscription.node') <NEW_LINE> affiliati...
A PubSub node.
62598f93ac7a0e7691f72198
class Manager: <NEW_LINE> <INDENT> def __init__( self, configuration: PartialConfiguration, run_dir: Optional[RunDir] = None ) -> None: <NEW_LINE> <INDENT> self._configuration = configuration <NEW_LINE> self._run_dir = run_dir <NEW_LINE> log_dir = self._run_dir.muscle_dir if self._run_dir else Path.cwd() <NEW_LINE> sel...
The MUSCLE3 manager. This creates and manager instances and connects them together according to the simulation configuration.
62598f93e76e3b2f99fd86c3
class QuickSort(ABCSortStrategy): <NEW_LINE> <INDENT> def sort(self, array): <NEW_LINE> <INDENT> print('quick sort') <NEW_LINE> self.quickSortHelper(array, 0, len(array) - 1) <NEW_LINE> print(array) <NEW_LINE> <DEDENT> def quickSortHelper(self, array, first, last): <NEW_LINE> <INDENT> if first < last: <NEW_LINE> <INDEN...
quick sort
62598f934e4d5625663720ac
class Restaurant(object): <NEW_LINE> <INDENT> def __init__(self, name, cuisine): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.cuisine = cuisine <NEW_LINE> print("Opened restaurant {}".format(self.name)) <NEW_LINE> <DEDENT> def describe(self): <NEW_LINE> <INDENT> print("This is {} restaurant and it serves {} cui...
Represents restaurant
62598f938e7ae83300ee8d32
class Variable(object): <NEW_LINE> <INDENT> def __init__(self, name, rank): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.rank = rank <NEW_LINE> <DEDENT> def __repr__(self): return self.name <NEW_LINE> def evaluate(self, env): return env[self.rank]
A variable is not a node in the BDD!
62598f937b25080760ed712c
class AllowedListTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_allowed_none(self): <NEW_LINE> <INDENT> self.assertFalse('' in AllowedList(None)) <NEW_LINE> self.assertFalse('' in AllowedList('')) <NEW_LINE> self.assertFalse('' in AllowedList([])) <NEW_LINE> <DEDENT> def test_allowed_all(self): <NEW_LINE> <INDEN...
Test case for the AllowedList class
62598f934428ac0f6e6581b5
class HelloViewSet(viewsets.ViewSet): <NEW_LINE> <INDENT> serializer_class = serializers.HelloSerializer <NEW_LINE> def list(self, request): <NEW_LINE> <INDENT> a_viewset = [ 'Uses actions (list, create, retrive, update, partial_update)', 'Automatically maps to url using routing', 'Provides more functionality with less...
Test API VIewSet
62598f938da39b475be02e6e
class TestFib(unittest.TestCase): <NEW_LINE> <INDENT> def test_seed_values(self): <NEW_LINE> <INDENT> specs = { 0: [], 1: [0] } <NEW_LINE> for (spec, answer) in specs.items(): <NEW_LINE> <INDENT> self.assertEqual(list(fib(spec)), answer) <NEW_LINE> <DEDENT> <DEDENT> def test_normal_values(self): <NEW_LINE> <INDENT> spe...
Tests core function
62598f9338b623060ffa8d18
class Change(models.Model): <NEW_LINE> <INDENT> infra = models.ForeignKey(Infra) <NEW_LINE> title = models.CharField(max_length=100) <NEW_LINE> description = models.CharField(max_length=1000, null=True) <NEW_LINE> justification = models.CharField(max_length=1000, null=True) <NEW_LINE> neg_impact = models.CharField(max_...
This model represents the change done to a specific infrastructure at a specific location with specific users interacting
62598f938a43f66fc4bf1e07
class SampleResourceCollection(ResourceCollection): <NEW_LINE> <INDENT> def __init__(self, id_field='id'): <NEW_LINE> <INDENT> self.id_field = id_field <NEW_LINE> self.items = {} <NEW_LINE> <DEDENT> async def create(self, details): <NEW_LINE> <INDENT> resource_details = deepcopy(details) <NEW_LINE> try: <NEW_LINE> <IND...
An in-memory ResourceCollection.
62598f9385dfad0860cbf8b9
class _ObjectIdentityWrapper(object): <NEW_LINE> <INDENT> def __init__(self, wrapped): <NEW_LINE> <INDENT> self._wrapped = wrapped <NEW_LINE> <DEDENT> @property <NEW_LINE> def unwrapped(self): <NEW_LINE> <INDENT> return self._wrapped <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> if isinstance(other, ...
Wraps an object, mapping __eq__ on wrapper to "is" on wrapped. Since __eq__ is based on object identity, it's safe to also define __hash__ based on object ids. This lets us add unhashable types like checkpointable _ListWrapper objects to object-identity collections.
62598f93d7e4931a7ef3bd2f
class ListPatchJobsPager: <NEW_LINE> <INDENT> def __init__( self, method: Callable[..., patch_jobs.ListPatchJobsResponse], request: patch_jobs.ListPatchJobsRequest, response: patch_jobs.ListPatchJobsResponse, *, metadata: Sequence[Tuple[str, str]] = () ): <NEW_LINE> <INDENT> self._method = method <NEW_LINE> self._reque...
A pager for iterating through ``list_patch_jobs`` requests. This class thinly wraps an initial :class:`google.cloud.osconfig_v1.types.ListPatchJobsResponse` object, and provides an ``__iter__`` method to iterate through its ``patch_jobs`` field. If there are more pages, the ``__iter__`` method will make additional ``...
62598f936aa9bd52df0d4b5a
class NewPageForm(Form): <NEW_LINE> <INDENT> title = TextField('Title', validators=[Required()])
A new page form.
62598f9332920d7e50bc5cec
class FlatGeometryManager(GeometryManager): <NEW_LINE> <INDENT> def find_intersections(self, frame, ray_bundle): <NEW_LINE> <INDENT> GeometryManager.find_intersections(self, frame, ray_bundle) <NEW_LINE> d = ray_bundle.get_directions() <NEW_LINE> v = ray_bundle.get_vertices() - frame[:3,3][:,None] <NEW_LINE> n = ray_bu...
Implements the geometry of an infinite flat surface, an the XY plane of its local coordinates (so the local Z is the surface normal).
62598f93507cdc57c63a4a20
class Expression(BaseExpression, Combinable): <NEW_LINE> <INDENT> pass
An expression that can be combined with other expressions.
62598f93a05bb46b3848a50b
class BasicPagePermissionManager(models.Manager): <NEW_LINE> <INDENT> def with_user(self, user): <NEW_LINE> <INDENT> User = get_user_model() <NEW_LINE> related_query_name = User.groups.field.related_query_name() <NEW_LINE> return self.filter(Q(user=user) | Q(**{'group__%s' % related_query_name: user})) <NEW_LINE> <DEDE...
Global page permission manager accessible under objects. !IMPORTANT: take care, PagePermissionManager extends this manager
62598f9330bbd722464697bd
class TradfriCover(TradfriBaseDevice, CoverEntity): <NEW_LINE> <INDENT> def __init__(self, device, api, gateway_id): <NEW_LINE> <INDENT> super().__init__(device, api, gateway_id) <NEW_LINE> self._unique_id = f"{gateway_id}-{device.id}" <NEW_LINE> self._refresh(device) <NEW_LINE> <DEDENT> @property <NEW_LINE> def extra_...
The platform class required by Home Assistant.
62598f9307f4c71912baf0d8
class LargeObjectDescriptor(models.fields.subclassing.Creator): <NEW_LINE> <INDENT> def __set__(self, instance, value): <NEW_LINE> <INDENT> value = self.field.to_python(value) <NEW_LINE> if value is not None: <NEW_LINE> <INDENT> if not isinstance(value, LargeObjectFile): <NEW_LINE> <INDENT> value = LargeObjectFile(valu...
LargeObjectField descriptor.
62598f9376d4e153a661c8a9
class TestRssNewsFeedParser(TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> RssNewsFeedParser.get_raw_content = lambda self, url, ntype: xml_input <NEW_LINE> <DEDENT> def test_parse_content(self): <NEW_LINE> <INDENT> feed_reader = RssNewsFeedParser() <NEW_LINE> actual = f...
Unit tests for RssNewsFeedParser
62598f9323e79379d538c193
@attr.s(auto_attribs=True, init=False) <NEW_LINE> class CredentialsLDAP(model.Model): <NEW_LINE> <INDENT> can: Optional[MutableMapping[str, bool]] = None <NEW_LINE> created_at: Optional[str] = None <NEW_LINE> email: Optional[str] = None <NEW_LINE> is_disabled: Optional[bool] = None <NEW_LINE> ldap_dn: Optional[str] = N...
Attributes: can: Operations the current user is able to perform on this object created_at: Timestamp for the creation of this credential email: EMail address is_disabled: Has this credential been disabled? ldap_dn: LDAP Distinguished name for this user (as-of the last login) ldap_id: LDAP Unique...
62598f93a79ad16197769cee
class Square: <NEW_LINE> <INDENT> def __init__(self, size=0): <NEW_LINE> <INDENT> if type(size) is not int: <NEW_LINE> <INDENT> raise TypeError("size must be an integer") <NEW_LINE> <DEDENT> if size < 0: <NEW_LINE> <INDENT> raise ValueError("size must be >= 0") <NEW_LINE> <DEDENT> self.__size = size <NEW_LINE> <DEDENT>...
Empty class with size private attribute
62598f937047854f4633f06d
class BetweenValidator(BaseValidator): <NEW_LINE> <INDENT> code = 'between_validator' <NEW_LINE> def __init__(self, min_value, max_value): <NEW_LINE> <INDENT> super(BetweenValidator, self).__init__() <NEW_LINE> self.min_value = int(min_value) <NEW_LINE> self.max_value = int(max_value) <NEW_LINE> <DEDENT> def is_valid(s...
Mix min and max validators.
62598f9323849d37ff850d53
@beam.typehints.with_output_types(beam.pvalue.PDone) <NEW_LINE> class WriteMetricsPlotsAndConfig(beam.PTransform): <NEW_LINE> <INDENT> def __init__(self, output_path, eval_config): <NEW_LINE> <INDENT> self._output_path = output_path <NEW_LINE> self._eval_config = eval_config <NEW_LINE> <DEDENT> def expand(self, metrics...
Writes metrics, plots and config to the given path. This is the internal implementation. Users should call model_eval_lib.WriteMetricsAndPlots instead of this.
62598f937b25080760ed712e
class PyNumexpr(Package): <NEW_LINE> <INDENT> homepage = "https://pypi.python.org/pypi/numexpr" <NEW_LINE> url = "https://pypi.python.org/packages/source/n/numexpr/numexpr-2.4.6.tar.gz" <NEW_LINE> version('2.4.6', '17ac6fafc9ea1ce3eb970b9abccb4fbd') <NEW_LINE> version('2.5', '84f66cced45ba3e30dcf77a937763aaa') <NE...
Fast numerical expression evaluator for NumPy
62598f93baa26c4b54d4ef3c
class RSConv_bkk(nn.Module): <NEW_LINE> <INDENT> def __init__( self, C_in, C_out, activation = nn.ReLU(inplace=True), mapping = None, relation_prior = 1, first_layer = False ): <NEW_LINE> <INDENT> super(RSConv, self).__init__() <NEW_LINE> self.bn_rsconv = nn.BatchNorm2d(C_in) if not first_layer else nn.BatchNorm2d(16) ...
Input shape: (B, C_in, npoint, nsample) Output shape: (B, C_out, npoint)
62598f938da39b475be02e70
class BackupFactory: <NEW_LINE> <INDENT> SGBD_MYSQL = "MySQL" <NEW_LINE> @staticmethod <NEW_LINE> def create(options): <NEW_LINE> <INDENT> if options.sgbd == BackupFactory.SGBD_MYSQL: <NEW_LINE> <INDENT> return MySQLBackup(options) <NEW_LINE> <DEDENT> raise Exception (53238,"SGBD non supporté") <NEW_LINE> <DEDENT> @sta...
Classe usine permettant de créer des objets de type IBackup
62598f93fbf16365ca793d42
class FbPage(BaseFbObject): <NEW_LINE> <INDENT> def __init__(self, page_id, name, liked_pages=None): <NEW_LINE> <INDENT> self.page_id = page_id <NEW_LINE> self.username = name <NEW_LINE> self.name = '' <NEW_LINE> self.liked_pages = set() <NEW_LINE> self.about = '' <NEW_LINE> self.description = '' <NEW_LINE> self.compan...
Summary
62598f93f7d966606f747c72
class TableViewItem(AbstractWidgetItem): <NEW_LINE> <INDENT> proxy = Typed(ProxyTableViewItem)
The base class implementation is sufficient.
62598f934a966d76dd5eeb6e
class LowerConfidenceBound(Acquisition): <NEW_LINE> <INDENT> def __init__(self, model, sigma=2.0): <NEW_LINE> <INDENT> super(LowerConfidenceBound, self).__init__(model) <NEW_LINE> self.sigma = DataHolder(np.array(sigma)) <NEW_LINE> <DEDENT> def build_acquisition(self, Xcand): <NEW_LINE> <INDENT> candidate_mean, candida...
Lower confidence bound acquisition function for single-objective global optimization. Key reference: :: @inproceedings{Srinivas:2010, author = "Srinivas, Niranjan and Krause, Andreas and Seeger, Matthias and Kakade, Sham M.", booktitle = "{Proceedings of the 27th International Conference on Machi...
62598f9363d6d428bbee244b
class CueSplitterTask(ConvertorTask): <NEW_LINE> <INDENT> def __init__(self, cue_tag_holder, target_dir, log_level, ff_general_options, ff_other_options, preserve_metadata, target_format): <NEW_LINE> <INDENT> self.time_offset = cue_tag_holder.time_offset <NEW_LINE> self.duration = cue_tag_holder.length <NEW_LINE> self....
Cue Slit TasksProcessor task
62598f938a43f66fc4bf1e09
class TestBug546(unittest.TestCase): <NEW_LINE> <INDENT> def testIt(self): <NEW_LINE> <INDENT> app = QApplication([]) <NEW_LINE> textEdit = QPlainTextEdit() <NEW_LINE> completer = QCompleter(("foo", "bar"), textEdit) <NEW_LINE> completer.setWidget(textEdit)
Test to check a crash at exit
62598f93d7e4931a7ef3bd31
class ObjectDetectionGeoJSONStore(LabelStore): <NEW_LINE> <INDENT> def __init__(self, uri, class_config, crs_transformer): <NEW_LINE> <INDENT> self.uri = uri <NEW_LINE> self.crs_transformer = crs_transformer <NEW_LINE> self.class_config = class_config <NEW_LINE> <DEDENT> def save(self, labels): <NEW_LINE> <INDENT> boxe...
Storage for object detection predictions.
62598f9332920d7e50bc5cee