code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class BooksSoldSerializer(serializers.Serializer): <NEW_LINE> <INDENT> book_id = serializers.IntegerField() <NEW_LINE> sold = serializers.IntegerField(min_value=1) | Serializer for selling book(s) API endpoint view. | 62598f82596a8972361276d8 |
class Flock(object): <NEW_LINE> <INDENT> def __init__(self, lock_filename): <NEW_LINE> <INDENT> self.lock_filename = lock_filename <NEW_LINE> self._lock = None <NEW_LINE> <DEDENT> def __del__(self): <NEW_LINE> <INDENT> if self._lock is not None: <NEW_LINE> <INDENT> self._lock.close() <NEW_LINE> self._lock = None <NEW_L... | Use flock for locking file. | 62598f8230c21e258be9826f |
class FailedAuthBox(Toplevel): <NEW_LINE> <INDENT> def __init__(self, master, box): <NEW_LINE> <INDENT> Toplevel.__init__(self, master, class_="CheckMails") <NEW_LINE> self.title(_("Error")) <NEW_LINE> self.columnconfigure(1, weight=1) <NEW_LINE> self.rowconfigure(0, weight=1) <NEW_LINE> self.im_error = PhotoImage(mast... | Message box to ask what to do in case of authentication failure. | 62598f8223849d37ff850b24 |
class Experiment050(object): <NEW_LINE> <INDENT> def __init__(p): <NEW_LINE> <INDENT> p.name = 'e050' <NEW_LINE> p.num_images = None <NEW_LINE> p.train_pct = 80 <NEW_LINE> p.valid_pct = 15 <NEW_LINE> p.test_pct = 5 <NEW_LINE> p.num_submission_images = None <NEW_LINE> p.batch_size = 256 <NEW_LINE> p.epochs = 10000 <NEW_... | comments:
(1) prelu!
otherwise the same as e048:
(0) new ema inference statistics for batch normalization layer
(1) light dropout
(2) light l2 regularization
(3) large batches (to increase sample size)
(4) 0.4 learning rate
results:
looks slightly worse than relu. BUT, I just noticed that they say
not to use weight ... | 62598f827b25080760ed6f0c |
class DescribeTasksResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TotalCount = None <NEW_LINE> self.TaskInfos = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.TotalCount = params.get("TotalCount") <NEW_LINE> i... | DescribeTasks response structure.
| 62598f8250485f2cf55da9d9 |
class ListHost(lister.Lister): <NEW_LINE> <INDENT> log = logging.getLogger(__name__ + ".ListHost") <NEW_LINE> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(ListHost, self).get_parser(prog_name) <NEW_LINE> parser.add_argument( "--zone", metavar="<zone>", help="Only return hosts in the availability ... | List host command | 62598f825f7d997b871f910b |
class MockedModel(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.initial_condition = {} <NEW_LINE> <DEDENT> def add_reactions(self, reaction_list): <NEW_LINE> <INDENT> self.reactions = reaction_list <NEW_LINE> <DEDENT> def get_reactions(self): <NEW_LINE> <INDENT> return self.reactions <NEW_LI... | This class acts as a fake Model instance- it only needs
the get_reactions method.
We add reactions to it as necessary via the add_reactions method.
That method is not available on the original Model instance, and it's merely
for convenience here. | 62598f8245492302aabfbf45 |
class main_negotiator(threading.Thread): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> grasp.tprint("Ready to negotiate", obj1.name, "as listener, unless pool is empty") <NEW_LINE> while True: <NEW_LINE> <INDENT> if len... | Main negotiator | 62598f8276d4e153a661c67a |
class userProfileSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta(): <NEW_LINE> <INDENT> fields = ('id', 'email','name','password') <NEW_LINE> model = models.UserProfile <NEW_LINE> extra_kwargs = {'password':{'write_only':True}} <NEW_LINE> <DEDENT> def create(self, validated_data): <NEW_LINE> <IN... | a serializer to | 62598f82ec188e330fdf8306 |
class RouterFlavor(models_v2.model_base.BASEV2): <NEW_LINE> <INDENT> flavor = Column(String(255)) <NEW_LINE> router_id = sa.Column(sa.String(36), sa.ForeignKey('routers.id', ondelete="CASCADE"), primary_key=True) <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return "<RouterFlavor(%s,%s)>" % (self.flavor, self.rout... | Represents a binding of router_id to flavor. | 62598f8226238365f5fac5d6 |
class SimpleHandler(IOHandler): <NEW_LINE> <INDENT> def __init__(self, workdir=None, data_type=None, mode=MODE.NONE): <NEW_LINE> <INDENT> IOHandler.__init__(self, workdir=workdir, mode=mode) <NEW_LINE> if data_type not in LITERAL_DATA_TYPES: <NEW_LINE> <INDENT> raise ValueError('data_type {} not in {}'.format(data_type... | Data handler for Literal In- and Outputs
>>> class Int_type(object):
... @staticmethod
... def convert(value): return int(value)
>>>
>>> class MyValidator(object):
... @staticmethod
... def validate(inpt): return 0 < inpt.data < 3
>>>
>>> inpt = SimpleHandler(data_type = Int_type)
>>> inpt.validator = ... | 62598f82596a8972361276d9 |
class HeNe(GaussianBeam): <NEW_LINE> <INDENT> def __init__(self, waistDiameter, power=None): <NEW_LINE> <INDENT> super(HeNe, self).__init__(waistDiameter, 632.8e-6, power) | Helium-Neon (HeNe) Laser | 62598f82e64d504609df90e4 |
class ForeignTableGetTestCase(BaseTestGenerator): <NEW_LINE> <INDENT> scenarios = [ ('Check foreign table Node', dict(url='/browser/foreign_table/obj/')) ] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.schema_data = parent_node_dict['schema'][-1] <NEW_LINE> self.server_id = self.schema_data['server_id'] <NEW_LIN... | This class will fetch foreign table under database node. | 62598f82d10714528d69d937 |
class _cx(object): <NEW_LINE> <INDENT> pass | OpenCV namespace for functions/types/constants with any "cv"/"cv_"
prefix removed. Symbols not starting with cv/cv_ retain their full name.
A leading underscore is retained in the following cases:
- Structures/Data types (CvXxx). E.g., cx._Mat is the CvMat structure
and cx.Mat is the cvMat constructor
- Names for ... | 62598f824e696a045264db35 |
class Operation(wx.Panel): <NEW_LINE> <INDENT> def __init__(self, params={}): <NEW_LINE> <INDENT> self.params = { 'applyPathOnly': False, 'applyName': True, 'applyExtension': False, 'displayName' : None, } <NEW_LINE> self.update_parameters(params) <NEW_LINE> <DEDENT> def update_parameters(self, params): <NEW_LINE> <IND... | "
Base class for all operations.
TODO - a lot ! | 62598f82596a8972361276da |
class VaultAppRoleAuthTest(TestCase, LoaderModuleMockMixin): <NEW_LINE> <INDENT> def setup_loader_modules(self): <NEW_LINE> <INDENT> return { vault: { '__opts__': { 'vault': { 'url': "http://127.0.0.1", "auth": { 'method': 'approle', 'role_id': 'role', 'secret_id': 'secret' } } } } } <NEW_LINE> <DEDENT> @patch('salt.ru... | Tests for the runner module of the Vault with approle setup | 62598f82507cdc57c63a47f5 |
class Generator(nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.conv1 = nn.Conv2d(3, 64, kernel_size=9, stride=1, padding=4, bias=False) <NEW_LINE> self.res_blocks = make_block(BasicBlock, 256, 256, 5, stride=1) <NEW_LINE> self.conv2 = nn.Conv2d(256, 256, kerne... | The generator network for generate SR Images | 62598f827c178a314d78cf13 |
class FillNaNWithMedianValues(object): <NEW_LINE> <INDENT> def __init__(self, poi, features): <NEW_LINE> <INDENT> self._poi = poi <NEW_LINE> self._non_poi = ~poi <NEW_LINE> self._features = features <NEW_LINE> <DEDENT> def __call__(self, series): <NEW_LINE> <INDENT> if series.name in self._features: <NEW_LINE> <INDENT>... | Objects of this class may be used as argument of pandas DataFrame.apply.
This function replace NaN values with median values of the relevant group (poi / non-poi). | 62598f8207d97122c421670b |
class Equipment(ComparingObject): <NEW_LINE> <INDENT> def __init__(self, type=None, description=None, manufacturer=None, vendor=None, model=None, serial_number=None, installation_date=None, removal_date=None, calibration_dates=None, resource_id=None): <NEW_LINE> <INDENT> self.type = type <NEW_LINE> self.description = d... | An object containing a detailed description of an equipment. | 62598f8207f4c71912baeeac |
class A2C(nn.Module): <NEW_LINE> <INDENT> def __init__(self, beta, v_fn): <NEW_LINE> <INDENT> super(A2C, self).__init__() <NEW_LINE> self.beta = beta <NEW_LINE> self.v_fn = v_fn <NEW_LINE> self.name = "A2C" <NEW_LINE> <DEDENT> def select_action(self, x): <NEW_LINE> <INDENT> return self.beta.select_action(x) <NEW_LINE> ... | Basic Monte Carlo Policy Gradient. This implementation is single-threaded only, and uses
the score function estimator to find the policy gradient. We use importance sampling to
take multiple update steps at the end of each trajectory. This is necessary to correct
for the fact that the value function was estimated under... | 62598f82a4f1c619b294e055 |
class ScalarProperty(Property): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> for _s in [Property]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, ScalarProperty, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE... | Proxy of C++ osgVolume::ScalarProperty class | 62598f829b70327d1c57e807 |
class CNAValidator(GenewiseFileValidator): <NEW_LINE> <INDENT> ALLOWED_VALUES = ['-2', '-1.5', '-1', '0', '1', '2'] + GenewiseFileValidator.NULL_VALUES <NEW_LINE> def checkValue(self, value, col_index): <NEW_LINE> <INDENT> if value.strip() not in self.ALLOWED_VALUES: <NEW_LINE> <INDENT> if self.logger.isEnabledFor(logg... | Sub-class CNA validator. | 62598f82711fe17d825e0151 |
class Projectile: <NEW_LINE> <INDENT> def __init__(self, angle, velocity, yinit): <NEW_LINE> <INDENT> self.xpos = 0 <NEW_LINE> self.ypos = yinit <NEW_LINE> theta = radians(angle) <NEW_LINE> self.xvel = velocity * cos(theta) <NEW_LINE> self.yvel = velocity * sin(theta) <NEW_LINE> <DEDENT> def update(self, time): <NEW_LI... | Simulates the flight of simple projectiles near the earth's
surface, ignoring wind resistance. Tracking is done in two
dimensions, height (y) and distance (x). | 62598f820a366e3fb87dc435 |
class WoodsStyle(Style): <NEW_LINE> <INDENT> default_style = '' <NEW_LINE> styles = { Whitespace: '#bbbbbb', Comment: '#2149B1', Comment.Preproc: 'bold noitalic #000000', Comment.Special: 'bold #000000', Operator: 'bold #A2590E', String: '#000000', ... | Port of the default trac highlighter design. | 62598f8230c21e258be98272 |
class DESDwarfs(EmpiricalPadova): <NEW_LINE> <INDENT> _params = odict([ ('distance_modulus', Parameter(15.0, [10.0, 30.0]) ), ('age', Parameter(12.5, [12.5, 12.5]) ), ('metallicity', Parameter(1e-4, [1e-4,1e-4]) ), ]) <NEW_LINE> _prefix = 'dsph' <NEW_LINE> _basename = '%(prefix)s_a12.5_z0.00010.dat' | Empirical isochrone derived from spectroscopic members of the
DES dwarfs. | 62598f82c432627299fa2a37 |
class RandomView(AllView): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> return Alias.objects.get_random() | Display a set of random aliases
| 62598f828a349b6b43685cad |
class StdTest(integration.ModuleCase): <NEW_LINE> <INDENT> def test_cli(self): <NEW_LINE> <INDENT> cmd_iter = self.client.cmd_cli( 'minion', 'test.ping', ) <NEW_LINE> for ret in cmd_iter: <NEW_LINE> <INDENT> self.assertTrue(ret['minion']) <NEW_LINE> <DEDENT> cmd_iter = self.client.cmd_cli( 'minion', 'test.sleep', [6] )... | Test standard client calls | 62598f82004d5f362081ed2f |
class And: <NEW_LINE> <INDENT> def __init__(self, exprs): <NEW_LINE> <INDENT> self.exprs = exprs <NEW_LINE> <DEDENT> def loss(self, t): <NEW_LINE> <INDENT> losses = torch.stack([exp.loss(t) for exp in self.exprs]) <NEW_LINE> return soft_maximum(losses, 0) <NEW_LINE> <DEDENT> def satisfy(self, t): <NEW_LINE> <INDENT> sa... | E_1 and E_2 and ... E_k | 62598f82d99f1b3c44d05116 |
class KronosServerTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.http_client = Client(application, BaseResponse) <NEW_LINE> self.get_path = '%s/get' % EVENT_BASE_PATH <NEW_LINE> self.put_path = '%s/put' % EVENT_BASE_PATH <NEW_LINE> self.delete_path = '%s/delete' % EVENT_BASE_... | Wrapper `TestCase` class which be used by all server tests because it
provides a clean API to Kronos and performs all necessary clean up logic. | 62598f8238b623060ffa8aff |
class ConstraintError(TypeError): <NEW_LINE> <INDENT> def __init__(self, attributeObj, requiredTypes, providedValue): <NEW_LINE> <INDENT> self.attributeObj = attributeObj <NEW_LINE> self.requiredTypes = requiredTypes <NEW_LINE> self.providedValue = providedValue <NEW_LINE> TypeError.__init__(self, "attribute [%s.%s = %... | A type constraint was violated.
| 62598f828a43f66fc4bf1bea |
class PrintPageEventHandler(MulticastDelegate, ICloneable, ISerializable): <NEW_LINE> <INDENT> def BeginInvoke(self, sender, e, callback, object): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def CombineImpl(self, *args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def DynamicInvokeImpl(self, *args): <NEW_LINE> <INDEN... | Represents the method that will handle the System.Drawing.Printing.PrintDocument.PrintPage event of a System.Drawing.Printing.PrintDocument.
PrintPageEventHandler(object: object, method: IntPtr) | 62598f821d351010ab8f35a6 |
class CellDisplayWidget(QLabel): <NEW_LINE> <INDENT> def __init__(self, value, position=None, size=16, palette=None, **kwargs): <NEW_LINE> <INDENT> super(CellDisplayWidget, self).__init__(**kwargs) <NEW_LINE> self.setFixedSize(size, size) <NEW_LINE> self.setPixmap(self.__pixmap_for_value(value)) <NEW_LINE> self.positio... | A little Widget that displays a cell in a neighbourhood. | 62598f8245492302aabfbf47 |
@method_decorator(login_required, name='dispatch') <NEW_LINE> class DeletePhotoView(SuccessMessageMixin, View): <NEW_LINE> <INDENT> model = Photo <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> photo = self.model.objects.get( pk=kwargs['pk'], user=request.user) <NEW_LINE... | View class for deleting a photo | 62598f826fece00bbaccb3f1 |
class MockDocker(object): <NEW_LINE> <INDENT> def do_build(self, build): <NEW_LINE> <INDENT> return (x for x in ['line1', 'line2']) | Expose the do_build but just return junk output | 62598f8230dc7b766599f2c2 |
class concept(_concept): <NEW_LINE> <INDENT> short_name = models.CharField(max_length=100,blank=True) <NEW_LINE> version = models.CharField(max_length=20,blank=True) <NEW_LINE> synonyms = models.CharField(max_length=200, blank=True) <NEW_LINE> references = RichTextField(blank=True) <NEW_LINE> origin_URI = models.URLFie... | This is an abstract class that all items that should behave like a 11179 Concept
**must inherit from**. This model includes the definitions for many long and optional text
fields and the self-referential ``superseded_by`` field. It is not possible to include this
model in a ``ForeignKey`` or ``ManyToManyField``. | 62598f8294891a1f408b9423 |
class Base(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.host = "www.mercadobitcoin.net" <NEW_LINE> <DEDENT> def get_api(self, action): <NEW_LINE> <INDENT> response = requests.get("https://%s/api/%s/" % (self.host, action)) <NEW_LINE> return response.json() | Base API Class | 62598f82596a8972361276db |
class RepositoryFile(object): <NEW_LINE> <INDENT> def __init__(self, f, metadata=None): <NEW_LINE> <INDENT> self._f = f <NEW_LINE> if metadata is not None: <NEW_LINE> <INDENT> self.metadata = metadata <NEW_LINE> <DEDENT> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> return getattr(self._f, name) <NEW_LINE> ... | File object wrapper that has a metadata attraibute | 62598f8226068e7796d4c3c5 |
class StorageGroup(object): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> path = os.path.abspath(path) <NEW_LINE> self.path = path <NEW_LINE> <DEDENT> def resolve_path(self, *paths): <NEW_LINE> <INDENT> return os.path.abspath( os.path.join(self.path, *(str(s) for s in paths))) <NEW_LINE> <DEDENT> de... | Group of experiment storage directories.
A storage group is a loose collection of experiment storage under
the same parent directory. Such directory structure is not required,
but might be a most natural way to store the different trials of
one experiment (of the same script).
Parameters
----------
path : str
Pa... | 62598f82f7d966606f747a51 |
class Sage(): <NEW_LINE> <INDENT> def __init__(self, static_config): <NEW_LINE> <INDENT> self.static_config = static_config <NEW_LINE> self.stock_data_df = None <NEW_LINE> self.x_matrix = None <NEW_LINE> self.y_daily_return = None <NEW_LINE> self._load_stock_data2df() <NEW_LINE> self._preprocess_df_data() <NEW_LINE> <D... | 保守策略:预测当日最低价 | 62598f8263d6d428bbee2222 |
class KVStoreServer(object): <NEW_LINE> <INDENT> def __init__(self, kvstore): <NEW_LINE> <INDENT> self.kvstore = kvstore <NEW_LINE> self.handle = kvstore.handle <NEW_LINE> self.init_logginig = False <NEW_LINE> <DEDENT> def _controller(self): <NEW_LINE> <INDENT> def server_controller(cmd_id, cmd_body, _): <NEW_LINE> <IN... | The key-value store server. | 62598f8273bcbd0ca4bc9cbb |
class Public(email.Email, databases.Databases, common.Common): <NEW_LINE> <INDENT> SECRET_KEY = values.SecretValue() <NEW_LINE> CSRF_COOKIE_HTTPONLY = True <NEW_LINE> SECURE_BROWSER_XSS_FILTER = True <NEW_LINE> SECURE_CONTENT_TYPE_NOSNIFF = True <NEW_LINE> X_FRAME_OPTIONS = 'DENY' <NEW_LINE> SILENCED_SYSTEM_CHECKS = va... | General settings for public projects. | 62598f8263b5f9789fe84bdb |
class Tunnelzone(extensions.ExtensionDescriptor): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_name(cls): <NEW_LINE> <INDENT> return "Tunnelzone" <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_alias(cls): <NEW_LINE> <INDENT> return 'tunnelzone' <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_description... | Extension class supporing tunnel zone. | 62598f82fbf16365ca793b13 |
@dataclass <NEW_LINE> class SelectEntityDescription(EntityDescription): <NEW_LINE> <INDENT> pass | A class that describes select entities. | 62598f8221bff66bcd7226d4 |
class ModelMPAddress(ModelAddressBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> ModelAddressBase.__init__(self) <NEW_LINE> <DEDENT> def is_constituency_postal_address(self): <NEW_LINE> <INDENT> return self.type == 'Constituency' and ((self.address_2 != '' and self.address_2 is not None) or (self.pos... | Model for an Address for a MP. | 62598f827b25080760ed6f10 |
class BaseTextViewBlock(CursesControl): <NEW_LINE> <INDENT> def __init__(self, window, y, x, filename, text, label, width, height): <NEW_LINE> <INDENT> import textwrap <NEW_LINE> CursesControl.__init__(self) <NEW_LINE> self.window = window <NEW_LINE> self.y = y <NEW_LINE> self.x = x <NEW_LINE> self.label = ' ' + label ... | TextViewBlock reads a file and displays the contents in a scroll-able block. | 62598f82711fe17d825e0153 |
class Multiplication(Exercise): <NEW_LINE> <INDENT> _operator = "x" <NEW_LINE> _operator_method = "__mul__" | A class for generating multiplication exercises | 62598f8282261d6c5272fc09 |
class MainWindow(QMainWindow): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.stackedLayout = QStackedLayout() <NEW_LINE> self.create_initial_layout() <NEW_LINE> self.stackedLayout.addWidget(self.initial_layout_widget) <NEW_LINE> self.central_widget = QWidget() <NEW_LINE>... | simple example using QtSql | 62598f82b5575c28eb7129fc |
class GitbucketIssueResult(NamedTuple): <NEW_LINE> <INDENT> issueSummaries: List[dict] <NEW_LINE> comments: List[GitbucketComment] <NEW_LINE> labels: List[dict] | All Issues, comments and labels fro the repositories to be fetched.
| 62598f82004d5f362081ed30 |
class Herbivore(Creature): <NEW_LINE> <INDENT> DIET = 'H' <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(Herbivore, self).__init__(*args, **kwargs) <NEW_LINE> self.eaten = False <NEW_LINE> <DEDENT> def _death_control(self): <NEW_LINE> <INDENT> if self.eaten: <NEW_LINE> <INDENT> self.death(cau... | class of herbivores | 62598f828a43f66fc4bf1bec |
class TestBaseNotificationDataProvider(TestCase): <NEW_LINE> <INDENT> shard = 4 <NEW_LINE> def test_cannot_create_instance(self): <NEW_LINE> <INDENT> with self.assertRaises(TypeError): <NEW_LINE> <INDENT> super(BadImplementationAbstractEnrollmentReportProvider, self) <NEW_LINE> <DEDENT> <DEDENT> def test_get_provider(s... | Cover the EnrollmentReportProvider class | 62598f82d10714528d69d93a |
class ThreadedPrefetchOneIterator(Iterator[T_co]): <NEW_LINE> <INDENT> def __init__(self, iterable): <NEW_LINE> <INDENT> self.__iter = iter(iterable) <NEW_LINE> self.__next = None <NEW_LINE> self.__stop_iteration = False <NEW_LINE> self.__thread: Thread = None <NEW_LINE> self.__prefetch() <NEW_LINE> <DEDENT> def __pref... | Prefetch one record via multithreading. | 62598f82b57a9660fecd14e8 |
class ExactCover(object): <NEW_LINE> <INDENT> def __init__(self, sets): <NEW_LINE> <INDENT> self.sets = sets.copy() <NEW_LINE> universe = set() <NEW_LINE> for (key, value) in sets.iteritems(): <NEW_LINE> <INDENT> universe.update(value) <NEW_LINE> <DEDENT> self.universe = universe <NEW_LINE> self.num_cols = len(universe... | Class representing the Exact Cover problem.
Given a collection S of subsets of the set X, does there exist a
subcollection S' such that every element of X is contained in exactly one
member of S'? | 62598f823c8af77a43b67c69 |
class RenewPropertiesResponseBillingCurrencyTotal(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'currency_code': {'key': 'currencyCode', 'type': 'str'}, 'amount': {'key': 'amount', 'type': 'float'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(RenewPropertiesResponseBilli... | Currency and amount that customer will be charged in customer's local currency for renewal purchase. Tax is not included.
:param currency_code:
:type currency_code: str
:param amount:
:type amount: float | 62598f826aa9bd52df0d4947 |
class TodoSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Todo <NEW_LINE> fields = ['id', 'title', 'description', 'created_date', 'deadline_date'] | Serializer for Todo Model | 62598f824e696a045264db37 |
class ClassList(models.Model): <NEW_LINE> <INDENT> branch = models.ForeignKey("Branch",verbose_name="校区") <NEW_LINE> course = models.ForeignKey("Course",verbose_name=u"课程") <NEW_LINE> semester = models.IntegerField(u"学期") <NEW_LINE> price = models.IntegerField(u"学费", default=10000) <NEW_LINE> start_date = models.DateFi... | 存储班级信息 | 62598f8263d6d428bbee2224 |
class Application(tk.Frame): <NEW_LINE> <INDENT> def __init__(self, master=None): <NEW_LINE> <INDENT> super().__init__(master) <NEW_LINE> self.master = master <NEW_LINE> self.pack() <NEW_LINE> self.createWidget() <NEW_LINE> <DEDENT> def createWidget(self): <NEW_LINE> <INDENT> global photo <NEW_LINE> photo = tk.PhotoIma... | 一个经典的GUI程序的类的写法 | 62598f82fbf16365ca793b15 |
@dataclass <NEW_LINE> class BodyStructure(DomainResource): <NEW_LINE> <INDENT> resource_type: ClassVar[str] = "BodyStructure" <NEW_LINE> identifier: Optional[List[Identifier]] = None <NEW_LINE> active: Optional[bool] = None <NEW_LINE> morphology: Optional[CodeableConcept] = None <NEW_LINE> location: Optional[CodeableCo... | Specific and identified anatomical structure.
Record details about an anatomical structure. This resource may be used
when a coded concept does not provide the necessary detail needed for the
use case. | 62598f8273bcbd0ca4bc9cbd |
class TLSChangeCipherSpec(_GenericTLSSessionInheritance): <NEW_LINE> <INDENT> name = "TLS ChangeCipherSpec" <NEW_LINE> fields_desc = [ByteEnumField("msgtype", 1, _tls_changecipherspec_type)] <NEW_LINE> def post_dissection_tls_session_update(self, msg_str): <NEW_LINE> <INDENT> self.tls_session.triggered_prcs_commit = Tr... | Note that, as they are not handshake messages, the ccs messages do not get
appended to the list of messages whose integrity gets verified through the
Finished messages. | 62598f82e76e3b2f99fd84a1 |
class thresholdContext(_object): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, thresholdContext, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, thresholdContext, name) <NEW_LINE> __rep... | Proxy of C++ thresholdContext class | 62598f8210dbd63aa1c7061e |
class LocalFetcher(Fetcher): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(LocalFetcher, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def fetch(self, import_spec): <NEW_LINE> <INDENT> source = import_spec['from'] <NEW_LINE> if not path.isabs(source): <NEW_LINE> <INDENT> sourc... | Fetcher for files and directory trees on the local machine.
:param sceptre_dir: The absolute path to the Sceptre directory.
:type argument: str
:param shared_template_dir: The absolute path to the Sceptre
shared template directory.
:type argument: str | 62598f8216aa5153ce3fff6d |
class ComputeProjectsSetUsageExportCloudStorageBucketRequest(messages.Message): <NEW_LINE> <INDENT> project = messages.StringField(1, required=True) <NEW_LINE> usageExportLocation = messages.MessageField('UsageExportLocation', 2) | A ComputeProjectsSetUsageExportCloudStorageBucketRequest object.
Fields:
project: Project ID for this request.
usageExportLocation: A UsageExportLocation resource to be passed as the
request body. | 62598f8221a7993f00c659de |
class GetCommentsInputSet(InputSet): <NEW_LINE> <INDENT> def set_AccessToken(self, value): <NEW_LINE> <INDENT> super(GetCommentsInputSet, self)._set_input('AccessToken', value) <NEW_LINE> <DEDENT> def set_AsUser(self, value): <NEW_LINE> <INDENT> super(GetCommentsInputSet, self)._set_input('AsUser', value) <NEW_LINE> <D... | An InputSet with methods appropriate for specifying the inputs to the GetComments
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 62598f8266673b3332c2fe32 |
class VT_STREAM(VT_BSTR): <NEW_LINE> <INDENT> pass | Typed value :const:`~lf.win.ole.varenum.VT_STREAM`. | 62598f8291af0d3eaad39868 |
class LinkedStack: <NEW_LINE> <INDENT> class _Node: <NEW_LINE> <INDENT> __slots__ = '_element', '_next' <NEW_LINE> def __init__(self, element, next_element): <NEW_LINE> <INDENT> self._element = element <NEW_LINE> self._next = next_element <NEW_LINE> <DEDENT> <DEDENT> def __init__(self): <NEW_LINE> <INDENT> self._head =... | LIFO Stack implementation using linked lists for storage | 62598f82baa26c4b54d4ed1f |
class Bulkhost(InfobloxObject): <NEW_LINE> <INDENT> _infoblox_type = 'bulkhost' <NEW_LINE> _fields = ['cloud_info', 'comment', 'disable', 'dns_prefix', 'end_addr', 'extattrs', 'last_queried', 'name_template', 'network_view', 'policy', 'prefix', 'reverse', 'start_addr', 'template_format', 'ttl', 'use_name_template', 'us... | Bulkhost: Bulkhost object.
Corresponds to WAPI object 'bulkhost'
If you need to add a large number of hosts, you can have the
Infoblox appliance add them as a group and automatically assign host
names based on a range of IP addresses and name format applied to
it. This group of hosts is referred to as a BulkHost. The ... | 62598f8250485f2cf55da9df |
class Anmeldeformular(SignupForm): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(Anmeldeformular, self).__init__(*args, **kwargs) <NEW_LINE> del self.fields['username'] <NEW_LINE> del self.fields['password1'] <NEW_LINE> del self.fields['password2'] <NEW_LINE> <DEDENT> def save(self)... | Kopiert aus SigninForm aus userena.forms, angepasst teils nach der Idee
wie in SigninFormOnlyEmail gemacht
Habe die Länge und Erzeugungsart des autogenerierten Namens verlängert. | 62598f82004d5f362081ed31 |
class Simulator: <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def go(self, duration: float): <NEW_LINE> <INDENT> pass | This abstract class defines interfaces for a Virtual Time Simulator. | 62598f82bde94217f370739c |
class TestSCMSingleLine(Base): <NEW_LINE> <INDENT> expected_title = "git.receive" <NEW_LINE> expected_subti = 'spot pushed to ember (master). ' + '"another missing patch? ridiculous."' <NEW_LINE> expected_link = "http://pkgs.fedoraproject.org/cgit/" + "ember.git/commit/" + "?h=master&id=aa2df80f3d... | Messages like this one are published when somebody runs "fedpkg push"
on a package. The whole git message is included for each commit. | 62598f8215baa723494619eb |
class TestAllComponentsPresent(Test): <NEW_LINE> <INDENT> def test(self, result): <NEW_LINE> <INDENT> if 'heimdall' not in result['which']: <NEW_LINE> <INDENT> self.alert_func("%s/BUG: 'heimdall' component is missing from result!" % self.__class__) <NEW_LINE> return False <NEW_LINE> <DEDENT> proceed = True <NEW_LINE> f... | Test that all the components (heimdall, horton, tribble) are detected.
If this test trips, one of them may be disconnected from the system! | 62598f82b5575c28eb7129fd |
class SubsetUpdateMessage(SubsetMessage): <NEW_LINE> <INDENT> def __init__(self, sender, attribute=None, tag=None): <NEW_LINE> <INDENT> SubsetMessage.__init__(self, sender, tag=tag) <NEW_LINE> self.attribute = attribute <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> result = super(SubsetUpdateMessage, self)... | A message that a subset issues when its state changes
Attributes
-----------
attribute : string
An optional label of what attribute has changed | 62598f828a43f66fc4bf1bee |
@TokenIndexer.register("bert-indexer-kk") <NEW_LINE> class PretrainedBertIndexer(WordpieceIndexer): <NEW_LINE> <INDENT> def __init__(self, pretrained_model: str, do_lowercase: bool = True, max_pieces: int = 512, doc_stride: int = 125) -> None: <NEW_LINE> <INDENT> bert_tokenizer = BertTokenizer.from_pretrained(pretraine... | A ``TokenIndexer`` corresponding to a pretrained BERT model.
Parameters
----------
pretrained_model: ``str``, optional (default = None)
Either the name of the pretrained model to use (e.g. 'bert-base-uncased'),
or the path to the .txt file with its vocabulary.
If the name is a key in the list of pretraine... | 62598f8273bcbd0ca4bc9cbe |
class LibraryItemGenerator: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def generate_test_items(): <NEW_LINE> <INDENT> book = Book <NEW_LINE> dvd = DVD <NEW_LINE> journal = Journal <NEW_LINE> dummy_item_list = [ book("100.200.300", "Harry Potter 1", 2, "J K Rowling"), book("999.224.854", "Harry Potter 2", 5, "J K Rowl... | LibraryItemGenerator generates dummy data for the Library. | 62598f8223e79379d538bf67 |
class ClosedError(Exception): <NEW_LINE> <INDENT> pass | Action performed on an unbound instance.
This exception is thrown when a call is made to an instance which has been
unbound.
If you wish to reconnect to the server, you must use a new instance. | 62598f824e696a045264db38 |
class CompileHtml(PageCompiler): <NEW_LINE> <INDENT> name = "html" <NEW_LINE> def compile_html(self, source, dest): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> os.makedirs(os.path.dirname(dest)) <NEW_LINE> <DEDENT> except Exception: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> shutil.copyfile(source, dest) <NEW_LINE> ... | Compile HTML into HTML. | 62598f82e64d504609df90e7 |
class Neighbour(models.Model): <NEW_LINE> <INDENT> household1 = models.ForeignKey("Household", related_name='household1') <NEW_LINE> household2 = models.ForeignKey("Household", related_name='household2') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> unique_together = (('household1', 'household2'),) | This is a relation that connects two households to form a
neighbour, household1 and household2. (household1, household2) are
unique together by adding the proper database constraint.
This relation defines a ManyToMany constraint between Household
entities.
Later extra fields can be added to a "Neighbour" relation. | 62598f82be383301e0253268 |
class SnippetUpdate(generics.UpdateAPIView): <NEW_LINE> <INDENT> model = Snippet <NEW_LINE> serializer_class = SnippetSerializer | RESTful update for Snippet Model | 62598f8271ff763f4b5e71db |
class VideoBlock(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=128) <NEW_LINE> description = models.TextField(help_text='Field for comments.') <NEW_LINE> title = models.CharField(max_length=128) <NEW_LINE> sub_title = models.CharField(max_length=128) <NEW_LINE> summary = models.CharField(max_len... | VideoBlock contains in itself the settings of this unit,
it is also part of the Page | 62598f8207f4c71912baeeb2 |
class MattMapApp(TethysAppBase): <NEW_LINE> <INDENT> name = 'Matt Map App' <NEW_LINE> index = 'matt_map_app:home' <NEW_LINE> icon = 'matt_map_app/images/icon.gif' <NEW_LINE> package = 'matt_map_app' <NEW_LINE> root_url = 'matt-map-app' <NEW_LINE> color = '#27ae60' <NEW_LINE> description = 'Place a brief description of ... | Tethys app class for Matt Map App. | 62598f8296565a6dacd2ccaf |
class FileIterator(object): <NEW_LINE> <INDENT> def __init__(self, file, chunksize=4194304): <NEW_LINE> <INDENT> self.fileobj = file <NEW_LINE> self.chunksize = chunksize <NEW_LINE> self._md5 = hashlib.md5() <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def next(self): <NEW... | FileIterator
| 62598f82379a373c97d98a80 |
class ProtocolError(RuntimeError): <NEW_LINE> <INDENT> pass | Exception raised when a network protocol violation is encountered in some way. | 62598f82d4950a0f3b110b6c |
class ArConfigSection: <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, ArConfigSection, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, ArConfigSection, name) <NEW_LINE> __repr__ = _swig_... | Proxy of C++ ArConfigSection class | 62598f828a349b6b43685cb3 |
class Ethtool(): <NEW_LINE> <INDENT> def __init__(self, interface, *args, **kwargs): <NEW_LINE> <INDENT> self.interface = interface <NEW_LINE> <DEDENT> def _parse_ethtool_output(self): <NEW_LINE> <INDENT> output = subprocess.getoutput('ethtool {}'.format(self.interface)) <NEW_LINE> fields = {} <NEW_LINE> field = '' <NE... | This class aims to parse ethtool output
There is several bindings to have something proper, but it requires
compilation and other requirements. | 62598f8215baa723494619ed |
class SingleNode(object): <NEW_LINE> <INDENT> def __init__(self, item): <NEW_LINE> <INDENT> self.item = item <NEW_LINE> self.next = None | The node of single link list | 62598f8215fb5d323ce7e79a |
class Order(models.Model): <NEW_LINE> <INDENT> class Status(models.TextChoices): <NEW_LINE> <INDENT> PLACED = "Pl", "Placed" <NEW_LINE> PROCESSED = "Pr", "Processed" <NEW_LINE> PACKED = "Pk", "Packed" <NEW_LINE> SHIPPED = "Sh", "Shipped" <NEW_LINE> DELIVERED = "Dl", "Delivered" <NEW_LINE> REJECTED = "Rj", "Rejected" <N... | Order Model for the Seller | 62598f82d53ae8145f917efd |
class DiffScreen(Screen): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> warnings.warn( "The functionality of ``DiffScreen` has been merged into " "``Screen`` and will be removed in 0.8.0. Please update " "your code accordingly.", DeprecationWarning) <NEW_LINE> super(DiffScreen, self).__in... | A screen subclass, which maintains a set of dirty lines in its
:attr:`dirty` attribute. The end user is responsible for emptying
a set, when a diff is applied.
.. deprecated:: 0.7.0
The functionality contained in this class has been merged into
:class:`~pyte.screens.Screen` and will be removed in 0.8.0.
Plea... | 62598f82cad5886f8bdc4d95 |
@api.route(settings("api")["endpoint"]+"/<string:query>",endpoint=settings("api")["endpoint"]) <NEW_LINE> @api.param('query', "Requête pour intérroger les bases de données d'image") <NEW_LINE> @api.doc(security="apikey") <NEW_LINE> class Image(Resource): <NEW_LINE> <INDENT> @api.response(200,'Liste des urls des photos ... | Représentation des photos retournées par l'API | 62598f820fa83653e46f495f |
class TestStringMethodsTwo(TestCase): <NEW_LINE> <INDENT> def test_upper(self): <NEW_LINE> <INDENT> self.assertEqual('foo'.upper(), 'FOO') <NEW_LINE> <DEDENT> def test_isupper(self): <NEW_LINE> <INDENT> self.assertTrue('FOO'.isupper()) <NEW_LINE> self.assertFalse('Foo'.isupper()) <NEW_LINE> <DEDENT> def test_split(self... | Example test. | 62598f82fb3f5b602db47ee8 |
class Reply: <NEW_LINE> <INDENT> def __init__(self, code, headers, message): <NEW_LINE> <INDENT> self.code = code <NEW_LINE> self.headers = headers <NEW_LINE> self.message = message <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> s = ['CODE: %s' % self.code, 'HEADERS: %s' % self.headers, 'MESSAGE:', str(self... | A transport reply
@ivar code: The HTTP code returned.
@type code: int
@ivar message: The message to be sent in a POST request.
@type message: str
@ivar headers: The HTTP headers to be used for the request.
@type headers: dict | 62598f82f8510a7c17d7deaf |
class AdAccountOwner(models.Model): <NEW_LINE> <INDENT> MasterAccount = models.ForeignKey(MasterAccount) <NEW_LINE> Name = models.CharField('Account Name', max_length=120, unique=False) <NEW_LINE> Geo_MetroArea = models.IntegerField("Geo - Metro Area", choices=dmacodes.T_DMA_CHOICES,null=True, blank=True) <NEW_LINE> Bu... | can be either a grouping of accounts or an account | 62598f8273bcbd0ca4bc9cc0 |
class TestSetMeta(object): <NEW_LINE> <INDENT> def test_basic(self, mocker): <NEW_LINE> <INDENT> mocker.patch.dict( backends.BACKENDS, {'test_backend': backends.register.Registry( extensions=['.test_backend'], backend=None, load=None, meta=lambda x: x.append('bar'), write=None, )}) <NEW_LINE> test = [] <NEW_LINE> backe... | Tests for the set_meta function. | 62598f8294891a1f408b9426 |
class JSSource(Resource): <NEW_LINE> <INDENT> src = pm.Param('Source code', default=None) <NEW_LINE> location = 'bodybottom' <NEW_LINE> template = 'tw2.core.templates.jssource' <NEW_LINE> def __eq__(self, other): <NEW_LINE> <INDENT> return isinstance(other, JSSource) and self.src == other.src <NEW_LINE> <DEDENT> def __... | Inline JavaScript source code. | 62598f82596a8972361276e1 |
class GameLog_Search(Resource): <NEW_LINE> <INDENT> resource_fields = { 'id ': fields.String, 'gamelog_id': fields.String, 'season_id': fields.String, 'player_id': fields.String, 'game_id': fields.String, 'game_date': fields.String, 'gap': fields.Integer, 'matchup': fields.String, 'wl': fields.String, 'min_': fields.In... | TODO:1. Add the arguments to the reg parse
2. Add a sorting mechnism
3. 2 more endpoints for logs and just by
4. Add tests
Fun Fact: request.query_string, request.args.get('filter'), request.args
are differnt ways to get data from the request. | 62598f826aa9bd52df0d494b |
class SelectedGridItemChangedEventArgs(EventArgs): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def __new__(self,oldSel,newSel): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> NewSelection=property(lambda self: object(),lambda self,v: None,lambda self: None) <NEW_LINE> OldSelection=property(lambda self: object(),lambda s... | Provides data for the System.Windows.Forms.PropertyGrid.SelectedGridItemChanged event of the System.Windows.Forms.PropertyGrid control.
SelectedGridItemChangedEventArgs(oldSel: GridItem,newSel: GridItem) | 62598f8226238365f5fac5de |
class Indio(): <NEW_LINE> <INDENT> AZIMUTE = Rosa(Ponto(0, -1),Ponto(1, 0),Ponto(0, 1),Ponto(-1, 0),) <NEW_LINE> def __init__(self, imagem, x, y, cena, taba): <NEW_LINE> <INDENT> self.lado = lado = Kwarwp.LADO <NEW_LINE> self.azimute = self.AZIMUTE.n <NEW_LINE> self.taba = taba <NEW_LINE> self.vaga = self <NEW_LINE> se... | Cria o personagem principal na arena do Kwarwp na posição definida.
:param imagem: A figura representando o índio na posição indicada.
:param x: Coluna em que o elemento será posicionado.
:param y: Cinha em que o elemento será posicionado.
:param cena: Cena em que o elemento será posicionado.
:param taba: Representa a ... | 62598f823eb6a72ae038a0a7 |
class StarkSite(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._registry = {} <NEW_LINE> <DEDENT> def register(self,model_class,stark_config=None): <NEW_LINE> <INDENT> if not stark_config: <NEW_LINE> <INDENT> stark_config = StarkConfig <NEW_LINE> <DEDENT> self._registry[model_class] = stark_c... | 项目已启动,就执行了这个类中的属性,以及方法 | 62598f8226068e7796d4c3cb |
class SMEPHandler(BaseHTTPRequestHandler): <NEW_LINE> <INDENT> def post(self, arguments): <NEW_LINE> <INDENT> self.respond('Not implemented. Override me!', 500) <NEW_LINE> <DEDENT> def respond(self, data, statusCode=200, contentType='application/json'): <NEW_LINE> <INDENT> if not isinstance(data, str): <NEW_LINE> <INDE... | Base class for web event handlers | 62598f82fbf16365ca793b19 |
class Calibration: <NEW_LINE> <INDENT> def __init__(self, calibration_dict: dict): <NEW_LINE> <INDENT> self._calibration_dict = calibration_dict <NEW_LINE> <DEDENT> def num_qubits(self) -> int: <NEW_LINE> <INDENT> return int(self._calibration_dict['qubits']) <NEW_LINE> <DEDENT> def target(self) -> str: <NEW_LINE> <INDE... | An object representing the current calibration state of a QPU. | 62598f8263d6d428bbee2228 |
class PaletteColor(Enum): <NEW_LINE> <INDENT> gray = 0 <NEW_LINE> navy_blue = 1 <NEW_LINE> sky_blue = 2 <NEW_LINE> shakespeare = 3 <NEW_LINE> rust = 4 <NEW_LINE> tangerine = 5 <NEW_LINE> sunflower = 6 <NEW_LINE> mulberry = 7 <NEW_LINE> hot_pink = 8 <NEW_LINE> rose = 9 <NEW_LINE> slate_blue = 10 <NEW_LINE> violet = 11 <... | All available colors for use in charts.
Semantic names for colors mostly pulled from:
http://www.htmlcsscolor.com/ | 62598f82d10714528d69d93f |
class Poisson(ExponentialFamily): <NEW_LINE> <INDENT> arg_constraints = {'rate': constraints.nonnegative} <NEW_LINE> support = constraints.nonnegative_integer <NEW_LINE> @property <NEW_LINE> def mean(self): <NEW_LINE> <INDENT> return self.rate <NEW_LINE> <DEDENT> @property <NEW_LINE> def variance(self): <NEW_LINE> <IND... | Creates a Poisson distribution parameterized by :attr:`rate`, the rate parameter.
Samples are nonnegative integers, with a pmf given by
.. math::
\mathrm{rate}^k \frac{e^{-\mathrm{rate}}}{k!}
Example::
>>> m = Poisson(torch.tensor([4]))
>>> m.sample()
tensor([ 3.])
Args:
rate (Number, Tensor): th... | 62598f8210dbd63aa1c70622 |
class Compress(object): <NEW_LINE> <INDENT> def __init__(self, app=None): <NEW_LINE> <INDENT> self.app = app <NEW_LINE> if app is not None: <NEW_LINE> <INDENT> self.init_app(app) <NEW_LINE> <DEDENT> <DEDENT> def init_app(self, app): <NEW_LINE> <INDENT> defaults = [ ('COMPRESS_MIMETYPES', ['text/html', 'text/css', 'text... | The Compress object allows your application to use Flask-Compress.
When initialising a Compress object you may optionally provide your
:class:`flask.Flask` application object if it is ready. Otherwise,
you may provide it later by using the :meth:`init_app` method.
:param app: optional :class:`flask.Flask` application... | 62598f820a366e3fb87dc43d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.