code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class GmailAuthCredentials(MailSyncBase): <NEW_LINE> <INDENT> gmailaccount_id = Column(BigInteger, ForeignKey(GmailAccount.id, ondelete='CASCADE'), nullable=False) <NEW_LINE> refresh_token_id = Column(BigInteger, ForeignKey(Secret.id, ondelete='CASCADE'), nullable=False) <NEW_LINE> _scopes = Column('scopes', String(512... | Associate a Gmail Account with a refresh token using a
one-to-many relationship. Refresh token ids are actually
ids of objects in the 'secrets' table.
A GmailAccount has many GmailAuthCredentials.
A GmailAuthCredentials entry has a single secret.
There should be only one GmailAuthCredentials for each
(gmailaccount, c... | 62598f7273bcbd0ca4bc9ac0 |
class Exp(tf.keras.layers.Layer): <NEW_LINE> <INDENT> def __call__(self, inputs, *args, **kwargs): <NEW_LINE> <INDENT> if not isinstance(inputs, tfp.edward2.RandomVariable): <NEW_LINE> <INDENT> return super(Exp, self).__call__(inputs, *args, **kwargs) <NEW_LINE> <DEDENT> return reversible.TransformedRandomVariable(inpu... | Exponential activation function for reversible networks. | 62598f72be8e80087fbbe8d2 |
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> @property <NEW_LINE> def height(self): <NEW_LINE> <INDE... | makes rectangle object | 62598f7230dc7b766599f0d1 |
class Material(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> object.__init__(self) | Base class which represents a generic material. | 62598f721d351010ab8f33b3 |
class ClientError(AffectrError): <NEW_LINE> <INDENT> pass | Thrown when there was an error processing the request | 62598f7223e79379d538bd6b |
class EditDescription(forms.ModelForm): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(EditDescription, self).__init__(*args, **kwargs) <NEW_LINE> self.helper = FormHelper(form=self) <NEW_LINE> self.helper.layout = Layout( Div( Div(Field('description'), css_class='col-md-12'), css_cl... | Edit the description field of the issuer. | 62598f72d10714528d69d741 |
class Tantrix: <NEW_LINE> <INDENT> def __init__(self, size): <NEW_LINE> <INDENT> assert size >= MINIMAL_GRID_SIZE <NEW_LINE> self._tiling_size = size <NEW_LINE> self._tile_value = {} <NEW_LINE> counter = 0 <NEW_LINE> for index_i in range(MINIMAL_GRID_SIZE): <NEW_LINE> <INDENT> for index_j in range(MINIMAL_GRID_SIZE - i... | Basic Tantrix game class | 62598f72d18da76e235b6d71 |
class FunctionClass(with_metaclass(BasicMeta, ManagedProperties)): <NEW_LINE> <INDENT> _new = type.__new__ <NEW_LINE> def __init__(cls, *args, **kwargs): <NEW_LINE> <INDENT> if hasattr(cls, 'eval'): <NEW_LINE> <INDENT> evalargspec = inspect.getargspec(cls.eval) <NEW_LINE> if evalargspec.varargs: <NEW_LINE> <INDENT> eva... | Base class for function classes. FunctionClass is a subclass of type.
Use Function('<function name>' [ , signature ]) to create
undefined function classes. | 62598f728e05c05ec3f6ea80 |
class TestImportUnfinishedWorkflow(BaseWorkflowRunnerTests, UnittestPythonCompatibility): <NEW_LINE> <INDENT> expected_output = {u'test1': 4, u'test2': 6, u'test3': 7, u'test4': 10, u'test5': 11} <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.wf = Workflow() <NEW_LINE> cls.wf.load(os.pa... | Import unfinished workflow and continue | 62598f72711fe17d825dff5a |
class ARADProp(Prop): <NEW_LINE> <INDENT> def new_foil(self, r, rpm, twist): <NEW_LINE> <INDENT> import foil_ARA <NEW_LINE> return self.new_blade_element(foil_ARA.ARADFoil, r, rpm, twist) | Prop that uses ARAD Airfoils
| 62598f720383005118f6cf78 |
class BlockReader(object): <NEW_LINE> <INDENT> def __init__(self, f, n=1): <NEW_LINE> <INDENT> self.f = f <NEW_LINE> self.n = n <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def next(self): <NEW_LINE> <INDENT> return [self.f.next() for i in xrange(self.n)] | class to read ASCII text in n-line "blocks" | 62598f7273bcbd0ca4bc9ac2 |
class Link(base.APIBase): <NEW_LINE> <INDENT> href = wtypes.text <NEW_LINE> rel = wtypes.text <NEW_LINE> type = wtypes.text <NEW_LINE> @staticmethod <NEW_LINE> def make_link(rel_name, url, resource, resource_args, bookmark=False, type=wtypes.Unset): <NEW_LINE> <INDENT> href = build_url(resource, resource_args, bookmark... | A link representation. | 62598f7223e79379d538bd6c |
class APIClient(object): <NEW_LINE> <INDENT> API = None <NEW_LINE> API_KEY = '' <NEW_LINE> OTE = False <NEW_LINE> OTE_ENDPOINT = 'https://rpc.ote.gandi.net/xmlrpc/' <NEW_LINE> ENDPOINT = 'https://rpc.gandi.net/xmlrpc/' <NEW_LINE> def __init__(self, API_KEY): <NEW_LINE> <INDENT> self.API_KEY = API_KEY <NEW_LINE> endpoin... | Gandi RPC API client
http://doc.rpc.gandi.net/ | 62598f726e29344779affed4 |
class ModifyPictureRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.PictureId = None <NEW_LINE> self.SdkAppId = None <NEW_LINE> self.Height = None <NEW_LINE> self.Width = None <NEW_LINE> self.XPosition = None <NEW_LINE> self.YPosition = None <NEW_LINE> <DEDENT> def _deserialize(s... | ModifyPicture请求参数结构体
| 62598f72167d2b6e312b67f2 |
class ErrorsValue(_messages.Message): <NEW_LINE> <INDENT> class ErrorsValueListEntry(_messages.Message): <NEW_LINE> <INDENT> code = _messages.StringField(1) <NEW_LINE> location = _messages.StringField(2) <NEW_LINE> message = _messages.StringField(3) <NEW_LINE> <DEDENT> errors = _messages.MessageField('ErrorsValueListEn... | [Output Only] Encountered errors during the last attempt to create or
delete the instance.
Messages:
ErrorsValueListEntry: A ErrorsValueListEntry object.
Fields:
errors: [Output Only] The array of errors encountered while processing
this operation. | 62598f7230c21e258be98079 |
class IngoingMovementForm(MovementForm): <NEW_LINE> <INDENT> class Meta(MovementForm.Meta): <NEW_LINE> <INDENT> exclude = ['product_entry', 'destination', 'author'] <NEW_LINE> <DEDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(IngoingMovementForm, self).__init__(*args, **kwargs) <NEW_LINE> self.fie... | Form for ingoing movement data.
| 62598f72be8e80087fbbe8d4 |
class invokable_data_source(data_source): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> def __init__(self, data): <NEW_LINE> <INDENT> data_source.__init__(self, data, mutable=False) <NEW_LINE> <DEDENT> @klass.steal_docs(data_source) <NEW_LINE> def text_fileobj(self, writable=False): <NEW_LINE> <INDENT> if writable: <NE... | data source that takes a callable instead of the actual data item
The callable takes a single argument- a boolean, True if a text fileobj
is requested, False if None
Note that this instance is explicitly readonly. | 62598f721f5feb6acb1624ad |
class FminWrapper(object): <NEW_LINE> <INDENT> def __init__(self, criterion, x0=None, *args, **kwargs): <NEW_LINE> <INDENT> self.criterion = criterion <NEW_LINE> self.gradient = getattr(criterion, "gradient", None) <NEW_LINE> self.hessian = getattr(criterion, "hessian", None) <NEW_LINE> self.hessian_p = getattr(criteri... | Abstract class to generate wrappers around scipy.optimize fmin_*
functions.
Parameters
-----------
criterion : Criterion
A criterion function with __call__ and gradient methods.
x0 : ndarray (None)
First guess
args=() : tuple
Extra arguments for the criterion function
kwargs : dict
Parameters of the f... | 62598f728c3a8732951f5dc4 |
class EventBeforeBigBang(HistoricalEvent): <NEW_LINE> <INDENT> def __init__(self, event_name, year): <NEW_LINE> <INDENT> super().__init__(event_name, None) <NEW_LINE> self.writing_invented = False | Model historical event that took place before the Big Bang. | 62598f7221bff66bcd7224d8 |
class InvertedPendulumPidController(SimpleNetworkDevice): <NEW_LINE> <INDENT> def __init__(self, name: str, xPos: float, yPos: float, frequencyBand: FrequencyBand): <NEW_LINE> <INDENT> super(InvertedPendulumPidController, self).__init__(name, xPos, yPos, frequencyBand) <NEW_LINE> self._angle = 0 <NEW_LINE> self.sensorA... | A PID inverted pendulum controller for the SlidingPendulum plant.
Note:
After initialization, the :attr:`sensorAddr` and :attr:`actuatorAddr`
attributes have to be set to the network addresses of the sensor and the
actuator. | 62598f7338b623060ffa8912 |
class Battery(): <NEW_LINE> <INDENT> def __init__(self, battery_size=70): <NEW_LINE> <INDENT> self.battery_size = battery_size <NEW_LINE> <DEDENT> def describe_battery(self): <NEW_LINE> <INDENT> print("This car has a " + str(self.battery_size) + "-kWh battery.") <NEW_LINE> <DEDENT> def get_range(self): <NEW_LINE> <INDE... | 一次模拟电动汽车电瓶的简单尝试 | 62598f73d10714528d69d743 |
class Step(db.Model): <NEW_LINE> <INDENT> __tablename__ = "step" <NEW_LINE> ste_name = db.Column(db.String(64), primary_key=True, nullable=False) <NEW_LINE> ste_caption = db.Column(db.String(255)) | Table fo steps | 62598f73a4f1c619b294de63 |
class RiakPbcKeyStream(RiakPbcStream): <NEW_LINE> <INDENT> _expect = MSG_CODE_LIST_KEYS_RESP <NEW_LINE> def __next__(self): <NEW_LINE> <INDENT> response = next(super(RiakPbcKeyStream, self)) <NEW_LINE> if response.done and len(response.keys) is 0: <NEW_LINE> <INDENT> raise StopIteration <NEW_LINE> <DEDENT> return respo... | Used internally by RiakPbcTransport to implement key-list streams. | 62598f738e05c05ec3f6ea81 |
class LinLogLeastNorm(LinLogBase): <NEW_LINE> <INDENT> def __init__(self, N, Ex, Ey, v_star, driver='gelsy', **kwargs): <NEW_LINE> <INDENT> self.driver = driver <NEW_LINE> LinLogBase.__init__(self, N, Ex, Ey, v_star, **kwargs) <NEW_LINE> <DEDENT> def solve(self, A, b): <NEW_LINE> <INDENT> return lstsq_wrapper(A, b, sel... | Uses dgels to solve for the least-norm solution to the linear equation | 62598f7373bcbd0ca4bc9ac4 |
class DataFromEVB1000: <NEW_LINE> <INDENT> def __init__(self, line): <NEW_LINE> <INDENT> self.line = line[:-2] <NEW_LINE> try: <NEW_LINE> <INDENT> self.line = self.line.decode('utf-8') <NEW_LINE> <DEDENT> except UnicodeDecodeError: <NEW_LINE> <INDENT> raise InvalidDataFromEVB1000 <NEW_LINE> <DEDENT> self.msg_type = '' ... | Decodes a line coming from the EVB1000 serial. | 62598f7323e79379d538bd6e |
class GetInputSet(InputSet): <NEW_LINE> <INDENT> def set_AccessToken(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'AccessToken', value) <NEW_LINE> <DEDENT> def set_ClientID(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'ClientID', value) <NEW_LINE> <DEDENT> def set_ClientSecret(self, value)... | An InputSet with methods appropriate for specifying the inputs to the Get
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 62598f7350485f2cf55da7e7 |
class ConnectorResolverContext: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.args_count = None <NEW_LINE> self.named_attr = None <NEW_LINE> <DEDENT> def start(self): <NEW_LINE> <INDENT> self.args_count = len(args) <NEW_LINE> self.named_attr = kwargs <NEW_LINE> parent.add(*args, **kwargs) <NEW_LINE> ... | Keep track of a temporary resolver.
Can be used with a 'with statement' or by calling :method:`start` and :method:`finish`.
@see :method:`TestResolve.test_without_with_statement` for an example. | 62598f737b25080760ed6d16 |
class MockPart(object): <NEW_LINE> <INDENT> def __init__(self, unicodeBody, contentType='text/plain'): <NEW_LINE> <INDENT> self.unicodeBody = unicodeBody <NEW_LINE> self.contentType = contentType <NEW_LINE> <DEDENT> def getUnicodeBody(self): <NEW_LINE> <INDENT> return self.unicodeBody <NEW_LINE> <DEDENT> def getBody(se... | A mock L{xquotient.mimestorage.Part} which implements enough functionality
to satisfy L{xquotient.exmess.PartDisplayer} | 62598f73be8e80087fbbe8d6 |
class AuthenticatedUserApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = create_user( email='test@mail.com', password='passw0rd', name='name' ) <NEW_LINE> self.client = APIClient() <NEW_LINE> self.client.force_authenticate(user=self.user) <NEW_LINE> <DEDENT> def test_retrieve_prof... | Test API requests that require authentication | 62598f73fb3f5b602db47dec |
class TestCompareXLSXFiles(ExcelComparisonTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.maxDiff = None <NEW_LINE> filename = 'header_image01.xlsx' <NEW_LINE> test_dir = 'xlsxwriter/test/comparison/' <NEW_LINE> self.image_dir = test_dir + 'images/' <NEW_LINE> self.got_filename = test_dir + '_test_... | Test file created by XlsxWriter against a file created by Excel. | 62598f731f037a2d8b9e3966 |
class TestPaymentDevicePreAuthTransactionAllOf(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 testPaymentDevicePreAuthTransactionAllOf(self): <NEW_LINE> <INDENT> pass | PaymentDevicePreAuthTransactionAllOf unit test stubs | 62598f73d6c5a102081e19bd |
class LibraryFilesystem(object): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self._root = config.library.filesystem_root <NEW_LINE> self._config = config <NEW_LINE> <DEDENT> def _compose(self, name, args, mkdir=True): <NEW_LINE> <INDENT> from os.path import normpath <NEW_LINE> from ambry.dbexce... | Build directory names from the filesystem entries in the run configuration
Each of the method will return a directory based on an entry in the configuration. The
directory will be created with makedirs. | 62598f730a366e3fb87dc23f |
class TestCampaignGroupsApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = egoi_api.api.campaign_groups_api.CampaignGroupsApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_create_campaign_group(self): <NEW_LINE> <INDENT> pass <NE... | CampaignGroupsApi unit test stubs | 62598f73d10714528d69d746 |
class LoadBalancerBackendAddressPoolListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'next_link': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'value': {'key': 'value', 'type': '[BackendAddressPool]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, **... | Response for ListBackendAddressPool API service call.
Variables are only populated by the server, and will be ignored when sending a request.
:param value: A list of backend address pools in a load balancer.
:type value: list[~azure.mgmt.network.v2020_07_01.models.BackendAddressPool]
:ivar next_link: The URL to get t... | 62598f7373bcbd0ca4bc9ac6 |
class ListPort(ListCommand): <NEW_LINE> <INDENT> resource = 'port' <NEW_LINE> log = logging.getLogger(__name__ + '.ListPort') <NEW_LINE> _formatters = {'fixed_ips': _format_fixed_ips, } <NEW_LINE> list_columns = ['id', 'name', 'mac_address', 'fixed_ips'] <NEW_LINE> pagination_support = True <NEW_LINE> sorting_support =... | List ports that belong to a given tenant. | 62598f738a43f66fc4bf19f8 |
class Master(BoxLayout, ScreenBase): <NEW_LINE> <INDENT> card_list_select = ObjectProperty() <NEW_LINE> __card_logic = CardAccessLogicImpl() <NEW_LINE> __history_logic = HistoryAccessLogicImpl() <NEW_LINE> __card_list_repr = '【title】:{id:>3}:{name} 【time(m)】:{time:5}\n【cate1】:{category1}【cate2】:{category2}' <NEW_LIN... | マスタ画面を表示するクラス | 62598f73ac7a0e7691f71d90 |
class SearchTaxonomiesResponse(_messages.Message): <NEW_LINE> <INDENT> nextPageToken = _messages.StringField(1) <NEW_LINE> taxonomies = _messages.MessageField('Taxonomy', 2, repeated=True) | Response message for "CategoryApi.SearchTaxonomies".
Fields:
nextPageToken: Token to retrieve the next page of results, or empty if
there are no more results in the list.
taxonomies: Taxonomies whose display name matches given regular
expression. | 62598f73cad5886f8bdc4b9a |
class PPMongoError(Exception): <NEW_LINE> <INDENT> pass | General ppmongo exception | 62598f7330dc7b766599f0d7 |
class QMapPrinter: <NEW_LINE> <INDENT> class _iterator: <NEW_LINE> <INDENT> def __init__(self, val): <NEW_LINE> <INDENT> self.val = val <NEW_LINE> self.ktype = self.val.type.template_argument(0) <NEW_LINE> self.vtype = self.val.type.template_argument(1) <NEW_LINE> self.data_node = self.val['e']['forward'][0] <NEW_LINE>... | Print a QMap | 62598f7330c21e258be9807e |
class Devnull: <NEW_LINE> <INDENT> def write(self, _): <NEW_LINE> <INDENT> pass | /dev/null incarnation as output-stream-like object | 62598f7376d4e153a661c48d |
class MachineState(Enum): <NEW_LINE> <INDENT> wait_for_server = 1 <NEW_LINE> wait_for_programs = 2 | Enum-Class serves for implementation of state machine status | 62598f7363f4b57ef00859ac |
class IngredientCreateView(IngredientMixin, CreateView): <NEW_LINE> <INDENT> model = Ingredient <NEW_LINE> title = ugettext_lazy('Add a new ingredient') <NEW_LINE> form_action = reverse_lazy('nutrition:ingredient:add') <NEW_LINE> sidebar = 'ingredient/form.html' <NEW_LINE> def form_valid(self, form): <NEW_LINE> <INDENT... | Generic view to add a new ingredient | 62598f7350485f2cf55da7ea |
class DescribeErrorLogsRequest(JDCloudRequest): <NEW_LINE> <INDENT> def __init__(self, parameters, header=None, version="v1"): <NEW_LINE> <INDENT> super(DescribeErrorLogsRequest, self).__init__( '/regions/{regionId}/instances/{instanceId}/errorLogs', 'GET', header, version) <NEW_LINE> self.parameters = parameters | 获取SQL Server 错误日志及下载信息<br>- 仅支持SQL Server | 62598f73d164cc61758207f1 |
class TestQueryResultResponseHeader(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 testQueryResultResponseHeader(self): <NEW_LINE> <INDENT> pass | QueryResultResponseHeader unit test stubs | 62598f73a8ecb03325870a83 |
class ProposalTypesChoices(forms.Form): <NEW_LINE> <INDENT> proposal_section = forms.ChoiceField( widget=forms.Select(attrs={"class": "dropdown"}) ) <NEW_LINE> proposal_type = forms.ChoiceField(widget=forms.Select(attrs={"class": "dropdown"})) <NEW_LINE> def __init__(self, conference, *args, **kwargs): <NEW_LINE> <INDE... | Base proposal form with proposal sections & types. | 62598f73ac7a0e7691f71d92 |
class Gtts(commands.Cog): <NEW_LINE> <INDENT> @commands.command() <NEW_LINE> async def say(self, ctx, *, query, lang = 'en'): <NEW_LINE> <INDENT> log.debug(f'Query: {query}') <NEW_LINE> tts = gTTS(query, lang) <NEW_LINE> audiopath = cog_data_path(raw_name='Audio') <NEW_LINE> tmppath = audiopath / 'localtracks/gtts-tmp/... | Speak using gTTS. | 62598f7307d97122c421651c |
class ThreadNotStartedError(RuntimeError): <NEW_LINE> <INDENT> pass | Called when a thread has not been started | 62598f73dc8b845886d52e2e |
class Solution: <NEW_LINE> <INDENT> @timeit <NEW_LINE> def topKFrequent(self, words: List[str], k: int) -> List[str]: <NEW_LINE> <INDENT> from collections import Counter <NEW_LINE> import heapq <NEW_LINE> from functools import cmp_to_key <NEW_LINE> ctr = Counter(words) <NEW_LINE> q = [] <NEW_LINE> for x in ctr: <NEW_LI... | [692. 前K个高频单词](https://leetcode-cn.com/problems/top-k-frequent-words/) | 62598f735e10d32532ce352a |
class Pos(Action): <NEW_LINE> <INDENT> def __init__(self, net_graph, uid, x, y): <NEW_LINE> <INDENT> super(Pos, self).__init__(net_graph, uid) <NEW_LINE> self.x, self.y = self.obj_config.pos <NEW_LINE> self.act_pos(x, y) <NEW_LINE> <DEDENT> def act_pos(self, x, y): <NEW_LINE> <INDENT> self.obj_config.pos = x, y <NEW_LI... | Set the position on a NetGraph Item or a visualisation component | 62598f734d74a7450cd58b17 |
class AbstractStack(ABC): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._top = -1 <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return self._top + 1 <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> res = "->".join(map(str, self)) <NEW_LINE> return 'Top->' + res <NEW_LINE> <DED... | Abstract Class for Stacks. | 62598f73c432627299fa2852 |
class RegOrgUnitContact(models.Model): <NEW_LINE> <INDENT> org_unit = models.ForeignKey(RegOrgUnit) <NEW_LINE> contact_detail_type_id = models.CharField(max_length=20) <NEW_LINE> contact_detail = models.CharField(max_length=255) <NEW_LINE> is_void = models.BooleanField(default=False) <NEW_LINE> class Meta: <NEW_LINE> <... | Model for Organisational units contact details. | 62598f73d4950a0f3b110a74 |
class RPCDoesNotExist(Exception): <NEW_LINE> <INDENT> pass | Method does not exist | 62598f73be8e80087fbbe8da |
class PutFailed(Exception): <NEW_LINE> <INDENT> def __init__(self, uri, msg): <NEW_LINE> <INDENT> self.uri = uri <NEW_LINE> self.msg = msg <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return 'Document %s: %s' % (self.uri, self.msg) | Could not add the specified doc to the database. | 62598f7330c21e258be9807f |
class RecurredCost(models.Model): <NEW_LINE> <INDENT> uuid = SmallUUIDField(default=uuid_default(), editable=False) <NEW_LINE> timestamp = models.DateTimeField(default=timezone.now, editable=False) <NEW_LINE> recurring_cost = models.ForeignKey(RecurringCost, related_name='recurrences') <NEW_LINE> billing_cycle = models... | A record of a recurring cost which has been enacted.
Links together the RecurringCost, BillingCycle, and Transaction. | 62598f73796e427e5384e012 |
class BatchDescribeKTVMusicDetailsResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.KTVMusicDetailInfoSet = None <NEW_LINE> self.NotExistMusicIdSet = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("KTVMu... | BatchDescribeKTVMusicDetails返回参数结构体
| 62598f73be383301e0253073 |
class Base(threading.Thread): <NEW_LINE> <INDENT> runnable = False <NEW_LINE> drawable = False <NEW_LINE> fps = 25 <NEW_LINE> lasttime = 0 <NEW_LINE> def __init__(self, canvas, sizex=None, sizey=None): <NEW_LINE> <INDENT> self.config = ari.config.Config() <NEW_LINE> self.canvas = canvas <NEW_LINE> if sizex is None: <NE... | Base class for demos
Demos must inherit from this class. | 62598f73287bf620b6271433 |
class Input2rcalc(djm.Model): <NEW_LINE> <INDENT> input = djm.ForeignKey('Input') <NEW_LINE> risk_calculation = djm.ForeignKey('RiskCalculation') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> db_table = 'uiapi\".\"input2rcalc' | `input` to `risk_calculation` link table. | 62598f736aa9bd52df0d4751 |
class AllowedMethodsForFeatureCollectionResourceTest(AbstractHeadRequestTest): <NEW_LINE> <INDENT> def test_head_for_feature_collection_simple_path(self): <NEW_LINE> <INDENT> response = requests.head(self.bcim_base_uri + "unidades-federativas") <NEW_LINE> self.assertEquals(response.status_code, 200) <NEW_LINE> self.ass... | Class to test every possible allowed methods for differents requests for FeatureCollectionResource | 62598f73d10714528d69d749 |
class theguardian(rss): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.doctype = "theguardian (www)" <NEW_LINE> self.rss_url = "https://www.theguardian.com/uk/rss" <NEW_LINE> self.version = ".1" <NEW_LINE> self.date = datetime.datetime(year=2017, month=9, day=13) <NEW_LINE> <DEDENT> def parsehtml(self... | Scrapes theguardian.com | 62598f73d164cc61758207f3 |
class ExistingListItemFormTest(TestCase): <NEW_LINE> <INDENT> def test_001(self): <NEW_LINE> <INDENT> list_object = List.objects.create() <NEW_LINE> soup = BeautifulSoup(ExistingListItemForm(for_list=list_object).as_p(), 'html.parser') <NEW_LINE> item_text = soup.find('input', {'name': 'text'}) <NEW_LINE> self.assertEq... | 对象清单的待办事项表单测试
| 62598f73711fe17d825dff62 |
class RNGContext: <NEW_LINE> <INDENT> def __init__(self, seed): <NEW_LINE> <INDENT> self.seed = seed <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self.start_state = np.random.get_state() <NEW_LINE> np.random.seed(self.seed) <NEW_LINE> <DEDENT> def __exit__(self, exc_type, exc_value, traceback): <NEW_LIN... | Context manager to set the numpy random number generator speed. Returns
to the original value upon exiting the context manager.
Parameters
----------
seed : int
Seed for numpy.random.seed
Examples
--------
with RNGContext(42):
np.random.randn() | 62598f738a349b6b43685abf |
class SaltCIStartupException(SaltCIException): <NEW_LINE> <INDENT> pass | This exception is raised to let the user that something is wrong and Salt-CI could not start | 62598f73d4950a0f3b110a75 |
@instance <NEW_LINE> @ensure_doctest <NEW_LINE> class wildcard(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def __eq__(other): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def __ne__(other): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <IND... | An object that compares equal to any other object.
This is useful when using :func:`~zipline.testing.predicates.assert_equal`
with a large recursive structure and some fields to be ignored.
Examples
--------
>>> wildcard == 5
True
>>> wildcard == 'ayy'
True
# reflected
>>> 5 == wildcard
True
>>> 'ayy' == wildcard
Tr... | 62598f737b25080760ed6d1c |
class Parameter(object): <NEW_LINE> <INDENT> def __init__(self, name, value, value_type, status=None, min_val=None, max_val=None, evaluator=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.value = value <NEW_LINE> self.value_type = value_type <NEW_LINE> if not status: <NEW_LINE> <INDENT> self.status = Parame... | System parameter wrapper | 62598f7315fb5d323ce7e5a5 |
class Category(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=100) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name | 文章分类 | 62598f7376d4e153a661c490 |
class PBKDF2(object): <NEW_LINE> <INDENT> def __init__(self, passphrase, salt, iterations=1000, digestmodule=SHA1, macmodule=HMAC): <NEW_LINE> <INDENT> self.__macmodule = macmodule <NEW_LINE> self.__digestmodule = digestmodule <NEW_LINE> self._setup(passphrase, salt, iterations, self._pseudorandom) <NEW_LINE> <DEDENT> ... | PBKDF2.py : PKCS#5 v2.0 Password-Based Key Derivation
This implementation takes a passphrase and a salt (and optionally an
iteration count, a digest module, and a MAC module) and provides a
file-like object from which an arbitrarily-sized key can be read.
If the passphrase and/or salt are unicode objects, they are en... | 62598f731f5feb6acb1624b5 |
@public <NEW_LINE> @implementer(ITemplateManager) <NEW_LINE> class TemplateManager: <NEW_LINE> <INDENT> @dbconnection <NEW_LINE> def set(self, store, name, context, uri, username=None, password=''): <NEW_LINE> <INDENT> template = store.query(Template).filter( Template.name == name, Template.context == context).one_or_n... | Manager of templates, with caching and support for mailman:// URIs. | 62598f73be383301e0253075 |
class TrackShare(BackendMessage): <NEW_LINE> <INDENT> def __init__(self, share_id): <NEW_LINE> <INDENT> self.share_id = share_id | Start tracking a media share
| 62598f73287bf620b6271435 |
class FadeExample(QtGui.QWidget): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(FadeExample, self).__init__() <NEW_LINE> self.resize(600,600) <NEW_LINE> self.vlayout = QtGui.QVBoxLayout(self) <NEW_LINE> self.w1 = QtGui.QWidget() <NEW_LINE> self.w1.setStyleSheet("QWidget {background-color: red;}") <N... | FadeExample(QtGui.QWidget)
Example widget using a FaderWidget to transition
between two simple colored QWidgets in a stack layout. | 62598f7376d4e153a661c491 |
class Meta: <NEW_LINE> <INDENT> model = Preuser | Factory configuration. | 62598f736aa9bd52df0d4753 |
class RetrieveTransferParametersResponse(proto.Message): <NEW_LINE> <INDENT> transfer_parameters = proto.Field( proto.MESSAGE, number=1, message="TransferParameters", ) | Response for the ``RetrieveTransferParameters`` method.
Attributes:
transfer_parameters (google.cloud.domains_v1beta1.types.TransferParameters):
Parameters to use when calling the ``TransferDomain``
method. | 62598f7363f4b57ef00859ae |
class unitTests(unittest.TestCase): <NEW_LINE> <INDENT> def test__init__(self): <NEW_LINE> <INDENT> fileName = 'add/Add.asm' <NEW_LINE> parser = Parser(fileName) <NEW_LINE> self.assertTrue(1 == Parser.A_COMMAND) <NEW_LINE> self.assertTrue(2 == Parser.C_COMMAND) <NEW_LINE> self.assertTrue(3 == Parser.L_COMMAND) <NEW_LIN... | unit tests for class Parser | 62598f7391af0d3eaad3968a |
class RouteTableSchema(base_schema_v2.BaseSchema): <NEW_LINE> <INDENT> table = (RouteTableEntrySchema,) | Schema class for routing table of a Logical Router.
>>> import pprint
>>> py_dict = {'table': [{'destination': '192.168.1.0',
... 'mask': '255.255.255.0',
... 'next_hop': '0.0.0.0',
... 'dr_flags': 'UCI',
... 'dr_ref' : '1',
... ... | 62598f73a4f1c619b294de6b |
class ObjectFlow(models.Model): <NEW_LINE> <INDENT> __package__ = 'UML.Activities' <NEW_LINE> activity_edge = models.OneToOneField('ActivityEdge', on_delete=models.CASCADE, primary_key=True) <NEW_LINE> is_multicast = models.BooleanField(help_text='Indicates whether the objects in the ObjectFlow are passed by ' + 'multi... | An ObjectFlow is an ActivityEdge that is traversed by object tokens that may hold values. Object flows also
support multicast/receive, token selection from object nodes, and transformation of tokens. | 62598f735e10d32532ce352c |
class ScheduleDateInvalid(BadRequest): <NEW_LINE> <INDENT> ID = "SCHEDULE_DATE_INVALID" <NEW_LINE> MESSAGE = __doc__ | Invalid schedule date provided | 62598f73dc8b845886d52e32 |
class MemoryShelf(JSONShelf): <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> self.data = {} <NEW_LINE> if os.path.exists(self.filename): <NEW_LINE> <INDENT> self.load() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.save() <NEW_LINE> <DEDENT> <DEDENT> def l... | A base class for shelves that keep all their data in memory and
write everything to disk on save(). | 62598f73d99f1b3c44d04f35 |
class DescribeModelDefinitionRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ProductId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.ProductId = params.get("ProductId") <NEW_LINE> memeber_set = set(params.keys()) <NEW_LINE> for name, value i... | DescribeModelDefinition请求参数结构体
| 62598f73ec188e330fdf8120 |
class SiloViewSet(viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> serializer_class = SiloSerializer <NEW_LINE> lookup_field = 'id' <NEW_LINE> permission_classes = (IsAuthenticated, Silo_IsOwnerOrCanRead,) <NEW_LINE> filter_fields = ('owner__username','shared__username','id','tags','public') <NEW_LINE> filter_backen... | This viewset automatically provides `list` and `retrieve` actions. | 62598f7366656f66f7d59c70 |
class UserView(APIView): <NEW_LINE> <INDENT> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> serializer = UserSerializer(request.user) <NEW_LINE> return Response(serializer.data, status=200) | Returns current user data if he is logged in. | 62598f73d53ae8145f917d16 |
class SafeFitnessTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.alphabet = TestAlphabet() <NEW_LINE> genome_1 = MutableSeq("2", self.alphabet) <NEW_LINE> self.org_1 = Organism(genome_1, test_fitness) <NEW_LINE> genome_2 = MutableSeq("2", self.alphabet) <NEW_LINE> self.org_2 = Org... | Tests for crossovers which do not reduce fitness.
| 62598f73d4950a0f3b110a76 |
class CurveA(_Curve): <NEW_LINE> <INDENT> def __init__(self, head_length=.4, head_width=.2): <NEW_LINE> <INDENT> super(ArrowStyle.CurveA, self).__init__( beginarrow=True, endarrow=False, head_length=head_length, head_width=head_width) | An arrow with a head at its begin point. | 62598f7376d4e153a661c492 |
class SubmitInput(Input): <NEW_LINE> <INDENT> input_type = 'submit' <NEW_LINE> def __call__(self, field, **kwargs): <NEW_LINE> <INDENT> kwargs.setdefault('value', field.label.text) <NEW_LINE> return super(SubmitInput, self).__call__(field, **kwargs) | Renders a submit button.
The field's label is used as the text of the submit button instead of the
data on the field. | 62598f73be383301e0253077 |
class WindowsServiceCollection(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._services = [] <NEW_LINE> <DEDENT> def AddService(self, new_service): <NEW_LINE> <INDENT> for service in self._services: <NEW_LINE> <INDENT> if new_service == service: <NEW_LINE> <INDENT> service.sources.append(new_... | Class to hold and de-duplicate Windows Services. | 62598f731f037a2d8b9e396e |
class FileTableColumnProvider(TableColumnProvider): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._column_labels = ["Name", "Size", "Date Modified"] <NEW_LINE> self.column_count = len(self._column_labels) <NEW_LINE> return <NEW_LINE> <DEDENT> def get_label(self, viewer, column_index): <NEW_LINE> <IND... | A table column provider for local file systems. | 62598f73d6c5a102081e19c5 |
class TestPodaacSeawindsGrids(unittest.TestCase): <NEW_LINE> <INDENT> def tearDown(self): <NEW_LINE> <INDENT> plt.close() <NEW_LINE> <DEDENT> def test_SW_S3E_rep_wind_speed_lvl0(self): <NEW_LINE> <INDENT> hdffile = 'SW_S3E_2003100.20053531923.hdf' <NEW_LINE> hdffile = fullpath(hdffile) <NEW_LINE> zoo.podaac.seawinds.SW... | Run PODAAC/AVHRR grid codes. | 62598f7321bff66bcd7224e2 |
class _GridDefinitions(_YamlStorage): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(_GridDefinitions, self).__init__('grid_def.yml') | Loads and stores the grid_def.yml file and returns dictionaries of
information necessary to construct a given grid in ESMpy regridding. | 62598f7391af0d3eaad3968c |
class Seq2SeqPredict(nn.Module): <NEW_LINE> <INDENT> def __init__(self, encoder, decoder, field): <NEW_LINE> <INDENT> super(Seq2SeqPredict, self).__init__() <NEW_LINE> self.encoder = encoder <NEW_LINE> self.decoder = decoder <NEW_LINE> self.sos_idx = field.vocab.stoi[SOS_TOKEN] <NEW_LINE> self.eos_idx = field.vocab.sto... | This class is wrapper around pre-trained model which can be used for testing model.
This model takes (numericalized) input, delegates it to appropriate sequence sampler and returns
:param encoder: Pre-trained encoder.
:param decoder: Pre-trained decoder.
:param field: Torchtext Field object which handles processing of... | 62598f734e696a045264da3e |
class Level2From(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.b_key = "level-2-from" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> self.into_2 = {} <NEW_LINE> for keys, value in kwargs.items(): <NEW_LINE> <INDENT> setattr(self,keys, value) | This class does not support CRUD Operations please use parent.
:param DeviceProxy: The device proxy for REST operations and session handling. Refer to `common/device_proxy.py` | 62598f733eb6a72ae0389ec3 |
class Singleton(type): <NEW_LINE> <INDENT> def __call__(cls: type, *args, **kwargs) -> object: <NEW_LINE> <INDENT> if not hasattr(cls, '_instance') or not isinstance(cls._instance, cls): <NEW_LINE> <INDENT> cls._instance = super().__call__(*args, **kwargs) <NEW_LINE> <DEDENT> return cls._instance | Singleton pattern implementation. | 62598f734d74a7450cd58b1a |
class Servidor(): <NEW_LINE> <INDENT> def __init__(self, host="localhost", port=4000): <NEW_LINE> <INDENT> self.clientes = [] <NEW_LINE> self.wwclient = {} <NEW_LINE> self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) <NEW_LINE> self.sock.bind((str(host), int(port))) <NEW_LINE> self.sock.listen(10) <NEW_LINE... | docstring for Servidor | 62598f73be383301e0253079 |
class ProcessingFunction(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=30) <NEW_LINE> function = models.CharField(max_length=30) <NEW_LINE> number_of_images = models.PositiveSmallIntegerField(default=1) <NEW_LINE> number_of_parameters = models.PositiveSmallIntegerField(default=0) <NEW_LINE> para... | Model określający zaimplementowane algorytmy przetwarzania obrazu w programie przechowywane w bazie danych. | 62598f7330c21e258be98086 |
class DescribeBackupConfigRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.InstanceId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.InstanceId = params.get("InstanceId") | DescribeBackupConfig请求参数结构体
| 62598f730383005118f6cf84 |
class DynamicMatrixTransform(BaseAffineTransform): <NEW_LINE> <INDENT> def __init__(self, matrix_func, fromsys, tosys, priority=1, register_graph=None): <NEW_LINE> <INDENT> if not callable(matrix_func): <NEW_LINE> <INDENT> raise TypeError('matrix_func is not callable') <NEW_LINE> <DEDENT> self.matrix_func = matrix_func... | A coordinate transformation specified as a function that yields a
3 x 3 cartesian transformation matrix.
This is similar to, but distinct from StaticMatrixTransform, in that the
matrix for this class might depend on frame attributes.
Parameters
----------
matrix_func : callable
A callable that has the signature `... | 62598f7350485f2cf55da7f2 |
class InformationController(): <NEW_LINE> <INDENT> def __init__(self, user): <NEW_LINE> <INDENT> self.user = user <NEW_LINE> self.userdialog = UserDialog.objects.create(target_user=self.user) <NEW_LINE> self.active_receptors = [] <NEW_LINE> self.user_message_signal = django.dispatch.dispatcher.Signal(providing_args=["u... | InformationController is a PlugIn for information management, may be plugged to an Agent object or to a Skill
instance for managing access of internal components to information and behaviours of the system. | 62598f73d164cc61758207f9 |
class Student: <NEW_LINE> <INDENT> def __init__(self, first_name, last_name, age): <NEW_LINE> <INDENT> self.first_name = first_name <NEW_LINE> self.last_name = last_name <NEW_LINE> self.age = age <NEW_LINE> <DEDENT> def to_json(self): <NEW_LINE> <INDENT> return self.__dict__ | Represents a Student. | 62598f73287bf620b627143a |
class IMAP4HelperMixin(SoledadTestMixin): <NEW_LINE> <INDENT> serverCTX = None <NEW_LINE> clientCTX = None <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> soledad_adaptor.cleanup_deferred_locks() <NEW_LINE> USERID = TEST_USER <NEW_LINE> def setup_server(account): <NEW_LINE> <INDENT> self.server = TestSoledadIMAPServer(... | MixIn containing several utilities to be shared across
different TestCases | 62598f738e05c05ec3f6ea87 |
class CmdPage(MuxCommand): <NEW_LINE> <INDENT> key = 'page' <NEW_LINE> aliases = ['p'] <NEW_LINE> locks = 'cmd:all()' <NEW_LINE> arg_regex = r'\s|$' <NEW_LINE> def func(self): <NEW_LINE> <INDENT> self.account.execute_cmd('public {}'.format(self.args)) | Command to forward pages into publc channel. | 62598f73cad5886f8bdc4ba4 |
class Tunnel(ABC): <NEW_LINE> <INDENT> @property <NEW_LINE> @abstractmethod <NEW_LINE> def there(self) -> int: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @property <NEW_LINE> @abstractmethod <NEW_LINE> def here(self) -> int: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def close(self): <NEW... | SSH tunnel. | 62598f736e29344779affee2 |
class PatternAnalyser: <NEW_LINE> <INDENT> def make_predicate(self, obj): <NEW_LINE> <INDENT> if isinstance(obj, Predicate): <NEW_LINE> <INDENT> return obj <NEW_LINE> <DEDENT> return Predicate.eq(obj) <NEW_LINE> <DEDENT> def make_span_predicate(self, span): <NEW_LINE> <INDENT> if span is None: <NEW_LINE> <INDENT> retur... | Converts a pattern into a bound predicate. | 62598f73dc8b845886d52e36 |
class Room(Model): <NEW_LINE> <INDENT> number = CharField('номер', max_length=50) <NEW_LINE> building = CharField('здание', max_length=50) <NEW_LINE> computer = BooleanField('компьютерная', default=False) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = 'аудитория' <NEW_LINE> verbose_name_plural = 'аудитории' ... | Аудитория | 62598f7376d4e153a661c496 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.