code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class QzoneSpiderMiddleware(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_crawler(cls, crawler): <NEW_LINE> <INDENT> s = cls() <NEW_LINE> crawler.signals.connect(s.spider_opened, signal=signals.spider_opened) <NEW_LINE> return s <NEW_LINE> <DEDENT> def process_start_requests(self, start_requests, spider... | 处理QQ空间登录相关问题 | 62598ee791f36d47f22301fc |
class WorkerRegistrationResponse(Model): <NEW_LINE> <INDENT> def __init__(self, person_id=None): <NEW_LINE> <INDENT> self.openapi_types = { 'person_id': str } <NEW_LINE> self.attribute_map = { 'person_id': 'personId' } <NEW_LINE> self._person_id = person_id <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_dict(cls,... | NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Do not edit the class manually. | 62598ee7f9cc0f698b1c4627 |
class DefinitionLine(Line): <NEW_LINE> <INDENT> def parse_line(state, dictionary, line, lineno): <NEW_LINE> <INDENT> _check_last_example_idiom(dictionary) <NEW_LINE> if line.startswith(meaning_marker): <NEW_LINE> <INDENT> text = formatted(line[len(meaning_marker) :]) <NEW_LINE> d = Definition(text) <NEW_LINE> dictionar... | One of article title meanings. | 62598ee732920d7e50bc46de |
class Square(Rectangle): <NEW_LINE> <INDENT> def __init__(self, size): <NEW_LINE> <INDENT> self.integer_validator("size", size) <NEW_LINE> super().__init__(size, size) <NEW_LINE> self.__size = size <NEW_LINE> def area(self): <NEW_LINE> <INDENT> return self.__size ** 2 | Class Square | 62598ee7d6c5a102081e07e3 |
class BulkSelectionDeleteGroupsViewMixin(object): <NEW_LINE> <INDENT> form_invalid_message = pgettext_lazy( 'admin delete_groups', 'Oups! Something went wrong. This may happen if someone edited ' 'students on the assignment or the semester while you were making ' 'your selection. Please try again.') <NEW_LINE> def disp... | Mixin class for deleting a set of :class:`~.devilry.core.apps.models.assignment_group.AssignmentGroup`s.
The set of `AssignmentGroup`s to delete is added as data to a from, and this is the set to delete.
Handle querysets of groups to delete in subclass. | 62598ee77047854f4633da87 |
class ListAnnPriceClassification(ListAPIView): <NEW_LINE> <INDENT> pagination_class = StandardResultsSetPagination <NEW_LINE> serializer_class = AnnPriceClassificationSerializer <NEW_LINE> filter_fields = ( 'source', 'resample_period', 'counter_currency', 'transaction_currency', 'predicted_ahead_for', 'ann_model_id') <... | Return AnnPriceClassification.
/api/v2/ann-price-classification/
URL query parameters:
For filtering:
predicted_ahead_for
ann_model_id
transaction_currency -- string BTC, ETH etc
counter_currency -- number 0=BTC, 1=ETH, 2=USDT, 3=XMR
source -- number 0=poloniex, 1=bittrex, 2=binance
resampl... | 62598ee701c39578d7f1145b |
class Automate: <NEW_LINE> <INDENT> def __init__(self,question,requete=[]): <NEW_LINE> <INDENT> self._state=StateInit.StateInit() <NEW_LINE> self._question=question <NEW_LINE> self._parsing=self._question.split(" ") <NEW_LINE> self._requete= dict() <NEW_LINE> self._requete["select"]=[] <NEW_LINE> self._requete["from"]=... | Classe context. Son état varie en fonction de situations
Contient les objets pour la construction de la requete SQL. | 62598ee71b99ca400228e866 |
class UriInvalid(Exception): <NEW_LINE> <INDENT> pass | Raised when `Request` factory's maker isn't in a valid form | 62598ee771ff763f4b5e5e0d |
class CObject(Base_CObject): <NEW_LINE> <INDENT> option_spec = { "name" : directives.unchanged, } <NEW_LINE> def handle_macro_signature(self, sig, signode): <NEW_LINE> <INDENT> rettype, fullname, arglist = split_signature(sig) <NEW_LINE> if rettype: <NEW_LINE> <INDENT> signode += addnodes.desc_type(rettype, rettype) <N... | Description of a C language object. | 62598ee799cbb53fe682f564 |
class EmbeddedRDFValue(rdf_structs.RDFProtoStruct): <NEW_LINE> <INDENT> protobuf = jobs_pb2.EmbeddedRDFValue <NEW_LINE> rdf_deps = [ rdfvalue.RDFDatetime, ] <NEW_LINE> def __init__(self, initializer=None, payload=None, *args, **kwargs): <NEW_LINE> <INDENT> if (not payload and isinstance(initializer, rdfvalue.RDFValue) ... | An object that contains a serialized RDFValue. | 62598ee7851cf427c66b6983 |
class ToSingleMessage(Message): <NEW_LINE> <INDENT> def to_params(self, app_key: str): <NEW_LINE> <INDENT> params = { 'cid': self.client_id, 'requestid': self.message_id, 'message': { 'appkey': app_key, 'is_offline': self.is_offline, 'offline_expire_time': self.offline_expire_time, 'msgtype': self.template.type, }, sel... | 单独推送的消息
| 62598ee77b25080760ed5b4c |
class TestNSGroupListResult(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 testNSGroupListResult(self): <NEW_LINE> <INDENT> pass | NSGroupListResult unit test stubs | 62598ee7bd1bec0571e14424 |
class InvalidEdgeError(Exception): <NEW_LINE> <INDENT> pass | Raise this when an edge is wrongly drawn | 62598ee7e76e3b2f99fd70e9 |
class LockFile(object): <NEW_LINE> <INDENT> def __init__(self, filename, timeout=None, sleep=0.05): <NEW_LINE> <INDENT> from os.path import abspath <NEW_LINE> self.filename = abspath(filename) <NEW_LINE> self.timeout = timeout <NEW_LINE> self.sleep = sleep <NEW_LINE> self._owns_lock = False <NEW_LINE> <DEDENT> def lock... | Gets an advisory lock for file C{filename}.
Creates a lock directory named after a file. Relies on the presumably
atomic nature of creating a directory.
*Beware* of mpi problems! `LockFile` is (purposefully) not mpi aware.
If used unwisely, processes will lock each other out. | 62598ee763d6d428bbee0e7f |
class ParsedDiffChangeTests(TestCase): <NEW_LINE> <INDENT> def test_init(self): <NEW_LINE> <INDENT> parser = BaseDiffParser(b'') <NEW_LINE> parsed_diff = ParsedDiff(parser=parser) <NEW_LINE> parsed_diff_change = ParsedDiffChange(parsed_diff=parsed_diff) <NEW_LINE> self.assertEqual(parsed_diff.changes, [parsed_diff_chan... | Unit tests for reviewboard.diffviewer.parser.ParsedDiffChange. | 62598ee757b8e32f5250745e |
class WorkspaceView(BaseWorkspaceView): <NEW_LINE> <INDENT> implements(IBlocksTransformEnabled) | Default View of the workspace | 62598ee7eab8aa0e5d30a42c |
class TestPersonCollection(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.api = main(UNIT_TEST=True).test_client() <NEW_LINE> cls.url_prefix = settings.FLASK_URL_PREFIX <NEW_LINE> return super().setUpClass() <NEW_LINE> <DEDENT> def test_get(self): <NEW_LINE>... | Collection Class Test
| 62598ee74428ac0f6e656c05 |
class MicrosoftPartnerSdkContractsAnalyticsPartnerLicensesUsageInsights(Model): <NEW_LINE> <INDENT> _validation = { 'attributes': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'prorated_licenses_usage_percent': {'key': 'proratedLicensesUsagePercent', 'type': 'float'}, 'workload_name': {'key': 'workloadName', 'typ... | Contains partner level insights about license usage.
Variables are only populated by the server, and will be ignored when
sending a request.
:param prorated_licenses_usage_percent: The percentage of licenses
deployed.
:type prorated_licenses_usage_percent: float
:param workload_name: The workload name. (Examples : s... | 62598ee744b2445a339b5cc2 |
class Mochila: <NEW_LINE> <INDENT> ESPACIADO_IMPRIMIR = 40 <NEW_LINE> def __init__(self, nombre, max_items:int=5): <NEW_LINE> <INDENT> self.nombre = nombre <NEW_LINE> self._max_items = max_items <NEW_LINE> self.items = [] <NEW_LINE> self.tipo_hacha = '' <NEW_LINE> self.tipo_martillo = '' <NEW_LINE> <DEDENT> def recoge... | La mochila tiene la capacidad de guardar un número limitado de artículos | 62598ee72c8b7c6e89bd1e73 |
class Trainer(object): <NEW_LINE> <INDENT> pass | Abstract class for an Antipasti Trainer. | 62598ee7fff4ab517ebcbe8b |
class Anything2Str(object): <NEW_LINE> <INDENT> def __call__(self, value): <NEW_LINE> <INDENT> if value is None: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> if np.isnan(value): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> <DEDENT> except: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDE... | Parse anything to ``str``
The logic:
- bytes: auto detect encoding and then decode
- other: stringlize it | 62598ee77d43ff2487426755 |
class Layer(nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Layer, self).__init__() <NEW_LINE> pass <NEW_LINE> <DEDENT> def forward(self): <NEW_LINE> <INDENT> pass | Abstract Base Class to ensure the optimal quantity of functions. | 62598ee7ac7a0e7691f70bcb |
class Sprite(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, x: int, y: int, image: pygame.Surface): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._image = image <NEW_LINE> self._rect = pygame.Rect(x, y, image.get_rect().width, image.get_rect().height) <NEW_LINE> <DEDENT> @property <NEW_LINE> def... | Base class for all sprites. | 62598ee7cc0a2c11144796b7 |
class UnsupportedOperationError(ApiError): <NEW_LINE> <INDENT> def __init__(self, error, message): <NEW_LINE> <INDENT> super(UnsupportedOperationError, self).__init__(error, message) <NEW_LINE> self.error = error <NEW_LINE> self.message = message <NEW_LINE> self.should_retry = False <NEW_LINE> <DEDENT> def __repr__(sel... | Unsupported operation: {0}. | 62598ee7be8e80087fbbd702 |
class DataStructure(UserObject): <NEW_LINE> <INDENT> security = ClassSecurityInfo() <NEW_LINE> meta_type = "DataStructure" <NEW_LINE> data = None <NEW_LINE> security.declareProtected('View', 'view') <NEW_LINE> def view(self): <NEW_LINE> <INDENT> return str(self.data) <NEW_LINE> <DEDENT> edit = view <NEW_LINE> security.... | This object is used to hold a python data structure.
The primary intent is so that structures can be calculated and stored.
It is designed to only be used from python (script,external method, product) and not
dtml/zpt etc. | 62598ee7d486a94d0ba2a681 |
class SVD(Model): <NEW_LINE> <INDENT> def __init__(self, acc=None): <NEW_LINE> <INDENT> self.swagger_types = { 'acc': str } <NEW_LINE> self.attribute_map = { 'acc': 'acc' } <NEW_LINE> self._acc = acc <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_dict(cls, dikt): <NEW_LINE> <INDENT> return util.deserialize_model(... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598ee71b99ca400228e867 |
class DeviceConfig(Model): <NEW_LINE> <INDENT> step_time = Float(strict=False).tag(config=True) <NEW_LINE> custom_rate = Float(-1, strict=False).tag(config=True) <NEW_LINE> step_size = Float(parse_unit('1mm'), strict=False).tag(config=True) <NEW_LINE> interpolate = Bool(False).tag(config=True) <NEW_LINE> sample_rate = ... | The default device configuration. Custom devices may want to subclass
this. | 62598ee77cff6e4e811b40a2 |
class ServiceList(ListResource): <NEW_LINE> <INDENT> def __init__(self, version): <NEW_LINE> <INDENT> super(ServiceList, self).__init__(version) <NEW_LINE> self._solution = {} <NEW_LINE> self._uri = '/Services'.format(**self._solution) <NEW_LINE> <DEDENT> def create(self, friendly_name, code_length=values.unset, lookup... | PLEASE NOTE that this class contains beta products that are subject to
change. Use them with caution. | 62598ee799cbb53fe682f565 |
class Log(tk.Frame): <NEW_LINE> <INDENT> def __init__(self, root, logfile, *args, **kwargs): <NEW_LINE> <INDENT> tk.Frame.__init__(self, *args, **kwargs) <NEW_LINE> self.root = root <NEW_LINE> self.logfile = files.real(logfile) <NEW_LINE> self._stop = False <NEW_LINE> self._previous_length = 0 <NEW_LINE> self._same_len... | Frame that displays the contents of a file | 62598ee766656f66f7d58a95 |
class ErrorResponse(S3ResponseBase, swob.HTTPException): <NEW_LINE> <INDENT> _status = '' <NEW_LINE> _msg = '' <NEW_LINE> _code = '' <NEW_LINE> def __init__(self, msg=None, *args, **kwargs): <NEW_LINE> <INDENT> if msg: <NEW_LINE> <INDENT> self._msg = msg <NEW_LINE> <DEDENT> if not self._code: <NEW_LINE> <INDENT> self._... | S3 error object.
Reference information about S3 errors is available at:
http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html | 62598ee70c0af96317c54a51 |
class TestingConfig(Config): <NEW_LINE> <INDENT> TESTING = True <NEW_LINE> DEBUG = True <NEW_LINE> connectionVariables="dbname='store_manager_test' password='Mwoboko10@' user='postgres' host='localhost' port='5432'" <NEW_LINE> os.environ['ENVIRONMENT']='testing' | Configurations for Testing, | 62598ee7097d151d1a2bf6d5 |
class Movie(): <NEW_LINE> <INDENT> def __init__(self, movie_title, story_summary, poster_image, trailer_youtube): <NEW_LINE> <INDENT> self.title = movie_title <NEW_LINE> self.storyline = story_summary <NEW_LINE> self.poster_image_url = poster_image <NEW_LINE> self.trailer_youtube_url = trailer_youtube <NEW_LINE> <DEDEN... | Define a Movie Class:
class: Movie
description: A simple class to describe a movie using its title,
youtube trailer, box art, and a short summary.
data attributes: The Movie's Title (movie_title), story summary
(story_summary), box art (poster_image) and tr... | 62598ee7e76e3b2f99fd70eb |
class with_app_config(object): <NEW_LINE> <INDENT> def __init__(self, *keys): <NEW_LINE> <INDENT> self.keys = keys <NEW_LINE> <DEDENT> def decorate_class(self, cls): <NEW_LINE> <INDENT> for key in self.keys: <NEW_LINE> <INDENT> with_fallback, fallback = False, None <NEW_LINE> try: <NEW_LINE> <INDENT> fallback = getattr... | Decorator that accepts any number of keys as arguments and makes those
application config values available to the decorated class or function. In
the case of a class the config value is accesible as an attribute (a
descriptor is placed on the class). In the case of a function it is passed
as a keyword argument.
usage:... | 62598ee78e71fb1e983ba11f |
class MutableType(object): <NEW_LINE> <INDENT> def is_mutable(self): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def copy_value(self, value): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def compare_values(self, x, y): <NEW_LINE> <INDENT> return x == y | A mixin that marks a Type as holding a mutable object. | 62598ee77b25080760ed5b4e |
class Task(models.Model): <NEW_LINE> <INDENT> instrument_id = models.ForeignKey(Instrument, on_delete=models.CASCADE) <NEW_LINE> input_queue_id = models.ForeignKey(StatusQueue, on_delete=models.CASCADE) <NEW_LINE> task_class = models.CharField(max_length=50, null=True, blank=True) <NEW_LINE> task_queue_ids = models.Man... | Define a task | 62598ee76e29344779afece6 |
class MRAmountOfSeconds(MRJob): <NEW_LINE> <INDENT> def steps(self): <NEW_LINE> <INDENT> return [ MRStep(mapper=self.app_seconds_mapper, reducer=self.avarage_reducer) ] <NEW_LINE> <DEDENT> def app_seconds_mapper(self, _, line): <NEW_LINE> <INDENT> (app_name, timestamp_start, session_id, client_ip, length_stream, kbyte_... | Sum of total amount of second of transmission | 62598ee7a219f33f346c4eee |
class Awards: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.xlsx = None <NEW_LINE> self.sheet = None <NEW_LINE> self.data_frame = None <NEW_LINE> self.sales_per_employee = {} <NEW_LINE> self.amount_of_awards = 0 <NEW_LINE> self.list_of_awards = [] <NEW_LINE> self.winners = [] <NEW_LINE> <DEDENT> def ... | Class that contains methods for opening excel sheets, analysis of data and calculate sales of employees
in order to grant them awards | 62598ee7d486a94d0ba2a682 |
class ProgressBar(): <NEW_LINE> <INDENT> def __init__(self, fd=sys.stderr): <NEW_LINE> <INDENT> self.fd = fd <NEW_LINE> self.lines = list() <NEW_LINE> self.nb_lines = 0 <NEW_LINE> self.term_width = 80 <NEW_LINE> signal.signal(signal.SIGWINCH, self.handle_resize) <NEW_LINE> self.handle_resize(None, None) <NEW_LINE> self... | A ProgressBar is simply a list of Lines
| 62598ee7a8370b77170eea98 |
class upload_egg(upload, CommandMixin): <NEW_LINE> <INDENT> command_consumes_arguments = True <NEW_LINE> description = "Upload an existing egg-file to PyPi" <NEW_LINE> def initialize_options(self): <NEW_LINE> <INDENT> self.args = [] <NEW_LINE> upload.initialize_options(self) <NEW_LINE> <DEDENT> def finalize_options(sel... | Uploads an existing egg-file to PyPi | 62598ee7a17c0f6771d5a908 |
class ScopeListLoader(object): <NEW_LINE> <INDENT> def __init__(self, config, server_id, cookies): <NEW_LINE> <INDENT> self.server_id = server_id <NEW_LINE> self.cookies = cookies <NEW_LINE> self._config = config <NEW_LINE> self._lock = threading.Lock() <NEW_LINE> self._handler = _ScopeListHandler() <NEW_LINE> self._ge... | Iterator over the objects in the scope lists referenced by the scope
cookies. | 62598ee77047854f4633da89 |
class SendGridAPIClient(object): <NEW_LINE> <INDENT> def __init__(self, **opts): <NEW_LINE> <INDENT> self.path = opts.get( 'path', os.path.abspath(os.path.dirname(__file__))) <NEW_LINE> self._apikey = opts.get('apikey', os.environ.get('SENDGRID_API_KEY')) <NEW_LINE> self._apikey = opts.get('api_key', self._apikey) <NEW... | The SendGrid API Client.
Use this object to interact with the v3 API. For example:
sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY'))
...
mail = Mail(from_email, subject, to_email, content)
response = sg.client.mail.send.post(request_body=mail.get())
For examples and detailed us... | 62598ee73317a56b869bd8c0 |
class RegionList(ListAPIView): <NEW_LINE> <INDENT> queryset = geodata.models.Region.objects.all() <NEW_LINE> serializer_class = serializers.RegionSerializer <NEW_LINE> fields = ('url', 'code', 'name') | Returns a list of IATI Regions stored in OIPA.
## Request parameters
- `fields` (*optional*): List of fields to display
- `fields[aggregations]` (*optional*): Aggregate available information.
See [Available aggregations]() section for details.
## Available aggregations
API request may include `fields[aggregatio... | 62598ee7aad79263cf42cebf |
class CsrfSettingOption(Option): <NEW_LINE> <INDENT> class_description = "Allowed values: required, yes, logfailure, no" <NEW_LINE> def str2value(self, value): <NEW_LINE> <INDENT> _val = value.lower() <NEW_LINE> if _val in ("required", "yes", "logfailure", "no"): <NEW_LINE> <INDENT> return _val <NEW_LINE> <DEDENT> else... | How should a csrf measure be enforced: required, yes, logfailure, no | 62598ee7dd821e528d6d75f9 |
class SketchSymbolInstance(SketchBase): <NEW_LINE> <INDENT> CLASS = 'symbolInstance' <NEW_LINE> ATTRS = { 'do_objectID': (asId, None), 'exportOptions': (SketchExportOptions, {}), 'frame': (SketchRect, BASE_FRAME), 'isFlippedHorizontal': (asBool, False), 'isFlippedVertical': (asBool, False), 'isFixedToViewport': (asBool... | _class: 'symbolInstance',
do_objectID: UUID,
exportOptions: SketchExportOptions,
frame: SketchRect,
isFlippedHorizontal: bool,
isFlippedVertical: bool,
isLocked: bool,
isVisible: bool,
layerListExpandedType: number,
name: string,
nameIsFixed: bool,
resizingType: number,
rotation: number,
shouldBreakMaskChain: bool,
sty... | 62598ee792d797404e387ed5 |
class ScenesBox(urwid.ListBox): <NEW_LINE> <INDENT> def __init__(self, window, parent, framefocus): <NEW_LINE> <INDENT> self.window = window <NEW_LINE> self.parent = parent <NEW_LINE> self._framefocus = framefocus <NEW_LINE> self.walker = ScenesTree(window, parent.walker, self) <NEW_LINE> self.__super.__init__(self.wal... | ScenesBox show the walker | 62598ee745492302aabfab62 |
class ExpansionProfileDesignation(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_type = "ExpansionProfileDesignation" <NEW_LINE> def __init__(self, jsondict=None, strict=True): <NEW_LINE> <INDENT> self.exclude = None <NEW_LINE> self.include = None <NEW_LINE> super(ExpansionProfileDesignation, self).__in... | When the expansion profile imposes designation contraints.
A set of criteria that provide the constraints imposed on the value set
expansion by including or excluding designations. | 62598ee72eb69b55b15a06e4 |
class TokenList(Resource): <NEW_LINE> <INDENT> @jwt_required <NEW_LINE> def get(self): <NEW_LINE> <INDENT> user_identity = get_jwt_identity() <NEW_LINE> all_tokens = get_user_tokens(user_identity) <NEW_LINE> ret = [token.json() for token in all_tokens] <NEW_LINE> return jsonify(ret) <NEW_LINE> <DEDENT> @fresh_jwt_requi... | Api resource that enables to see the JWT for a user
| 62598ee7eab8aa0e5d30a42e |
class Action(models.Model): <NEW_LINE> <INDENT> task = models.ForeignKey(Task, related_name='actions') <NEW_LINE> created = models.DateTimeField('Created Timestamp', auto_now_add=True) <NEW_LINE> modified = models.DateTimeField('Modified Timestamp', auto_now=True) <NEW_LINE> action_type = models.IntegerField( default=A... | Model for actions for a specific task
Refers to task | 62598ee755399d3f05624be8 |
class RandomTransformer: <NEW_LINE> <INDENT> def __init__(self, horizontal_flip=False, vertical_flip=False): <NEW_LINE> <INDENT> self.horizontal_flip = horizontal_flip <NEW_LINE> self.vertical_flip = vertical_flip <NEW_LINE> <DEDENT> def random_params_gen(self) -> TransformParams: <NEW_LINE> <INDENT> while True: <NEW_L... | To consistently add data augmentation to image pairs, we split the process in
two steps. First, we generate a stream of random augmentation parameters, that
can be zipped together with the images. Second, we do the actual transformation,
that has no randomness since the parameters are passed in. | 62598ee721bff66bcd721308 |
class Scores: <NEW_LINE> <INDENT> def __init__(self, f_scores, s, u_score): <NEW_LINE> <INDENT> self.frame_scores = np.array(f_scores,dtype=np.float_) <NEW_LINE> self.scores = np.array(s, dtype=np.float_) <NEW_LINE> self.ubm_score = u_score | Expects frame scores and scores (f_scores and s respectively) as Python lists.
Argument u_score represents an ubm score as a float type. | 62598ee756b00c62f0fb0f85 |
class LocationModel(base): <NEW_LINE> <INDENT> __tablename__ = 'locations' <NEW_LINE> postal_code = sa.Column(sa.Integer, primary_key=True, autoincrement=True) <NEW_LINE> country_code = sa.Column(sa.String(3)) <NEW_LINE> region_id = sa.Column(sa.Text) <NEW_LINE> longitude = sa.Column(sa.Float) <NEW_LINE> latitude = sa.... | headers from csv: country_code,postal_code,town,region,latitude,longitude | 62598ee78da39b475be01860 |
class RandomGeom(random.Random): <NEW_LINE> <INDENT> def randPointInRect(self,*intervals): <NEW_LINE> <INDENT> if len(intervals) == 1 and isinstance(intervals[0],(tuple,list)): <NEW_LINE> <INDENT> intervals = tuple(intervals[0]) <NEW_LINE> <DEDENT> coords = [] <NEW_LINE> for i in intervals: <NEW_LINE> <INDENT> if isins... | Extension of standard Random class with additional methods for creating geometric input. | 62598ee7dd821e528d6d75fa |
class WillieMemory(dict): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> dict.__init__(self, *args) <NEW_LINE> self.lock = threading.Lock() <NEW_LINE> <DEDENT> def __setitem__(self, key, value): <NEW_LINE> <INDENT> self.lock.acquire() <NEW_LINE> result = dict.__setitem__(self, key, value) <NEW_LINE>... | A simple thread-safe dict implementation.
*Availability: 4.0; available as ``Willie.WillieMemory`` in 3.1.0 - 3.2.0*
In order to prevent exceptions when iterating over the values and changing
them at the same time from different threads, we use a blocking lock on
``__setitem__`` and ``contains``. | 62598ee70a50d4780f703a61 |
class BaseImageDependency(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'registry': {'key': 'registry', 'type': 'str'}, 'repository': {'key': 'repository', 'type': 'str'}, 'tag': {'key': 'tag', 'type': 'str'}, 'digest': {'key': 'digest', 'type': 'str'}, } <N... | Properties that describe a base image dependency.
:ivar type: The type of the base image dependency. Possible values include: "BuildTime",
"RunTime".
:vartype type: str or ~azure.mgmt.containerregistry.v2018_09_01.models.BaseImageDependencyType
:ivar registry: The registry login server.
:vartype registry: str
:ivar r... | 62598ee73d592f4c4edb95ab |
class Points(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.position = om.MPointArray() <NEW_LINE> self.normal = om.MVectorArray() <NEW_LINE> self.poly_id = om.MIntArray() <NEW_LINE> self.u_coord = [] <NEW_LINE> self.v_coord = [] <NEW_LINE> <DEDENT> def set_length(self, length): <NEW_LINE> <I... | conatainer for sampled points.
holds position, normal, polyid and uv coords | 62598ee7460517430c430b3d |
@implementer(IBoardResource) <NEW_LINE> class BoardContainer(BaseContainer): <NEW_LINE> <INDENT> def __init__(self, request, board): <NEW_LINE> <INDENT> super(BoardContainer, self).__init__(request) <NEW_LINE> self.obj = board <NEW_LINE> self._objs = {} <NEW_LINE> <DEDENT> def _query_posts(self, query_fn=lambda n: n): ... | Container for :class:`Board` object and is used in traversal. | 62598ee723849d37ff84f76c |
@attr('shard_1') <NEW_LINE> class TestNewInstructorDashboardEmailViewXMLBacked(SharedModuleStoreTestCase): <NEW_LINE> <INDENT> MODULESTORE = TEST_DATA_MIXED_TOY_MODULESTORE <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> super(TestNewInstructorDashboardEmailViewXMLBacked, cls).setUpClass() <... | Check for email view on the new instructor dashboard | 62598ee77047854f4633da8a |
class MAVLink_battery2_message(MAVLink_message): <NEW_LINE> <INDENT> id = MAVLINK_MSG_ID_BATTERY2 <NEW_LINE> name = 'BATTERY2' <NEW_LINE> fieldnames = ['voltage', 'current_battery'] <NEW_LINE> ordered_fieldnames = [ 'voltage', 'current_battery' ] <NEW_LINE> format = '<Hh' <NEW_LINE> native_format = bytearray('<Hh', 'as... | 2nd Battery status | 62598ee78a43f66fc4bf0828 |
class ProcNetworkMonitor(NetworkMonitorBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> log.debug("Initializing proc based network monitor") <NEW_LINE> NetworkMonitorBase.__init__(self) <NEW_LINE> self._state = pk.NetworkEnum.OFFLINE <NEW_LINE> self._file = Gio.File.new_for_path("/proc/net/route") <NE... | Use the route information of the proc filesystem to detect
the network state. | 62598ee7be8e80087fbbd704 |
class DaySchedule(object): <NEW_LINE> <INDENT> swagger_types = { 'schedule_name': 'str', 'services': 'list[Service]', 'open_time': 'str', 'close_time': 'str' } <NEW_LINE> attribute_map = { 'schedule_name': 'scheduleName', 'services': 'services', 'open_time': 'openTime', 'close_time': 'closeTime' } <NEW_LINE> def __init... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598ee7f548e778e5969c41 |
class _FHEquiv: <NEW_LINE> <INDENT> def __init__(self, obj): <NEW_LINE> <INDENT> obj.addProperty("App::PropertyLink","Node1","EM",QT_TRANSLATE_NOOP("App::Property","First FHNode to short-circuit")) <NEW_LINE> obj.addProperty("App::PropertyLink","Node2","EM",QT_TRANSLATE_NOOP("App::Property","Second FHNode to short-circ... | The EM FastHenry node Equivalence object | 62598ee78e7ae83300ee7745 |
class SiteLogoFunctionalTest(unittest.TestCase): <NEW_LINE> <INDENT> layer = PRODUCTS_CMFPLONE_INTEGRATION_TESTING <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.portal = self.layer['portal'] <NEW_LINE> <DEDENT> def test_sitelogo_view(self): <NEW_LINE> <INDENT> registry = getUtility(IRegistry) <NEW_LINE> settings... | Test the site logo view.
| 62598ee7e1aae11d1e7cdb9a |
class PlayerListController(object): <NEW_LINE> <INDENT> def __init__(self, player_list, game_factory): <NEW_LINE> <INDENT> self.player_list = player_list <NEW_LINE> self.player_list.subscribe('start-game', self._onStartGame) <NEW_LINE> self.game_factory = game_factory <NEW_LINE> <DEDENT> def _onStartGame(self, ev, play... | Acts on PlayerList 'start-game' events. | 62598ee7d7e4931a7ef3a755 |
class Settings: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.screen_width = 1020 <NEW_LINE> self.screen_height = 680 <NEW_LINE> self.bg_color = (230, 230, 230) <NEW_LINE> self.ship_speed = 1.5 <NEW_LINE> self.ship_limit = 3 <NEW_LINE> self.bullet_speed = 1.5 <NEW_LINE> self.bullet_width = 3 <NEW_LIN... | A class to store all settings for Alien Invasion. | 62598ee73cc13d1c6d463e25 |
class Tab(urwid.AttrMap): <NEW_LINE> <INDENT> def __init__(self, label, content=urwid.SolidFill(' '), color=(8,8,8)): <NEW_LINE> <INDENT> self.label = urwid.Button(label) <NEW_LINE> self.content = content <NEW_LINE> super(Tab, self).__init__(self.label, 'normal', focus_map='reversed') <NEW_LINE> urwid.connect_signal(se... | A Button that also tracks some other Widget for display in a VerticalTabs widget. | 62598ee710dbd63aa1c6f229 |
class LUXCORE_OT_pointer_set_node_tree(bpy.types.Operator, LUXCORE_OT_set_node_tree): <NEW_LINE> <INDENT> bl_idname = "luxcore.pointer_set_node_tree" <NEW_LINE> node_tree_index: IntProperty() <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> return poll_node(context) <NEW_LINE> <DEDENT> def... | Dropdown operator pointer node version | 62598ee7e76e3b2f99fd70ed |
class Join(function.Function): <NEW_LINE> <INDENT> def __init__(self, stack, fn_name, args): <NEW_LINE> <INDENT> super(Join, self).__init__(stack, fn_name, args) <NEW_LINE> example = '"%s" : [ " ", [ "str1", "str2"]]' % self.fn_name <NEW_LINE> fmt_data = {'fn_name': self.fn_name, 'example': example} <NEW_LINE> if not i... | A function for joining strings.
Takes the form::
{ "Fn::Join" : [ "<delim>", [ "<string_1>", "<string_2>", ... ] ] }
And resolves to::
"<string_1><delim><string_2><delim>..." | 62598ee799cbb53fe682f568 |
class NetIfaceConfig: <NEW_LINE> <INDENT> def __init__(self, host_ip=DEFAULT_HOST_IP, guest_ip=DEFAULT_GUEST_IP, tap_name=DEFAULT_TAP_NAME, dev_name=DEFAULT_DEV_NAME, netmask=DEFAULT_NETMASK): <NEW_LINE> <INDENT> self._host_ip = host_ip <NEW_LINE> self._guest_ip = guest_ip <NEW_LINE> self._tap_name = tap_name <NEW_LINE... | Defines a network interface configuration. | 62598ee7435de62698e9a48c |
class CreateAccessKeyResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None) | A ResultSet with methods tailored to the values returned by the CreateAccessKey Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution. | 62598ee7fff4ab517ebcbe8e |
class TestSingleActivity(ClientTestCase): <NEW_LINE> <INDENT> def test_xml_activity_count(self): <NEW_LINE> <INDENT> load_fix("single_activity.xml") <NEW_LINE> resp = self.client.get('/api/1/access/activity.xml') <NEW_LINE> xml = ET.fromstring(resp.data) <NEW_LINE> self.assertEquals(1, len(xml.findall('.//iati-activity... | Different reprisentations of the same input activity | 62598ee7a8370b77170eea9a |
class GetUploadFilePath(): <NEW_LINE> <INDENT> def __init__(self, files_name): <NEW_LINE> <INDENT> self.__files = files_name <NEW_LINE> self.__flag = 0 <NEW_LINE> if ';' in self.__files: <NEW_LINE> <INDENT> self.__files = self.__files.split(';') <NEW_LINE> self.__flag = 1 <NEW_LINE> <DEDENT> <DEDENT> def get_files_path... | 1.本类主要是解决从upload_file 文件夹下上传文件
2.将传入的文件拼接上upload_file的路径 | 62598ee732920d7e50bc46e3 |
class Memoise: <NEW_LINE> <INDENT> cache = {} <NEW_LINE> def __init__(self, func_): <NEW_LINE> <INDENT> self.func = func_ <NEW_LINE> <DEDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> args_tuple = _keys_to_tuple(args, kwargs) <NEW_LINE> try: <NEW_LINE> <INDENT> res = self.cache[s... | A memoise class class. | 62598ee74428ac0f6e656c09 |
class DataPrepUtil: <NEW_LINE> <INDENT> imputer_mode = SimpleImputer(strategy='most_frequent') <NEW_LINE> imputer_mean = SimpleImputer(strategy='mean') <NEW_LINE> train_data_loaded = False <NEW_LINE> def load_train_data(self, train_data_path: str): <NEW_LINE> <INDENT> train_data = pd.read_csv(train_data_path) <NEW_LINE... | Class that stores two sklearn.impute.SimpleImputer objects, one of them which does imputation by mean
while the other by mode. As imputation process is repeatable, it is more conveninent to wrap it in a class.
This class also contains a flag train_data_loaded, which acts as a guard against imputation that is run
before... | 62598ee7a8370b77170eea9b |
class OneKeyFindHouseView(View): <NEW_LINE> <INDENT> def post(self, request): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> page = request.POST.get('page') or 1 <NEW_LINE> land = request.POST.get('land_id') or '0' <NEW_LINE> train = request.POST.get('train_id') or '0' <NEW_LINE> house = request.POST.get('house') or '0' ... | 一键找房 | 62598ee77047854f4633da8c |
class ObjOneLevel: <NEW_LINE> <INDENT> def __init__(self, dic): <NEW_LINE> <INDENT> for k, v in dic.items(): <NEW_LINE> <INDENT> self.__dict__[k] = v | Returns object with same structure as dict | 62598ee77cff6e4e811b40a6 |
class AvalancheDev( Avalanche.Avalanche ): <NEW_LINE> <INDENT> def __init__( self ): <NEW_LINE> <INDENT> super( AvalancheDev, self ).__init__( "avalanche-dev", "zeromq-2.2.0", "root-5.32.03", "curl-7.26.0" ) <NEW_LINE> return <NEW_LINE> <DEDENT> def _IsDownloaded( self ): <NEW_LINE> <INDENT> return os.path.exists( self... | The development version of avalanche (git repo). | 62598ee7d486a94d0ba2a685 |
class ViewConfig(VegaLiteSchema): <NEW_LINE> <INDENT> _schema = {'$ref': '#/definitions/ViewConfig'} <NEW_LINE> _rootschema = Root._schema <NEW_LINE> def __init__(self, clip=Undefined, fill=Undefined, fillOpacity=Undefined, height=Undefined, stroke=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, strokeOpac... | ViewConfig schema wrapper
Mapping(required=[])
Attributes
----------
clip : boolean
Whether the view should be clipped.
fill : string
The fill color. **Default value:** (none)
fillOpacity : float
The fill opacity (value between [0,1]). **Default value:** (none)
height : float
The default height of t... | 62598ee7498bea3a75a561ea |
class jigVoltage(object): <NEW_LINE> <INDENT> def __init__(self, provider, channel): <NEW_LINE> <INDENT> self.ai = VoltageInput() <NEW_LINE> self.ai.setDeviceSerialNumber(provider) <NEW_LINE> self.ai.setChannel(channel) <NEW_LINE> self.ai.setOnAttachHandler(self._attached) <NEW_LINE> self.ai.openWaitForAttachment(1000)... | voltage sensor | 62598ee726068e7796d4b014 |
class ProjectExecutePermission(ProjectPermissionBase): <NEW_LINE> <INDENT> message = "Insufficient permission to execute within this project." <NEW_LINE> insufficient_permissions = [ Permission.VIEW_ONLY, Permission.CAN_EDIT, Permission.CAN_TRANSFER, ] | Checks whether a user has execute access to a project.
| 62598ee730dc7b766599df40 |
class User(PyrogramType): <NEW_LINE> <INDENT> def __init__(self, *, client: "pyrogram.client.ext.BaseClient", id: int, is_self: bool, is_contact: bool, is_mutual_contact: bool, is_deleted: bool, is_bot: bool, first_name: str, last_name: str = None, status: UserStatus = None, username: str = None, language_code: str = N... | This object represents a Telegram user or bot.
Args:
id (``int``):
Unique identifier for this user or bot.
is_self(``bool``):
True, if this user is you yourself.
is_contact(``bool``):
True, if this user is in your contacts.
is_mutual_contact(``bool``):
True, if you bo... | 62598ee72c8b7c6e89bd1e78 |
class StateMachine(object): <NEW_LINE> <INDENT> def __init__(self, trans_table): <NEW_LINE> <INDENT> self.trans_table = trans_table <NEW_LINE> <DEDENT> def nextStep(self, input): <NEW_LINE> <INDENT> for rule in self.trans_table: <NEW_LINE> <INDENT> for (state, input_type),(condition, transition, next_state) in rule.ite... | A table driven state machine | 62598ee7442bda511e95ab1a |
class FileEntry(Gtk.Box): <NEW_LINE> <INDENT> def __init__(self, defname, title, parent=None): <NEW_LINE> <INDENT> Gtk.Box.__init__(self) <NEW_LINE> self.title = title <NEW_LINE> self.parent = parent <NEW_LINE> self.dir = False <NEW_LINE> self.__base_path = "" <NEW_LINE> self.__file_name = "" <NEW_LINE> self.entry = Gt... | A widget that allows the user to select a file from the file system | 62598ee7d486a94d0ba2a686 |
class PyannoDatabase(object): <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> self.db_filename = filename <NEW_LINE> self.database = shelve.open(filename, flag='c', protocol=2) <NEW_LINE> self.closed = False <NEW_LINE> <DEDENT> def store_result(self, data_id, anno_container, model, value): <NEW_LI... | Database to store model results.
The database is based on :mod:`shelve`. Keys are strings that uniquely
identify data sets. Values are lists of :class:`PyannoResult` objects,
which contain a copy of the annotations, the pyanno model that has
been applied on them, and the value of the log likelihood of the
annotations ... | 62598ee73539df3088eca96b |
class ArchivesView(IndexView): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> year = self.kwargs.get('year') <NEW_LINE> month = self.kwargs.get('month') <NEW_LINE> monthRange = calendar.monthrange(int(year), int(month)) <NEW_LINE> post_list = super(ArchivesView, self).get_queryset().filter( created_tim... | 从post_list中获取指定时间的数据 | 62598ee7a8370b77170eea9c |
class Button(IntEnum): <NEW_LINE> <INDENT> A = 0 <NEW_LINE> B = 1 <NEW_LINE> X = 2 <NEW_LINE> Y = 3 <NEW_LINE> LB = 4 <NEW_LINE> RB = 5 <NEW_LINE> LJOY = 6 <NEW_LINE> RJOY = 7 | The buttons on the controller. | 62598ee7a17c0f6771d5a90c |
class SymbolDatabase(object): <NEW_LINE> <INDENT> def __init__(self, pool=None): <NEW_LINE> <INDENT> self._symbols = {} <NEW_LINE> self._symbols_by_file = {} <NEW_LINE> self.pool = pool or descriptor_pool.Default() <NEW_LINE> <DEDENT> def RegisterMessage(self, message): <NEW_LINE> <INDENT> desc = message.DESCRIPTOR <NE... | A database of Python generated symbols.
SymbolDatabase also models message_factory.MessageFactory.
The symbol database can be used to keep a global registry of all protocol
buffer types used within a program. | 62598ee7dd821e528d6d75fd |
class UnixHTTPConnection(http_client.HTTPConnection): <NEW_LINE> <INDENT> def __init__(self, path, timeout=socket._GLOBAL_DEFAULT_TIMEOUT): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> super().__init__("localhost", timeout=timeout) <NEW_LINE> <DEDENT> def connect(self): <NEW_LINE> <INDENT> self.sock = socket.socket(... | HTTP connection over unix domain socket. | 62598ee74f6381625f198818 |
class LogHandler(logging.Handler): <NEW_LINE> <INDENT> def __init__(self, name=None): <NEW_LINE> <INDENT> super(LogHandler, self).__init__() <NEW_LINE> self.name = name <NEW_LINE> <DEDENT> def emit(self, record): <NEW_LINE> <INDENT> if record.name.startswith('blueox'): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> wit... | Handler to provide log events as blueox events.
Records standard fields such as logger name, level the message and if an
exception was provided, the string formatted exception.
The type name, if not specified will be something like '<my parent context>.log' | 62598ee792d797404e387ed7 |
class Collection: <NEW_LINE> <INDENT> def __init__(self, obj_type: type, key: str): <NEW_LINE> <INDENT> self.obj_type = obj_type <NEW_LINE> self.key = key <NEW_LINE> self._objects: Dict[str, Any] = {} <NEW_LINE> <DEDENT> def add(self, obj: Any): <NEW_LINE> <INDENT> key = self._get_key(obj) <NEW_LINE> if key in self._ob... | A Collection of objects keyed on an attribute.
It collects objects identified by the value of an attribute.
No objects with duplicated keys are allowed.
:param obj_type: string identifying the objects type.
:param key: the object attribute to use as key. | 62598ee785dfad0860cbedc4 |
class _CoreSettings(ConfigObj, metaclass=_SettingsMeta): <NEW_LINE> <INDENT> def __init__(self, infile): <NEW_LINE> <INDENT> super(_CoreSettings, self).__init__(infile) <NEW_LINE> self._language = None <NEW_LINE> for item in self._odict: <NEW_LINE> <INDENT> self._odict[item](self) <NEW_LINE> <DEDENT> self.initial_comme... | Class used to store core settings. | 62598ee756ac1b37e63008a6 |
class Dog(): <NEW_LINE> <INDENT> def __init__(self, name, age): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.age = age <NEW_LINE> <DEDENT> def sit(self): <NEW_LINE> <INDENT> print(self.name.title() + " is now sitting.") <NEW_LINE> <DEDENT> def roll_over(self): <NEW_LINE> <INDENT> print(self.name.title() + " rol... | A simple attempt to model a dog | 62598ee744b2445a339b5cc5 |
class BaseFinder(object): <NEW_LINE> <INDENT> def find(self, path, all=False): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def list(self, ignore_patterns): <NEW_LINE> <INDENT> raise NotImplementedError() | A base file finder to be used for custom mediafiles finder classes. | 62598ee74c3428357761899c |
class Merge(RowWise): <NEW_LINE> <INDENT> __slots__ = 'child', 'children' <NEW_LINE> iscolumn = False <NEW_LINE> @property <NEW_LINE> def schema(self): <NEW_LINE> <INDENT> for c in self.children: <NEW_LINE> <INDENT> if not isinstance(c.schema[0], Record): <NEW_LINE> <INDENT> raise TypeError("All schemas must have Recor... | Merge the columns of many Tables together
Must all descend from same table via RowWise operations
Examples
--------
>>> accounts = TableSymbol('accounts', '{name: string, amount: int}')
>>> newamount = (accounts['amount'] * 1.5).label('new_amount')
>>> merge(accounts, newamount).columns
['name', 'amount', 'new_amo... | 62598ee797e22403b38395aa |
class Action: <NEW_LINE> <INDENT> def __init__(self, relpath, srcPath, tgtPath): <NEW_LINE> <INDENT> self.relpath = relpath <NEW_LINE> self.srcPath = srcPath <NEW_LINE> self.tgtPath = tgtPath <NEW_LINE> <DEDENT> def execute(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def getExtension(self):... | The abstract class of actions. | 62598ee77d43ff2487426758 |
class SSLifyAdminMiddleware(object): <NEW_LINE> <INDENT> def process_request(self, request): <NEW_LINE> <INDENT> sslify_admin_namespace = getattr(settings, 'SSLIFY_ADMIN_NAMESPACE', 'admin') <NEW_LINE> sslify_admin_disable = getattr(settings, 'SSLIFY_ADMIN_DISABLE', settings.DEBUG) <NEW_LINE> if request.path.startswith... | Force all admin requests to use HTTPs. If we get an HTTP request, we'll just
force a redirect to HTTPs.
.. note::
This will only take effect if ``settings.DEBUG`` is False. | 62598ee767a9b606de544687 |
class Run(Command): <NEW_LINE> <INDENT> name = 'run' <NEW_LINE> description = "Deploys a version of the stylobyte project" <NEW_LINE> def add_args(self, parser): <NEW_LINE> <INDENT> parser.add_argument( '--docker-dev', '-d', action='store_true', help='Run the dev docker image' ) <NEW_LINE> parser.add_argument( '--docke... | stylo run --back-end/-b
--front-end/-f
--docker-dev/-d
--docker-prod/-D
--logs | 62598ee7fff4ab517ebcbe91 |
class emp_login(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.emp = urlbase.UA_url() <NEW_LINE> self.base_url = self.emp +"/logout" <NEW_LINE> self.base_url_login = self.emp + "/login" <NEW_LINE> <DEDENT> def test_login_pwd_wrong(self): <NEW_LINE> <INDENT> head = {'Content-Type': 'ap... | 后台登出接口 | 62598ee7dd821e528d6d75fe |
class ArgReplacer(object): <NEW_LINE> <INDENT> def __init__(self, func, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> try: <NEW_LINE> <INDENT> self.arg_pos = self._getargnames(func).index(name) <NEW_LINE> <DEDENT> except ValueError: <NEW_LINE> <INDENT> self.arg_pos = None <NEW_LINE> <DEDENT> <DEDENT> def _geta... | Replaces one value in an ``args, kwargs`` pair.
Inspects the function signature to find an argument by name
whether it is passed by position or keyword. For use in decorators
and similar wrappers. | 62598ee75fdd1c0f98e5c65d |
class UserChangeForm(forms.ModelForm): <NEW_LINE> <INDENT> password = ReadOnlyPasswordHashField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ('username', 'password', 'email', 'id', 'describe', 'money', 'is_active', 'is_admin') <NEW_LINE> <DEDENT> def clean_password(self): <NEW_LINE> <IN... | A form for updating users. Includes all the fields on
the user, but replaces the password field with admin's
password hash display field. | 62598ee7f548e778e5969c45 |
class JsonExportXMLInJobRequest(object): <NEW_LINE> <INDENT> swagger_types = { 'view_config': 'str', 'send_notification': 'bool', 'file_name': 'str' } <NEW_LINE> attribute_map = { 'view_config': 'viewConfig', 'send_notification': 'sendNotification', 'file_name': 'fileName' } <NEW_LINE> def __init__(self, view_config=No... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598ee7090684286d592a3d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.