code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Server(RoutedWebsocketServer): <NEW_LINE> <INDENT> def __init__(self,socket_paths : dict, http_paths : dict ,host : str = LOCALHOST,port : int = 8000,global_max_size : int = 1024,CORS_DOMAINS : list = [],headr_recv_size : int = 1024,**kwargs) -> None: <NEW_LINE> <INDENT> super(Server, self).__init__(socket_paths,...
Server that can handle both websocket and HTTP connections concurrently at the same adress and port. The way connections are distinguished is by looking at the Upgrade header's value. if it is not present or it is anything else other than 'websocket' then it is interpeted as HTTP else it is authenticated as ws.
62598ee5d486a94d0ba2a64d
class FlowControl(Operation): <NEW_LINE> <INDENT> def __init__(self, buffer_size): <NEW_LINE> <INDENT> opcode = CMD_FLOW_CONTROL <NEW_LINE> Operation.__init__(self, opcode, key = "connection_buffer_size", value = str(buffer_size)) <NEW_LINE> <DEDENT> def formated_response(self, opcode, keylen, extlen, status, cas, body...
FlowControl spec
62598ee53eb6a72ae0388cc3
class IGroupAssignment(IDocPrincipal): <NEW_LINE> <INDENT> pass
Doc group assignment.
62598ee576e4537e8c3edc38
class DummyPortMapperFactory(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._connectDeferred = Deferred()
Fake EPMD factory for tests.
62598ee50c0af96317c54a1e
class GeneralMailMixIn: <NEW_LINE> <INDENT> def generate(self, process_name): <NEW_LINE> <INDENT> email_dict = GenerateEmailVar(process_name=process_name, **self.conf.get("global.subj_body")) <NEW_LINE> return email_dict
用来解析conf中的subj_body, 返回一个字典
62598ee5a8370b77170eea65
class PanglerCallStubTestCase(unittest.TestCase): <NEW_LINE> <INDENT> p = panglery.Pangler() <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> irc.addDefaultDispatchHooks(self.p) <NEW_LINE> <DEDENT> def assertStubCalled(self, stub, *args, **kwargs): <NEW_LINE> <INDENT> self.assertTrue(stub.called) <NEW_LINE> calledArgs, ...
A test case that verifies if a pangler called a stub.
62598ee52c8b7c6e89bd1e41
class BlogPost(models.Model): <NEW_LINE> <INDENT> pass
Some entity 1
62598ee57d847024c075aa4f
class ScoresRSSAction(Action): <NEW_LINE> <INDENT> def handle(self): <NEW_LINE> <INDENT> if self.classname != 'country': <NEW_LINE> <INDENT> raise ValueError('This action only applies to countries') <NEW_LINE> <DEDENT> self.client.setHeader('Content-Type', 'application/rss+xml') <NEW_LINE> if self.nodeid is None: <NEW_...
Action to return an RSS feed of scores.
62598ee5dd821e528d6d75c6
class Snapshot(object): <NEW_LINE> <INDENT> def __init__(self, events, decisions=None): <NEW_LINE> <INDENT> self.events = events <NEW_LINE> self.decisions = decisions
Class representing Snapshot.
62598ee5fff4ab517ebcbe5a
class ResourceBarResize(Message): <NEW_LINE> <INDENT> pass
Signals a change in resource bar size (not slot changes, but number of slot changes).
62598ee58e7ae83300ee7711
class LinuxConfiguration(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'disable_password_authentication': {'key': 'disablePasswordAuthentication', 'type': 'bool'}, 'ssh': {'key': 'ssh', 'type': 'SshConfiguration'}, 'provision_vm_agent': {'key': 'provisionVMAgent', 'type': 'bool'}, } <NEW_LINE> def...
Specifies the Linux operating system settings on the virtual machine. :code:`<br>`:code:`<br>`For a list of supported Linux distributions, see `Linux on Azure-Endorsed Distributions <https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.j...
62598ee5d268445f26638ecf
class DockingAttribute(Attribute,_Attribute): <NEW_LINE> <INDENT> def Equals(self,obj): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def GetHashCode(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def IsDefaultAttribute(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __eq__(self,*args): <NEW_LINE> <INDENT> ...
Specifies the default docking behavior for a control. DockingAttribute() DockingAttribute(dockingBehavior: DockingBehavior)
62598ee5a8ecb0332586f86a
class MailForm(FlaskForm): <NEW_LINE> <INDENT> subject = TextField(validators = [ Required() ], render_kw={"placeholder": "will be prefixed with [DevSummit Name]"}) <NEW_LINE> body = TextField(widget = TextArea(), validators = [ Required() ], render_kw={"placeholder": "plain text only", "rows": "10"}) <NEW_LINE> send =...
Form used to define (and validate) UI-entered emails for attendees
62598ee53c8af77a43b67274
class IStartVM(IJob): <NEW_LINE> <INDENT> pass
Starts a vm.
62598ee5379a373c97d9767d
class Lines: <NEW_LINE> <INDENT> def __init__(self, rows, columns): <NEW_LINE> <INDENT> self.rows = rows <NEW_LINE> self.columns = columns <NEW_LINE> self.lines = self._getLines(rows, columns) <NEW_LINE> <DEDENT> def _getLines(self, nRows, nColumns): <NEW_LINE> <INDENT> return self._getRows(nRows, nColumns) + self._get...
A Lines object contains: - All of the horizontal and vertical line coordinates for a grid of dimensions ('rows' x 'columns').
62598ee5097d151d1a2bf6a2
class SessionEndedRequestHandler(AbstractRequestHandler): <NEW_LINE> <INDENT> def can_handle(self, handler_input): <NEW_LINE> <INDENT> return ask_utils.is_request_type("SessionEndedRequest")(handler_input) <NEW_LINE> <DEDENT> def handle(self, handler_input): <NEW_LINE> <INDENT> handler_input.attributes_manager.session_...
Handler for Session End.
62598ee53d592f4c4edb9577
class AcsImage(Entity): <NEW_LINE> <INDENT> label = StringField('div[id^="fig"]::attr("id"), img[alt="Abstract Image"]::attr("alt"), div[id^="sch"]::attr("id")') <NEW_LINE> caption = StringField('div[class="caption hlFld-FigureCaption"]') <NEW_LINE> url = UrlField('img::attr("src")') <NEW_LINE> process_caption = Chain(...
Embedded image. Includes both Schemes and Figures.
62598ee510dbd63aa1c6f1f4
class StorageAccount(ARMBaseModel): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'system_data': {'readonly': True}, 'data_policy': {'required': True}, 'blob_endpoint': {'readonly': True}, 'container_count': {'readonly': True}, } <NEW_LINE> _attrib...
Represents a Storage Account on the Data Box Edge/Gateway device. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. :ivar id: The path ID that uniquely identifies the object. :vartype id: str :ivar name: The o...
62598ee599fddb7c1ca62146
class InconsistentCSIDCAS(LabForUser): <NEW_LINE> <INDENT> def setUpFormData(self): <NEW_LINE> <INDENT> super(InconsistentCSIDCAS, self).setUpFormData() <NEW_LINE> self.formData['CAS_ID'] = '290-37-9' <NEW_LINE> <DEDENT> def test_validation(self): <NEW_LINE> <INDENT> self.validationFails()
Tests that the form does not validate when the CAS number and CSID are not consistent.
62598ee58a43f66fc4bf07f4
class RouteLogic: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.dbinterface_map_list = list(); <NEW_LINE> self.dbindexerMatch = lambda x,y,z:[i for i,p in enumerate( self.dbinterface_map_list) if p['userid_name']==x and p['db_type']==y and p['sched_cat']==z] <NEW_LINE> self.schedmaster_map_list = lis...
ref http://stackoverflow.com/questions/8725605/bottle-framework-and-oop-using-method-instead-of-function and https://www.artima.com/weblogs/viewpost.jsp?thread=240808 http://www.jeffknupp.com/blog/2013/11/29/improve-your-python-decorators-explained/ for decorator related tutorials and integrating bottle with methods.
62598ee57047854f4633da57
class SetVariable(Statement): <NEW_LINE> <INDENT> __slots__ = ('vnameexp', 'token', 'value', 'valueloc', 'targetexp', 'source') <NEW_LINE> def __init__(self, vnameexp, token, value, valueloc, targetexp, source=None): <NEW_LINE> <INDENT> assert isinstance(vnameexp, (data.Expansion, data.StringExpansion)) <NEW_LINE> asse...
Represents a variable assignment. Variable assignment comes in two different flavors. Simple assignment has the form: <Expansion> <Assignment Token> <string> e.g. FOO := bar These correspond to the fields `vnameexp`, `token`, and `value`. In addition, `valueloc` will be a Location and `source` will be a pymake.d...
62598ee560cbc95b063629bf
class NotFollowingFeed(FeedException): <NEW_LINE> <INDENT> pass
Raised upon unfollow request while not actually following
62598ee53617ad0b5ee047b2
class Add(Layer): <NEW_LINE> <INDENT> def __init__(self, weights=None, **kwargs): <NEW_LINE> <INDENT> super(Add, self).__init__(**kwargs) <NEW_LINE> self.weights = weights <NEW_LINE> try: <NEW_LINE> <INDENT> shape1 = list(self.in_layers[0].shape) <NEW_LINE> shape2 = list(self.in_layers[1].shape) <NEW_LINE> if len(shape...
Compute the (optionally weighted) sum of the input layers.
62598ee5fbf16365ca792725
class UserInfoDialog(QtGui.QDialog): <NEW_LINE> <INDENT> @logger.logFn <NEW_LINE> def __init__(self, username, email, parent = None): <NEW_LINE> <INDENT> QtGui.QDialog.__init__(self, parent) <NEW_LINE> self.ui = userInfoUi.Ui_Dialog() <NEW_LINE> self.ui.setupUi(self) <NEW_LINE> self.setWindowTitle("(Git) User Informati...
Dialog for getting (or changing) the username and email address used by git.
62598ee5aad79263cf42ce8c
class RunOnceNtuserPlugintest(test_lib.RegistryPluginTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self._plugin = run.RunUserPlugin() <NEW_LINE> <DEDENT> def testProcess(self): <NEW_LINE> <INDENT> test_file = self._GetTestFilePath(['NTUSER-RunTests.DAT']) <NEW_LINE> key_path = u'\\Software\\Micros...
Tests for the RunOnce Windows Registry plugin on the User hive.
62598ee591f36d47f22301e4
class ArrowOption(MenuOption): <NEW_LINE> <INDENT> __direction = None <NEW_LINE> __color = () <NEW_LINE> def __init__(self, direction, pos=None, function=None): <NEW_LINE> <INDENT> super(ArrowOption, self).__init__(None, pos, function) <NEW_LINE> self.size = (30, 30) <NEW_LINE> self.surface = pygame.Surface(self.size) ...
A selectable menu option in the shape of an arrow.
62598ee555399d3f05624bb4
class Institutionimage(db.Model): <NEW_LINE> <INDENT> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> institution_id = db.Column(db.ForeignKey('institution.id')) <NEW_LINE> file = db.Column(db.String(500)) <NEW_LINE> institution = db.relationship('Institution', backref = db.backref('institutionimages', cascade=...
附属实体:培训机构的图片路径信息
62598ee5bd1bec0571e1440c
class InjectorCleanup(object): <NEW_LINE> <INDENT> def __init__(self, injector): <NEW_LINE> <INDENT> self.injector = injector <NEW_LINE> self.keep = None <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> assert self.keep is None <NEW_LINE> self.keep = set(self.injector._keys) <NEW_LINE> return self.injector ...
A context manager for cleaning up keys added to an ``Injector``. This is used to mitigate reference loops that could cause problems for the Python garbage collector.
62598ee5a219f33f346c4ebb
class MNISTElasticTranform(object): <NEW_LINE> <INDENT> def __init__(self, sigma, alpha): <NEW_LINE> <INDENT> self.sigma = sigma <NEW_LINE> self.alpha = alpha <NEW_LINE> <DEDENT> def __call__(self, sample): <NEW_LINE> <INDENT> image = sample <NEW_LINE> image = np.asarray(image).reshape(28, 28, 1) <NEW_LINE> image = ela...
Applies Elastic Transform on MNIST images
62598ee5a17c0f6771d5a8d6
class CommSocket: <NEW_LINE> <INDENT> def __init__(self, manager): <NEW_LINE> <INDENT> self.supports_binary = None <NEW_LINE> self.manager = manager <NEW_LINE> self.uuid = str(uuid.uuid4()) <NEW_LINE> display(HTML("<div id=%r></div>" % self.uuid)) <NEW_LINE> try: <NEW_LINE> <INDENT> self.comm = Comm('matplotlib', data=...
Manages the Comm connection between IPython and the browser (client). Comms are 2 way, with the CommSocket being able to publish a message via the send_json method, and handle a message with on_message. On the JS side figure.send_message and figure.ws.onmessage do the sending and receiving respectively.
62598ee576e4537e8c3edc3a
class UniformRandom(Dataset): <NEW_LINE> <INDENT> def __init__(self, ntrain, ntest, nin, nout, **kwargs): <NEW_LINE> <INDENT> self.__dict__.update(kwargs) <NEW_LINE> self.ntrain = ntrain <NEW_LINE> self.ntest = ntest <NEW_LINE> self.nin = nin <NEW_LINE> self.nout = nout <NEW_LINE> self.macro_batched = False <NEW_LINE> ...
Sets up a synthetic uniformly random dataset. Attributes: inputs (dict): structure housing the loaded train/test/validation input data targets (dict): structure housing the loaded train/test/validation target data
62598ee53317a56b869bd8a8
class OnlySuperUsersCanModify(permissions.BasePermission): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> if request.method == 'GET': <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> return request.user.is_superuser <NEW_LINE> <DEDENT> def has_object_permission(self, request, view, ...
Miscellaneous Permissions. Checks to ensure that the user is a super user.
62598ee576e4537e8c3edc3b
class CLIStory(object): <NEW_LINE> <INDENT> def __init__(self, story: list): <NEW_LINE> <INDENT> self.story = Story(story) <NEW_LINE> <DEDENT> def go(self): <NEW_LINE> <INDENT> print(self.story)
Doc
62598ee5e5267d203ee69f88
class TestNodeCLI(): <NEW_LINE> <INDENT> def __init__(self, binary, datadir): <NEW_LINE> <INDENT> self.options = [] <NEW_LINE> self.binary = binary <NEW_LINE> self.datadir = datadir <NEW_LINE> self.input = None <NEW_LINE> self.log = logging.getLogger('TestFramework.usdecoincli') <NEW_LINE> <DEDENT> def __call__(self, *...
Interface to usdecoin-cli for an individual node
62598ee516aa5153ce3feb80
class Package: <NEW_LINE> <INDENT> def __init__(self, name_string, version_string=None): <NEW_LINE> <INDENT> self._plain_package = False <NEW_LINE> self.package_name = name_string <NEW_LINE> self._requirement = None <NEW_LINE> if version_string: <NEW_LINE> <INDENT> version_string = version_string.lstrip() <NEW_LINE> se...
Python distribution package metadata wrapper. A wrapper class for Requirement, which provides API to parse package name, version specifier, test whether a package is already satisfied.
62598ee5aad79263cf42ce8d
class V1ScaleStatus(object): <NEW_LINE> <INDENT> def __init__(self, selector=None, replicas=None): <NEW_LINE> <INDENT> self.swagger_types = { 'selector': 'str', 'replicas': 'int' } <NEW_LINE> self.attribute_map = { 'selector': 'selector', 'replicas': 'replicas' } <NEW_LINE> self._selector = selector <NEW_LINE> self._re...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598ee523849d37ff84f739
class IPrintLogoContent( Interface ): <NEW_LINE> <INDENT> printlogoLocalOnly = schema.Bool( title = _(u"label_printlogoLocalOnly", default=(u"Local Print Logo")), description=_(u'help_printlogoLocalOnly', default=u"Display the logo for pinting in the current folder only"), required = False, default = False, )
Bandeau informations
62598ee5d486a94d0ba2a650
class CronRange(object): <NEW_LINE> <INDENT> logger = logging.getLogger(__name__) <NEW_LINE> def __init__(self, vpart, *vrange): <NEW_LINE> <INDENT> self.dangling = None <NEW_LINE> self.part = vpart <NEW_LINE> self.cron = None <NEW_LINE> self.seq = 1 <NEW_LINE> if not vrange: <NEW_LINE> <INDENT> self.all() <NEW_LINE> <...
A range between one value and another for a time range.
62598ee532920d7e50bc46b0
class CorrectData(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Score = None <NEW_LINE> self.ScoreCat = None <NEW_LINE> self.Comment = None <NEW_LINE> self.SentenceComments = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Score = params.get("Score") ...
批改的结果
62598ee55fdd1c0f98e5c632
class ExportJobDetails(JobDetails): <NEW_LINE> <INDENT> _validation = { 'instance_type': {'required': True}, } <NEW_LINE> _attribute_map = { 'instance_type': {'key': 'instanceType', 'type': 'str'}, 'affected_object_details': {'key': 'affectedObjectDetails', 'type': '{str}'}, 'blob_uri': {'key': 'blobUri', 'type': 'str'...
This class represents details for export jobs workflow. All required parameters must be populated in order to send to Azure. :param instance_type: Required. Gets the type of job details (see JobDetailsTypes enum for possible values).Constant filled by server. :type instance_type: str :param affected_object_details: ...
62598ee56e29344779afecb4
class ResourceProviderOperation(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(ResourceProviderOperation, self)._...
Supported operations of this resource provider. :param name: Operation name, in format of {provider}/{resource}/{operation}. :type name: str :param display: Display metadata associated with the operation. :type display: ~azure.mgmt.customproviders.models.ResourceProviderOperationDisplay
62598ee54e4d562566370a9c
class FullBatchFileImageLoader(FileImageLoader, FullBatchImageLoader): <NEW_LINE> <INDENT> pass
Loads images from multiple folders as full batch.
62598ee53cc13d1c6d463df1
class JSON_Serializer(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def save_to_JSON(self, JSON_path): <NEW_LINE> <INDENT> serialized_data = data_to_json(list(self.__dict__.items())) <NEW_LINE> with open(JSON_path, 'w') as outfile: <NEW_LINE> <INDENT> outfile.write(serialized_d...
A class that can save all of its attributes to a JSON file, or load them from a JSON file.
62598ee58e71fb1e983ba0ee
@python_2_unicode_compatible <NEW_LINE> class Characteristic(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = _('Characteristic') <NEW_LINE> verbose_name_plural = _('Characteristics') <NEW_LINE> <DEDENT> category = models.ForeignKey('Category', related_name='characteristics') <NEW_LINE>...
Abstract product attribute. Characteristic is connected to category. All products that are connected to category with characteristic must have attribute that defines concrete value of given characteristic.
62598ee5dd821e528d6d75c9
class NaayaContentTestCase(NaayaTestCase.NaayaTestCase): <NEW_LINE> <INDENT> def afterSetUp(self): <NEW_LINE> <INDENT> self.doc_name_en = 'mycontent_en' <NEW_LINE> self.doc_name_fr = "mycontent_fr" <NEW_LINE> self.doc_meta_type = NaayaContent.meta_type <NEW_LINE> self.login() <NEW_LINE> <DEDENT> def beforeTearDown(self...
TestCase for NaayaContent object
62598ee5796e427e5384ce1c
class drfLayerSourceEditorDialogTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_icon_png(self): <NEW_LINE> <INDENT> path = ':/plugins/drfLayerSourceEditor/icon.png' <NEW_LINE> icon = QIco...
Test rerources work.
62598ee5d486a94d0ba2a651
class WebSearcher: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def search_directory_write_results(expression, search_dir, out_dir, out_file): <NEW_LINE> <INDENT> files_containing_expression = WebSearcher.search_directory(expression, search_dir) <NEW_LINE> files_string = (os.linesep).join(files_containing_expression) <...
Controller composed of several objects. Reads input commands. Searches files for expression.
62598ee5eab8aa0e5d30a3fd
class Hermite(SpatialFilter): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> SpatialFilter.__init__(self, radius=1.0) <NEW_LINE> <DEDENT> def weight(self, x): <NEW_LINE> <INDENT> return (2.0 * x - 3.0) * x * x + 1.0
Hermite filter (radius = 1.0). Weight function:: w(x) = (2*x-3)*x^2 + 1
62598ee54527f215b58e858b
class CifarResNeXt(nn.Module): <NEW_LINE> <INDENT> def __init__(self, block, depth, cardinality, base_width, num_classes): <NEW_LINE> <INDENT> super(CifarResNeXt, self).__init__() <NEW_LINE> assert (depth - 2) % 9 == 0, 'depth should be one of 29, 38, 47, 56, 101' <NEW_LINE> layer_blocks = (depth - 2) // 9 <NEW_LINE> s...
ResNext optimized for the Cifar dataset, as specified in https://arxiv.org/pdf/1611.05431.pdf
62598ee555399d3f05624bb6
class ContextTagCreate(PermissionRequiredMixin, CreateView): <NEW_LINE> <INDENT> permission_required = 'tasks.can_add_context' <NEW_LINE> template_name = 'tasks/context-create.html' <NEW_LINE> model = Context <NEW_LINE> context_object_name = 'context' <NEW_LINE> fields = ['name', 'description'] <NEW_LINE> def form_vali...
This allows users with permissions to create tags to create their own tags for contexts
62598ee526068e7796d4afe0
class GradesTransformer(BlockStructureTransformer): <NEW_LINE> <INDENT> VERSION = 2 <NEW_LINE> FIELDS_TO_COLLECT = [u'due', u'format', u'graded', u'has_score', u'weight', u'course_version', u'subtree_edited_on'] <NEW_LINE> @classmethod <NEW_LINE> def name(cls): <NEW_LINE> <INDENT> return u'grades' <NEW_LINE> <DEDENT> @...
The GradesTransformer collects grading information and stores it on the block structure. No runtime transformations are performed. The following values are stored as xblock_fields on their respective blocks in the block structure: due: (datetime) when the problem is due. format: (string) what type of problem...
62598ee50c0af96317c54a22
class Movie(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=250) <NEW_LINE> genre = models.ForeignKey('Genre', on_delete=models.CASCADE) <NEW_LINE> stars = models.FloatField(default=1.0) <NEW_LINE> description = models.TextField() <NEW_LINE> created = models.DateTimeField(auto_now_add=True) <NEW_L...
The Model to hold a list of Movies
62598ee585dfad0860cbedaa
class AbstractTopicNamer(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.name_scheme = None <NEW_LINE> <DEDENT> def name_topics(self, analysis_db): <NEW_LINE> <INDENT> raise NotImplementedError('name_topics is not implemented')
TopicNamers must have: Required Property: name_scheme -- the name of the scheme Required Function: name_topics -- takes an Analysis Django database object and saves to the database the topic to scheme_name assignments
62598ee5e5267d203ee69f8a
class nn_se_rReWavL2_AFD200(p40): <NEW_LINE> <INDENT> blstm_layers = 1 <NEW_LINE> lstm_layers = 1 <NEW_LINE> loss_name = ["real_net_reWavL2"] <NEW_LINE> relative_loss_epsilon = 1.0/200.0
cnn1blstm1lstm relative wav mse, AFD 200
62598ee556ac1b37e6300871
class TelloCamera(BaseCamera): <NEW_LINE> <INDENT> def __init__(self, image_w=160, image_h=120, image_d=3, image=None): <NEW_LINE> <INDENT> import parts.tello as tello <NEW_LINE> import cv2 <NEW_LINE> self.running = True <NEW_LINE> self.frame = None <NEW_LINE> self.image_w = image_w <NEW_LINE> self.image_h = image_h <N...
Tello camera.
62598ee516aa5153ce3feb82
class AuthResponse(Token): <NEW_LINE> <INDENT> user: UserOut
Login Response schema.
62598ee5ac7a0e7691f70b9b
class Logger(object): <NEW_LINE> <INDENT> handlers = {} <NEW_LINE> def __init__(self, filename, name=None, level=LOGGING_LEVEL, format="%(asctime)s %(levelname)-5s: %(message)s", dateformat="%Y-%m-%d %H:%M", max_filesize = MAX_FILESIZE): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.filename = filename <NEW_LINE...
Logger class that locks the log file and closes the log file after each log
62598ee5b7558d5895461cca
class KArray(nodes.Array): <NEW_LINE> <INDENT> pass
For [] KExpression
62598ee5e76e3b2f99fd70bd
class AdrivingConfig(Config): <NEW_LINE> <INDENT> NAME = "Adriving" <NEW_LINE> GPU_COUNT = 1 <NEW_LINE> IMAGES_PER_GPU = 1 <NEW_LINE> STEPS_PER_EPOCH = 10 <NEW_LINE> VALIDATION_STEPS = 1 <NEW_LINE> NUM_CLASSES = 1 + 7 <NEW_LINE> MEAN_PIXEL = np.array([88.59672608, 95.91837699, 98.90089033]) <NEW_LINE> RPN_NMS_THRESHOLD...
Configuration for training on the toy dataset. Derives from the base Config class and overrides some values.
62598ee544b2445a339b5caa
class Error(Exception): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> super().__init__(message) <NEW_LINE> self.__doc__ = 'Base class for other exceptions'
Base exception. All other exceptions below are subclasses of this. Note: Do not raise this. It is boring an uninformative. Args: msg (str): Human readable string describing the exception. code (:obj:`int`, optional): Error code. Attributes: msg (str): Human readable string describing the exception. ...
62598ee5fff4ab517ebcbe5e
class Critic(nn.Module): <NEW_LINE> <INDENT> def __init__(self, state_size, action_size, seed, fcs1_units=256, fc2_units=128): <NEW_LINE> <INDENT> super(Critic, self).__init__() <NEW_LINE> self.seed = torch.manual_seed(seed) <NEW_LINE> self.fcs1 = nn.Linear(state_size * 2, fcs1_units) <NEW_LINE> self.fc2 = nn.Linear(fc...
Critic (Value) Model.
62598ee54e4d562566370a9e
class SteamGameEntity(CoordinatorEntity, BinarySensorEntity): <NEW_LINE> <INDENT> entity_id = None <NEW_LINE> def __init__( self, manager, game: SteamGame, ): <NEW_LINE> <INDENT> super().__init__(coordinator=manager.coordinator) <NEW_LINE> self.game = game <NEW_LINE> self.manager = manager <NEW_LINE> self.slug = slugif...
Representation of a Steam game.
62598ee5f9cc0f698b1c4611
class ParserData: <NEW_LINE> <INDENT> path = "" <NEW_LINE> metadata: Dict[str, Any] = {} <NEW_LINE> def __init__( self, schema: schemanode.DataNode, native: Any, root_native: Any, keys: Dict[str, str], extra: Dict[str, Any], ) -> None: <NEW_LINE> <INDENT> self.schema = schema <NEW_LINE> self.native = native <NEW_LINE> ...
This is the base class for the :obj:`Parser.Yangify` object. Attributes: schema (`yangson.schemanode.DataNode`): Schema of the current grouping being processed native (`Any`): Exact details will depend on the parser implementation. As a rule of thumb points to the native configuration/data relevant fo...
62598ee566656f66f7d58a66
class TestExtensionsV1beta1SELinuxStrategyOptions(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def testExtensionsV1beta1SELinuxStrategyOptions(self): <NEW_LINE> <INDENT> pass
ExtensionsV1beta1SELinuxStrategyOptions unit test stubs
62598ee53539df3088eca938
class SendResponse(object): <NEW_LINE> <INDENT> def __init__(self, resp, exception): <NEW_LINE> <INDENT> self._exception = exception <NEW_LINE> self._message_id = None <NEW_LINE> if resp: <NEW_LINE> <INDENT> self._message_id = resp.get('name', None) <NEW_LINE> <DEDENT> <DEDENT> @property <NEW_LINE> def message_id(self)...
The response received from an individual batched request to the FCM API.
62598ee567a9b606de544653
class MyThread(QThread): <NEW_LINE> <INDENT> def __init__(self, callback1, callback2): <NEW_LINE> <INDENT> QThread.__init__(self) <NEW_LINE> self.callback1 = callback1 <NEW_LINE> self.callback2 = callback2 <NEW_LINE> <DEDENT> def __del__(self): <NEW_LINE> <INDENT> self.wait() <NEW_LINE> <DEDENT> def run(self): <NEW_LIN...
This is a simple class to implement a QThread object and specify its *run()* method.
62598ee58e71fb1e983ba0f0
class RestoreDBInstanceFromDBSnapshotInputSet(InputSet): <NEW_LINE> <INDENT> def set_AWSAccessKeyId(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'AWSAccessKeyId', value) <NEW_LINE> <DEDENT> def set_AWSSecretKeyId(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'AWSSecretKeyId', value) <NEW_LI...
An InputSet with methods appropriate for specifying the inputs to the RestoreDBInstanceFromDBSnapshot Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
62598ee58c0ade5d55dc29c6
class FileCounter: <NEW_LINE> <INDENT> def __init__(self, func): <NEW_LINE> <INDENT> functools.update_wrapper(self, func) <NEW_LINE> self.func = func <NEW_LINE> self.counter = 0 <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.counter <NEW_LINE> <DEDENT> def __call__(self, *args, **kwargs): <NEW_L...
Class decorator for creating a class counter
62598ee5656771135c487d1a
class Activity: <NEW_LINE> <INDENT> def __init__(self, Id, personIds, date, time, description): <NEW_LINE> <INDENT> self.__Id = Id <NEW_LINE> self.__personIds = personIds <NEW_LINE> self.__date = date <NEW_LINE> self.__time = time <NEW_LINE> self.__description = description <NEW_LINE> <DEDENT> @property <NEW_LINE> def ...
For of storing activity information
62598ee50a50d4780f703a31
class LocalComputation(object): <NEW_LINE> <INDENT> def __init__(self, c_local_computation, is_compiled): <NEW_LINE> <INDENT> self.c_local_computation = c_local_computation <NEW_LINE> self.is_compiled = is_compiled <NEW_LINE> if is_compiled: <NEW_LINE> <INDENT> assert isinstance(c_local_computation, c_api.CompiledLocal...
Python wrapper for a local XLA Computation. A LocalComputation can be executed if it is compiled. Otherwise, it can still be used as a Computation where required by the ComputationBuilder methods.
62598ee560cbc95b063629c3
class InteractionFragmentDict(WotBaseDict): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> fields = { "forms", "title", "uriVariables", "description", "security", "scopes" } <NEW_LINE> <DEDENT> @property <NEW_LINE> def forms(self): <NEW_LINE> <INDENT> return [FormDict(item) for item in self._init.get("forms", [])]...
Base class for the three types of Interaction patterns (Properties, Actions and Events).
62598ee53617ad0b5ee047b6
class _iter(Iterator): <NEW_LINE> <INDENT> def __init__(self, val): <NEW_LINE> <INDENT> self.val = val <NEW_LINE> self.which = 'first' <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def __next__(self): <NEW_LINE> <INDENT> if self.which is None: <NEW_LINE> <INDENT> raise Stop...
An iterator for std::pair types. Returns 'first' then 'second'.
62598ee597e22403b3839576
class Order: <NEW_LINE> <INDENT> def __init__(self, API_resp=None, order_id=None, exchange=None, bid=None, amount=None, filled=None, cancelled=None, complete=None, rate=None, created_at=None, completed_at=None): <NEW_LINE> <INDENT> if API_resp is not None: <NEW_LINE> <INDENT> order = API_resp <NEW_LINE> self.id = order...
A container for an order Attributes: order_id: the order id exchange: the Exchange for this order bid: true if this is bid(buy), false for ask(sell) rate: Decimal rate at from_currency per to_currency amount: the amount of this Order filled: the amount of this order that has been filled canc...
62598ee54a966d76dd5ed56a
class UserModel(object): <NEW_LINE> <INDENT> def __init__(self, user_name): <NEW_LINE> <INDENT> self.user_name = user_name <NEW_LINE> <DEDENT> @inlineCallbacks <NEW_LINE> def exists(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> yield get_user(self.user_name, "hash") <NEW_LINE> returnValue(True) <NEW_LINE> <DEDENT...
Users have usernames, passwords, and buckets.
62598ee5d486a94d0ba2a653
class Screen(object): <NEW_LINE> <INDENT> def __init__(self, display, x, y, width, height): <NEW_LINE> <INDENT> self.display = display <NEW_LINE> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.width = width <NEW_LINE> self.height = height <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '%s(x=%d, y=...
A virtual monitor that supports fullscreen windows. Screens typically map onto a physical display such as a monitor, television or projector. Selecting a screen for a window has no effect unless the window is made fullscreen, in which case the window will fill only that particular virtual screen. The `width` and `he...
62598ee5aad79263cf42ce90
class TimeInterval(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Start = None <NEW_LINE> self.End = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Start = params.get("Start") <NEW_LINE> self.End = params.get("End") <NEW_LINE> memeber_set = set(params...
左闭右开时间区间,包括起始时间和结束时间,格式为"%Y-%m-%d %H:%M:%S"
62598ee54f88993c371ef829
class DatasetRBACPermission( RBACPermission ): <NEW_LINE> <INDENT> permissions_class = model.DatasetPermissions <NEW_LINE> action_name = None <NEW_LINE> def __assert_action( self ): <NEW_LINE> <INDENT> if not self.action_name: <NEW_LINE> <INDENT> raise NotImplementedError( "abstract parent class" + " needs action_name"...
Base class for the manage and access RBAC permissions used by dataset security. The DatasetPermissions used by the RBAC agent are associations between a Dataset and a single Role. DatasetPermissions are typed (but not polymorphic themselves) by a string 'action'. There are two types: - manage permissions : can a ...
62598ee5627d3e7fe0e0550f
class ParseError(StandardError): <NEW_LINE> <INDENT> def __init__(self, expression): <NEW_LINE> <INDENT> self.offset = expression.offset <NEW_LINE> self.content = expression.content[:3] <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return 'Unexpected content at offset {0}, "{1}"'.format(self.offset, self.c...
Error raised when parsing fails. It has two members, offset and content, which give the offset of the error and the offending content.
62598ee5442bda511e95aae8
class Twitter(db.Model): <NEW_LINE> <INDENT> id = db.Column(db.Integer, primary_key = True) <NEW_LINE> mention_id = db.Column(db.BigInteger) <NEW_LINE> fav_id = db.Column(db.BigInteger)
Keep track of a few max id's for fetching via Twitter ID. Should only be one row in this table
62598ee576e4537e8c3edc3f
class UserModel: <NEW_LINE> <INDENT> def __init__(self, u_id = None, name = None, passwd = None, salt = None, master = None): <NEW_LINE> <INDENT> self._id = u_id <NEW_LINE> self._name = name <NEW_LINE> self._passwd = passwd <NEW_LINE> self._salt = salt <NEW_LINE> self._master = master
Holds User data.
62598ee51b99ca400228e850
class ParameterParser(): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> if isinstance(data, type(DataFactory('dict')(dict={}))): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._logger.warning( 'Please supply an AiiDA Dict datatype for `data`.') <NEW_LINE> self...
Parse the input parameters for premod.
62598ee592d797404e387ebe
class Inhibition(object): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def __init__(self, _c_height=0, _c_width=0, _desired_density=1.0, _small=0): <NEW_LINE> <INDENT> this = _algorithms.new_Inhibi...
Proxy of C++ nta::algorithms::Inhibition class
62598ee56aa9bd52df0d3537
class RequirePackage(PackageReference): <NEW_LINE> <INDENT> def __init__(self, flap): <NEW_LINE> <INDENT> super().__init__(flap, "RequirePackage")
Intercept 'RequirePackage' commands. It triggers copying the package, if it is defined locally.
62598ee516aa5153ce3feb84
class SimpleUnpolarisedTelescope(UnpolarisedTelescope, metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> @property <NEW_LINE> def beamclass(self): <NEW_LINE> <INDENT> return np.zeros(self._single_feedpositions.shape[0], dtype=np.int64) <NEW_LINE> <DEDENT> @abc.abstractproperty <NEW_LINE> def _single_feedpositions(self): <NEW...
A base for a polarised telescope. Again, an abstract class, but the only things that require implementing are the `feedpositions`, `_get_unique` and the beam functions `beamx` and `beamy`. Methods ------- beamx, beamy : methods (abstract methods) Routines giving the field pattern for the x and y feeds.
62598ee5ac7a0e7691f70b9d
class ApprovState(object): <NEW_LINE> <INDENT> def __init__(self, appinst_id, user_id): <NEW_LINE> <INDENT> super(ApprovState, self).__init__() <NEW_LINE> self.appinst_id = appinst_id <NEW_LINE> self.user_id = user_id <NEW_LINE> self._client = msclient.MSClient(app.config['KONG_URL'], app.config['KONG_USER'], app.confi...
docstring for ApprovState
62598ee5d7e4931a7ef3a725
class MasterDataBreadCrumb( icemac.addressbook.browser.breadcrumb.Breadcrumb): <NEW_LINE> <INDENT> grok.adapts( MasterData, icemac.addressbook.browser.interfaces.IAddressBookLayer) <NEW_LINE> title = _('Master data')
Breadcrumb for the master data view.
62598ee57cff6e4e811b4074
class TestEnvironment: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> irises = datasets.load_iris() <NEW_LINE> self.env = Environment(irises.data, irises.target) <NEW_LINE> <DEDENT> def get_random(self): <NEW_LINE> <INDENT> _, sample, _ = self.env.get_random_sample() <NEW_LINE> return sample <NEW_LINE> <DE...
Functions tested in TestEnvironment: - get_random_sample - get_random_sample_index - get_sample - get_samples Functions not tested: - __init__ - standard_distance - get_all - get_all_classes - get_all_samples - get_class - set_distance
62598ee5fff4ab517ebcbe5f
class MultiFactorScheduler(LRScheduler): <NEW_LINE> <INDENT> def __init__(self, step, factor=1, base_lr=0.01): <NEW_LINE> <INDENT> super(MultiFactorScheduler, self).__init__(base_lr) <NEW_LINE> assert isinstance(step, list) and len(step) >= 1 <NEW_LINE> for i, _step in enumerate(step): <NEW_LINE> <INDENT> if i != 0 and...
Reduce the learning rate by given a list of steps. Assume there exists *k* such that:: step[k] <= num_update and num_update < step[k+1] Then calculate the new learning rate by:: base_lr * pow(factor, k+1) Parameters ---------- step: list of int The list of steps to schedule a change factor: float The fact...
62598ee5460517430c430b0f
class TextItem(UIGraphicsItem): <NEW_LINE> <INDENT> def __init__(self, text='', color=(200,200,200), html=None, anchor=(0,0), border=None, fill=None, angle=0): <NEW_LINE> <INDENT> self.anchor = Point(anchor) <NEW_LINE> UIGraphicsItem.__init__(self) <NEW_LINE> self.textItem = QtGui.QGraphicsTextItem() <NEW_LINE> self.te...
GraphicsItem displaying unscaled text (the text will always appear normal even inside a scaled ViewBox).
62598ee5fff4ab517ebcbe60
class ModelOutput: <NEW_LINE> <INDENT> def __init__( self, value=None, policy=None, hidden=None): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> self.policy = policy <NEW_LINE> self.hidden = hidden
Output of the model.
62598ee532920d7e50bc46b4
class Service(Resource): <NEW_LINE> <INDENT> class LoggerAdapter(Resource.LoggerAdapter): <NEW_LINE> <INDENT> def process(self, msg, kwargs): <NEW_LINE> <INDENT> return ( "[%s] %s" % ( self.extra['self'].host.ip, msg, ), kwargs, ) <NEW_LINE> <DEDENT> <DEDENT> def __init__(self, host): <NEW_LINE> <INDENT> super(Service,...
General service provided by Host.
62598ee5d268445f26638ed2
class Order(Model): <NEW_LINE> <INDENT> def __init__(self, id: int=None, pet_id: int=None, quantity: int=None, ship_date: datetime=None, status: str=None, complete: bool=False): <NEW_LINE> <INDENT> self.swagger_types = { 'id': int, 'pet_id': int, 'quantity': int, 'ship_date': datetime, 'status': str, 'complete': bool }...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598ee53539df3088eca93a
class Glimmer(Worker): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Worker.__init__(self) <NEW_LINE> self.inputs.append(Input(self)) <NEW_LINE> self.outputs.append(Output(self)) <NEW_LINE> self.speed = 0.05 <NEW_LINE> random.seed() <NEW_LINE> self._freqs = [] <NEW_LINE> for i in range(0, 50): <NEW_LINE> ...
Glimmer imitates a fire-like effect with random sinus
62598ee5462c4b4f79dba082
class BlacklistToken(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'blacklist_tokens' <NEW_LINE> __table_args__ = {'extend_existing': True} <NEW_LINE> id = db.Column(db.Integer, primary_key=True, autoincrement=True) <NEW_LINE> token = db.Column(db.String(500), unique=True, nullable=False) <NEW_LINE> blacklisted_on = d...
Token Model for storing JWT tokens
62598ee56fb2d068a7693167
class Teacher(Person): <NEW_LINE> <INDENT> def __init__(self, name, grade, papers): <NEW_LINE> <INDENT> Person.__init__(self, name, grade) <NEW_LINE> self.papers = papers <NEW_LINE> <DEDENT> def get_details(self): <NEW_LINE> <INDENT> return "{} teaches {}".format(self.name, ','.join(self.papers)) <NEW_LINE> <DEDENT> de...
返回 Teacher 对象,采用字符串列表作为参数
62598ee599fddb7c1ca62149
class ClassD(object): <NEW_LINE> <INDENT> globalInClassD="a global only in ClassD" <NEW_LINE> def __init__(self, property1 = None): <NEW_LINE> <INDENT> self.property1 = property1 <NEW_LINE> <DEDENT> def someMethod(self): <NEW_LINE> <INDENT> print("someMethod called") <NEW_LINE> <DEDENT> @property <NEW_LINE> def propert...
An example fact.
62598ee5cc0a2c111447968b
class PostDelete(DeleteView): <NEW_LINE> <INDENT> model = Post <NEW_LINE> success_url = reverse_lazy('post:post-list')
2017.03.21 Mission 4. DeleteView를 상속받아 구현해보세요
62598ee54f6381625f198800
class Command(object): <NEW_LINE> <INDENT> def __init__(self, command_number, pin_number=None, number_of_bytes_to_receive=1, number_received_varies=False): <NEW_LINE> <INDENT> self.command_number = command_number <NEW_LINE> self.pin_number = pin_number <NEW_LINE> self.number_of_bytes_to_receive = number_of_bytes_to_rec...
Represents a robot command that can be sent to the Arduino for execution.
62598ee597e22403b3839578
class GroundPlane(Object): <NEW_LINE> <INDENT> def __init__(self, position=None, normal=None): <NEW_LINE> <INDENT> if position is None: <NEW_LINE> <INDENT> position = Vector(0, 0, 0) <NEW_LINE> <DEDENT> if normal is None: <NEW_LINE> <INDENT> normal = Vector(0, 1, 0) <NEW_LINE> <DEDENT> super(GroundPlane, self).__init__...
An infinite flat surface facing a normal
62598ee5925a0f43d25e66b5
class ControlPoint(object,IEpsilonComparable[ControlPoint]): <NEW_LINE> <INDENT> def EpsilonEquals(self,other,epsilon): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __init__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def __new__(self,*__args): <NEW_LINE> <INDENT> pass <NEW_LI...
Represents control-point geometry with three-dimensional position and weight. ControlPoint(x: float,y: float,z: float) ControlPoint(x: float,y: float,z: float,weight: float) ControlPoint(pt: Point3d) ControlPoint(pt: Point3d,weight: float) ControlPoint(pt: Point4d)
62598ee5d6c5a102081e07b8