code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Project(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=100) <NEW_LINE> description = models.CharField(max_length=5000, blank=True) <NEW_LINE> svn_path = models.CharField(max_length=500) <NEW_LINE> version = models.CharField(max_length=20) <NEW_LINE> public_time = models.DateTimeField() <NEW...
项目,用来定义所有项目信息
6259906963d6d428bbee3e6f
class IotHubDescriptionListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'next_link': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'value': {'key': 'value', 'type': '[IotHubDescription]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, value: Option...
The JSON-serialized array of IotHubDescription objects with a next link. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The array of IotHubDescription objects. :vartype value: list[~azure.mgmt.iothub.v2016_02_03.models.IotHubDescription] :ivar next_link: The next ...
62599069a219f33f346c7fd4
class JSONEncoderForHTML(json.JSONEncoder): <NEW_LINE> <INDENT> def encode(self, o): <NEW_LINE> <INDENT> chunks = self.iterencode(o) <NEW_LINE> if self.ensure_ascii: <NEW_LINE> <INDENT> return ''.join(chunks) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return u''.join(chunks) <NEW_LINE> <DEDENT> <DEDENT> def iterenco...
An encoder that produces JSON safe to embed in HTML. To embed JSON content in, say, a script tag on a web page, the characters &, < and > should be escaped. They cannot be escaped with the usual entities (e.g. &amp;) because they are not expanded within <script> tags. Originally from the simplejson project: https://g...
625990692c8b7c6e89bd4fb2
class ChatsSlice(TLObject): <NEW_LINE> <INDENT> __slots__ = ["count", "chats"] <NEW_LINE> ID = 0x9cd81144 <NEW_LINE> QUALNAME = "types.messages.ChatsSlice" <NEW_LINE> def __init__(self, *, count: int, chats: list): <NEW_LINE> <INDENT> self.count = count <NEW_LINE> self.chats = chats <NEW_LINE> <DEDENT> @staticmethod <N...
Attributes: LAYER: ``112`` Attributes: ID: ``0x9cd81144`` Parameters: count: ``int`` ``32-bit`` chats: List of either :obj:`ChatEmpty <pyrogram.api.types.ChatEmpty>`, :obj:`Chat <pyrogram.api.types.Chat>`, :obj:`ChatForbidden <pyrogram.api.types.ChatForbidden>`, :obj:`Channel <pyrogram.api.types.Chann...
62599069796e427e5384ff43
class ModeratorRegisterView(CreateView): <NEW_LINE> <INDENT> template_name = "moderators/signup.html" <NEW_LINE> form_class = ModeratorRegisterForm <NEW_LINE> def get_success_url(self) -> str: <NEW_LINE> <INDENT> return reverse_lazy('moderators:login')
Provides moderators the ability to register
6259906991f36d47f2231a75
class TracCommon(Stats): <NEW_LINE> <INDENT> def __init__(self, option, name=None, parent=None): <NEW_LINE> <INDENT> self.parent = parent <NEW_LINE> Stats.__init__(self, option, name, parent)
Common Trac Stats object for saving prefix & proxy
6259906932920d7e50bc7813
class ClaimCoverage(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_name = "ClaimCoverage" <NEW_LINE> def __init__(self, jsondict=None): <NEW_LINE> <INDENT> self.businessArrangement = None <NEW_LINE> self.claimResponse = None <NEW_LINE> self.coverage = None <NEW_LINE> self.focal = None <NEW_LINE> self.or...
Insurance or medical plan. Financial instrument by which payment information for health care.
62599069a8370b77170f1b91
class BatteryReader(object): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.stat_fin = open(os.path.join(self.path, 'status')) <NEW_LINE> self.now_fin = open(os.path.join(self.path, 'energy_now')) <NEW_LINE> self.full_fin = open(os.path.join(self.path, 'energy_full'))...
Battery using functions eats 80% of cpu see if you hold a file handle if it improves
62599069091ae356687063fe
class Data: <NEW_LINE> <INDENT> def __init__(self, train_x, train_y, dev_x, dev_y, test_x, test_y, timesteps=None, data_dim=200, vocab_size=0): <NEW_LINE> <INDENT> self.train_x = train_x <NEW_LINE> self.train_y = train_y <NEW_LINE> self.dev_x = dev_x <NEW_LINE> self.dev_y = dev_y <NEW_LINE> self.test_x = test_x <NEW_LI...
Data representation: separates train, dev, and test sets holds meta data about data properties
62599069460517430c432c3b
class FooItemAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ("title",) <NEW_LINE> prepopulated_fields = {"slug": ("title",)} <NEW_LINE> fieldsets = ( (None, {"fields": ("title", "slug", "body")}), ) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> app_label = _("Foo item")
Foo item admin.
625990694f88993c371f1105
class ExampleError(Exception): <NEW_LINE> <INDENT> def __init__(self, msg, code): <NEW_LINE> <INDENT> self.msg = msg <NEW_LINE> self.code = code
Exceptions are documented in the same way as classes. The __init__ method may be documented in either the class level docstring, or as a docstring on the __init__ method itself. Either form is acceptable, but the two should not be mixed. Choose one convention to document the __init__ method and be consistent with it....
62599069cc0a2c111447c6b6
class FloatField(BaseField): <NEW_LINE> <INDENT> def parse(self, xml, namespace): <NEW_LINE> <INDENT> value = self._fetch_by_xpath(xml, namespace) <NEW_LINE> if value: <NEW_LINE> <INDENT> return float(value) <NEW_LINE> <DEDENT> return self._default
Returns the single value found by the xpath expression, as a float
6259906992d797404e389742
class Block: <NEW_LINE> <INDENT> sizew = 40 <NEW_LINE> sizeh = 20 <NEW_LINE> x,y = 0, 0 <NEW_LINE> colour = 'red' <NEW_LINE> newc = 'black' <NEW_LINE> value = 1 <NEW_LINE> hits = 3 <NEW_LINE> broken = True
A Blocks represent blocks in the game
62599069379a373c97d9a7eb
class TestUnInstallation(CMFNotificationTestCase): <NEW_LINE> <INDENT> def afterSetUp(self): <NEW_LINE> <INDENT> qtool = getToolByName(self.portal, 'portal_quickinstaller') <NEW_LINE> self.setRoles(['Manager']) <NEW_LINE> qtool.uninstallProducts(['CMFNotification']) <NEW_LINE> <DEDENT> def testToolIsNotThere(self): <NE...
Test that the product has been properly uninstalled.
625990697d43ff2487427ff7
class OvertimeCredit(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name="overtime_credits", ) <NEW_LINE> comment = models.CharField(max_length=255, blank=True) <NEW_LINE> date = models.DateField() <NEW_LINE> duration = models.DurationField(defau...
Overtime credit model. An overtime credit is a transferred overtime from the last year. This is added to the worktime of a user.
6259906921bff66bcd724433
class Upper_Lip_pt(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "object.upper_lip_pt" <NEW_LINE> bl_label = "Upper Lip" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> found = 'Upper Lip' in bpy.data.objects <NEW_LINE> if found == False...
Tooltip
62599069435de62698e9d5d8
class TestMigrateToSplit(ModuleStoreTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestMigrateToSplit, self).setUp() <NEW_LINE> self.course = CourseFactory(default_store=ModuleStoreEnum.Type.mongo) <NEW_LINE> <DEDENT> def test_user_email(self): <NEW_LINE> <INDENT> call_command( "migrate_to_sp...
Unit tests for migrating a course from old mongo to split mongo
62599069097d151d1a2c283a
class Symmetric(Kernpart): <NEW_LINE> <INDENT> def __init__(self,k,transform=None): <NEW_LINE> <INDENT> if transform is None: <NEW_LINE> <INDENT> transform = np.eye(k.input_dim)*-1. <NEW_LINE> <DEDENT> assert transform.shape == (k.input_dim, k.input_dim) <NEW_LINE> self.transform = transform <NEW_LINE> self.input_dim =...
Symmetrical kernels :param k: the kernel to symmetrify :type k: Kernpart :param transform: the transform to use in symmetrification (allows symmetry on specified axes) :type transform: A numpy array (input_dim x input_dim) specifiying the transform :rtype: Kernpart
62599069e5267d203ee6cfa4
class DiffResultDescriptor: <NEW_LINE> <INDENT> def __init__(self, diff_function): <NEW_LINE> <INDENT> self.diff_function = diff_function <NEW_LINE> self.instances = WeakKeyDictionary() <NEW_LINE> <DEDENT> def __get__(self, obj, objtype=None): <NEW_LINE> <INDENT> if obj is None: <NEW_LINE> <INDENT> return self <NEW_LIN...
Descriptor for managing diff results.
62599069ac7a0e7691f73cb4
class ViewDebate(DetailView): <NEW_LINE> <INDENT> context_object_name = 'debate' <NEW_LINE> template_name = 'debate/debate_view.html' <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> key = self.kwargs['debate_id'] <NEW_LINE> debate = get_or_insert_object_in_cache(Debate, key, pk=key) <NEW_LINE> if datetime.date.tod...
View a debate. :context: get_place, notes, columns, rows
6259906944b2445a339b7546
class AverageMeter(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.clear() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self.avg = 0 <NEW_LINE> self.val = 0 <NEW_LINE> self.sum = 0 <NEW_LINE> self.count = 0 <NEW_LINE> <DEDENT> def clear(self): <NEW_LINE> <INDENT> self.reset() <NEW_...
Computes and stores the average and current value
625990692c8b7c6e89bd4fb3
class Dropout3d(Module): <NEW_LINE> <INDENT> def __init__(self, p=0.5, inplace=False): <NEW_LINE> <INDENT> super(Dropout3d, self).__init__() <NEW_LINE> if p < 0 or p > 1: <NEW_LINE> <INDENT> raise ValueError("dropout probability has to be between 0 and 1, " "but got {}".format(p)) <NEW_LINE> <DEDENT> self.p = p <NEW_LI...
Randomly zeroes whole channels of the input tensor. The channels to zero are randomized on every forward call. *Usually the input comes from Conv3d modules.* As described in the paper `Efficient Object Localization Using Convolutional Networks`_ , if adjacent pixels within feature maps are strongly correlated (as is ...
625990697047854f46340b83
class Extender(Super): <NEW_LINE> <INDENT> def method(self): <NEW_LINE> <INDENT> print('starting Extender.method') <NEW_LINE> Super.method(self) <NEW_LINE> print('ending Extender.method')
Failed to make an instance unless action is defined.
6259906945492302aabfdca5
class AlgorithmRunner(object): <NEW_LINE> <INDENT> def __init__(self, renderRefreshMethod=None): <NEW_LINE> <INDENT> self.algorithm = None <NEW_LINE> self.thread = None <NEW_LINE> self.forcedToStop = False <NEW_LINE> self.threadExceptionBucket = Queue() <NEW_LINE> self.renderRefreshMethod = renderRefreshMethod <NEW_LIN...
This class should have the following features
6259906926068e7796d4e107
class MembersGetInfoArgs(bb.Struct): <NEW_LINE> <INDENT> __slots__ = [ '_members_value', '_members_present', ] <NEW_LINE> _has_required_fields = True <NEW_LINE> def __init__(self, members=None): <NEW_LINE> <INDENT> self._members_value = None <NEW_LINE> self._members_present = False <NEW_LINE> if members is not None: <N...
:ivar team.MembersGetInfoArgs.members: List of team members.
625990695166f23b2e244ba0
class AbstractFormBuilder(object, metaclass=ABCMeta): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.constructed_object = None <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def add_text_field(self, field_dict): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def add_checkbox(s...
Builder interface specifying methods to create input, checkbox and button fields
6259906999cbb53fe68326b4
class SaleOrder(geo_model.GeoModel): <NEW_LINE> <INDENT> _inherit = "sale.order" <NEW_LINE> geo_point = fields.GeoPoint( 'Addresses coordinate', related='partner_invoice_id.geo_point')
Add geo_point to sale.order
62599069009cb60464d02d07
class WindowRateLimiter(RateLimiter): <NEW_LINE> <INDENT> def __init__(self, backend, key, *, limit=1, window=1): <NEW_LINE> <INDENT> assert limit >= 1, "limit must be positive" <NEW_LINE> assert window >= 1, "window must be positive" <NEW_LINE> super().__init__(backend, key) <NEW_LINE> self.limit = limit <NEW_LINE> se...
A rate limiter that ensures that only `limit` operations may happen over some sliding window. Note: Windows are in seconds rather that milliseconds. This is different from most durations and intervals used in Remoulade, because keeping metadata at the millisecond level is far too expensive for most use cases...
6259906991f36d47f2231a76
class AjouterSalle(forms.Form): <NEW_LINE> <INDENT> nom = forms.CharField(required=True, max_length=30, label="", widget=forms.TextInput(attrs={'placeholder': 'Nom', 'class':'form-control input-perso'})) <NEW_LINE> capacite = forms.IntegerField(required=False, label="", widget=forms.TextInput(attrs={'placeholder': 'Cap...
A Form to add a classroom to the database. :Exemples: >> form=AjouterSalle() >> form return html code of the form >> form=AjouterSalle(request.POST) >> form.cleaned_data['nom'] returns the name of the classroom that the user wants to add >> form=AjouterSalle(request.POST) >> if form.is_valid(): >> form.sa...
62599069091ae35668706400
class RandomTranslate(object): <NEW_LINE> <INDENT> def __init__(self, translate=0.2, diff=False): <NEW_LINE> <INDENT> self.translate = translate <NEW_LINE> if type(self.translate) == tuple: <NEW_LINE> <INDENT> assert len(self.translate) == 2, "Invalid range" <NEW_LINE> assert self.translate[0] > 0 & self.translate[0] <...
Randomly Translates the image Bounding boxes which have an area of less than 25% in the remaining in the transformed image is dropped. The resolution is maintained, and the remaining area if any is filled by black color. Parameters ---------- translate: float or tuple(float) if **float**, the image is trans...
6259906992d797404e389743
class Pais(models.Model): <NEW_LINE> <INDENT> nombre = models.CharField(max_length=100)
Guarda los paises
625990695fc7496912d48e4f
class ChargeSpecError(SpecError): <NEW_LINE> <INDENT> pass
Charge specification error.
625990693539df3088ecda6e
class TeraSort(luigi.hadoop_jar.HadoopJarJobTask): <NEW_LINE> <INDENT> terasort_in = luigi.Parameter(default=DEFAULT_TERASORT_IN, description="directory to store terasort input into.") <NEW_LINE> terasort_out = luigi.Parameter(default=DEFAULT_TERASORT_OUT, description="directory to store terasort output into.") <NEW_LI...
Runs TeraGent, by default using
6259906971ff763f4b5e8f75
class _IRandomGeneratorProxy: <NEW_LINE> <INDENT> __jsii_type__: typing.ClassVar[str] = "@aws-cdk/aws-autoscaling-common.IRandomGenerator" <NEW_LINE> @jsii.member(jsii_name="nextBoolean") <NEW_LINE> def next_boolean(self) -> builtins.bool: <NEW_LINE> <INDENT> return jsii.invoke(self, "nextBoolean", []) <NEW_LINE> <DEDE...
:stability: experimental
62599069cb5e8a47e493cd6b
class ICouponCreatedEvent(BaseWebhookEvent): <NEW_LINE> <INDENT> pass
describes a coupon - Occurs whenever a coupon is created.
625990693d592f4c4edbc6af
class V1VolumeError(object): <NEW_LINE> <INDENT> openapi_types = { 'message': 'str', 'time': 'datetime' } <NEW_LINE> attribute_map = { 'message': 'message', 'time': 'time' } <NEW_LINE> def __init__(self, message=None, time=None, local_vars_configuration=None): <NEW_LINE> <INDENT> if local_vars_configuration is None: <N...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
6259906963d6d428bbee3e71
class EnrollmentFrame(Frame): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> Frame.__init__(self, parent) <NEW_LINE> Label(self, text="Enrollment Frame").grid(row=0, column=0, sticky="w")
Frame container for Enrollment screen
6259906999cbb53fe68326b6
class RandomGaussianBlurring(object): <NEW_LINE> <INDENT> def __init__(self, sigma, p=0.2, random_state=np.random): <NEW_LINE> <INDENT> self.sigma = sigma <NEW_LINE> self.p = p <NEW_LINE> self.random_state = random_state <NEW_LINE> <DEDENT> def __call__(self, image): <NEW_LINE> <INDENT> if isinstance(self.sigma, collec...
Apply gaussian blur to a numpy.ndarray (H x W x C)
625990690a50d4780f7069a8
class ResultChannelHelper(QtCore.QObject): <NEW_LINE> <INDENT> _testStarted = QtCore.Signal(TestResultBase, DeviceExecResult) <NEW_LINE> _testStopped = QtCore.Signal(TestResultBase, DeviceExecResult) <NEW_LINE> _stopped = QtCore.Signal() <NEW_LINE> def __init__(self, resultView): <NEW_LINE> <INDENT> QtCore.QObject.__in...
A helper class to interact with a result channel. It maintains a tab in the Result view.
6259906932920d7e50bc7817
class Restaurant(): <NEW_LINE> <INDENT> def __init__(self,restaurant_name,cuisine_type): <NEW_LINE> <INDENT> self.restaurant_name = restaurant_name <NEW_LINE> self.cuisine_type = cuisine_type <NEW_LINE> <DEDENT> def describe_restaurant(self): <NEW_LINE> <INDENT> print(self.restaurant_name.title() + " serves " + self.c...
Simple model for a restaurant.
625990695166f23b2e244ba2
class IS_LOWER(Validator): <NEW_LINE> <INDENT> def __call__(self, value): <NEW_LINE> <INDENT> return (to_bytes(to_unicode(value).lower()), None)
Converts to lowercase:: >>> IS_LOWER()('ABC') ('abc', None) >>> IS_LOWER()('Ñ') ('\xc3\xb1', None)
62599069f548e778e596cd5c
class WFDataArrEver(RadiationField): <NEW_LINE> <INDENT> glossary_name = 'data/arrEver' <NEW_LINE> def __init__(self, wf): <NEW_LINE> <INDENT> super(WFDataArrEver, self).__init__(wf) <NEW_LINE> self.attributes.update( {'units': 'see params/wEFieldUnit', 'limits': '[FLOAT_MIN:FLOAT_MAX]', 'alias': 'arEy' }) <NEW_LINE> <...
EM field (Re, Im) pairs written in 3D array, slice number changes first. Vertical polarization
625990694e4d562566373bd7
class CanvasWriter(object): <NEW_LINE> <INDENT> def __init__(self, canvas): <NEW_LINE> <INDENT> self.canvas = canvas <NEW_LINE> self.filename = '' <NEW_LINE> <DEDENT> def set_filename(self, filename): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> <DEDENT> def write(self): <NEW_LINE> <INDENT> with open(self.fi...
This class is used to write a canvas object into a file
6259906916aa5153ce401caa
class Request(Message): <NEW_LINE> <INDENT> def __init__(self, method=None, params=None, msg_id=None): <NEW_LINE> <INDENT> self.method = method <NEW_LINE> self.params = params <NEW_LINE> self.msg_id = msg_id <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def parse(data): <NEW_LINE> <INDENT> if 'method' not in data: <NEW_...
Request a method call on the server.
62599069435de62698e9d5db
class BspScene(): <NEW_LINE> <INDENT> @property <NEW_LINE> def tris(self): <NEW_LINE> <INDENT> for face_idx, face in enumerate(self._bsp.faces): <NEW_LINE> <INDENT> if len(face.verts) < 3: <NEW_LINE> <INDENT> warn("{} (idx = {}) has < 3 " "verts".format(face, face_idx)) <NEW_LINE> continue <NEW_LINE> <DEDENT> first_ver...
An SDL scene, constructed from a `q3.bsp.Bsp` instance. This satifies the definition of a scene, described in `povray.sdl`.
62599069097d151d1a2c283e
class Id_Val(Val): <NEW_LINE> <INDENT> def __init__(self, value: str, value_type: types.Type = types.Unresolved()): <NEW_LINE> <INDENT> super().__init__(value, value_type) <NEW_LINE> self.cached_eval_result_val = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> if self.value_val is not ...
stores identifier of the variable, variable expression stores type signature variable identifier signature and STL formula operator
625990693539df3088ecda70
class Normalize(object): <NEW_LINE> <INDENT> def __init__(self, mean, std): <NEW_LINE> <INDENT> self.mean = mean <NEW_LINE> self.std = std <NEW_LINE> <DEDENT> def __call__(self, tensors, points): <NEW_LINE> <INDENT> if isinstance(tensors, list): is_list = True <NEW_LINE> else: is_list, tensors =...
Normalize an tensor image with mean and standard deviation. Given mean: (R, G, B) and std: (R, G, B), will normalize each channel of the torch.*Tensor, i.e. channel = (channel - mean) / std Args: mean (sequence): Sequence of means for R, G, B channels respecitvely. std (sequence): Sequence of standard deviations fo...
625990690c0af96317c57947
class Comment(models.Model): <NEW_LINE> <INDENT> content = models.TextField(max_length=150) <NEW_LINE> date_posted = models.DateTimeField(default=timezone.now) <NEW_LINE> author = models.ForeignKey(User, on_delete=models.CASCADE) <NEW_LINE> post_connected = models.ForeignKey(Post, on_delete=models.CASCADE) <NEW_LINE> d...
コメントの管理
62599069ac7a0e7691f73cb8
class Model372DigitalOutputRegister(RegisterBase): <NEW_LINE> <INDENT> bit_names = [ "d_1", "d_2", "d_3", "d_4", "d_5", ] <NEW_LINE> def __init__(self, d_1, d_2, d_3, d_4, d_5): <NEW_LINE> <INDENT> self.d_1 = d_1 <NEW_LINE> self.d_2 = d_2 <NEW_LINE> self.d_3 = d_3 <NEW_LINE> self.d_4 = d_4 <NEW_LINE> self.d_5 = d_5
Class representing the digital output register.
6259906971ff763f4b5e8f77
class Yum2(Model): <NEW_LINE> <INDENT> def setup(self): <NEW_LINE> <INDENT> with Vectorize(1): <NEW_LINE> <INDENT> cake = Cake() <NEW_LINE> <DEDENT> y = cake.y <NEW_LINE> self.cost = sum(y) <NEW_LINE> constraints = ConstraintSet([cake]) <NEW_LINE> return constraints
Total dessert system model containing 1 Cake
62599069d486a94d0ba2d790
class StartTask(ActionIntent): <NEW_LINE> <INDENT> required_fields = [ 'student_id', 'task_id', ] <NEW_LINE> auto_fields = [ ('task_session_id', new_id), ('session_id', get_current_session_id, 'student_id'), ] <NEW_LINE> def check_duplicate(self, state): <NEW_LINE> <INDENT> student_id = self.data['student_id'] <NEW_LIN...
Student starts working on a task
62599069b7558d5895464b19
class StatsViewSet(GenericViewSet): <NEW_LINE> <INDENT> permission_classes = [AllowAny] <NEW_LINE> def list(self, request): <NEW_LINE> <INDENT> now = datetime.now() <NEW_LINE> current_month = (now.year, now.month) <NEW_LINE> user_count = auth_models.User.objects.filter( is_active=True, account__is_disabled=False).count...
Handle stats: show: transactions, cash position, amount of donations. Overall and for the current month. This view set is public and can be viewed without being logged in.
62599069442bda511e95d941
class Alien(Sprite): <NEW_LINE> <INDENT> def __init__(self, ai_settings, screen): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.ai_settings = ai_settings <NEW_LINE> self.screen = screen <NEW_LINE> self.image = pygame.image.load('images/alien.bmp') <NEW_LINE> self.rect = self.image.get_rect() <NEW_LINE> self.re...
表示单个外星人的类
62599069d6c5a102081e38fa
class VirtualDeviceNeVnSectionGridRemote(RemoteModel): <NEW_LINE> <INDENT> properties = ("DeviceID", "Collector", "DeviceIPDotted", "DeviceIPNumeric", "VirtualNetworkID", "Network", "DeviceName", "count", "DeviceModel", "DeviceVersion", "DeviceType", "DeviceMAC", "DeviceVendor", "DeviceContextName", )
| ``DeviceID:`` none | ``attribute type:`` string | ``Collector:`` none | ``attribute type:`` string | ``DeviceIPDotted:`` none | ``attribute type:`` string | ``DeviceIPNumeric:`` none | ``attribute type:`` string | ``VirtualNetworkID:`` none | ``attribute type:`` string | ``Network:`` none | ``attribu...
62599069aad79263cf42ff88
class Ins_MOVE(Instruction): <NEW_LINE> <INDENT> def __init__(self, order): <NEW_LINE> <INDENT> super(Ins_MOVE, self).__init__(order) <NEW_LINE> self.opcode = "MOVE" <NEW_LINE> <DEDENT> def execute(self): <NEW_LINE> <INDENT> self.printExecuting() <NEW_LINE> var1 = self.ops_list[0].toVar() <NEW_LINE> var2 = self.ops_lis...
MOVE instruction
62599069cc0a2c111447c6b9
class ComputeManagementClientConfiguration(Configuration): <NEW_LINE> <INDENT> def __init__( self, credential: "TokenCredential", subscription_id: str, **kwargs: Any ) -> None: <NEW_LINE> <INDENT> super(ComputeManagementClientConfiguration, self).__init__(**kwargs) <NEW_LINE> if credential is None: <NEW_LINE> <INDENT> ...
Configuration for ComputeManagementClient. Note that all parameters used to create this instance are saved as instance attributes. :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Subscription credentials which u...
6259906938b623060ffaa43b
class RequestError(Exception): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return repr(self.value) <NEW_LINE> <DEDENT> def __unicode__(self): <NEW_LINE> <INDENT> return self.value
请求异常
625990697d43ff2487427ffa
class ToScriptHash(list): <NEW_LINE> <INDENT> pass
just for some plugin do not generate syntax check error.
6259906916aa5153ce401cac
class Solution: <NEW_LINE> <INDENT> def maxPathSum(self, root): <NEW_LINE> <INDENT> maxSum, _ = self.maxPathHelper(root) <NEW_LINE> return maxSum <NEW_LINE> <DEDENT> def maxPathHelper(self, root): <NEW_LINE> <INDENT> if root is None: <NEW_LINE> <INDENT> return None, 0 <NEW_LINE> <DEDENT> left = self.maxPathHelper(root....
@param: root: The root of binary tree. @return: An integer
6259906956b00c62f0fb40a2
class NetInfo(models.Model): <NEW_LINE> <INDENT> host_uid = models.CharField(max_length=10, verbose_name='随机码') <NEW_LINE> insert_datetime = models.DateTimeField(default=datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') , verbose_name='插入时间戳') <NEW_LINE> net_io_counters = models.IntegerField(verbose_name='网络的 I/O 情...
记录主机网络动态性能信息
62599069adb09d7d5dc0bd3d
class Benchmark(EndPoint): <NEW_LINE> <INDENT> argparse_noflag = "benchmark_code" <NEW_LINE> schema = { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "required": ["benchmark_code", "language"], "properties": { "language": { "type": "string", "title": "l", "description": "性能检验针对的语言", "enum": ["...
对指定语言的源码做性能检验.
625990690c0af96317c57948
class kalman_circular(kalman_jc.KalmanFilter): <NEW_LINE> <INDENT> def __init__(self, q, r): <NEW_LINE> <INDENT> self._last_value = 0 <NEW_LINE> super().__init__(q, r) <NEW_LINE> <DEDENT> def _enrollar(self, x): <NEW_LINE> <INDENT> while (x - self._last_value) > 180: <NEW_LINE> <INDENT> x -= 360 <NEW_LINE> <DEDENT> whi...
Filtro de kalman para usar con grados sexagesimales, que tiene en cuenta que 0-360 es la misma cosa
625990693539df3088ecda72
class SplitEvent(DemographicEvent): <NEW_LINE> <INDENT> def __init__(self, sizes=[], names=[], ops=[], output='', begin=0, end=-1, step=1, at=[], reps=ALL_AVAIL, subPops=ALL_AVAIL, infoFields=[]): <NEW_LINE> <INDENT> self.sizes = sizes <NEW_LINE> self.names = names <NEW_LINE> DemographicEvent.__init__(self, ops, output...
A demographic event that splits a specified population into two or more subpopulations.
6259906997e22403b383c6e0
class GELU(df.Module): <NEW_LINE> <INDENT> def symb_forward(self, x): <NEW_LINE> <INDENT> return 0.5 * x * (1 + df.T.tanh(0.79788456 * (x + 0.044715 * x*x*x)))
Gaussian Error Linear Unit (https://arxiv.org/abs/1606.08415)
62599069dd821e528d6da56a
@square <NEW_LINE> @symmetric <NEW_LINE> class EigendecompositionOperator(CompositionOperator): <NEW_LINE> <INDENT> def __init__(self, A=None, v=None, w=None, **kwargs): <NEW_LINE> <INDENT> if v is None or w is None: <NEW_LINE> <INDENT> w, v = eigsh(A, return_eigenvectors=True, **kwargs) <NEW_LINE> <DEDENT> W = Diagona...
Define a symmetric Operator from the eigendecomposition of another symmetric Operator. This can be used as an approximation for the operator. Inputs ------- A: Operator (default: None) The linear operator to approximate. v: 2d ndarray (default: None) The eigenvectors as given by arpack.eigsh w: 1d ndarray (defaul...
625990697b25080760ed88cb
class Solve: <NEW_LINE> <INDENT> def __init__(self, input, equation): <NEW_LINE> <INDENT> input = int(input) <NEW_LINE> self.equation = equation <NEW_LINE> out = eval(equation) <NEW_LINE> self.out = out
docstring for Solve.
62599069fff4ab517ebcefee
class Solution: <NEW_LINE> <INDENT> def topKFrequentWords(self, words, k): <NEW_LINE> <INDENT> count = {} <NEW_LINE> for word in words: <NEW_LINE> <INDENT> count[word] = count.get(word, 0) + 1 <NEW_LINE> <DEDENT> heap = [] <NEW_LINE> for word in count: <NEW_LINE> <INDENT> item = Item(count[word], word) <NEW_LINE> heapp...
@param words: an array of string @param k: An integer @return: an array of string
6259906966673b3332c31bd1
class HandlerSignUp(HandlerBase): <NEW_LINE> <INDENT> def add_user(self, username, password, email): <NEW_LINE> <INDENT> hashed_password = session.hash_password(username, password) <NEW_LINE> new_user = User( parent = session.user_key(), username = username, password = hashed_password, email = email ) <NEW_LINE> u_key ...
Shows singup info for user who'd like to register
625990691f037a2d8b9e5454
class DocumentInformation(DictionaryObject): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> DictionaryObject.__init__(self) <NEW_LINE> <DEDENT> def getText(self, key): <NEW_LINE> <INDENT> retval = self.get(key, None) <NEW_LINE> if isinstance(retval, TextStringObject): <NEW_LINE> <INDENT> return retval <NEW...
A class representing the basic document metadata provided in a PDF File. This class is accessible through :meth:`documentInfo()<pypdf.PdfFileReader.documentInfo()>` All text properties of the document metadata have *two* properties, e.g. author and author_raw. The non-raw property will always return a ``TextStringObje...
6259906921bff66bcd72443a
class DynamodbEncryptionSdkError(Exception): <NEW_LINE> <INDENT> pass
Base class for all custom exceptions.
6259906963d6d428bbee3e73
class MCellFloatVectorProperty(bpy.types.PropertyGroup): <NEW_LINE> <INDENT> vec: FloatVectorProperty(name="Float Vector") <NEW_LINE> def remove_properties ( self, context ): <NEW_LINE> <INDENT> pass
Generic PropertyGroup to hold float vector for a CollectionProperty
625990698e7ae83300eea862
class FuzzLoggerCsv(ifuzz_logger_backend.IFuzzLoggerBackend): <NEW_LINE> <INDENT> def __init__(self, file_handle=sys.stdout, bytes_to_str=DEFAULT_HEX_TO_STR): <NEW_LINE> <INDENT> self._file_handle = file_handle <NEW_LINE> self._format_raw_bytes = bytes_to_str <NEW_LINE> self._csv_handle = csv.writer(self._file_handle) ...
This class formats FuzzLogger data for pcap file. It can be configured to output to a named file.
62599069aad79263cf42ff8a
class MyScrollBar(QScrollBar): <NEW_LINE> <INDENT> def __init__(self, orientation, parent=None): <NEW_LINE> <INDENT> super().__init__(orientation, parent) <NEW_LINE> self.equation = None <NEW_LINE> self.prev_max = None <NEW_LINE> <DEDENT> def mouseReleaseEvent(self, event): <NEW_LINE> <INDENT> QScrollBar.mouseReleaseEv...
Class to set focus in equation when moving the scroll bars. It also moves the equation correctly when inserting new elements.
625990694e4d562566373bdb
class ImporterMain(HasTraits): <NEW_LINE> <INDENT> _last_open_path = File() <NEW_LINE> _files_path = List(File) <NEW_LINE> _notice_shown = Bool(False) <NEW_LINE> def import_data(self, file_path, have_variable_names = True, have_object_names = True, sep='\t'): <NEW_LINE> <INDENT> importer = self._make_importer(file_path...
Importer class
62599069091ae35668706406
class HowItWorks(Section): <NEW_LINE> <INDENT> _subheading_locator = (By.CSS_SELECTOR, 'h2') <NEW_LINE> _box_locator = (By.CSS_SELECTOR, '.blurb-table .blurb') <NEW_LINE> @property <NEW_LINE> def subheading(self): <NEW_LINE> <INDENT> return self.find_element(*self._subheading_locator) <NEW_LINE> <DEDENT> @property <NEW...
The 'How It Works' section.
6259906938b623060ffaa43c
class Solution: <NEW_LINE> <INDENT> def searchBST(self, root, val): <NEW_LINE> <INDENT> if not root or root.val == val: return root <NEW_LINE> if val < root.val: return self.searchBST(root.left, val) <NEW_LINE> else: return self.searchBST(root.right, val)
@param root: the tree @param val: the val which should be find @return: the node
62599069009cb60464d02d0e
class BasicLSTMCell(RNNCell): <NEW_LINE> <INDENT> def __init__(self, num_units, forget_bias=1.0, state_is_tuple=True, activation=None, reuse=None): <NEW_LINE> <INDENT> super(BasicLSTMCell, self).__init__(_reuse=reuse) <NEW_LINE> if not state_is_tuple: <NEW_LINE> <INDENT> logging.warn("%s: Using a concatenated state is ...
Basic LSTM recurrent network cell. The implementation is based on: http://arxiv.org/abs/1409.2329. We add forget_bias (default: 1) to the biases of the forget gate in order to reduce the scale of forgetting in the beginning of the training. It does not allow cell clipping, a projection layer, and does not use peep-hole...
625990694527f215b58eb58a
class TextWrapperWithNewLines: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def wrap(text, width=70, **kw): <NEW_LINE> <INDENT> result = [] <NEW_LINE> for line in text.split("\n"): <NEW_LINE> <INDENT> result.extend(textwrap.wrap(line, width, **kw)) <NEW_LINE> <DEDENT> return result <NEW_LINE> <DEDENT> @staticmethod <NE...
TextWrapper that keeps newline characters.
62599069379a373c97d9a7f4
class SynplaBootstrap(object): <NEW_LINE> <INDENT> def __init__(self, app=None): <NEW_LINE> <INDENT> self.app = app <NEW_LINE> if self.app: <NEW_LINE> <INDENT> self.init_app(self.app) <NEW_LINE> <DEDENT> <DEDENT> def init_app(self, app): <NEW_LINE> <INDENT> blueprint = Blueprint( 'synpla_bootstrap', __name__, template_...
Bootstrap templates for SynPla.
625990694428ac0f6e659d07
class FloatType(FloatBaseType): <NEW_LINE> <INDENT> __slots__ = ['name', 'nbits', 'nmant', 'nexp'] <NEW_LINE> _construct_nbits = _construct_nmant = _construct_nexp = Integer <NEW_LINE> @property <NEW_LINE> def max_exponent(self): <NEW_LINE> <INDENT> return two**(self.nexp - 1) <NEW_LINE> <DEDENT> @property <NEW_LINE> d...
Represents a floating point type with fixed bit width. Base 2 & one sign bit is assumed. Parameters ========== name : str Name of the type. nbits : integer Number of bits used (storage). nmant : integer Number of bits used to represent the mantissa. nexp : integer Number of bits used to represent the...
6259906916aa5153ce401cae
class Crawler: <NEW_LINE> <INDENT> def __init__(self, keywords, db, timeout=3): <NEW_LINE> <INDENT> self.keywords = keywords <NEW_LINE> self.item = ItemCrawler(self.keywords, db, timeout) <NEW_LINE> self.rate = RateCrawler(db, timeout) <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> self.item.run() <NEW_LINE> se...
淘宝商品及评论爬虫
62599069097d151d1a2c2843
class Sound(EventDispatcher): <NEW_LINE> <INDENT> source = StringProperty(None) <NEW_LINE> volume = NumericProperty(1.) <NEW_LINE> state = OptionProperty('stop', options=('stop', 'play')) <NEW_LINE> def _get_status(self): <NEW_LINE> <INDENT> return self.state <NEW_LINE> <DEDENT> status = AliasProperty(_get_status, None...
Represent a sound to play. This class is abstract, and cannot be used directly. Use SoundLoader to load a sound ! :Events: `on_play` : None Fired when the sound is played `on_stop` : None Fired when the sound is stopped
625990692ae34c7f260ac8bd
class Meta: <NEW_LINE> <INDENT> model = Servicios <NEW_LINE> fields = ('nombre', 'precio', 'descripcion',)
Meta.
62599069a17c0f6771d5d792
class TestFaults(test.TestCase): <NEW_LINE> <INDENT> def test_fault_exception(self): <NEW_LINE> <INDENT> fault = faults.Fault(webob.exc.HTTPBadRequest( explanation='test')) <NEW_LINE> self.assertTrue(isinstance(fault.wrapped_exc, webob.exc.HTTPBadRequest)) <NEW_LINE> <DEDENT> def test_fault_exception_status_int(self): ...
Tests covering ec2 Fault class.
625990691b99ca4002290120
class StructuralSectionRoundBar(StructuralSectionRound,IDisposable): <NEW_LINE> <INDENT> def Dispose(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def ReleaseUnmanagedResources(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __enter__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __e...
Defines parameters for Round Bar structural section. StructuralSectionRoundBar(diameter: float,centroidHorizontal: float,centroidVertical: float,principalAxesAngle: float,sectionArea: float,perimeter: float,nominalWeight: float,momentOfInertiaStrongAxis: float,momentOfInertiaWeakAxis: float,elasticModulusStrongAxis:...
62599069a8370b77170f1b9a
class Environment: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._running = False <NEW_LINE> self._simulation_sleep = 0.1 <NEW_LINE> self._dtime = 0.1 <NEW_LINE> self.current_date_time = datetime.datetime(year=2017, month=11, day=16, hour=8) <NEW_LINE> self.ambient_air_temperature = 20.0 <NEW_LINE> s...
Class to simulate a controlled environment.
62599069e1aae11d1e7cf3f7
class SpliterInterfaceException(SpliterException): <NEW_LINE> <INDENT> pass
Interface exception.
62599069be8e80087fbc0861
class MCP_Input: <NEW_LINE> <INDENT> address = 0 <NEW_LINE> num_gpios = 0 <NEW_LINE> mcp = None <NEW_LINE> buttons = [] <NEW_LINE> debug_states = [] <NEW_LINE> def __init__(self, address = 0x20, num_gpios = 16): <NEW_LINE> <INDENT> self.address = address <NEW_LINE> self.num_gpios = num_gpios <NEW_LINE> self.mcp = Adafr...
Gather, via I2C protocol, the state of buttons hooked up to a MCP23017 IC. Convert it into something useful and pass the state info on to associaton Button objects.
625990698da39b475be049c1
class RemoveShapeKeyOperator(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "tsk.remove_shape_keys" <NEW_LINE> bl_label = "Remove Shape Keys in src" <NEW_LINE> bl_description = 'Remove all Shape Keys in source mesh' <NEW_LINE> bl_context = 'objectmode' <NEW_LINE> bl_options = {'REGISTER', 'INTERNAL','UNDO'} <NEW_...
Remove all Shape Keys in source mesh
625990693cc13d1c6d466f1b
class UnsupportedCurrencyError(Exception): <NEW_LINE> <INDENT> def __init__(self, currency): <NEW_LINE> <INDENT> super().__init__(currency)
A currency is currently not supported by the API
6259906921bff66bcd72443c
class MedianFilter(AbstractBGModel): <NEW_LINE> <INDENT> def __init__(self, imageBuffer, thresh=20, soft_thresh = False): <NEW_LINE> <INDENT> AbstractBGModel.__init__(self, imageBuffer, thresh, soft_thresh) <NEW_LINE> <DEDENT> def _getMedianVals(self): <NEW_LINE> <INDENT> self._imageStack = self._imageBuffer.asStackBW(...
Uses median pixel values of the images in a buffer to approximate a background model.
6259906976e4537e8c3f0d58
class SpecCounter: <NEW_LINE> <INDENT> def __init__(self, specName = None, specVersion = None, timeout = None): <NEW_LINE> <INDENT> self.channelName = '' <NEW_LINE> self.connection = None <NEW_LINE> self.type = UNKNOWN <NEW_LINE> if specName is not None and specVersion is not None: <NEW_LINE> <INDENT> self.connectToSpe...
SpecCounter class
625990693d592f4c4edbc6b5
class FileFinder(finders.FileSystemFinder): <NEW_LINE> <INDENT> def __init__(self, locations): <NEW_LINE> <INDENT> self.locations = [] <NEW_LINE> self.prefixes = set() <NEW_LINE> self.storages = OrderedDict() <NEW_LINE> if not isinstance(locations, (list, tuple)): <NEW_LINE> <INDENT> raise TypeError("locations argument...
A modified version of the Django FileSystemFinder class which allows us to pass in arbitrary locations to find files
62599069e76e3b2f99fda1d7
class Hook(GitHubCore): <NEW_LINE> <INDENT> def __init__(self, hook, session=None): <NEW_LINE> <INDENT> super(Hook, self).__init__(hook, session) <NEW_LINE> self._api = hook.get('url', '') <NEW_LINE> self.updated_at = None <NEW_LINE> if hook.get('updated_at'): <NEW_LINE> <INDENT> self.updated_at = self._strptime(hook.g...
The :class:`Hook <Hook>` object. This handles the information returned by GitHub about hooks set on a repository. See also: http://developer.github.com/v3/repos/hooks/
62599069aad79263cf42ff8b
class Generator(tf.keras.Model): <NEW_LINE> <INDENT> def __init__(self, output_dim=28 * 28): <NEW_LINE> <INDENT> super(Generator, self).__init__() <NEW_LINE> self.output_dim = output_dim <NEW_LINE> self.dense_G_1 = tf.layers.Dense(128, activation=tf.nn.relu) <NEW_LINE> self.dense_G_2 = tf.layers.Dense(256, activation=t...
Generator Module for GAN Args: noise_dim: dimension of noise z. basically 10 is used output_dim: dimension of output image. 28 * 28 for MNIST
625990698e7ae83300eea864
class Imu(object): <NEW_LINE> <INDENT> def __init__(self, imu_file): <NEW_LINE> <INDENT> self.file = imu_file <NEW_LINE> self.rows = 0 <NEW_LINE> self.info = np.array(["", 0, 0]) <NEW_LINE> self.a, self.w, self.timestamp = np.array([0, 0, 0]), np.array([0, 0, 0]), np.array([0]) <NEW_LINE> self.end_info = np.array([0, 0...
the class that parse the input imu and adds noise to imu
62599069d6c5a102081e38fe
class BoxTransfer(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = _("box transfer") <NEW_LINE> verbose_name_plural = _("box transfers") <NEW_LINE> <DEDENT> from_box = models.ForeignKey( Box, verbose_name=_("debtor box"), related_name='debits') <NEW_LINE> to_box = models.ForeignKey( Box...
Represent a tranfer of money from a box to another.
6259906932920d7e50bc781d
class IsolatedTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def run(self, result=None): <NEW_LINE> <INDENT> if result is None: result = self.defaultTestResult() <NEW_LINE> run_isolated(unittest.TestCase, self, result)
A TestCase which executes in a forked process. Each test gets its own process, which has a performance overhead but will provide excellent isolation from global state (such as django configs, zope utilities and so on).
625990697b180e01f3e49c4f
class Directory(object): <NEW_LINE> <INDENT> def __init__(self, abspath, relpath, parent): <NEW_LINE> <INDENT> self._abspath = abspath <NEW_LINE> self._relpath = relpath <NEW_LINE> self._name = os.path.basename(abspath) <NEW_LINE> self._parent = parent <NEW_LINE> self._rawdoc = None <NEW_LINE> self._module = None <NEW_...
(Sub)directory in the GROMACS tree.
625990694a966d76dd5f06cb
class CacheBackend(KeyValueStoreBackend): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(CacheBackend, self).__init__(*args, **kwargs) <NEW_LINE> self.serializer = 'pickle' <NEW_LINE> <DEDENT> def get(self, key): <NEW_LINE> <INDENT> return self.cache_backend.get(key) <NEW_LINE> <DEDE...
Backend using the Django cache framework to store task metadata.
625990698e7ae83300eea865