code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class TaskDefinition(resource.BaseResource): <NEW_LINE> <INDENT> def __init__(self, name, container_spec, cluster): <NEW_LINE> <INDENT> super(TaskDefinition, self).__init__() <NEW_LINE> self.name = name <NEW_LINE> self.cpus = container_spec.cpus <NEW_LINE> self.memory = container_spec.memory <NEW_LINE> self.image = con...
Class representing an AWS task definition.
62598fa201c39578d7f12bed
class CompAddWithDefault(ExplicitComponent): <NEW_LINE> <INDENT> def setup(self): <NEW_LINE> <INDENT> self.add_input('x_a') <NEW_LINE> self.add_input('x_b', val=3.) <NEW_LINE> self.add_input('x_c', val=(3., 3.)) <NEW_LINE> self.add_input('x_d', val=[3., 3.]) <NEW_LINE> self.add_input('x_e', val=3. * np.ones((2, 2))) <N...
Component for tests for declaring only default value.
62598fa2baa26c4b54d4f11e
class EDSR(nn.Module): <NEW_LINE> <INDENT> def __init__(self, nb_channel, upscale_factor=2, base_channel=64, num_residuals=50): <NEW_LINE> <INDENT> super(EDSR, self).__init__() <NEW_LINE> self.input_conv = nn.Conv2d(nb_channel, base_channel, kernel_size=3, stride=1, padding=1) <NEW_LINE> resnet_blocks = [] <NEW_LINE> f...
https://github.com/icpm/super-resolution/edit/master/EDSR/model.py
62598fa2656771135c4894f3
class BufferTree(gtkextra.Tree): <NEW_LINE> <INDENT> YPAD = 2 <NEW_LINE> XPAD = 2 <NEW_LINE> COLUMNS = [('icon', gtk.gdk.Pixbuf, gtk.CellRendererPixbuf, True, 'pixbuf'), ('name', gobject.TYPE_STRING, gtk.CellRendererText, True, 'text'), ('file', gobject.TYPE_STRING, None, False, None), ('number', gobject.TYPE_INT, None...
Tree view control for buffer list.
62598fa25f7d997b871f9317
class GitProject(ProjectExtention): <NEW_LINE> <INDENT> def __init__(self, name: str, proj_path: str,): <NEW_LINE> <INDENT> super().__init__(name, proj_path) <NEW_LINE> <DEDENT> def _create(self): <NEW_LINE> <INDENT> files = ["__init__.py"] <NEW_LINE> files = [osp.join(self.proj_path, "source", fn) for fn in files] <NE...
This extention creates a git project and adds some essential files Basic tutorial follows: https://gitpython.readthedocs.io/en/stable/tutorial.html#the-commit-object
62598fa24f6381625f1993f4
class Binding: <NEW_LINE> <INDENT> def __init__(self, name, parserFn=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.invocation = None <NEW_LINE> self.outputs = None <NEW_LINE> self.parserFn = parserFn <NEW_LINE> self.instanceOf = None <NEW_LINE> <DEDENT> def matchArgs(self, bindings): <NEW_LINE> <INDENT> i...
Connects a macro definition with the arguments of a particular invocation
62598fa2d53ae8145f9182fb
class RegistrationDetail(JSONAPIBaseView, generics.RetrieveUpdateAPIView, RegistrationMixin, WaterButlerMixin): <NEW_LINE> <INDENT> permission_classes = ( drf_permissions.IsAuthenticatedOrReadOnly, ContributorOrPublic, base_permissions.TokenHasScope, ) <NEW_LINE> required_read_scopes = [CoreScopes.NODE_REGISTRATIONS_RE...
The documentation for this endpoint can be found [here](https://developer.osf.io/#operation/registrations_read).
62598fa260cbc95b063641bd
class UserCreationForm(forms.ModelForm): <NEW_LINE> <INDENT> password1 = forms.CharField(label='Password', widget=forms.PasswordInput) <NEW_LINE> password2 = forms.CharField(label='Password confirmation', widget=forms.PasswordInput) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Tbusuario <NEW_LINE> fields = ('emai...
A form for creating new users. Includes all the required fields, plus a repeated password.
62598fa25fdd1c0f98e5de07
class AttributedDictTest(test_base.RDFValueTestCase): <NEW_LINE> <INDENT> rdfvalue_class = rdfvalue.AttributedDict <NEW_LINE> def GenerateSample(self, number=0): <NEW_LINE> <INDENT> return rdfvalue.AttributedDict({"number": number}) <NEW_LINE> <DEDENT> def testInitialize(self): <NEW_LINE> <INDENT> arnie = {"target": "S...
Test AttributedDictFile operations.
62598fa266656f66f7d5a260
class BaseLogger(Callback): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(BaseLogger, self).__init__() <NEW_LINE> <DEDENT> def on_epoch_begin(self, epoch, logs=None): <NEW_LINE> <INDENT> self.seen = 0 <NEW_LINE> self.totals = defaultdict(list) <NEW_LINE> <DEDENT> def on_batch_end(self, batch, logs=N...
Callback that accumulates epoch averages.
62598fa20c0af96317c561f1
class GIC_CFG_PERMIS(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'A_GIC_CFG_PERMIS' <NEW_LINE> id_permis = db.Column(db.Integer, primary_key=True) <NEW_LINE> nom_permis = db.Column(db.String(40)) <NEW_LINE> actiu = db.Column(db.String(1)) <NEW_LINE> grup = db.Column(db.Integer, db.ForeignKey(GIC_CFG_GRUP.id_grup)) <...
taula de permisos
62598fa2e5267d203ee6b77c
class IsSuperOrProfileOwner(permissions.BasePermission): <NEW_LINE> <INDENT> def has_object_permission(self, request, view, obj): <NEW_LINE> <INDENT> if request.user.profile == obj or request.user.is_superuser: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> return False <NEW_LINE> <DEDENT> def has_permission(self,...
Custom permission to only allow superusers or owners of an object to see and edit it.
62598fa276e4537e8c3ef41b
class DateTimeScaleDraw( QwtScaleDraw ): <NEW_LINE> <INDENT> def __init__( self, *args ): <NEW_LINE> <INDENT> QwtScaleDraw.__init__( self, *args ) <NEW_LINE> <DEDENT> def label(self, value ): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> dt = datetime.fromtimestamp( value ) <NEW_LINE> return QwtText( '%s' % dt.strftime(...
Class used to draw a datetime axis on the plot.
62598fa23539df3088ecc123
class List(ListWidget): <NEW_LINE> <INDENT> admin = site.get_action('bans') <NEW_LINE> id = 'list' <NEW_LINE> columns = ( ('ban', _("Ban"), 50), ('expires', _("Expires")), ) <NEW_LINE> default_sorting = 'expires' <NEW_LINE> sortables = { 'ban': 1, 'expires': 0, } <NEW_LINE> pagination = 20 <NEW_LINE> search_form = Sear...
List Bans
62598fa23539df3088ecc124
class NEODatabase(object): <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> self.neo_name = {} <NEW_LINE> self.neo_date = {} <NEW_LINE> <DEDENT> def load_data(self, filename=None): <NEW_LINE> <INDENT> if not (filename or self.filename): <NEW_LINE> <INDENT> raise ...
Object to hold Near Earth Objects and their orbits. To support optimized date searching, a dict mapping of all orbit date paths to the Near Earth Objects recorded on a given day is maintained. Additionally, all unique instances of a Near Earth Object are contained in a dict mapping the Near Earth Object name to the Ne...
62598fa26aa9bd52df0d4d39
class Kong(_SameNum): <NEW_LINE> <INDENT> size: int = 4 <NEW_LINE> def __str__(self) -> str: <NEW_LINE> <INDENT> return '|'.join(map(str, [ self.tiles[0], Misc.HIDDEN.value, self.tiles[-1]]))
Represents a Kong (four identical tiles, counted as three)
62598fa291f36d47f2230dd9
class TestBaseType(unittest.TestCase): <NEW_LINE> <INDENT> def test_no_data(self): <NEW_LINE> <INDENT> var = BaseType("var") <NEW_LINE> self.assertIsNone(var.data) <NEW_LINE> self.assertEqual(var.dimensions, ()) <NEW_LINE> <DEDENT> def test_data_and_dimensions(self): <NEW_LINE> <INDENT> var = BaseType("var", [42], ('x'...
Test the base Pydap type.
62598fa201c39578d7f12bee
class RangeModule: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._ranges = [] <NEW_LINE> <DEDENT> def addRange(self, left: int, right: int) -> None: <NEW_LINE> <INDENT> lb = bisect_left(self._ranges, left) <NEW_LINE> rb = bisect_right(self._ranges, right) <NEW_LINE> self._ranges[lb: rb] = [left] * (l...
1. Take the ranges as a sorted list of numbers where the items on the even indexes stand for the openings of each range while the items on the odd indexes stand for the closings of each range. For example, if ranges = [10, 15, 20, 25], this covers the ranges of [10, 15) and [20, 25). 2. When we want to...
62598fa2627d3e7fe0e06d1b
class RandomBallsEnv(PoliceKillAllEnv): <NEW_LINE> <INDENT> def __init__(self, init_thief_num=1, step_add_thief_max=3, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.step_add_thief_max = step_add_thief_max <NEW_LINE> self.init_thief_num = init_thief_num <NEW_LINE> self.team_size[self.adversar...
Focus to add more randomness into env Feature: 1. Thief are incremently added into map in each step 2. Each add batch has random num of thief 3. Thief walk in a random way
62598fa232920d7e50bc5ec5
class DiscoveredNeighbor(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swagger_types = { 'heard_count': 'int', 'mac_address': 'str', 'rssi': 'int' } <NEW_LINE> self.attribute_map = { 'heard_count': 'heardCount', 'mac_address': 'macAddress', 'rssi': 'rssi' } <NEW_LINE> self._heard_count = Non...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598fa2097d151d1a2c0e9a
class TestPlugin: <NEW_LINE> <INDENT> classProvides(ITestPlugin, IPlugin) <NEW_LINE> def test1(): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> test1 = staticmethod(test1)
A plugin used solely for testing purposes.
62598fa2d58c6744b42dc20b
class MsgSetBinData(MsgpackMsg): <NEW_LINE> <INDENT> object_type = 'set_bindata' <NEW_LINE> rid = fields.SmallUnsignedInteger() <NEW_LINE> id = fields.NodeID() <NEW_LINE> key = fields.String() <NEW_LINE> start = fields.SmallUnsignedInteger(default=0) <NEW_LINE> data = fields.Binary() <NEW_LINE> truncate = fields.Boolea...
Sets a range of bindata on a given node. Server replies with MsgRequestAck or MsgRequestError. The bindata is modified starting from a given start position - it is an error if the position is after the current end of bindata (but not if it's equal). The bindata is expanded if necessary to hold the new data. If trun...
62598fa27cff6e4e811b5896
class TestProductTranslationTemplateSplitter( TestCaseWithFactory, TestTranslationTemplateSplitterBase): <NEW_LINE> <INDENT> def makePOTemplate(self): <NEW_LINE> <INDENT> return self.factory.makePOTemplate( name='template', side=TranslationSide.UPSTREAM) <NEW_LINE> <DEDENT> def makeSharingTemplate(self, template, other...
Templates in a product get split appropriately.
62598fa2adb09d7d5dc0a3fa
class IFixtureAsset(Interface): <NEW_LINE> <INDENT> pass
Marker to register :term:`asset` specs for fixtures directories.
62598fa201c39578d7f12bef
class ReorderableListBox(wx.ListBox): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> if len(args) == 0 and len(kwargs) == 0: <NEW_LINE> <INDENT> wx.ListBox.__init__(self) <NEW_LINE> self.Bind(wx.EVT_WINDOW_CREATE, self.OnCreate) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> wx.ListBox.__in...
Additional functionality: Move selected item one step upward/downward
62598fa2d6c5a102081e1fb7
class TerminateError(Exception): <NEW_LINE> <INDENT> pass
Raised when attempts to terminate the browser fail.
62598fa263d6d428bbee2622
class CustomCreateView(CreateView): <NEW_LINE> <INDENT> def set_initial(self, instance): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def form_valid(self, form): <NEW_LINE> <INDENT> self.set_initial(form.instance) <NEW_LINE> return super().form_valid(form)
オブジェクトの生成時に初期値をシステム側で管理する生成ビュー (フォームとしては扱わない値の初期値を制御)
62598fa230dc7b766599f6be
class Book(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'tbl_books' <NEW_LINE> 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("tbl_authors.id"))
书籍
62598fa2d53ae8145f9182fd
class RequestedRangeNotSatisfiable(HTTPError): <NEW_LINE> <INDENT> status = "416", "Requested Range Not Satisfiable"
Allow customized messages on 415 errors
62598fa210dbd63aa1c70a20
@dataclass <NEW_LINE> class Tags(Generics): <NEW_LINE> <INDENT> content: List[str] <NEW_LINE> def __init__(self, pack: DataPack): <NEW_LINE> <INDENT> super().__init__(pack) <NEW_LINE> self.content: List[str] = []
A Generics class Tags, used to refer to tags part of the report Attributes: content (List[str])
62598fa276e4537e8c3ef41d
class DdnsCollection(XmlObject): <NEW_LINE> <INDENT> OPERATE_ADD = 1 <NEW_LINE> OPERATE_DELETE = 2 <NEW_LINE> OPERATE_EDIT = 3 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(DdnsCollection, self).__init__() <NEW_LINE> self.ddnss = [] <NEW_LINE> self.operate = self.OPERATE_ADD <NEW_LINE> <DEDENT> def addNoIpDd...
Provides support for dynamic DNS providers: NoIp, DynDns, Oray
62598fa2c432627299fa2e4b
class Users(_base.Base): <NEW_LINE> <INDENT> __tablename__ = 'users' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> name = Column(String(512), nullable=False, info={'verbose_name': 'Имя'}) <NEW_LINE> last_name = Column(String(512), nullable=False, info={'verbose_name': 'Фамилия'}) <NEW_LINE> fathers_name ...
Таблица пользователь
62598fa2e5267d203ee6b77e
class ComputeManagementClient: <NEW_LINE> <INDENT> def __init__( self, credential: "TokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: <NEW_LINE> <INDENT> self._config = ComputeManagementClientConfiguration(credential=credential, subscription_id=subscription...
Compute Client. :ivar disks: DisksOperations operations :vartype disks: azure.mgmt.compute.v2019_11_01.operations.DisksOperations :ivar snapshots: SnapshotsOperations operations :vartype snapshots: azure.mgmt.compute.v2019_11_01.operations.SnapshotsOperations :ivar disk_encryption_sets: DiskEncryptionSetsOperations op...
62598fa2d268445f26639abb
class PageAlert(object): <NEW_LINE> <INDENT> def __getattr__(self, item): <NEW_LINE> <INDENT> rds = Redis.get_conn() <NEW_LINE> alert = rds.get('Single:{}'.format(item)) <NEW_LINE> return alert
处理页面警告 从redis中获取页面警告
62598fa2462c4b4f79dbb87d
class AllPostRssFeed(Feed): <NEW_LINE> <INDENT> title = 'VanBlog博客' <NEW_LINE> link = '/' <NEW_LINE> description = 'VanBlog博客上的文章' <NEW_LINE> def items(self): <NEW_LINE> <INDENT> return Post.objects.all().filter(is_pub=True).filter(category__is_pub=True).order_by('-create_time') <NEW_LINE> <DEDENT> def item_title(self,...
RSS订阅
62598fa245492302aabfc342
class Flow(Cut): <NEW_LINE> <INDENT> def __init__(self, graph, value, flow, cut, partition): <NEW_LINE> <INDENT> super(Flow, self).__init__(graph, value, cut, partition) <NEW_LINE> self._flow = flow <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "%s(%r, %r, %r, %r, %r)" % (self.__class__.__...
A flow of a given graph. This is a simple class used to represent flows returned by L{Graph.maxflow}. It has the following attributes: - C{graph} - the graph on which this flow is defined - C{value} - the value (capacity) of the flow - C{flow} - the flow values on each edge. For directed graphs, this is ...
62598fa23539df3088ecc126
class MLPContinuousPolicy(nn.Module): <NEW_LINE> <INDENT> def __init__(self, state_dim, action_dim, num_hidden=20): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.base = nn.Sequential( nn.Linear(state_dim, num_hidden), nn.Tanh(), nn.Linear(num_hidden, num_hidden), nn.Tanh(), ) <NEW_LINE> self.mean_head = nn.Lin...
For classic control
62598fa24e4d562566372295
@injected <NEW_LINE> @setup(IUserService, name='userService') <NEW_LINE> class UserServiceAlchemy(EntityServiceAlchemy, IUserService): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> EntityServiceAlchemy.__init__(self, UserMapped, QUser)
Implementation for @see: IUserService
62598fa2435de62698e9bc65
class RPSGame: <NEW_LINE> <INDENT> def __init__(self, engineClass, playerClasses, engineArgs = None, playerArgs = None): <NEW_LINE> <INDENT> if(engineArgs == None): <NEW_LINE> <INDENT> engineArgs = [] <NEW_LINE> <DEDENT> if(playerArgs == None): <NEW_LINE> <INDENT> playerArgs = [[]]*len(playerClasses) <N...
Base (factory) class for making an RPSGame. engineClass must be inherited from RPSEngine. playerClasses must be a list of classes inherited from RPSPlayer. engineArgs, if not None, is the list of arguements for the engine invocation playerArgs is a list of lists of arguements for the players. (e.g., playerArg...
62598fa2627d3e7fe0e06d1d
class Transaction: <NEW_LINE> <INDENT> def __init__(self, payer, amount, receiver): <NEW_LINE> <INDENT> self.payer = payer <NEW_LINE> self.amount = amount <NEW_LINE> self.receiver = receiver <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "{} pays {} eur to {}".format(self.payer, round(self.amount,2),...
Class representing a transaction (un remboursement) between two people
62598fa21f5feb6acb162a94
class MockIOStream(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.colored = True <NEW_LINE> for k in ('error', 'success', 'write'): <NEW_LINE> <INDENT> setattr(self, 'test__{0}_data'.format(k), None) <NEW_LINE> def _wrapper(k): <NEW_LINE> <INDENT> def _mockfunc(self, s, newline=True): <NEW_LI...
Mock object for `IOStream` class.
62598fa2cb5e8a47e493c0af
class SUB(Instruction): <NEW_LINE> <INDENT> operand_count = 3 <NEW_LINE> def do(self): <NEW_LINE> <INDENT> self.set_operand(0, self.get_operand(1) - self.get_operand(2))
Substract (unsigned): <op0> = <op1> - <op2>
62598fa2379a373c97d98e89
class Producer(celery_app.Task): <NEW_LINE> <INDENT> name = 'producer' <NEW_LINE> def run(self, file, consumer='consumer', queue='test', header_rows=0, column_map={'name': 0, 'email': 1}, sep=','): <NEW_LINE> <INDENT> logger.info("Processing file: {}".format(file)) <NEW_LINE> data = open(file, 'r') <NEW_LINE> reader = ...
Producer class is responsible for reading input file and creating a `group` of tasks. Each group element represent a row plus some other identification data like timestamps and group_id. Each group element is sent to attached broker in a specified queue.
62598fa256ac1b37e630205d
class Result(Base): <NEW_LINE> <INDENT> assignment = db.relationship("Assignment", back_populates="result", uselist=False) <NEW_LINE> type = db.Column(db.String(50)) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> __mapper_args__ = { "polymorphic_identity": "result", "pol...
A Result is the outcome of a Participant completing an Activity. Different Activities have different data that they generate, so this model does not actually contain any information on the outcome of an Activity. That is something that child classes of this class must define in their schemas. On the Assignment level,...
62598fa2b7558d58954634a0
class BatchServiceClientConfiguration(AzureConfiguration): <NEW_LINE> <INDENT> def __init__( self, credentials, batch_url): <NEW_LINE> <INDENT> if credentials is None: <NEW_LINE> <INDENT> raise ValueError("Parameter 'credentials' must not be None.") <NEW_LINE> <DEDENT> if batch_url is None: <NEW_LINE> <INDENT> raise Va...
Configuration for BatchServiceClient Note that all parameters used to create this instance are saved as instance attributes. :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object<msrestazure.azure_active_directory>` :param batch_url: The b...
62598fa28c0ade5d55dc35c8
class NoSuchColumnError(DatabaseException): <NEW_LINE> <INDENT> pass
Raised when a non-existing column is requested.
62598fa2d7e4931a7ef3bf0c
class MovementController: <NEW_LINE> <INDENT> def __init__(self, motor000: MotorDriver, motor120: MotorDriver, motor240: MotorDriver ): <NEW_LINE> <INDENT> self._motor000 = motor000 <NEW_LINE> self._motor120 = motor120 <NEW_LINE> self._motor240 = motor240 <NEW_LINE> self._speed = 0. <NEW_LINE> self._direction = 0. <NEW...
Class responsible for controlling the movement of the robot by properly adjusting the speed of each one of the three motors. The controller assumes that the motors ale set up in a way, that each wheel creates one vertex of an equilateral triangle. The naming convention for each motor is "motorA", where "A" denotes the...
62598fa28da39b475be03052
class Like(TimeStampedModel): <NEW_LINE> <INDENT> creator = models.ForeignKey(user_models.User, on_delete=models.CASCADE, null=True) <NEW_LINE> image = models.ForeignKey(Image, on_delete=models.CASCADE, null=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return "User: {} - Image Caption: {}".format(self.creato...
Like model
62598fa24f88993c371f0443
class TestPortletsStats(TestCase): <NEW_LINE> <INDENT> def afterSetUp(self): <NEW_LINE> <INDENT> self.view = queryMultiAdapter((self.portal, self.portal.REQUEST), name='portlets_stats') <NEW_LINE> <DEDENT> def test_getPropsList(self): <NEW_LINE> <INDENT> self.loginAsPortalOwner() <NEW_LINE> portlet = getUtility(IPortle...
Tests all properties_stats view methods.
62598fa2460517430c431f94
class TestModule(TransactionCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> self.SaleOrder = self.env["sale.order"] <NEW_LINE> self.ResPartner = self.env["res.partner"] <NEW_LINE> self.user_worker = self.env.ref("fiscal_company_base.user_worker") <NEW_LINE> self.child_company ...
Tests for 'CAE - Sale' Module
62598fa2925a0f43d25e7eb0
class TenCrop(BaseTransformation): <NEW_LINE> <INDENT> def __init__(self, size, vertical_flip=False): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> if isinstance(size, numbers.Number): <NEW_LINE> <INDENT> self.size = (int(size), int(size)) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> assert len(size) == 2, "Please p...
Crop the given PIL Image into four corners and the central crop plus the flipped version of these (horizontal flipping is used by default) .. Note:: This transform returns a tuple of images and there may be a mismatch in the number of inputs and targets your Dataset returns. See below for an example of how t...
62598fa256b00c62f0fb2724
class GeneNotFound(Exception): <NEW_LINE> <INDENT> pass
My own exception, for a gene that wasn't found.
62598fa26e29344779b004cf
class RTHNLayer(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_depth, total_key_depth, total_value_depth, num_heads, output_depth, program_class, max_doc_len, bias_mask=None, attention_dropout=0.0, layer_dropout=0.0): <NEW_LINE> <INDENT> super(RTHNLayer, self).__init__() <NEW_LINE> self.program_class = progra...
An implementation of the framework in https://arxiv.org/abs/1906.01236 Refer Figure 2
62598fa2090684286d593614
class Article(object): <NEW_LINE> <INDENT> def __init__(self, article): <NEW_LINE> <INDENT> self.title = article["Title"] <NEW_LINE> self.author = article["Author"] <NEW_LINE> self.up = article["UpVote"] <NEW_LINE> self.down = article["DownVote"] <NEW_LINE> self.noVote = article["NoVote"] <NEW_LINE> self.hot = self.up ...
文章的保存結構,包含了文章標題、作者、與回文狀態 (不包含文章內容)
62598fa256ac1b37e630205e
class Rectangle: <NEW_LINE> <INDENT> pass
defining rectangle
62598fa2c432627299fa2e4d
class ProMySqlDB(object): <NEW_LINE> <INDENT> def __init__(self, dbName, user, passwd, host, port): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.dbName = str(dbName) <NEW_LINE> self.user = str(user) <NEW_LINE> self.passwd = str(passwd) <NEW_LINE> self.host = str(host) <NEW_LINE> self.port = int(port) <NEW_LINE> se...
MySQL数据库类
62598fa21f037a2d8b9e3f5c
class Database: <NEW_LINE> <INDENT> def __init__(self, path_to_db="database.db"): <NEW_LINE> <INDENT> self._db = path_to_db <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self._conn = sqlite3.connect(self._db) <NEW_LINE> cursor = self._conn.cursor() <NEW_LINE> cursor.execute("CREATE TABLE IF NOT EXISTS ca...
Main database connection class. Returns a cursor object.
62598fa201c39578d7f12bf2
class NotFoundException(ConanException): <NEW_LINE> <INDENT> pass
404 error
62598fa2442bda511e95c2ce
class change_password_user(osv.TransientModel): <NEW_LINE> <INDENT> _name = 'change.password.user' <NEW_LINE> _description = 'Change Password Wizard User' <NEW_LINE> _columns = { 'wizard_id': fields.many2one('change.password.wizard', string='Wizard', required=True), 'user_id': fields.many2one('res.users', string='User'...
A model to configure users in the change password wizard
62598fa22c8b7c6e89bd3639
class TeamFolderTeamSharedDropboxError(bb.Union): <NEW_LINE> <INDENT> _catch_all = 'other' <NEW_LINE> disallowed = None <NEW_LINE> other = None <NEW_LINE> def is_disallowed(self): <NEW_LINE> <INDENT> return self._tag == 'disallowed' <NEW_LINE> <DEDENT> def is_other(self): <NEW_LINE> <INDENT> return self._tag == 'other'...
This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. :ivar team.TeamFolderTeamSharedDropboxError.disallowed: This action is not allowed for a shared team root.
62598fa297e22403b383ad7f
class CommentAnalysisChartMixin(object): <NEW_LINE> <INDENT> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> if isinstance(self, VideoCommentListView): <NEW_LINE> <INDENT> qs = self.get_queryset() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> qs = self.object.videocomment_set.all() <NEW_LINE> <DEDENT> context...
Mixin for comment analysis charts and graphs across views
62598fa21f5feb6acb162a96
class TestBayes(unittest.TestCase): <NEW_LINE> <INDENT> def test_train(self): <NEW_LINE> <INDENT> train_data = mockData().get_mock_data() <NEW_LINE> list_classes = mockData().class_vec <NEW_LINE> p0v, p1v, pab = BayesLearning().train0(train_data, list_classes) <NEW_LINE> test_entry = ['love', 'my', 'dalmation'] <NEW_LI...
朴素贝叶斯算法测试
62598fa27d847024c075c239
class AllPairs(ParentWithSetFactory, DisjointUnionEnumeratedSets): <NEW_LINE> <INDENT> def __init__(self, policy): <NEW_LINE> <INDENT> ParentWithSetFactory.__init__(self, (), policy=policy, category=EnumeratedSets().Finite()) <NEW_LINE> DisjointUnionEnumeratedSets.__init__(self, LazyFamily(range(MAX), self.pairs_y), fa...
This parent shows how one can use set factories together with :class:`DisjointUnionEnumeratedSets`. It is constructed as the disjoint union (:class:`DisjointUnionEnumeratedSets`) of :class:`Pairs_Y` parents: .. MATH:: S := \bigcup_{i = 0,1,..., 4} S^y .. WARNING:: When writing a parent ``P`` as a disjoint ...
62598fa2796e427e5384e607
class LoginForm(forms.Form): <NEW_LINE> <INDENT> username = forms.CharField(widget=forms.TextInput(attrs={"placeholder": "Username", "required": "required",}), max_length=50,error_messages={"required": "username不能为空",}) <NEW_LINE> password = forms.CharField(widget=forms.PasswordInput(attrs={"placeholder": "Password", "...
登录Form
62598fa2a8ecb03325871082
class FirstBootForm(ValidNewUsernameCheckMixin, auth.forms.UserCreationForm): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.request = kwargs.pop('request') <NEW_LINE> super().__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def save(self, commit=True): <NEW_LINE> <INDENT> user = super()...
User module first boot step: create a new admin user.
62598fa2442bda511e95c2cf
class ResPQ(TLObject): <NEW_LINE> <INDENT> __slots__ = ["nonce", "server_nonce", "pq", "server_public_key_fingerprints"] <NEW_LINE> ID = 0x05162463 <NEW_LINE> QUALNAME = "types.ResPQ" <NEW_LINE> def __init__(self, *, nonce: int, server_nonce: int, pq: bytes, server_public_key_fingerprints: list): <NEW_LINE> <INDENT> se...
Attributes: LAYER: ``112`` Attributes: ID: ``0x05162463`` Parameters: nonce: ``int`` ``128-bit`` server_nonce: ``int`` ``128-bit`` pq: ``bytes`` server_public_key_fingerprints: List of ``int`` ``64-bit`` See Also: This object can be returned by :obj:`ReqPq <pyrogram.api.functions.ReqPq>` ...
62598fa27cff6e4e811b589a
class MelFrequencySpectrumCentroid(Features): <NEW_LINE> <INDENT> def __init__(self, arg, **kwargs): <NEW_LINE> <INDENT> kwargs['feature']='cqft' <NEW_LINE> Features.__init__(self, arg, kwargs) <NEW_LINE> <DEDENT> def extract(self): <NEW_LINE> <INDENT> Features.extract(self) <NEW_LINE> self.X = (self.X.T * self._logfrq...
Mel-Frequency Spectrum Centroid
62598fa28e7ae83300ee8f14
class Rainbow(ColorCycle): <NEW_LINE> <INDENT> def init_parameters(self): <NEW_LINE> <INDENT> super().init_parameters() <NEW_LINE> self.set_parameter('num_steps_per_cycle', 255) <NEW_LINE> <DEDENT> def before_start(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def update(self, current_step: int, current_cycle: in...
Rotates a rainbow color wheel around the strip. No parameters necessary
62598fa230bbd722464698b1
class LaunchpadCelebrities: <NEW_LINE> <INDENT> implements(ILaunchpadCelebrities) <NEW_LINE> admin = PersonCelebrityDescriptor('admins') <NEW_LINE> software_center_agent = PersonCelebrityDescriptor( 'software-center-agent') <NEW_LINE> bug_importer = PersonCelebrityDescriptor('bug-importer') <NEW_LINE> bug_watch_updater...
See `ILaunchpadCelebrities`.
62598fa2fbf16365ca793f2f
class UserDataViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> serializer_class = PerfilSerializer <NEW_LINE> http_method_names = ['get','head'] <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return Perfil.objects.filter(user_id=self.request.user.id).all()
! Clase que gestiona los datos del usuario autenticado @author Rodrigo Boet (rboet at cenditel.gob.ve) @copyright <a href='https://www.gnu.org/licenses/gpl-3.0.en.html'>GNU Public License versión 3 (GPLv3)</a> @date 28-09-2017 @version 1.0.0
62598fa2a8370b77170f0254
class RunT(Enum): <NEW_LINE> <INDENT> REMOTE_CLI = 'remote_cli' <NEW_LINE> REMOTE_API = 'remote_api' <NEW_LINE> ONTARGET_CLI = 'ontarget_cli'
Modes of setup run
62598fa2925a0f43d25e7eb2
class Dropout(KerasLayer): <NEW_LINE> <INDENT> def __init__(self, p, input_shape=None, **kwargs): <NEW_LINE> <INDENT> super(Dropout, self).__init__(None, float(p), list(input_shape) if input_shape else None, **kwargs)
Applies Dropout to the input by randomly setting a fraction 'p' of input units to 0 at each update during training time in order to prevent overfitting. When you use this layer as the first layer of a model, you need to provide the argument input_shape (a shape tuple, does not include the batch dimension). # Argument...
62598fa238b623060ffa8f08
class SegmentationRecordsParserBase: <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> @abstractmethod <NEW_LINE> def getSegmentationRecords(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def _getAllValidDirs(self, baseDir): <NEW_LINE> <INDENT> if not os.path.isdir(baseDir): <NEW_LINE> <INDENT> return [] <NEW...
Base class for Parsers that work on the mpReview Data/File Structure
62598fa2656771135c4894f9
class B2BCouponManager(models.Manager): <NEW_LINE> <INDENT> def get_unexpired_coupon(self, *, coupon_code, product_id): <NEW_LINE> <INDENT> coupon = ( self.filter( Q(coupon_code=coupon_code), Q(enabled=True), Q(product_id=None) | Q(product_id=product_id), ) .filter(Q(activation_date__isnull=True) | Q(activation_date__l...
Add a function to filter valid coupons
62598fa256b00c62f0fb2726
class CreateView(generics.ListCreateAPIView): <NEW_LINE> <INDENT> queryset = Contact.objects.all() <NEW_LINE> serializer_class = ContactSerializer <NEW_LINE> permission_classes = (permissions.IsAuthenticated, IsOwner) <NEW_LINE> def perform_create(self, serializer): <NEW_LINE> <INDENT> serializer.save(owner=self.reques...
This class defines the create behavior of our rest api.
62598fa24e4d562566372298
class SourceMultiSelectWidget(MultiSelectWidget): <NEW_LINE> <INDENT> def __init__(self, field, source, request): <NEW_LINE> <INDENT> super(SourceMultiSelectWidget, self).__init__( field, IterableSourceVocabulary(source, request), request)
A multi-selection widget with ordering support.
62598fa2d268445f26639abd
class MacManager(BaseManager): <NEW_LINE> <INDENT> NAME = 'Darwin' <NEW_LINE> FRIENDLY = 'Mac' <NEW_LINE> IGNORED_APPLICATION_NAMES = [ "iTunesHelper.app", "slack helper.app", "garcon.appex", "musiccacheextension", "podcastswidget", "mailcachedelete", ] <NEW_LINE> @log_running <NEW_LINE> def is_running(self, applicatio...
Application manager for OS X.
62598fa292d797404e388aa0
class AbstractUser(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> username = models.CharField(_('username'), max_length=50, unique=True, help_text=_('Required. 50 characters or fewer. Letters, numbers and ' '@/./+/-/_ characters'), validators=[ validators.RegexValidator(re.compile('^[\w.@+-]+$'), _('Enter a v...
An abstract base class implementing a fully featured User model with admin-compliant permissions. Username, password and email are required. Other fields are optional.
62598fa245492302aabfc346
class ProvinceAreasView(View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> province_list = cache.get('province_list') <NEW_LINE> if not province_list: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> province_model_list = Area.objects.filter(parent__isnull=True) <NEW_LINE> province_list = [] <NEW_LINE> ...
省级地区
62598fa221bff66bcd722ada
class Service(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, name=None): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.name = name or self.__class__.__name__ <NEW_LINE> self.channel = None <NEW_LINE> self.connection = pika.SelectConnection( pika.ConnectionParameters(host='132.252.152.56...
Service Base for Micro Service via RabbitMQ
62598fa29c8ee823130400a9
@dataclass <NEW_LINE> class PassportElementErrorDataField(Base): <NEW_LINE> <INDENT> source: str <NEW_LINE> type: str <NEW_LINE> field_name: str <NEW_LINE> data_hash: str <NEW_LINE> message: str
Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes.
62598fa2236d856c2adc9375
class X10CommandType(Enum): <NEW_LINE> <INDENT> DIRECT = 0 <NEW_LINE> BROADCAST = 1
X10 command types.
62598fa2bd1bec0571e14ffe
class DataTableResult: <NEW_LINE> <INDENT> def __init__(self, request_data, queryset, column_names): <NEW_LINE> <INDENT> self.queryset = queryset <NEW_LINE> self.request_data = request_data <NEW_LINE> self.column_names = column_names <NEW_LINE> <DEDENT> def _iter_sorting_columns(self): <NEW_LINE> <INDENT> number_of_sor...
Paginate and order queryset for rendering DataTable response
62598fa2b7558d58954634a3
class Variable(object): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "<AQL Variable: {}>".format(self.value)
AQL Variable
62598fa21f5feb6acb162a98
class LocationOfInterest (google.appengine.ext.ndb.Model): <NEW_LINE> <INDENT> owner = google.appengine.ext.ndb.StringProperty() <NEW_LINE> description = google.appengine.ext.ndb.StringProperty() <NEW_LINE> location = google.appengine.ext.ndb.GeoPtProperty() <NEW_LINE> @classmethod <NEW_LINE> def query_user(cls, user_i...
NDB model class for a location for which a user would like to receive notifications for earthquakes. In the interest of scalability, it might have been better to batch locations of interest by user ID, but I didn't want to figure it out.
62598fa2cb5e8a47e493c0b1
class DesignSpace(Entity): <NEW_LINE> <INDENT> def __init__(self, constellations=None, launchers=None, satellites=None, groundNetworks=None, groundStations=None, _id=None): <NEW_LINE> <INDENT> if isinstance(constellations, Constellation): self.constellations = [constellations] <NEW_LINE> else: self.constellations = con...
Specification of fixed and variable quantities for a space mission. Attributes: constellations List of potential constellations to consider. launchers List of available launch vehicles to consider (overrides default database). satellites List of available satellites. gro...
62598fa2a79ad16197769ed5
class AjaxHandler(Handler): <NEW_LINE> <INDENT> def dispatch(self, request, *args, **kwargs): <NEW_LINE> <INDENT> if not (request.is_ajax() or request.GET.get('ajax', False)): <NEW_LINE> <INDENT> raise NotMyJob('ajax') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return super(AjaxHandler, self).dispatch(request, *args...
Handler for Ajax sub-page requests.
62598fa299cbb53fe6830d49
class Config: <NEW_LINE> <INDENT> log_dir = './train_log' <NEW_LINE> '''where to write model snapshots to''' <NEW_LINE> log_model_dir = os.path.join(log_dir, 'models') <NEW_LINE> exp_name = os.path.basename(log_dir) <NEW_LINE> minibatch_size = 256 <NEW_LINE> nr_channel = 3 <NEW_LINE> image_shape = (32, 32) <NEW_LINE> n...
where to write all the logging information during training(includes saved models)
62598fa2796e427e5384e609
class MultiplayerSelect(PopUpMenu[None]): <NEW_LINE> <INDENT> shrink_to_items = True <NEW_LINE> def startup(self, **kwargs: Any) -> None: <NEW_LINE> <INDENT> super().startup(**kwargs) <NEW_LINE> self.task(self.reload_items, 1, -1) <NEW_LINE> <DEDENT> def initialize_items(self) -> Generator[MenuItem[None], None, None]: ...
Menu to show games found by the network game scanner
62598fa23c8af77a43b67e7b
class CustomOp: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def process_ops(cls, ops, block_num, block_date): <NEW_LINE> <INDENT> for op in ops: <NEW_LINE> <INDENT> if op['id'] not in ['follow', 'com.steemit.community']: <NEW_LINE> <INDENT> continue <NEW_LINE> <DEDENT> if len(op['required_posting_auths']) != 1: <NEW_LI...
Processes custom ops and dispatches updates.
62598fa2009cb60464d0139b
class Tag(Command): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> version_file = version.VersionFile(self.cfg.version_file) <NEW_LINE> current = version_file.read() <NEW_LINE> try: <NEW_LINE> <INDENT> vcs_handler = vcs.VCS(self.cfg.vcs_engine) <NEW_LINE> vcs_handler.create_tag(current, self.cfg.vcs_tag_params)...
Realize tasks for 'tag' command
62598fa266656f66f7d5a267
class mainSpace(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def main(cls, args): <NEW_LINE> <INDENT> poly_deg = 5 <NEW_LINE> seq_length = mSeqlength.seq_length(poly_deg) <NEW_LINE> print("The Sequences length is: " + seq_length) <NEW_LINE> init_state = [None] * poly_deg <NEW_LINE> init_state[poly_deg - 1] = 1 ...
generated source for class mainSpace
62598fa2a8370b77170f0255
class Array(Pattern): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Array, self).__init__() <NEW_LINE> self._members = [] <NEW_LINE> <DEDENT> def add(self, expr): <NEW_LINE> <INDENT> if not isinstance(expr, Expression): <NEW_LINE> <INDENT> raise InconsistentExpression() <NEW_LINE> <DEDENT> self._mem...
representation of an array of constants
62598fa21b99ca400228f46a
class VirtualLibrary(p.SingletonPlugin): <NEW_LINE> <INDENT> p.implements(p.IConfigurer) <NEW_LINE> def update_config(self, config): <NEW_LINE> <INDENT> p.toolkit.add_template_directory(config, 'templates') <NEW_LINE> p.toolkit.add_public_directory(config, 'public')
Plugin for public-facing version of data.gc.ca site, aka the "portal" This plugin requires the DataGCCAForms plugin
62598fa256b00c62f0fb2728
class Binomial(Distribution): <NEW_LINE> <INDENT> def __init__(self, prob:float = 0.5, size:int = 20): <NEW_LINE> <INDENT> self.p = prob <NEW_LINE> self.n = size <NEW_LINE> mean = self.calculate_mean() <NEW_LINE> stdev = self.calculate_stdev() <NEW_LINE> super().__init__(mean,stdev) <NEW_LINE> <DEDENT> def calculate_me...
Binomial distribution class for calculating and visualizing a Binomial distribution. Attributes: mean (float) representing the mean value of the distribution stdev (float) representing the standard deviation of the distribution data_list (list of floats) a list of floats to be extracted from the data file...
62598fa299cbb53fe6830d4a
class CompositeTemplateHintProvider(list): <NEW_LINE> <INDENT> def get_template_hints(self, name_provider, hint_providers=None): <NEW_LINE> <INDENT> if hint_providers is None: <NEW_LINE> <INDENT> hint_providers = self <NEW_LINE> <DEDENT> template_hints = [] <NEW_LINE> for hint_provider in hint_providers: <NEW_LINE> <IN...
Can be used as a composite of multiple TemplateHintProviders. That's useful if you want to group the providers into a list. It's used for example in the ``{% render_content %}`` template tag.
62598fa24f6381625f1993f8
class PostgresLexer(PostgresBase, RegexLexer): <NEW_LINE> <INDENT> name = 'PostgreSQL SQL dialect' <NEW_LINE> aliases = ['postgresql', 'postgres'] <NEW_LINE> mimetypes = ['text/x-postgresql'] <NEW_LINE> flags = re.IGNORECASE <NEW_LINE> tokens = { 'root': [ (r'\s+', Text), (r'--.*?\n', Comment.Single), (r'/\*', Comment....
Lexer for the PostgreSQL dialect of SQL. .. versionadded:: 1.5
62598fa285dfad0860cbf9b0
class ExcitationMotor: <NEW_LINE> <INDENT> def __init__(self, filename, phase_offset_excitation=0, rotation_direction=-1, optical_element='L/2 Plate'): <NEW_LINE> <INDENT> self.experiment_start_datetime = None <NEW_LINE> self.filename = filename <NEW_LINE> sel...
This class will hold the data associated with the excitation polarizer. It is used to: * read in the file generated by the labview component * extrapolate the angular function (assumed to be linear) * present the function such that it can be queried
62598fa2c432627299fa2e51
class MapdataRouter(object): <NEW_LINE> <INDENT> def db_for_read(self, model, **hints): <NEW_LINE> <INDENT> if model._meta.app_label == 'mapdata': <NEW_LINE> <INDENT> return 'msemap_db' <NEW_LINE> <DEDENT> return None <NEW_LINE> <DEDENT> def db_for_write(self, model, **hints): <NEW_LINE> <INDENT> if model._meta.app_lab...
Determine how to route database calls for an app's models (in this case, for an app named mapdata). All other models will be routed to the next router in the DATABASE_ROUTERS setting if applicable, or otherwise to the default database.
62598fa255399d3f05626399
class ConcreteComponent(Component): <NEW_LINE> <INDENT> def operation(self): <NEW_LINE> <INDENT> pass
Defina un objeto al cual nuevas responsabilidades pueden ser agregadas
62598fa292d797404e388aa1