code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Clothing1M(data.Dataset): <NEW_LINE> <INDENT> def __init__(self, root, image_set, transform=None, target_transform=None): <NEW_LINE> <INDENT> self.root = root <NEW_LINE> self.image_set = image_set <NEW_LINE> self.transform = transform <NEW_LINE> self.target_transform = target_transform <NEW_LINE> self.labels = No...
Clothing1M dataset input is image, target is annotation Arguments: root (string): filepath to rootder. image_set (string): imageset to use (eg. 'train', 'val', 'test') transform (callable, optional): transformation to perform on the input image target_transform (callable, optional): transformati...
62598ee7460517430c430b4b
class Game(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.screen = self.setup_pygame() <NEW_LINE> self.screen_rect = self.screen.get_rect() <NEW_LINE> self.digimon_group = self.create_digimon() <NEW_LINE> self.clock = pygame.time.Clock() <NEW_LINE> self.fps = 60 <NEW_LINE> self.done = False <...
Controls entire game
62598ee7adb09d7d5dc08c8b
class BaseModel(models.Model): <NEW_LINE> <INDENT> create_time = models.DateTimeField(auto_now_add=True,verbose_name='创建时间') <NEW_LINE> update_time = models.DateTimeField(auto_now_add=True,verbose_name='更新时间') <NEW_LINE> is_delete = models.BooleanField(default=False,verbose_name='删除标记') <NEW_LINE> class Meta: <NEW_LINE...
模型类抽象基类
62598ee75fcc89381b265487
class FileTypeSticker(Object): <NEW_LINE> <INDENT> ID = "fileTypeSticker" <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def read(q: dict, *args) -> "FileTypeSticker": <NEW_LINE> <INDENT> return FileTypeSticker()
The file is a sticker Attributes: ID (:obj:`str`): ``FileTypeSticker`` No parameters required. Returns: FileType Raises: :class:`telegram.Error`
62598ee745492302aabfab70
class StartView(View): <NEW_LINE> <INDENT> message = "Well lad wdc??" <NEW_LINE> quick_replies = [QR_SEARCH_FOR_BOOK]
The view the user sees when they first message, or when they send an invalid message.
62598ee72c8b7c6e89bd1e83
class CocoDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, dataType, transform=None, length=None): <NEW_LINE> <INDENT> dataDir= '/home/fast_seg/coco/' <NEW_LINE> annFile='{}/annotations/instances_{}.json'.format(dataDir,dataType) <NEW_LINE> self.image_path = dataDir + '/images/' + dataType + '/' <NEW_LINE> self...
Face Landmarks dataset.
62598ee74428ac0f6e656c15
class ApplyDiscount(FormView): <NEW_LINE> <INDENT> form_class = DiscountForm <NEW_LINE> def form_valid(self, form): <NEW_LINE> <INDENT> request = self.request <NEW_LINE> cart = Cart(request) <NEW_LINE> discount = form.cleaned_data['discount'] <NEW_LINE> cart.apply_discount(form.cleaned_data['discount']) <NEW_LINE> retu...
It will be a good idea to make this view ajax
62598ee76fb2d068a7693186
class mail_mail(osv.Model): <NEW_LINE> <INDENT> _inherit = 'mail.mail' <NEW_LINE> def _get_partner_access_link(self, cr, uid, mail, partner=None, context=None): <NEW_LINE> <INDENT> return None
Update of mail_mail class, to add the signin URL to notifications.
62598ee76e29344779afecf6
class HtmlFeaturesExtractor(BaseEstimator): <NEW_LINE> <INDENT> def __init__(self, default_tags=('PAGE',), tokenize=tokenize): <NEW_LINE> <INDENT> self.tagset = Tagset(default_tags) <NEW_LINE> self.tokenize = tokenize <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def clean_html(cls, html, encoding=None): <NEW_LINE> <INDE...
Extract the features for all the anchors from a HTML page.
62598ee72c8b7c6e89bd1e84
class RunCaseVersion(HasEnvironmentsModel, MTModel): <NEW_LINE> <INDENT> run = models.ForeignKey(Run, related_name="runcaseversions") <NEW_LINE> caseversion = models.ForeignKey(CaseVersion, related_name="runcaseversions") <NEW_LINE> suites = models.ManyToManyField(Suite, related_name="runcaseversions") <NEW_LINE> order...
An ordered association between a Run and a CaseVersion. RunCaseVersion objects are created to lock in the specific case-versions in a run when the run is activated.
62598ee7e1aae11d1e7cdba1
class GirlWatcherFavorites(Base): <NEW_LINE> <INDENT> __tablename__ = 'gwf' <NEW_LINE> gw_id = Column(Integer, ForeignKey("gw.id"), primary_key=True) <NEW_LINE> user_id = Column(Integer, ForeignKey("u.id"), primary_key=True) <NEW_LINE> best = Column(Boolean)
The M2M intermediate table
62598ee71b99ca400228e86f
class _RC(configparser.SafeConfigParser): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> configparser.SafeConfigParser.__init__(self) <NEW_LINE> self.reload_rc() <NEW_LINE> <DEDENT> def _clear(self): <NEW_LINE> <INDENT> self.remove_section(configparser.DEFAULTSECT) <NEW_LINE> for s in self.sections(): <NEW...
Allows reading from and writing to Nengo RC settings.
62598ee7cad5886f8bdc39c6
class OpenSSLCommandLine(APNSConnectionContext): <NEW_LINE> <INDENT> certificate = None <NEW_LINE> host = None <NEW_LINE> port = None <NEW_LINE> executable = None <NEW_LINE> debug = False <NEW_LINE> def __init__(self, certificate = None, executable = None, debug = False): <NEW_LINE> <INDENT> self.certificate = certific...
This class execute and send data with openssl command line tool
62598ee799cbb53fe682f575
class AdvertiserReportLogClicks(AdvertiserReportLogBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> AdvertiserReportLogBase.__init__( self, "advertiser/stats/clicks", True, True ) <NEW_LINE> self.fields_recommended = [ "id", "created", "site_id", "site.name", "publisher_id", "publisher.name", "is_uniq...
TUNE Reporting API endpoint '/advertiser/stats/clicks'
62598ee7627d3e7fe0e0554d
class ScriptLog(AzureResourceBase): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'log': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type':...
Script execution log object. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: String Id used to locate any resource on Azure. :vartype id: str :ivar name: Name of this resource. :vartype name: str :ivar type: Type of this resource. :vartype type: str :ivar log: Script ...
62598ee7d486a94d0ba2a692
class HeNormal(FanInFanOut_ABC) : <NEW_LINE> <INDENT> def run(self, shape) : <NEW_LINE> <INDENT> return LI.HeNormal(gain = self.gain).sample(shape)
Initialization proposed by He et al. for ReLU in *Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification*, 2015. On a Normal distribution, Uses lasagne as backend.
62598ee776e4537e8c3edc7d
class InstrumentedHttp(httplib2.Http): <NEW_LINE> <INDENT> def __init__(self, name, time_fn=time.time, timeout=DEFAULT_TIMEOUT, **kwargs): <NEW_LINE> <INDENT> super(InstrumentedHttp, self).__init__(timeout=timeout, **kwargs) <NEW_LINE> self.fields = {'name': name, 'client': 'httplib2'} <NEW_LINE> self.time_fn = time_fn...
A httplib2.Http object that reports ts_mon metrics about its requests.
62598ee792d797404e387edd
class UserLoginList(BaseModel): <NEW_LINE> <INDENT> __tablename__ = 'bk_user_login_list' <NEW_LINE> LoginId = Column('fi_login_id', Integer, primary_key=True) <NEW_LINE> UserId = Column('fi_user_id', Integer) <NEW_LINE> LoginIp = Column('fs_login_ip',String(50)) <NEW_LINE> LoginTime = Column('ft_login_time', DateTime) ...
用户登录日志
62598ee7cb5e8a47e493b4db
class TestEnIn: <NEW_LINE> <INDENT> def test_city_name(self, faker, num_samples): <NEW_LINE> <INDENT> for _ in range(num_samples): <NEW_LINE> <INDENT> city_name = faker.city_name() <NEW_LINE> assert isinstance(city_name, str) <NEW_LINE> assert city_name in EnInAddressProvider.cities <NEW_LINE> <DEDENT> <DEDENT> def tes...
Test en_IN address provider methods
62598ee766656f66f7d58aa5
class Triangle(Marker): <NEW_LINE> <INDENT> __example__ = "examples/reference/models/Triangle.py"
Render triangle markers.
62598ee77b25080760ed5b5f
class SubmissionNotFoundError(SubmissionError): <NEW_LINE> <INDENT> pass
This error is raised when no submission is found for the request. If a state is specified in a call to the API that results in no matching Submissions, this error may be raised.
62598ee7aad79263cf42cecf
class TestSimplePrecessionModel(ConcreteDifferentiableModelTest, DerandomizedTestCase): <NEW_LINE> <INDENT> def instantiate_model(self): <NEW_LINE> <INDENT> return SimplePrecessionModel() <NEW_LINE> <DEDENT> def instantiate_prior(self): <NEW_LINE> <INDENT> return UniformDistribution(np.array([[10,12]])) <NEW_LINE> <DED...
Tests SimplePrecessionModel.
62598ee74428ac0f6e656c16
class ArticleCollection(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.article_list = [] <NEW_LINE> <DEDENT> def cb_add_article(self, article=None, **kwargs): <NEW_LINE> <INDENT> self.article_list.append(article)
Primitive collection object with callback to add entries.
62598ee799fddb7c1ca62167
class InvalidProxyCallback(ValidationError): <NEW_LINE> <INDENT> code = 'INVALID_PROXY_CALLBACK'
The proxy callback specified is invalid.
62598ee7e76e3b2f99fd70fc
class _VOMSTags(univ.SequenceOf): <NEW_LINE> <INDENT> componentType = _VOMSTag()
Sequence of VOMSTag as per GOF 182
62598ee732920d7e50bc46f1
class UserMessages(object): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> collection_name = 'user_messages' <NEW_LINE> indices = { ('username_uc', 'key'): [IndexOptions.UNIQUE], ('username_uc', 'ts'): {} } <NEW_LINE> @classmethod <NEW_LINE> @contract_epydoc <NEW_LINE> def add_message(cls, username, key, body, fdbw): <N...
The namespace for all the FastDB queries related to the messages between the Host and the Node.
62598ee73d592f4c4edb95bb
class FailoverRequestHandler(BaseHTTPRequestHandler): <NEW_LINE> <INDENT> def handle_one_request(self): <NEW_LINE> <INDENT> global thread_local <NEW_LINE> thread_local.current_handler = self <NEW_LINE> try: <NEW_LINE> <INDENT> return BaseHTTPRequestHandler.handle_one_request(self) <NEW_LINE> <DEDENT> finally: <NEW_LINE...
This handles HTTP requests and acts on them accordingly. For docs on what properties and methods are available, see: https://docs.python.org/2/library/basehttpserver.html
62598ee70a50d4780f703a70
class _collision_method(): <NEW_LINE> <INDENT> def __init__(self, seed, period): <NEW_LINE> <INDENT> if not hoomd.init.is_initialized(): <NEW_LINE> <INDENT> raise RuntimeError( 'mpcd.collide: system must be initialized before collision method\n' ) <NEW_LINE> <DEDENT> if hoomd.context.current.mpcd is None: <NEW_LINE> <I...
Base collision method Args: seed (int): Seed to the collision method random number generator (must be positive) period (int): Number of integration steps between collisions This class is not intended to be initialized directly by the user. Instead, initialize a specific collision method directly. It is includ...
62598ee7adb09d7d5dc08c8d
class solarsystem(solarsystem): <NEW_LINE> <INDENT> def Euler(self, CURplanet): <NEW_LINE> <INDENT> ax, ay = self.Accel(CURplanet) <NEW_LINE> CURplanet.vx = CURplanet.vx + ax*self.h <NEW_LINE> CURplanet.vy = CURplanet.vy + ay*self.h <NEW_LINE> CURplanet.x = CURplanet.x + CURplanet.vx*self.h <NEW_LINE> CURplanet.y = CUR...
Inherits all methods from the solarsystem class in PlanetSystem_VV but changes steps to use the new Euler method
62598ee7a8370b77170eeaa9
class OrderInvoice(OrderViewMixin, DetailView): <NEW_LINE> <INDENT> template_name = 'basic_webshop/order_invoice.html'
Overview for specific order.
62598ee74428ac0f6e656c17
class AppApiTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> app.testing = True <NEW_LINE> self.app = app.test_client() <NEW_LINE> self.data = {"username":"vic", "email":"vic@gmail.com", "password":"longpassword" } <NEW_LINE> <DEDENT> def test_login(self): <NEW_LINE> <INDENT> self.a...
Authenication
62598ee77d43ff248742675e
class UserConfig(dict): <NEW_LINE> <INDENT> def _string_decode_hook(self, data): <NEW_LINE> <INDENT> rv = {} <NEW_LINE> for key, value in data.items(): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> if isinstance(key, unicode): <NEW_LINE> <INDENT> key = key.encode('utf-8') <NEW_LINE> <DEDENT> if isinstance(value, unicode...
loads the json configuration file
62598ee744b2445a339b5ccb
class BuySDWidget(WidgetFactorBuyBase): <NEW_LINE> <INDENT> def _init_widget(self): <NEW_LINE> <INDENT> self.description = widgets.Textarea( value=u'参照大盘走势向上趋势突破买入策略:\n' u'在海龟突破基础上,参照大盘走势,进行降低交易频率,提高系统的稳定性处理,当大盘走势震荡时封锁交易,' u'当大盘走势平稳时再次打开交易,每一个月计算一次大盘走势是否平稳', description=u'平稳突破', disabled=False, layout=self.description_...
对应AbuSDBreak策略widget
62598ee77047854f4633da9a
class TrainLinearResolver(TrainMentionClassifier): <NEW_LINE> <INDENT> NIL_CLS = '0' <NEW_LINE> NON_NIL_CLS = '1' <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ranking_feature = kwargs.pop('ranker') <NEW_LINE> kwargs['mapping'] = 'ZeroMeanUnitVarianceMapper' <NEW_LINE> super(TrainLinearResolver, sel...
Trains a linear nil resolver over a corpus of documents.
62598ee70c0af96317c54a63
class TestCustomProperty(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 testCustomProperty(self): <NEW_LINE> <INDENT> model = pyacp.models.custom_property.CustomProperty()
CustomProperty unit test stubs
62598ee78e7ae83300ee7755
class ZipPickler(object): <NEW_LINE> <INDENT> def loads(self, string): <NEW_LINE> <INDENT> return pickle.loads(zlib.decompress(string)) <NEW_LINE> <DEDENT> def dumps(self, obj, protocol): <NEW_LINE> <INDENT> return zlib.compress(pickle.dumps(obj, protocol))
Simple wrapper for pickle that auto compresses/decompresses values
62598ee7cad5886f8bdc39c8
class ActionOpenSelectedDocument(SimpleAction): <NEW_LINE> <INDENT> def __init__(self, main_window, config, doclist): <NEW_LINE> <INDENT> SimpleAction.__init__(self, "Open selected document") <NEW_LINE> self.__main_win = main_window <NEW_LINE> self.__config = config <NEW_LINE> self.__doclist = doclist <NEW_LINE> <DEDEN...
Starts a new document.
62598ee701c39578d7f1146f
class videos(): <NEW_LINE> <INDENT> def __init__(self, title, run_time): <NEW_LINE> <INDENT> self.title = title <NEW_LINE> self.run_time = run_time
This is a Videos class that holds information like title and run time
62598ee7097d151d1a2bf6e2
class Compiler2(Compiler0): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(Compiler2, self).__init__(*args, **kwargs) <NEW_LINE> self.operation = None <NEW_LINE> self.times = self.pointer_move = self.pointer_position = 0 <NEW_LINE> self.accumulated = set(['+', '-', '<', '>']) <NEW_LI...
Caches the pointer movements and uses relative offsets to index memory whenever possible. Also aggregates identical brainfuck instructions into a single python statement.
62598ee73539df3088eca978
class ArtPiece(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=100, unique=True) <NEW_LINE> date_created = models.DateTimeField(default=timezone.now) <NEW_LINE> description = models.TextField() <NEW_LINE> collection = models.ForeignKey('ArtCollection', on_delete=models.SET_NULL, null=True, blank=T...
A single art gallery image
62598ee7d6c5a102081e07f7
class Particle(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._pose = np.zeros(3, dtype=np.float32) <NEW_LINE> self._weight = 1. <NEW_LINE> <DEDENT> def move(self, dt): <NEW_LINE> <INDENT> delp = np.zeros(3, dtype=np.float32) <NEW_LINE> dt = 0.001 <NEW_LINE> u = np.random.random_sample()*(U_...
Represents a particle.
62598ee78c0ade5d55dc29e5
class Envelope(abstract.AbstractGeometry): <NEW_LINE> <INDENT> _json = None <NEW_LINE> _dict = None <NEW_LINE> _geom = None <NEW_LINE> _xmin = None <NEW_LINE> _ymin = None <NEW_LINE> _zmin = None <NEW_LINE> _mmin = None <NEW_LINE> _xmax = None <NEW_LINE> _ymax = None <NEW_LINE> _zmax = None <NEW_LINE> _mmax = None <NEW...
An envelope is a rectangle defined by a range of values for each coordinate and attribute. It also has a spatialReference field. The fields for the z and m ranges are optional.
62598ee792d797404e387ede
class TaskTimerStopCommand(ApplicationCommand): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> increment_seconds() <NEW_LINE> report_time() <NEW_LINE> sublime.task_timer_seconds = 0 <NEW_LINE> sublime.task_timer_time = None
A sublime text command to stop the timer
62598ee78e71fb1e983ba132
class Allegato(ConMarcaTemporale, ConScadenzaPulizia, ModelloSemplice): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name_plural = "Allegati" <NEW_LINE> permissions = ( ("view_allegato", "Can view allegato"), ) <NEW_LINE> <DEDENT> oggetto_tipo = models.ForeignKey(ContentType, db_index=True, blank=True, n...
Rappresenta un allegato generico in database, con potenziale scadenza.
62598ee799cbb53fe682f578
class ConstantNode(Node): <NEW_LINE> <INDENT> def _evaluate(self): <NEW_LINE> <INDENT> return 1
A Node subclass which always evaluates to the value 1
62598ee763b5f9789fe83823
class Daobase: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_connection(cls): <NEW_LINE> <INDENT> return psycopg2.connect(database="loushi", user="postgres", password="00", host="127.0.0.1", port="5432") <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def writelist(cls, item_list, sqlmaker, info_getter): <NEW_LINE> <...
数据库访问基础类
62598ee77b25080760ed5b61
class cnLed(QtWidgets.QLabel): <NEW_LINE> <INDENT> statusChanged = pyqtSignal(bool) <NEW_LINE> def __init__(self, parent=None): <NEW_LINE> <INDENT> super(cnLed, self).__init__(parent=parent) <NEW_LINE> self.__imagePath = ":/images/" <NEW_LINE> self.iconOff = QtGui.QPixmap(self.__imagePath + "ledRougeEteinte.svg") <NEW_...
QLabel affichant une image de Led eteinte ou allumee
62598ee7d7e4931a7ef3a766
class StoredFileSystem(FileSystem): <NEW_LINE> <INDENT> def __init__(self, files): <NEW_LINE> <INDENT> self.files = files <NEW_LINE> self.dirs = {os.path.dirname(f) for f in files} <NEW_LINE> <DEDENT> def isfile(self, path): <NEW_LINE> <INDENT> return path in self.files <NEW_LINE> <DEDENT> def isdir(self, path): <NEW_L...
File system based on a file list.
62598ee766656f66f7d58aa7
class WTrackerOutputWindow(QWidget): <NEW_LINE> <INDENT> STR_WIN_TITLE = 'Filter Output' <NEW_LINE> def __init__(self, parent): <NEW_LINE> <INDENT> super(WTrackerOutputWindow, self).__init__() <NEW_LINE> self.parent = parent <NEW_LINE> self.frm_vid_filters = QLabel(self) <NEW_LINE> self.lyt_main = QVBoxLayout(self) <NE...
Sub window, displays the output of the image area of interest, kernel and filter response.
62598ee738b623060ffa775f
class TaskSetManager(ResultManager): <NEW_LINE> <INDENT> @transaction_retry(max_retries=1) <NEW_LINE> def restore_taskset(self, taskset_id): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self.get(taskset_id=taskset_id) <NEW_LINE> <DEDENT> except self.model.DoesNotExist: <NEW_LINE> <INDENT> return None <NEW_LINE> ...
Manager for :class:`celery.models.TaskSet` models.
62598ee7d268445f26638ef1
class CurieLookupService(object): <NEW_LINE> <INDENT> config = get_config() <NEW_LINE> ontologies = config['ontologies'] if 'ontologies' in config else {} <NEW_LINE> ontology_graph = None <NEW_LINE> def __init__(self, curie_map: dict = None): <NEW_LINE> <INDENT> if curie_map: <NEW_LINE> <INDENT> self.curie_map = CURIE_...
A service to lookup label for a given CURIE.
62598ee799fddb7c1ca62168
class HeaderPluginModel(CMSPlugin): <NEW_LINE> <INDENT> text = models.CharField(max_length=80) <NEW_LINE> def __str__(self) -> str: <NEW_LINE> <INDENT> return str(self.text)
Header plugin model
62598ee73c8af77a43b67297
class Diagnostic(Enum): <NEW_LINE> <INDENT> SOC = 0 <NEW_LINE> NSB = 1
SOC vs. NSB Diagnostic (Urine LAM)
62598ee72eb69b55b15a06ed
class Class(Scope): <NEW_LINE> <INDENT> def __init__(self, module, name, supers, start_pos): <NEW_LINE> <INDENT> super(Class, self).__init__(module, start_pos) <NEW_LINE> self.name = name <NEW_LINE> name.parent = self.use_as_parent <NEW_LINE> self.supers = supers <NEW_LINE> for s in self.supers: <NEW_LINE> <INDENT> s.p...
Used to store the parsed contents of a python class. :param name: The Class name. :type name: str :param supers: The super classes of a Class. :type supers: list :param start_pos: The start position (line, column) of the class. :type start_pos: tuple(int, int)
62598ee75fcc89381b265489
class ModelCollectionField(WrappedObjectField): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> kwargs.setdefault('default', list) <NEW_LINE> super(ModelCollectionField, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def _to_python(self): <NEW_LINE> <INDENT> object_list = [] <NEW_LINE>...
Field containing a list of model instances. Use this field when your source data dictionary contains a list of dictionaries. It takes a single required argument, which is the name of the nested class that each item in the list should be converted to. For example:: some_data = { 'list': [ {'val...
62598ee7a8ecb0332586f8b0
class RestrictedJSONDecoder(JSONDecoder): <NEW_LINE> <INDENT> def __init__(self, *, size_limit:int=None, obj_limit:int=None, arr_limit:int=None, **kwargs) -> None: <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self._size_limit = size_limit <NEW_LINE> self._obj_limit = obj_limit <NEW_LINE> self._arr_limit = ...
Checks untrusted JSON data for restrictions before decoding.
62598ee756b00c62f0fb0f97
class NewsStory(object): <NEW_LINE> <INDENT> def __init__(self, guid, title, subject, summary, link): <NEW_LINE> <INDENT> self.guid = guid <NEW_LINE> self.title = title <NEW_LINE> self.subject = subject <NEW_LINE> self.summary = summary <NEW_LINE> self.link = link <NEW_LINE> <DEDENT> def getGuid(self): <NEW_LINE> <IN...
Assume that parsing is already done contain information for a news story
62598ee78e7ae83300ee7756
@keras_export('keras.layers.ZeroPadding1D') <NEW_LINE> class ZeroPadding1D(Layer): <NEW_LINE> <INDENT> def __init__(self, padding=1, **kwargs): <NEW_LINE> <INDENT> super(ZeroPadding1D, self).__init__(**kwargs) <NEW_LINE> self.padding = conv_utils.normalize_tuple(padding, 2, 'padding') <NEW_LINE> self.input_spec = Input...
Zero-padding layer for 1D input (e.g. temporal sequence). Examples: >>> input_shape = (2, 2, 3) >>> x = np.arange(np.prod(input_shape)).reshape(input_shape) >>> print(x) [[[ 0 1 2] [ 3 4 5]] [[ 6 7 8] [ 9 10 11]]] >>> y = tf.keras.layers.ZeroPadding1D(padding=2)(x) >>> print(y) tf.Tensor( [[[ 0 0 0] ...
62598ee77d43ff248742675f
class TearDownAppTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.config = get_test_config() <NEW_LINE> self.orig_run_appcfg_with_auth = gaedriver.run_appcfg_with_auth <NEW_LINE> self.orig_restore_backends_yaml = gaedriver._restore_backends_yaml <NEW_LINE> <DEDENT> def tearDown(sel...
Tests for teardown_app.
62598ee766673b3332c2ea6f
@auto_repr <NEW_LINE> class NoMultiplexSSHConnection(BaseSSHConnection): <NEW_LINE> <INDENT> def __init__(self, sshri, **kwargs): <NEW_LINE> <INDENT> super().__init__(sshri, **kwargs) <NEW_LINE> self._ssh_open_args += [ '-o', 'PasswordAuthentication=no', '-o', 'KbdInteractiveAuthentication=no', ] <NEW_LINE> <DEDENT> de...
Representation of an SSH connection. The connection is opened for execution of a single process, and closed as soon as the process end.
62598ee7379a373c97d976bd
class DispatchTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.site1 = Site.objects.create(domain='site1.test.com') <NEW_LINE> self.site2 = Site.objects.create(domain='site2.test.com') <NEW_LINE> self.article_type = ResourceType.objects.create(name='article') <NEW_LINE> self.event_type ...
Ensure incoming requests and slugs get views.dispatched to correct view functions
62598ee791f36d47f2230207
class ConfigCASigningProfilesCaCaconstraint(): <NEW_LINE> <INDENT> def __init__(self, *, isca: bool = None, maxpathlen: float = None, maxpathlenzero: bool = None) -> None: <NEW_LINE> <INDENT> self.isca = isca <NEW_LINE> self.maxpathlen = maxpathlen <NEW_LINE> self.maxpathlenzero = maxpathlenzero <NEW_LINE> <DEDENT> @cl...
ConfigCASigningProfilesCaCaconstraint. :attr bool isca: (optional) Indicates if this certificate is for a CA. :attr float maxpathlen: (optional) A value of 0 indicates that this intermediate CA cannot issue other intermediate CA certificates. :attr bool maxpathlenzero: (optional) To enforce a `maxpathlen` of 0, ...
62598ee76e29344779afecfa
class User(AbstractBaseUser): <NEW_LINE> <INDENT> email = models.EmailField(max_length=100, unique=True) <NEW_LINE> USERNAME_FIELD = 'email' <NEW_LINE> is_driver = models.BooleanField(default=False) <NEW_LINE> is_shipper = models.BooleanField(default=False)
Extended the User model for the two users, driver and shipper
62598ee7d7e4931a7ef3a767
class AUCHistory(Callback): <NEW_LINE> <INDENT> def __init__(self, validation_data=(), interval=10): <NEW_LINE> <INDENT> super(Callback, self).__init__() <NEW_LINE> self.interval = interval <NEW_LINE> self.X_val, self.y_val = validation_data <NEW_LINE> self.aucs = [] <NEW_LINE> <DEDENT> def on_batch_end(self, batch, lo...
Computes area under ROC curve. Copied from here: https://gist.github.com/smly/d29d079100f8d81b905e
62598ee771ff763f4b5e5e24
class TestCall: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def test_header(): <NEW_LINE> <INDENT> request = requests.Request() <NEW_LINE> auth = ServiceRequestAuth() <NEW_LINE> auth(request) <NEW_LINE> actual = request.headers['Token'] <NEW_LINE> expected = settings.JWT_AUTH['SERVICE_SECRET_TOKEN'] <NEW_LINE> assert ...
Tests for the ServiceRequestAuth.__call__ function
62598ee78e7ae83300ee7757
class DeliveryRuleCacheExpirationAction(DeliveryRuleAction): <NEW_LINE> <INDENT> _validation = { 'name': {'required': True}, 'parameters': {'required': True}, } <NEW_LINE> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'parameters': {'key': 'parameters', 'type': 'CacheExpirationActionParameters'}, } <NEW_LI...
Defines the cache expiration action for the delivery rule. All required parameters must be populated in order to send to Azure. :param name: Required. The name of the action for the delivery rule.Constant filled by server. Possible values include: "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", "Mo...
62598ee7167d2b6e312b5662
class TipDetail(DynamicFieldsViewMixin, RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> queryset = Tip.objects.all() <NEW_LINE> serializer_class = TipSerializer <NEW_LINE> permission_classes = (IsOwnerOrReadOnly,)
GET: Get tip details PATCH: Partially update a tip PUT: Update a tip DELETE: Delete a tip
62598ee74527f215b58e85ce
class Control(object): <NEW_LINE> <INDENT> def __init__(self, caption): <NEW_LINE> <INDENT> self.screen = pg.display.get_surface() <NEW_LINE> self.done = False <NEW_LINE> self.clock = pg.time.Clock() <NEW_LINE> self.caption = caption <NEW_LINE> self.fps = 60 <NEW_LINE> self.show_fps = True <NEW_LINE> self.current_time ...
Control class for entire project. Contains the game loop, and contains the event_loop which passes events to States as needed. Logic for flipping states is also found here.
62598ee776e4537e8c3edc81
class Car(object): <NEW_LINE> <INDENT> def __init__(self, electric): <NEW_LINE> <INDENT> self. electric = electric <NEW_LINE> <DEDENT> def drive(self): <NEW_LINE> <INDENT> if not self.electric: <NEW_LINE> <INDENT> return "VROOOOM" <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return "WHIRRRRRRRR"
make a car that drive
62598ee7d486a94d0ba2a696
class ValueRule(SampleDates): <NEW_LINE> <INDENT> description = models.TextField() <NEW_LINE> parameter = models.ForeignKey(Parameter) <NEW_LINE> standard = models.ForeignKey(Standard, null=True, blank=True) <NEW_LINE> water_use_type = models.ForeignKey(WaterUseType, null=True, blank=True) <NEW_LINE> def __unicode__(se...
Rules Applied to the values
62598ee7d7e4931a7ef3a768
class NameOrIdRetrieval(): <NEW_LINE> <INDENT> idPattern = re.compile("^-?[0-9]+$") <NEW_LINE> namePattern = re.compile("^[0-9A-Za-z\-\+]+$") <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> queryset = self.get_queryset() <NEW_LINE> queryset = self.filter_queryset(queryset) <NEW_LINE> lookup = self.kwargs['pk'] <NE...
Mixin to allow retrieval of resources by pk (in this case ID) or by name
62598ee7be383301e0251ea2
class TransformerRegistry: <NEW_LINE> <INDENT> mapping = {} <NEW_LINE> @classmethod <NEW_LINE> def validate_mapping_exists(cls): <NEW_LINE> <INDENT> if 'mapping' not in cls.__dict__: <NEW_LINE> <INDENT> raise AttributeError( '{} registry must has its own "mapping" class attribute.'.format( cls.__name__ ) ) <NEW_LINE> <...
Registry to keep track of event transformers. Every Registry that inherits this registry MUST has its own `mapping` class attribute to avoid conflicts.
62598ee7e64d504609df8723
class intSet(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.vals = [] <NEW_LINE> <DEDENT> def insert(self, e): <NEW_LINE> <INDENT> if not e in self.vals: <NEW_LINE> <INDENT> self.vals.append(e) <NEW_LINE> <DEDENT> <DEDENT> def member(self, e): <NEW_LINE> <INDENT> return e in self.vals <NEW_LI...
An intSet is a set of integers The value is represented by a list of ints, self.vals. Each int in the set occurs in self.vals exactly once.
62598ee7e76e3b2f99fd70ff
class UnknownCounterTypeError(Exception): <NEW_LINE> <INDENT> def __init__(self, counter_type): <NEW_LINE> <INDENT> msg = 'Encountered unknown counter type {}'.format(counter_type) <NEW_LINE> super(UnknownCounterTypeError, self).__init__(msg)
Error for unknown counter types.
62598ee785dfad0860cbedcc
class MooneyRivlinTLTerm( VectorVector, HyperElasticTLBase ): <NEW_LINE> <INDENT> name = 'dw_tl_he_mooney_rivlin' <NEW_LINE> arg_types = ('material', 'virtual', 'state') <NEW_LINE> family_data_names = ['detF', 'trC', 'invC', 'C', 'in2C'] <NEW_LINE> term_function = {'stress' : terms.dq_tl_he_stress_mooney_rivlin, 'tange...
:Description: Hyperelastic Mooney-Rivlin term. Effective stress :math:`S_{ij} = \kappa J^{-\frac{4}{3}} (C_{kk} \delta_{ij} - C_{ij} - \frac{2}{3 } I_2 C_{ij}^{-1})`. :Definition: .. math:: \int_{\Omega} S_{ij}(\ul{u}) \delta E_{ij}(\ul{u};\ul{v}) :Arguments: material : :math:`\kappa`, virtual : :math:`\...
62598ee756ac1b37e63008b6
class GeneratedSection (Directive): <NEW_LINE> <INDENT> required_arguments = 0 <NEW_LINE> optional_arguments = 1 <NEW_LINE> final_argument_whitespace = True <NEW_LINE> option_spec = { 'class': directives.class_option, 'name': directives.unchanged, 'local': directives.flag, 'backlinks': option_check_backlinks, 'page-num...
Base class for generated sections (Contents, Footnotes, Citations, etc.).
62598ee776e4537e8c3edc82
@ts.register(period=config.whitelist.period) <NEW_LINE> @attr.s <NEW_LINE> class UpdateWhitelist(Task): <NEW_LINE> <INDENT> period = attr.ib(default=10) <NEW_LINE> def run(self, state): <NEW_LINE> <INDENT> state.whitelist = get_whitelist()
updates whitelist, runs each `period` iterations
62598ee7236d856c2adc8779
class GeneralContractorSchema(SchemaObject): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.schema = 'GeneralContractor'
Schema Mixin for GeneralContractor Usage: place after django model in class definition, schema will return the schema.org url for the object A general contractor.
62598ee72c8b7c6e89bd1e89
class TestDialog(BaseTestDialog): <NEW_LINE> <INDENT> dl_class = FirstRunDialog <NEW_LINE> def test_exec(self): <NEW_LINE> <INDENT> self.exec_() <NEW_LINE> print(self.dl.host) <NEW_LINE> print(self.dl.port) <NEW_LINE> print(self.dl.db_name) <NEW_LINE> print(self.dl.db_user) <NEW_LINE> print(self.dl.db_pass) <NEW_LINE> ...
BaseTestDialog inherits from unittest.TestCase
62598ee7f548e778e5969c54
class ParserError(Exception): <NEW_LINE> <INDENT> pass
Raise exception when parser didn't work correctly.
62598ee74428ac0f6e656c1b
class BundleEntryRequest(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_type = "BundleEntryRequest" <NEW_LINE> def __init__(self, jsondict=None, strict=True): <NEW_LINE> <INDENT> self.ifMatch = None <NEW_LINE> self.ifModifiedSince = None <NEW_LINE> self.ifNoneExist = None <NEW_LINE> self.ifNoneMatch = N...
Transaction Related Information. Additional information about how this entry should be processed as part of a transaction.
62598ee797e22403b38395ba
class ConfigItem: <NEW_LINE> <INDENT> name: str <NEW_LINE> default: Any <NEW_LINE> def __init__(self, *alt_keys: str, **kwargs: Any): <NEW_LINE> <INDENT> self.alt_keys: List[str] = list(alt_keys) <NEW_LINE> self.type_: Optional[Type] = kwargs.get("type") <NEW_LINE> try: <NEW_LINE> <INDENT> self.default = kwargs["defaul...
A descriptor to represent a configuration item. Attributes are loaded from a dictionary with fancy default handling.
62598ee7dd821e528d6d760e
class Laser (object): <NEW_LINE> <INDENT> def __init__(self, pin): <NEW_LINE> <INDENT> self.pin = pin <NEW_LINE> GPIO.setmode(GPIO.BCM) <NEW_LINE> GPIO.setup(self.pin, GPIO.OUT) <NEW_LINE> <DEDENT> def on(self): <NEW_LINE> <INDENT> GPIO.output(self.pin, 1) <NEW_LINE> <DEDENT> def off(self): <NEW_LINE> <INDENT> GPIO.out...
Classe Laser -> permet juste de contrôler le transistor qui ouvre/ferme le circuit du laser
62598ee7090684286d592a45
class LauncherCommand(object): <NEW_LINE> <INDENT> def __init__(self, name, description=None, module_name=None, function=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.module_name = module_name <NEW_LINE> if description is None: <NEW_LINE> <INDENT> description = "A command" <NEW_LINE> <DEDENT> self.descrip...
Description of a command
62598ee710dbd63aa1c6f23d
class wishList(Base): <NEW_LINE> <INDENT> __tablename__ = "wishlist" <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> user_id = Column(Integer, ForeignKey('user.id')) <NEW_LINE> Car_id = Column(Integer, ForeignKey('car.id')) <NEW_LINE> user = relationship(User) <NEW_LINE> car = relationship(Car) <NEW_LINE> ...
docstring for wishList
62598ee7f548e778e5969c55
class Profile(AbstractUser): <NEW_LINE> <INDENT> api_key = models.CharField(default=uuid4, max_length=36, null=False, blank=False, unique=True, db_index=True)
User profile.
62598ee730dc7b766599df52
class MongoDbMigrationSettings(Model): <NEW_LINE> <INDENT> _validation = { 'databases': {'required': True}, 'source': {'required': True}, 'target': {'required': True}, } <NEW_LINE> _attribute_map = { 'boost_rus': {'key': 'boostRUs', 'type': 'int'}, 'databases': {'key': 'databases', 'type': '{MongoDbDatabaseSettings}'},...
Describes how a MongoDB data migration should be performed. All required parameters must be populated in order to send to Azure. :param boost_rus: The RU limit on a CosmosDB target that collections will be temporarily increased to (if lower) during the initial copy of a migration, from 10,000 to 1,000,000, or 0 to ...
62598ee799cbb53fe682f57b
class TurtleSVG(Turtle): <NEW_LINE> <INDENT> pass
SVG version of turtle
62598ee7009cb60464cffc18
class GetHostInfo(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._dic={ 'cpu':CpuMain, 'disk':DiskMain, 'mem':MemMain, 'network':NetMain, 'motherboard':MotherboardMain, 'ssh':SshMain, 'other':OtherMain } <NEW_LINE> <DEDENT> def _begin(self,no_all_in=False): <NEW_LINE> <INDENT> ret_li=[] <NEW_...
程序统一入口: 通过self._dic 执行各个分支
62598ee76aa9bd52df0d357b
class TimeSpanRef: <NEW_LINE> <INDENT> def clone(self): <NEW_LINE> <INDENT> if self.ptr == None: <NEW_LINE> <INDENT> raise Exception("self is disposed") <NEW_LINE> <DEDENT> result = TimeSpan(livesplit_core_native.TimeSpan_clone(self.ptr)) <NEW_LINE> return result <NEW_LINE> <DEDENT> def total_seconds(self): <NEW_LINE> ...
A Time Span represents a certain span of time.
62598ee7ac7a0e7691f70be2
class grouping_sets(GenericFunction): <NEW_LINE> <INDENT> _has_args = True <NEW_LINE> inherit_cache = True
Implement the ``GROUPING SETS`` grouping operation. This function is used as part of the GROUP BY of a statement, e.g. :meth:`_expression.Select.group_by`:: stmt = select( func.sum(table.c.value), table.c.col_1, table.c.col_2 ).group_by(func.grouping_sets(table.c.col_1, table.c.col_2)) In order to gr...
62598ee7a219f33f346c4f04
class FirmwareUpdateProgressDataType(TypedDict): <NEW_LINE> <INDENT> sentFragments: int <NEW_LINE> totalFragments: int
Represent a firmware update progress event dict type.
62598ee7cb5e8a47e493b4de
class IBN(nn.Module): <NEW_LINE> <INDENT> def __init__(self, planes, ratio=0.5): <NEW_LINE> <INDENT> super(IBN, self).__init__() <NEW_LINE> self.half = int(planes * ratio) <NEW_LINE> self.IN = nn.InstanceNorm2d(self.half, affine=True) <NEW_LINE> self.BN = nn.BatchNorm2d(planes - self.half) <NEW_LINE> <DEDENT> def forwa...
Instance-Batch Normalization layer from `"Two at Once: Enhancing Learning and Generalization Capacities via IBN-Net" <https://arxiv.org/pdf/1807.09441.pdf>` Args: planes (int): Number of channels for the input tensor ratio (float): Ratio of instance normalization in the IBN layer
62598ee77d847024c075aa98
class Terrain: <NEW_LINE> <INDENT> _tabl_cards = None <NEW_LINE> _tabl_points = None <NEW_LINE> _taille = None <NEW_LINE> _labels = None <NEW_LINE> _can = None <NEW_LINE> _can_width = 60 <NEW_LINE> _can_height = 60 <NEW_LINE> _root = None <NEW_LINE> def __init__(self,width,height,tabl_points,root): <NEW_LINE> <INDENT> ...
Classe regroupant les informations relatives au Terrain de jeu
62598ee7a8370b77170eeaae
class PG_flow_rawip(PG_flow_t): <NEW_LINE> <INDENT> def __init__(self, name, smac, dmac, sip, dip, vlan_tag=0, data_length=18, **kwargs): <NEW_LINE> <INDENT> super(PG_flow_rawip, self).__init__('ip', name) <NEW_LINE> cmds = [ ] <NEW_LINE> pkt_len = 0 <NEW_LINE> if 0 != vlan_tag: <NEW_LINE> <INDENT> cmds.extend([ 'layer...
Class to create a raw ipv4 object for pagent Args: name ('str'): raw ipv4 flow object smac ('str'): source mac address dmac ('str'): destination mac address sip ('str'): source ipv4 dip ('str'): destination ipv4 vlan_tag ('int', optional): vlan tag, default 0 data_length ('str', optional): l3 data length ...
62598ee77cff6e4e811b40b8
class SingleTasks(APIView): <NEW_LINE> <INDENT> def get(self, request, username, id): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> user = User.objects.get(username=username) <NEW_LINE> return JsonResponse({ 'username': user.username, 'task': user.tasks.get(id=id) }) <NEW_LINE> <DEDENT> except (User.DoesNotExist, Task.D...
Handle get, put, and delete operations for an individual task.
62598ee7d7e4931a7ef3a76a
class MapPosition(Position): <NEW_LINE> <INDENT> def __init__( self, x: int = 0, y: int = 0, reverseY: bool = True, frame: Optional[Sequence[Sequence[Any]]] = None, xmin: Numeric = -inf, xmax: Numeric = inf, ymin: Numeric = -inf, ymax: Numeric = inf, occupied: Callable[[_PositionGeneric], bool] = lambda p: False ) -> N...
MapPosition class: represents a Position on a possibly limited, possibly not fully traversable 2D plane. Inherits from Position Syntax is MapPosition(x, y, reverseY=True, frame=None, xmin=-inf, xmax=inf, ymin=-inf, xmax=inf, occupied=lambda p: False) [Hashable] A MapPosition assumes reverseY, contrary to the Position...
62598ee7d486a94d0ba2a698
class InterfaceOption(object): <NEW_LINE> <INDENT> def __init__(self, Parameter=None, Type=None, Handler=None, Name=None, Help=None): <NEW_LINE> <INDENT> self.Parameter = Parameter <NEW_LINE> if self.Parameter is None: <NEW_LINE> <INDENT> if Name is None: <NEW_LINE> <INDENT> raise IncompetentDeveloperError("Must specif...
Describes an option and what to do with it ``Parameter`` is a pyqi.core.command.Parameter instance, typically an instance of a ``CommandIn`` or a ``CommandOut``. ``Type`` refers to the interface type, not the actually datatype of the ``Parameter``. For instance, a file path may be specified on a command l...
62598ee7aad79263cf42ced5
class InlineResponse2002(Model): <NEW_LINE> <INDENT> def __init__(self, s: Status=None, errmsg: str=None, d: List[Fixture]=None): <NEW_LINE> <INDENT> self.swagger_types = { 's': Status, 'errmsg': str, 'd': List[Fixture] } <NEW_LINE> self.attribute_map = { 's': 's', 'errmsg': 'errmsg', 'd': 'd' } <NEW_LINE> self._s = s ...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598ee738b623060ffa7763
class SingleProcessInvoker(Invoker): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(SingleProcessInvoker, self).__init__() <NEW_LINE> <DEDENT> @stoppable <NEW_LINE> def invoke(self, caller, fargs, **kwargs): <NEW_LINE> <INDENT> self._caller = caller <NEW_LINE> del caller <NEW_LINE> try: <NEW_LINE> <I...
Invoker that does the work on its own.
62598ee7be383301e0251ea4