code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class SyncClient: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.services = [] <NEW_LINE> self.playlists = [] <NEW_LINE> <DEDENT> def login(self, service, options): <NEW_LINE> <INDENT> if service == "spotify": <NEW_LINE> <INDENT> if options.has_key('username') and options.has_key('password') and optio...
Manages and allows auth/syncing from different music streaming services. Currently supports Google Music and Spotify.
62598f668c3a8732951f5c33
class NormActivation(Chain): <NEW_LINE> <INDENT> def __init__(self, in_channels, bn_eps=1e-5, activation=(lambda: F.relu), **kwargs): <NEW_LINE> <INDENT> super(NormActivation, self).__init__(**kwargs) <NEW_LINE> with self.init_scope(): <NEW_LINE> <INDENT> self.bn = L.BatchNormalization( size=in_channels, eps=bn_eps) <N...
Activation block with preliminary batch normalization. It's used by itself as the final block in PreResNet. Parameters: ---------- in_channels : int Number of input channels. bn_eps : float, default 1e-5 Small float added to variance in Batch norm. activation : function or str or None, default F.relu Activ...
62598f66d53ae8145f917b78
class Book(db.Model): <NEW_LINE> <INDENT> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String(64), unique=True) <NEW_LINE> author_id = db.Column(db.Integer, db.ForeignKey(Author.id)) <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return "Book: %s %s " % (self.id, self.name)
书籍类 多的一方
62598f6630c21e258be97ee1
class PDF(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> self.client.login(username='admin', password='admin') <NEW_LINE> self.admin = get_user_model().objects.get(username='admin') <NEW_LINE> self.assignment = Assignment.objects.create(title='test_assignment_Ox...
Tests assignment PDF.
62598f663eb6a72ae0389d24
class DecimalFactorialError(Exception): <NEW_LINE> <INDENT> def __init__(self, message="Can't factorialize decimal numbers."): <NEW_LINE> <INDENT> self.message = message <NEW_LINE> super().__init__(self.message)
Exception is raised when trying to factorialize a decimal number.
62598f66711fe17d825dfdce
class TestV1beta1CertificateSigningRequestSpec(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 testV1beta1CertificateSigningRequestSpec(self): <NEW_LINE> <INDENT> pass
V1beta1CertificateSigningRequestSpec unit test stubs
62598f660a366e3fb87dc0a6
class Program(object): <NEW_LINE> <INDENT> def __init__(self, code=None, parameter=None): <NEW_LINE> <INDENT> self.code = code <NEW_LINE> self.parameter = parameter <NEW_LINE> <DEDENT> def serialize(self, buf): <NEW_LINE> <INDENT> extended_para_len = len(self.parameter) <NEW_LINE> buf = utility.write_var_unit(buf, exte...
classdocs
62598f66711fe17d825dfdcf
class MarketMonitor(BasicMonitor): <NEW_LINE> <INDENT> def __init__(self, mainEngine, eventEngine, parent=None): <NEW_LINE> <INDENT> super(MarketMonitor, self).__init__(mainEngine, eventEngine, parent) <NEW_LINE> d = OrderedDict() <NEW_LINE> d['symbol'] = {'chinese':u'合约代码', 'cellType':BasicCell} <NEW_LINE> d['vtSymbol...
市场监控组件
62598f665e10d32532ce345b
class Category(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=120) <NEW_LINE> group = models.ForeignKey(Group) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.name
class Car(models.Model): company_that_makes_it = models.ForeignKey(Manufacturer) # ...
62598f661d351010ab8f3227
class JukeBox(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> pygame.mixer.init() <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> self.soundon = False <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.soundon = True <NEW_LINE> <DEDENT> self.sfx = rstore.sfx <NEW_LINE> self...
Game jukebox that handles music and sfx. We have three attributes that are important: soundon - this will be true unless we couldn't initialize pygame music musicon - this can be set by the user via the menu sfxon - this can be set by the user via the menu
62598f6630c21e258be97ee2
class DTUserError(DTException): <NEW_LINE> <INDENT> pass
Exceptions that will not be printed with full traceback, because they contain a simple message for the user, to be printed in red.
62598f66a8ecb033258708e9
class BoutiqueItemATMetatags(GdwATMetatags): <NEW_LINE> <INDENT> implements(IOpengraphMetatags) <NEW_LINE> @property <NEW_LINE> def image_url(self): <NEW_LINE> <INDENT> return self.context.photo.absolute_url() <NEW_LINE> <DEDENT> @property <NEW_LINE> def content_type(self): <NEW_LINE> <INDENT> return 'product'
Boutique item Facebook informations
62598f6673bcbd0ca4bc9938
class LinearSVC(BaseClassifier): <NEW_LINE> <INDENT> def __init__(self, C=1.0, loss="hinge", criterion="accuracy", max_iter=1000, tol=1e-3, permute=True, shrinking=True, warm_start=False, random_state=None, callback=None, n_calls=100, verbose=0): <NEW_LINE> <INDENT> self.C = C <NEW_LINE> self.loss = loss <NEW_LINE> sel...
Estimator for learning linear support vector machine by coordinate descent in the dual. Parameters ---------- loss : str, 'hinge', 'squared_hinge' The loss function to be used. criterion : str, 'accuracy', 'auc' Whether to optimize for classification accuracy or AUC. C : float Weight of the loss term. m...
62598f660a366e3fb87dc0a7
class LogisticRegressionWithL2Regularization(Classifier): <NEW_LINE> <INDENT> def __init__(self, _lambda, epsilon): <NEW_LINE> <INDENT> self.epsilon = epsilon <NEW_LINE> self._lambda = _lambda <NEW_LINE> self.w = None <NEW_LINE> <DEDENT> def fit(self, X, y, n_iter=100, verbose=False): <NEW_LINE> <INDENT> n, d = X.shape...
Cost function is J(w) = -l(w) + \lambda |w|^2 l(w) = loglikelihood(w)
62598f66796e427e5384de7a
class Actor: <NEW_LINE> <INDENT> def __init__(self, state_size, action_size, action_low, action_high): <NEW_LINE> <INDENT> self.state_size = state_size <NEW_LINE> self.action_size = action_size <NEW_LINE> self.action_low = action_low <NEW_LINE> self.action_high = action_high <NEW_LINE> self.action_range = self.action_h...
Actor (Policy) Model.
62598f66925a0f43d25e771e
class TestOrgRepControls(BaseTest): <NEW_LINE> <INDENT> def test_org_rep_ctrl_startup(self, bp: BasePage, op: OrganismPage): <NEW_LINE> <INDENT> op.go_to_organism() <NEW_LINE> assert not op.org_rep_controls_enabled() <NEW_LINE> assert op.org_rep_controls_disabled() <NEW_LINE> assert op.get_cycle() == 0 <NEW_LINE> <DEDE...
Test class that runs simple experiments with the organism window reproduction.
62598f66711fe17d825dfdd1
class BaseDialog( Toplevel ): <NEW_LINE> <INDENT> def __init__(self, parent, title = None, buttons=""): <NEW_LINE> <INDENT> Toplevel.__init__( self, parent ) <NEW_LINE> self.transient(parent) <NEW_LINE> if title: <NEW_LINE> <INDENT> self.title(title) <NEW_LINE> <DEDENT> self.parent = parent <NEW_LINE> self.result = Non...
Helper base class for dialogs used in the UI.
62598f668c3a8732951f5c36
class MmseqsParser(object): <NEW_LINE> <INDENT> def __init__(self, input_file, input_type = 'search'): <NEW_LINE> <INDENT> self.input_file = input_file <NEW_LINE> if input_type == 'search': <NEW_LINE> <INDENT> self.input_type = 'search' <NEW_LINE> <DEDENT> elif input_type == 'taxonomy': <NEW_LINE> <INDENT> self.input_t...
Parses an MMseqs output file in tab format Uses different parser depending on the type of MMseqs module (right now only taxonomy and search supported)
62598f6691af0d3eaad394ef
class FabricBreakout(ManagedObject): <NEW_LINE> <INDENT> consts = FabricBreakoutConsts() <NEW_LINE> naming_props = set([u'slotId', u'portId']) <NEW_LINE> mo_meta = MoMeta("FabricBreakout", "fabricBreakout", "breakout-slot-[slot_id]-port-[port_id]", VersionMeta.Version141a, "InputOutput", 0x7f, [], ["admin", "ext-lan-co...
This is FabricBreakout class.
62598f66d164cc6175820660
class GOSTmsg05975sw( SmallWeierstrassCurveFp ): <NEW_LINE> <INDENT> curveId = 'GOSTmsg05975sw' <NEW_LINE> strength = 256 <NEW_LINE> oid = None <NEW_LINE> p = 2**512 - 569 <NEW_LINE> a = 0xDC9203E514A721875485A529D2C722FB187BC8980EB866644DE41C68E143064546E861C0E2C9EDD92ADE71F46FCF50FF2AD97F951FDA9F2A2EB6546F39689BD3 <N...
from: http://www.ietf.org/mail-archive/web/cfrg/current/msg05975.html related to GOSTmsg05975te
62598f666fece00bbaccb07b
class TestEdgeSubgraph(_TestMultiGraphEdgeSubgraph): <NEW_LINE> <INDENT> def setup_method(self): <NEW_LINE> <INDENT> G = nx.MultiDiGraph() <NEW_LINE> nx.add_path(G, range(5)) <NEW_LINE> nx.add_path(G, range(5)) <NEW_LINE> nx.add_path(G, reversed(range(5))) <NEW_LINE> nx.add_path(G, reversed(range(5))) <NEW_LINE> for i ...
Unit tests for the :meth:`MultiDiGraph.edge_subgraph` method.
62598f6630c21e258be97ee5
class ReadOnlyStoreTree(BaseTree): <NEW_LINE> <INDENT> def __init__(self, tree_root, file_store): <NEW_LINE> <INDENT> super(ReadOnlyStoreTree, self).__init__(tree_root) <NEW_LINE> self._file_store = file_store <NEW_LINE> <DEDENT> def _require_parent(self, full_path): <NEW_LINE> <INDENT> parent = os.path.dirname(full_pa...
Represents a read-only filesystem tree in a file store.
62598f66d10714528d69d5b3
class ServiceForm(ModelForm, Form): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> csrf = False <NEW_LINE> model = Service <NEW_LINE> <DEDENT> name = StringField(u'Name', validators=[DataRequired()]) <NEW_LINE> token = StringField(u'Token', validators=[DataRequired()]) <NEW_LINE> hwk_url = StringField(u'Hawkular U...
Handle subscribe form neatly with WTForms.
62598f66287bf620b62712a3
class ExDirectionType(Enum): <NEW_LINE> <INDENT> Settlement = 48 <NEW_LINE> Sale = 49 <NEW_LINE> def __int__(self): <NEW_LINE> <INDENT> return self.value <NEW_LINE> <DEDENT> def __char__(self): <NEW_LINE> <INDENT> return chr(self.value)
换汇方向类型
62598f66ff9c53063f519d3b
class LongRunningRecognizeResponse(proto.Message): <NEW_LINE> <INDENT> results = proto.RepeatedField( proto.MESSAGE, number=2, message="SpeechRecognitionResult", )
The only message returned to the client by the ``LongRunningRecognize`` method. It contains the result as zero or more sequential ``SpeechRecognitionResult`` messages. It is included in the ``result.response`` field of the ``Operation`` returned by the ``GetOperation`` call of the ``google::longrunning::Operations`` se...
62598f66711fe17d825dfdd2
class CkSession: <NEW_LINE> <INDENT> def __init__(self, usernames=()): <NEW_LINE> <INDENT> self.session = {} <NEW_LINE> self.uid = {pwd.getpwnam(user).pw_uid for user in usernames} <NEW_LINE> <DEDENT> def list_sessions(self): <NEW_LINE> <INDENT> name = None <NEW_LINE> for line in subprocess.check_output('ck-list-sessio...
Wrapper around ck-list-sessions - provides a query for active x11 sessions by user (optional). Note, that the man page indicates that this should work (but doesn't currently): ck-list-sessions --format="session-id,unix-user,display-type"
62598f665166f23b2e242ac2
class TestCacheAlwaysShow(PackageReadTestBase): <NEW_LINE> <INDENT> fallback = 'cache' <NEW_LINE> always_show_upstream = True <NEW_LINE> def test_no_package_no_read_no_user(self): <NEW_LINE> <INDENT> self.should_ask_auth(self.get_request()) <NEW_LINE> <DEDENT> def test_no_package_no_read_user(self): <NEW_LINE> <INDENT>...
Test reading packages with fallback=cache and always_show_upstream=true
62598f66925a0f43d25e7720
class ImageKey(DataWithDarksAndFlats): <NEW_LINE> <INDENT> def __init__(self, data_obj, image_key, proj_dim, ignore=None): <NEW_LINE> <INDENT> self.data_obj = data_obj <NEW_LINE> self.image_key = image_key <NEW_LINE> self.proj_dim = proj_dim <NEW_LINE> self.ignore = ignore <NEW_LINE> super(ImageKey, self).__init__(data...
This class is used to get data from a dataset with an image key.
62598f66d18da76e235b6caa
class miniAtoms(object): <NEW_LINE> <INDENT> def __init__(self, atoms=None, positions=None, numbers=None): <NEW_LINE> <INDENT> if atoms is not None: <NEW_LINE> <INDENT> self.positions = np.copy(atoms.positions) <NEW_LINE> self.numbers = np.copy(atoms.numbers) <NEW_LINE> <DEDENT> elif positions is not None: <NEW_LINE> <...
Minimal atoms class including only positions and atomic numbers using the same ase.Atoms interface. Attributes ---------- numbers : 1-D np.ndarray of int Atomic numbers of the represented atoms. positions : 2-D np.ndarray of float Positions of the represented atoms. Parameters ---------- atoms : ase.Atoms obj...
62598f661f5feb6acb162323
class MessageSchema(Schema): <NEW_LINE> <INDENT> title = validators.String(not_empty=True, max=100) <NEW_LINE> author = validators.String(not_empty=True) <NEW_LINE> content = validators.String(not_empty=True)
Represent Message Document - MongoDB
62598f6663f4b57ef00858e4
class EchoRequestReassemblyTimeoutTestCase(ComplianceTestCase): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> self.logger.info("Sending fragmented echo request to link multicast") <NEW_LINE> self.node(1).send( IPv6(src=str(self.node(1).global_ip()), dst="ff02::1")/ IPv6ExtHdrFragment(offset=0, m=1)/...
Error Condition With Multicast Destination - Echo Request Reassembly Timeout Verify that a node properly handles the reception of an error condition caused by a packet with a Multicast Destination Address. @private Source: IPv6 Ready Phase-1/Phase-2 Test Specification Core Test v6LC.5.1.10b
62598f66925a0f43d25e7722
class PadOperation(Operation): <NEW_LINE> <INDENT> def __init__(self, x, paddings, pad_dim_name, name=None): <NEW_LINE> <INDENT> super(PadOperation, self).__init__([x], name=name or "pad") <NEW_LINE> assert len(paddings) == 2 <NEW_LINE> input_shape = self._inputs[0].shape <NEW_LINE> dim_names = [dim.name for dim in x.s...
tf.pad. Similar to tf.pad but we only pad along one axis given by pad_dim_name with values specified by paddings. paddings is a list of two values, giving the padding value before and after pad_dim.
62598f66bf627c535bcb0b6c
class MySQLObjectStore(SQLObjectStore): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self._autocommit = kwargs.pop('autocommit', False) <NEW_LINE> SQLObjectStore.__init__(self, **kwargs) <NEW_LINE> <DEDENT> def augmentDatabaseArgs(self, args, pool=False): <NEW_LINE> <INDENT> if not args.get('db...
MySQLObjectStore implements an object store backed by a MySQL database. MySQL notes: * MySQL home page: http://www.mysql.com. * MySQL version this was developed and tested with: 3.22.34 & 3.23.27 * The platforms developed and tested with include Linux (Mandrake 7.1) and Windows ME. * The MySQL-Python DB AP...
62598f6626238365f5fac260
class BaseCompOp(CSTNode, ABC): <NEW_LINE> <INDENT> __slots__ = ()
Any node that has a static value used in a :class:`Comparison` expression. This node is purely for typing.
62598f668c3a8732951f5c3a
class ArticleRate(models.Model): <NEW_LINE> <INDENT> article = models.OneToOneField( to=Article, on_delete=models.CASCADE, primary_key=True, related_name='article_rate', verbose_name='Ratio articulo', ) <NEW_LINE> positives = models.PositiveIntegerField(default=0) <NEW_LINE> objects = ArticleRateManager() <NEW_LINE> de...
Ratio de un articulo.
62598f6691af0d3eaad394f3
class ParentLoader(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._parent_cache = {} <NEW_LINE> <DEDENT> def load_parent(self, parent_str): <NEW_LINE> <INDENT> if not self._parent_cache.has_key(parent_str): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> module_str, parent_class = parent_str.rsp...
Handles loading and caching parent classes.
62598f664d74a7450cd58a4d
class Machine: <NEW_LINE> <INDENT> def __init__(self, id: str, name: str, public_ip: str=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.id = id <NEW_LINE> self.public_ip = public_ip
Representation of a machine in the cloud
62598f66a4f1c619b294dcdf
class Geq(Eq): <NEW_LINE> <INDENT> operator = ">="
Condition that value of column is greater or equal than some value
62598f661d351010ab8f322d
class Monomer(Component): <NEW_LINE> <INDENT> def __init__(self, name, sites=[], site_states={}, _export=True): <NEW_LINE> <INDENT> Component.__init__(self, name, _export) <NEW_LINE> if not isinstance(sites, collections.Iterable) or isinstance(sites, basestring): <NEW_LINE> <INDENT> raise ValueError("sites must be a li...
Model component representing a protein or other molecule.
62598f667c178a314d78cb8b
class Settings(object): <NEW_LINE> <INDENT> __slots__ = [] <NEW_LINE> _search_path = SearchPathList() <NEW_LINE> @property <NEW_LINE> def search_path(self): <NEW_LINE> <INDENT> return self._search_path <NEW_LINE> <DEDENT> @property <NEW_LINE> def mwindow_size(self): <NEW_LINE> <INDENT> return option(GIT_OPT_GET_MWINDOW...
Library-wide settings
62598f66c432627299fa26be
class MarketItem(BaseObject): <NEW_LINE> <INDENT> uuid = Column(String(36), unique=True, nullable=False, default=lambda: str(uuid4())) <NEW_LINE> name = Column(Unicode(64), nullable=False) <NEW_LINE> price = Column(Integer, nullable=False) <NEW_LINE> image = Column(Unicode(255)) <NEW_LINE> description = Column(Unicode(...
Item definition
62598f6621bff66bcd722347
class ImageFileCreateEntry(Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'contents': {'key': 'contents', 'type': 'bytearray'}, 'tag_ids': {'key': 'tagIds', 'type': '[str]'}, 'regions': {'key': 'regions', 'type': '[Region]'}, } <NEW_LINE> def __init__(self, *, name: str=None, con...
ImageFileCreateEntry. :param name: :type name: str :param contents: :type contents: bytearray :param tag_ids: :type tag_ids: list[str] :param regions: :type regions: list[~azure.cognitiveservices.vision.customvision.training.models.Region]
62598f660383005118f6cdf5
class FileinfoArguments(ToolArguments): <NEW_LINE> <INDENT> def __init__(self, *, config_file=None, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.config_file = config_file <NEW_LINE> <DEDENT> @property <NEW_LINE> def input_file(self): <NEW_LINE> <INDENT> return self.input_files[0] <NEW_LINE>...
A representation of fileinfo arguments.
62598f66d10714528d69d5b7
class IncosistentData(HAProxyDataError): <NEW_LINE> <INDENT> message = 'Received different data per HAProxy process'
Data across all processes is not the same.
62598f66be8e80087fbbe747
class FormClassTests(TestCase): <NEW_LINE> <INDENT> def test_module_exists(self): <NEW_LINE> <INDENT> project_path = os.getcwd() <NEW_LINE> tradebooks_app_path = os.path.join(project_path, 'tradebooks') <NEW_LINE> forms_module_path = os.path.join(tradebooks_app_path, 'forms.py') <NEW_LINE> self.assertTrue(os.path.exist...
Do the Form classes exist, and do they contain the correct instance variables?
62598f665166f23b2e242ac8
class JobStatus(models.Model): <NEW_LINE> <INDENT> job_name = models.CharField(max_length=255, blank=False, null=False, primary_key=True) <NEW_LINE> job_type = models.CharField(max_length=255, blank=False, null=False, choices=JOB_TYPE) <NEW_LINE> last_finished = models.DateTimeField(blank=False, null=False) <NEW_LINE> ...
This model keeps finish time for cron jobs.
62598f66507cdc57c63a448a
class IClass(Enum): <NEW_LINE> <INDENT> I_CAP_LOAD = "cap_load" <NEW_LINE> I_CAP_STORE = "cap_store" <NEW_LINE> I_CAP_CAST = "cap_cast" <NEW_LINE> I_CAP_ARITH = "cap_arith" <NEW_LINE> I_CAP_BOUND = "cap_bound" <NEW_LINE> I_CAP_FLOW = "cap_flow" <NEW_LINE> I_CAP_CPREG = "cap_cpreg" <NEW_LINE> I_CAP_CMP = "cap_cmp" <NEW_...
Enumerate instruction classes with the relative callback name. There are two more reserved classes I_ALL and I_EXCEPTION that define the callback invoked for every instruction and whenever an instruction causes an exception.
62598f668a349b6b4368592e
class MockCapabilityImpl(absltest.TestCase): <NEW_LINE> <INDENT> def __init__(self, expected_request, apiproxy_response, failure=None): <NEW_LINE> <INDENT> self.failure = failure <NEW_LINE> self.expected_request = expected_request <NEW_LINE> self.apiproxy_response = apiproxy_response <NEW_LINE> <DEDENT> def MakeSyncCal...
Stub for the apiproxy_stub_map module. Used for testing that RPC calls from stubby.py are formatted correctly.
62598f661d351010ab8f3231
class LightweightConvolution(nn.Module): <NEW_LINE> <INDENT> def __init__( self, wshare, n_feat, dropout_rate, kernel_size, use_kernel_mask=False, use_bias=False, ): <NEW_LINE> <INDENT> super(LightweightConvolution, self).__init__() <NEW_LINE> assert n_feat % wshare == 0 <NEW_LINE> self.wshare = wshare <NEW_LINE> self....
Lightweight Convolution layer. This implementation is based on https://github.com/pytorch/fairseq/tree/master/fairseq Args: wshare (int): the number of kernel of convolution n_feat (int): the number of features dropout_rate (float): dropout_rate kernel_size (int): kernel size (length) use_kernel_m...
62598f66a8ecb033258708f3
class FileAdmin(BaseFileAdmin): <NEW_LINE> <INDENT> def __init__(self, base_path, *args, **kwargs): <NEW_LINE> <INDENT> storage = LocalFileStorage(base_path) <NEW_LINE> super(FileAdmin, self).__init__(*args, storage=storage, **kwargs)
Simple file-management interface. :param base_path: Path to the directory which will be managed :param base_url: Optional base URL for the directory. Will be used to generate static links to the files. If not defined, a route will be created to serve uploaded files. Sample usage:: import os.path ...
62598f6621bff66bcd72234b
class CuMod(loader.Module): <NEW_LINE> <INDENT> strings = {'name': 'Cu'} <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.name = self.strings['name'] <NEW_LINE> self._me = None <NEW_LINE> self._ratelimit = [] <NEW_LINE> <DEDENT> async def client_ready(self, client, db): <NEW_LINE> <INDENT> self._db = db <NEW_LIN...
Полное копирование юзера(ава, имя|фамилия, био)
62598f6673bcbd0ca4bc9942
class ASPBackend(object): <NEW_LINE> <INDENT> def __init__(self, module, toolchain, cache_dir): <NEW_LINE> <INDENT> self.module = module <NEW_LINE> self.toolchain = toolchain <NEW_LINE> self.compiled_module = None <NEW_LINE> self.cache_dir = cache_dir <NEW_LINE> self.dirty = True <NEW_LINE> <DEDENT> def compile(self): ...
Class to encapsulate a backend for Asp. A backend is the combination of a CodePy module (which contains the actual functions) and a CodePy compiler toolchain.
62598f660a366e3fb87dc0b2
class BedGraphCreator(object): <NEW_LINE> <INDENT> __slots__ = ('testMode', 'conf', 'bedtype', 'bgrtype') <NEW_LINE> def __init__(self, testMode=False): <NEW_LINE> <INDENT> self.testMode = testMode <NEW_LINE> self.conf = Config() <NEW_LINE> self.bedtype = Filetype.objects.get(code='bed') <NEW_LINE> self.bgrtype =...
Core class used to iterate over all alignments in the database.
62598f665166f23b2e242aca
class Installation(object): <NEW_LINE> <INDENT> def __init__(self, install_num, postal_code="", town_name="", street_num="", street_name="", longitude="", latitude="", no_access_arrang="", access_low_mob_hand="", access_sens_hand=""): <NEW_LINE> <INDENT> self.install_num = install_num <NEW_LINE> try: <NEW_LINE> <INDENT...
This class is used to represent an Installation
62598f6656b00c62f0fb1fa4
class CheckSEBHashBrowserExamKey(CheckSEBHash, Permission): <NEW_LINE> <INDENT> http_header = 'HTTP_X_SAFEEXAMBROWSER_REQUESTHASH' <NEW_LINE> detailed_config_key = 'BROWSER_KEYS'
Check for SEB Browser keys, allow if there are none configured
62598f66d99f1b3c44d04da4
class OptionListReturnEvent(GameEvent): <NEW_LINE> <INDENT> def apply(self, game: 'Game') -> None: <NEW_LINE> <INDENT> game.state.resume_display()
A GameEvent which forces the current displayable to redisplay itself. This GameEvent is used to force the GameView to redisplay the current displayable resource. This is useful for when the options or text has been changed by another event but the current displayable hasn't been been changed nor has the game state bee...
62598f66711fe17d825dfddb
class XceptionBlock(nn.Module): <NEW_LINE> <INDENT> def __init__( self, in_planes, filters, rate=1, depth_activation=False, stride=1, skip_return=False, agg="sum", ): <NEW_LINE> <INDENT> super(XceptionBlock, self).__init__() <NEW_LINE> self.conv1 = sepconv_bn( in_planes, filters[0], stride=1, rate=rate, depth_activatio...
Xception Block. SepConv-BN => SepConv-BN => SepConv-BN. Args: in_planes (int): number of input channels. filters (list of int): number of channels per each SepConv-BN block. rate (int): dilation rate in the convolution. depth_activation (bool): whether to use activation function (ReLU). stride (int): stride...
62598f664d74a7450cd58a50
class TextLanderInterface: <NEW_LINE> <INDENT> def showInfo(self, lander): <NEW_LINE> <INDENT> altitude = lander.getAltitude() <NEW_LINE> velocity = lander.getVelocity() <NEW_LINE> fuel = lander.getFuel() <NEW_LINE> print("Altitude is", altitude, "meters.\nVelocity is", velocity, ".\nFuel left is", fuel) <NEW_LINE> <DE...
Text-based interface for lander game. Use this one for testing
62598f6650485f2cf55da669
class ScubaThrower(ThrowerAnt): <NEW_LINE> <INDENT> name = 'Scuba' <NEW_LINE> food_cost = 6 <NEW_LINE> implemented = True <NEW_LINE> watersafe = True
A ScubaThrower is a ThrowerAnt which is watersafe.
62598f668a349b6b43685930
class BaidubaikeException(Exception): <NEW_LINE> <INDENT> def __init__(self, error): <NEW_LINE> <INDENT> self.error = error <NEW_LINE> <DEDENT> def __unicode__(self): <NEW_LINE> <INDENT> return "An unknown error occured: \"{0}\". Please report it on GitHub!".format(self.error) <NEW_LINE> <DEDENT> if sys.version_info > ...
Base Baidubaike exception class.
62598f666aa9bd52df0d45c0
class AssessmentTopCategoryPermissionUpdateSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> assessor_id = serializers.IntegerField(required=True) <NEW_LINE> assessment_top_category_id = serializers.IntegerField(required=True) <NEW_LINE> assessor_has_access = serializers.BooleanField(required=True) <NEW_LINE...
Serializer to update assessed's assessment permissions.
62598f66a8ecb033258708f5
class Hyperparameter(namedtuple('Hyperparameter', ('name', 'value_type', 'bounds', 'n_elements', 'fixed'))): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> def __new__(cls, name, value_type, bounds, n_elements=1, fixed=None): <NEW_LINE> <INDENT> if bounds != "fixed": <NEW_LINE> <INDENT> bounds = np.atleast_2d(bounds) <N...
A kernel hyperparameter's specification in form of a namedtuple. Entries ------- name : string The name of the hyperparameter. Note that a kernel using a hyperparameter with name "x" must have the attributes self.x and self.x_bounds value_type : string The type of the hyperparameter. Currently, only "...
62598f666e29344779affd4b
class TestLogin(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.url = r'http://192.168.10.131/TinyShop_v1.7/index.php?con=simple&act=login_act' <NEW_LINE> self.re = requests.Session() <NEW_LINE> print("setup") <NEW_LINE> <DEDENT> def test_t1(self): <NEW_LINE> <INDENT> data = { 'email':...
登录模块
62598f66d10714528d69d5bc
class SelectorDIC(ModelSelector): <NEW_LINE> <INDENT> def select(self): <NEW_LINE> <INDENT> warnings.filterwarnings("ignore", category=DeprecationWarning) <NEW_LINE> dic_previous = -100000.0 <NEW_LINE> for num_states in range(self.min_n_components, self.max_n_components): <NEW_LINE> <INDENT> hmm_model = GaussianHMM(n_c...
select best model based on Discriminative Information Criterion Biem, Alain. "A model selection criterion for classification: Application to hmm topology optimization." Document Analysis and Recognition, 2003. Proceedings. Seventh International Conference on. IEEE, 2003. http://citeseerx.ist.psu.edu/viewdoc/download?d...
62598f6663f4b57ef00858e8
class StringIter: <NEW_LINE> <INDENT> def __init__(self, string: str) -> None: <NEW_LINE> <INDENT> self._string = string <NEW_LINE> self._index = 0 <NEW_LINE> <DEDENT> def __iter__(self) -> "StringIter": <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def __next__(self) -> str: <NEW_LINE> <INDENT> return self.itern...
Preprocess replace tokens.
62598f661f5feb6acb16232b
class BPGEntry: <NEW_LINE> <INDENT> FIELDS = ["Date", "Systolic", "Diastolic", "Glucose"] <NEW_LINE> def __init__(self, date, systolic=None, diastolic=None, glucose=None): <NEW_LINE> <INDENT> if not date: <NEW_LINE> <INDENT> raise ValueError("Date is required for a BGPEntry.") <NEW_LINE> <DEDENT> if isinstance(date, st...
Class representing a blood pressure and glucose entry for a particular date.
62598f66711fe17d825dfddc
class Meta: <NEW_LINE> <INDENT> model = PopularCards <NEW_LINE> fields = '__all__'
Meta class to map serializer's fields with the model fields.
62598f66d99f1b3c44d04da6
class TorrentFile: <NEW_LINE> <INDENT> def __init__(self, start_args: list[str], logger): <NEW_LINE> <INDENT> self.logger = logger <NEW_LINE> self.magnet = start_args[0] <NEW_LINE> self.search_term = ''.join(start_args[1:]) <NEW_LINE> <DEDENT> def is_btih(self): <NEW_LINE> <INDENT> return len(self.magnet) == 40 <NEW_LI...
Accepts a magnet link or btih and outputs a torrent file.
62598f66711fe17d825dfddd
class Dataset(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=45) <NEW_LINE> file_name = models.FileField(upload_to='files/', blank=True, null=True) <NEW_LINE> date = models.DateTimeField(auto_now_add=True)
Creation DB Dataset
62598f664d74a7450cd58a51
class RefQualifierKind(BaseEnumeration): <NEW_LINE> <INDENT> _kinds = [] <NEW_LINE> _name_map = None <NEW_LINE> def from_param(self): <NEW_LINE> <INDENT> return self.value <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return 'RefQualifierKind.%s' % (self.name,)
Describes a specific ref-qualifier of a type.
62598f66a4f1c619b294dce6
class ErrorDetail(six.text_type): <NEW_LINE> <INDENT> code = None <NEW_LINE> def __new__(cls, string, code=None): <NEW_LINE> <INDENT> self = super(ErrorDetail, cls).__new__(cls, string) <NEW_LINE> self.code = code <NEW_LINE> return self <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> r = super(ErrorDet...
A string-like object that can additionally have a code.
62598f668c3a8732951f5c42
class CheckError(Exception): <NEW_LINE> <INDENT> pass
Raised when data integrity check failed.
62598f671d351010ab8f3235
class NUSimGatewaySecurity(NUSimResource): <NEW_LINE> <INDENT> __vspk_class__ = vsdk.NUGatewaySecurity <NEW_LINE> __unique_fields__ = ['externalID'] <NEW_LINE> __mandatory_fields__ = [] <NEW_LINE> __default_fields__ = { } <NEW_LINE> __get_parents__ = ['gateway', 'nsgateway'] <NEW_LINE> __create_parents__ = [] <NEW_LINE...
Represents a GatewaySecurity Notes: This object represents the gateway security object
62598f67d164cc617582066c
class Solution: <NEW_LINE> <INDENT> def findPeak(self, A): <NEW_LINE> <INDENT> if A == None or len(A) < 1: <NEW_LINE> <INDENT> return -1 <NEW_LINE> <DEDENT> start = 0 <NEW_LINE> end = len(A) - 1 <NEW_LINE> while start + 1 < end: <NEW_LINE> <INDENT> mid = start + (end - start)//2 <NEW_LINE> if A[mid] > A[mid - 1]: <NEW...
@param A: An integers array. @return: return any of peek positions.
62598f676e29344779affd4d
class LMHead(nn.Module): <NEW_LINE> <INDENT> def __init__(self, model, cfg): <NEW_LINE> <INDENT> super(LMHead, self).__init__() <NEW_LINE> self.n_embd = cfg.n_embd <NEW_LINE> embed_shape = model.embed.weight.shape <NEW_LINE> self.decoder = nn.Linear(embed_shape[1], embed_shape[0], bias=False) <NEW_LINE> self.decoder.we...
Language Model Head for the transformer
62598f670383005118f6cdfd
class User(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> GENDER_CHOICES = ( ('m', 'Male'), ('f', 'Female'), ('o', 'Other') ) <NEW_LINE> first_name = models.CharField(_('first name'), max_length=150, blank=True) <NEW_LINE> last_name = models.CharField(_('last name'), max_length=150, blank=True) <NEW_LINE> is_...
Custom User model handle signup using email
62598f6791af0d3eaad394fe
class DalRegisterer: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._dals = set() <NEW_LINE> <DEDENT> def register(self, dal): <NEW_LINE> <INDENT> self._dals.add(dal) <NEW_LINE> <DEDENT> def unregister(self, dal): <NEW_LINE> <INDENT> self._dals.remove(dal) <NEW_LINE> <DEDENT> def find_from_collection(...
Keep trace of the defined class::`umongo.Document` children. This is usefull to retrieve a document class from it name to avoid recursive referencing and tricky imports.
62598f67ac7a0e7691f71c07
class Resource(db.Model): <NEW_LINE> <INDENT> __tablename__ = "content" <NEW_LINE> id = db.Column(db.Integer(), primary_key=True) <NEW_LINE> domain_id = db.Column(db.Integer(), db.ForeignKey('domains.id')) <NEW_LINE> path = db.Column(db.String()) <NEW_LINE> created = db.Column(db.DateTime(...
Resource.path = "/path/to/resource?q=param"
62598f670a366e3fb87dc0b8
class ApiError(Exception): <NEW_LINE> <INDENT> pass
Base class for E-Commerce API errors.
62598f675166f23b2e242ad0
class CubySensor(Entity): <NEW_LINE> <INDENT> def __init__(self, c, device, sensor_name): <NEW_LINE> <INDENT> self._cuby = c <NEW_LINE> self._device_id = device['id'] <NEW_LINE> self._sensor_name = sensor_name <NEW_LINE> self._name = '{} {}'.format("CubyDev", sensor_name) <NEW_LINE> self._unique_id = 'cuby_sensor {}'.f...
Representation of a single sensor in a Cuby device.
62598f6715baa7234946167b
class FeatureCombiner(nn.Module): <NEW_LINE> <INDENT> def __init__(self, args): <NEW_LINE> <INDENT> super(FeatureCombiner, self).__init__() <NEW_LINE> self.alpha_1 = nn.Parameter(torch.FloatTensor(1).to(args.device)) <NEW_LINE> self.alpha_2 = nn.Parameter(torch.FloatTensor(1).to(args.device)) <NEW_LINE> self.alpha_b = ...
Using the number of ratings as a variable, combines the feature and the rating representations.
62598f674d74a7450cd58a53
class DemandEnvGen(UGen): <NEW_LINE> <INDENT> _ordered_input_names = collections.OrderedDict( [ ("level", None), ("duration", None), ("shape", 1), ("curve", 0), ("gate", 1), ("reset", 1), ("level_scale", 1), ("level_bias", 0), ("time_scale", 1), ("done_action", 0), ] ) <NEW_LINE> _valid_calculation_rates = (Calculation...
A demand rate envelope generator. :: >>> demand_env_gen = supriya.ugens.DemandEnvGen.ar( ... curve=0, ... done_action=0, ... duration=1, ... gate=1, ... level=1, ... level_bias=0, ... level_scale=1, ... reset=1, ... shape=1, ... time_...
62598f67796e427e5384de8a
class ShotgunFieldDelegate(ShotgunFieldDelegateGeneric): <NEW_LINE> <INDENT> def __init__( self, sg_entity_type, field_name, display_class, editor_class, view, bg_task_manager=None, ): <NEW_LINE> <INDENT> field_data_role = shotgun_model.ShotgunModel.SG_ASSOCIATED_FIELD_ROLE <NEW_LINE> super(ShotgunFieldDelegate, self)....
A delegate for a given type of Shotgun field. This delegate is designed to work with indexes from a ``ShotgunModel`` where the value of the field is stored in the ``SG_ASSOCIATED_FIELD_ROLE`` role.
62598f6791af0d3eaad39500
class patch_GAN(nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_nc, nf=64, n_layers=3, norm_layer=nn.BatchNorm2d): <NEW_LINE> <INDENT> super(patch_GAN, self).__init__() <NEW_LINE> if type(norm_layer) == functools.partial: <NEW_LINE> <INDENT> use_bias = norm_layer.func == nn.InstanceNorm2d <NEW_LINE> <DEDENT> else...
Defines a PatchGAN discriminator
62598f67d164cc6175820670
class StatesDepository(Database): <NEW_LINE> <INDENT> def __init__(self, label='', name='', shortDesc='', longDesc=''): <NEW_LINE> <INDENT> Database.__init__(self, label=label, name=name, shortDesc=shortDesc, longDesc=longDesc) <NEW_LINE> <DEDENT> def loadEntry(self, index, label, molecule, states, reference=None, refe...
A class for working with the RMG states (frequencies) depository.
62598f671d351010ab8f323a
class FilterDetections(keras.layers.Layer): <NEW_LINE> <INDENT> def __init__( self, nms = True, class_specific_filter = True, nms_threshold = 0.5, score_threshold = 0.05, max_detections = 100, parallel_iterations = 32, **kwargs ): <NEW_LINE> <INDENT> self.nms =...
Keras layer for filtering detections using score threshold and NMS.
62598f67a4f1c619b294dcec
class GridXmlFileNotFoundError(InaSAFEError): <NEW_LINE> <INDENT> suggestion = 'Please ask the developers of InaSAFE to add a suggestion.'
An exception for when an grid.xml could not be found
62598f67711fe17d825dfde3
class SR830GUI(AbstractMainApp, Window_trayService_ui): <NEW_LINE> <INDENT> sig_arbitrary = pyqtSignal() <NEW_LINE> sig_assertion = pyqtSignal(str) <NEW_LINE> def __init__( self, Lockin=None, identity=None, InstrumentAddress=None, prometheus_port=None, **kwargs, ): <NEW_LINE> <INDENT> self._identity = identity <NEW_LIN...
This is the SR830 GUI WIndow
62598f6738b623060ffa8794
class CSVReader: <NEW_LINE> <INDENT> def __init__(self, csvpath): <NEW_LINE> <INDENT> self.csvfile = open(csvpath,'r') <NEW_LINE> self.reader = csv.DictReader(self.csvfile, delimiter=',') <NEW_LINE> self.header = self.reader.__next__() <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <...
Iterate through the rows of the CSV file. The iterator returns a dictionary with the column names as keys. The values of the dictionary are strings, they may need to be casted.
62598f67d164cc6175820672
class MotionScannablePart(Scannable): <NEW_LINE> <INDENT> def __init__(self, scannableName, index, parentScannable, isInputField): <NEW_LINE> <INDENT> self.setName(scannableName) <NEW_LINE> if isInputField: <NEW_LINE> <INDENT> self.setInputNames([scannableName]) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.setExt...
A scannable to be placed in the parent's childrenDict that allows access to the parent's individual fields.
62598f6721bff66bcd722355
class DataSplitterBaseTask(UsesFeatures): <NEW_LINE> <INDENT> def requires(self): <NEW_LINE> <INDENT> return self.data_source <NEW_LINE> <DEDENT> def read_data(self): <NEW_LINE> <INDENT> with self.input().open() as f: <NEW_LINE> <INDENT> return pd.read_csv(f) <NEW_LINE> <DEDENT> <DEDENT> def split_data(self): <NEW_LINE...
Functionality to split train/test data, no run method.
62598f670383005118f6ce03
class AlertTable(DatasourceTable): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> proxy = True <NEW_LINE> <DEDENT> _query_class = 'AlertQuery' <NEW_LINE> TABLE_OPTIONS = {} <NEW_LINE> FIELD_OPTIONS = {'duration': '1d', 'durations': ('1m', '15m', '1h', '4h', '1d', '1w', '4w', '12w', 'All')} <NEW_LINE> def post_proc...
Query Alerts that have been stored in system.
62598f670a366e3fb87dc0bc
class Task(HighriseObject): <NEW_LINE> <INDENT> plural = 'tasks' <NEW_LINE> singular = 'task' <NEW_LINE> fields = { 'id': HighriseField(type='id'), 'recording_id': HighriseField(type=int), 'subject_id': HighriseField(type=int), 'subject_type': HighriseField(type=str, options=('Party')), 'category_id': HighriseField(typ...
An object representing a Highrise task.
62598f6773bcbd0ca4bc994c
class FitParamT(BaseEstimator): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.successful = False <NEW_LINE> <DEDENT> def fit(self, X, y, should_succeed=False): <NEW_LINE> <INDENT> self.successful = should_succeed <NEW_LINE> <DEDENT> def predict(self, X): <NEW_LINE> <INDENT> return self.successful <NE...
Mock classifier
62598f67a8ecb033258708fe
class RandomScheduler(Scheduler): <NEW_LINE> <INDENT> def schedule(self, parcels, trucks, verbose): <NEW_LINE> <INDENT> shuffle(trucks) <NEW_LINE> shuffle(parcels) <NEW_LINE> left_overs = parcels[:] <NEW_LINE> for parcel in parcels: <NEW_LINE> <INDENT> for truck in trucks: <NEW_LINE> <INDENT> if truck.check_volume(parc...
A random scheduler, this calss is dumb and sort stuff randomly
62598f67167d2b6e312b6677
class ParseResults: <NEW_LINE> <INDENT> def __init__(self, type, manifest = None, volume_number = None, time = None, start_time = None, end_time = None, encrypted = None, compressed = None, partial = False): <NEW_LINE> <INDENT> assert type in ["full-sig", "new-sig", "inc", "full"] <NEW_LINE> self.type = type <NEW_LINE>...
Hold information taken from a duplicity filename
62598f6763f4b57ef00858ec
class AudioEncodingValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> AUDIO_ENCODING_UNSPECIFIED = 0 <NEW_LINE> AUDIO_ENCODING_LINEAR_16 = 1 <NEW_LINE> AUDIO_ENCODING_FLAC = 2 <NEW_LINE> AUDIO_ENCODING_MULAW = 3 <NEW_LINE> AUDIO_ENCODING_AMR = 4 <NEW_LINE> AUDIO_ENCODING_AMR_WB = 5 <NEW_LINE> AUDIO_ENCODING_OGG_OPUS ...
Required. Audio encoding of the audio content to process. Values: AUDIO_ENCODING_UNSPECIFIED: Not specified. AUDIO_ENCODING_LINEAR_16: Uncompressed 16-bit signed little-endian samples (Linear PCM). AUDIO_ENCODING_FLAC: [`FLAC`](https://xiph.org/flac/documentation.html) (Free Lossless Audio Codec) is the ...
62598f67be8e80087fbbe755
class CourseResource(models.Model): <NEW_LINE> <INDENT> course = models.ForeignKey(Course,verbose_name=u'课程') <NEW_LINE> name = models.CharField(max_length=100,verbose_name=u"名称") <NEW_LINE> download = models.FileField(upload_to="course/resource/%Y/%m",verbose_name=u"资源文件",max_length=100) <NEW_LINE> add_time = models.D...
课程资源
62598f671f5feb6acb162333
class BaseObject(gui.QImage): <NEW_LINE> <INDENT> def __init__(self, x_position, y_position, width, height): <NEW_LINE> <INDENT> self.x_position = x_position <NEW_LINE> self.y_position = y_position <NEW_LINE> self.width = width <NEW_LINE> self.height = height <NEW_LINE> super().__init__(width, height, Settings.COLOR_FO...
Abstract class representing an object in the game.
62598f6730c21e258be97ef8
class InventoryItem: <NEW_LINE> <INDENT> def __init__(item, quantity): <NEW_LINE> <INDENT> self.item = item <NEW_LINE> self.quantity = quantity <NEW_LINE> <DEDENT> def add(i): <NEW_LINE> <INDENT> self.quantity += i <NEW_LINE> <DEDENT> def remove(i): <NEW_LINE> <INDENT> self.quantity -= i <NEW_LINE> <DEDENT> def setQuan...
The InventoryItem class provides item data for an entity's inventory
62598f67711fe17d825dfde5