code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class gre(packet_base.PacketBase): <NEW_LINE> <INDENT> _PACK_STR = "!BBH" <NEW_LINE> _CHECKSUM_PACK_STR = "!H2x" <NEW_LINE> _KEY_PACK_STR = "!I" <NEW_LINE> _SEQNUM_PACK_STR = "!I" <NEW_LINE> _MIN_LEN = struct.calcsize(_PACK_STR) <NEW_LINE> _CHECKSUM_LEN = struct.calcsize(_CHECKSUM_PACK_STR) <NEW_LINE> _KEY_LEN = struct...
GRE (RFC2784,RFC2890) header encoder/decoder class. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. __init__ takes the corresponding args in this order. ============== ======================================================== Attribute D...
62598fa8ac7a0e7691f72448
class MapValueError(ValueError): <NEW_LINE> <INDENT> pass
Illegal value for Map.
62598fa85166f23b2e243315
class CandidateLocation(models.Model): <NEW_LINE> <INDENT> candidate = models.ForeignKey( 'Candidate', on_delete=models.CASCADE ) <NEW_LINE> location = models.ForeignKey( commons.Location, on_delete=models.PROTECT ) <NEW_LINE> current = models.BooleanField()
Describe the relation between Users and models, multiple users can have multiple locations and visa versa
62598fa860cbc95b0636428a
class EntityMap(models.Model): <NEW_LINE> <INDENT> appName = models.CharField(max_length=200, blank=False, null=False) <NEW_LINE> modelName = models.CharField(max_length=200, blank=False, null=False) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> unique_together = ("appName", "modelName")
DGT: Capa adicional para manejar parametros de workflow autonumericos y secuencias permisos a nivel de campo ( fieldLevelSecurity ), documentacion acciones replicar conttenttype etc Para manejar las vstas, se maneja directamente la protoOpcion, (se prodria crear un contte...
62598fa8d6c5a102081e2085
class PaymentFromSaleImportCSVStart(ModelView): <NEW_LINE> <INDENT> __name__ = 'import.csv.payment.from.sale.start' <NEW_LINE> profile_domain = fields.Function(fields.One2Many('profile.csv', None, 'Profile Domain', states={ 'invisible': True }), 'on_change_with_profile_domain') <NEW_LINE> profile = fields.Many2One('pro...
Payment From Sale Import CSV Start
62598fa88da39b475be03121
class RangedDictVertexSlice(object): <NEW_LINE> <INDENT> __slots__ = [ "__ranged_dict", "__vertex_slice"] <NEW_LINE> def __init__(self, ranged_dict, vertex_slice): <NEW_LINE> <INDENT> self.__ranged_dict = ranged_dict <NEW_LINE> self.__vertex_slice = vertex_slice <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE...
A slice of a ranged dict to be used to update values
62598fa89c8ee8231304010f
class StripePositiveIntegerField(StripeFieldMixin, models.PositiveIntegerField): <NEW_LINE> <INDENT> pass
A field used to define a PositiveIntegerField value according to djstripe logic.
62598fa87d847024c075c301
class Mpl2dGraphicsView(QtGui.QWidget): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> QtGui.QWidget.__init__(self, parent) <NEW_LINE> self._myCanvas = Qt4Mpl2dCanvas(self) <NEW_LINE> self._myToolBar = MyNavigationToolbar(self, self._myCanvas) <NEW_LINE> self._vBox = QtGui.QVBoxLayout(self) <NEW_LI...
A combined graphics view including matplotlib canvas and a navigation tool bar for 2D image specifically
62598fa816aa5153ce400440
class TEST11(PMEM2_MAP_DEVDAX): <NEW_LINE> <INDENT> test_case = "test_map_invalid_alignment"
DevDax map using invalid alignment in the offset
62598fa83d592f4c4edbae0b
@attr.s(cmp=False) <NEW_LINE> class Plan(object): <NEW_LINE> <INDENT> uid = attr.ib(None, init=False) <NEW_LINE> time = attr.ib(converter=int) <NEW_LINE> title = attr.ib() <NEW_LINE> location = attr.ib(None, converter=lambda x: x or "") <NEW_LINE> location_id = attr.ib(None, converter=lambda x: x or "") <NEW_LINE> auth...
Represents a plan.
62598fa8442bda511e95c393
class StockTaskQueueList: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.queues = {} <NEW_LINE> tmp='123456' <NEW_LINE> for i in range(0,5,1): <NEW_LINE> <INDENT> self.queues[tmp[i:i+2]]=TaskQueue(Queue()) <NEW_LINE> <DEDENT> self.doneMaps = {} <NEW_LINE> for m in range(0,5,1): <NEW_LINE> <INDENT> sel...
job1 获取最新全量股票信息 1、从东方财富页面获取最新所有股票 code,name 2、逐个股票获取上市时间(用于后面生成季度股价url) 后续可以扩展为存储上市公司信息 job2 下载缺失的股价信息 数据库单只股票最大时间至当前日期的数据 3、生成需要下载的URL(新浪股票数据一个季度一个页面) 4、下载页面 5、解析页面 6、数据入库
62598fa87047854f4633f317
class APPend(SCPINode, SCPIQuery, SCPISet): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> _cmd = "APPend" <NEW_LINE> args = ["<string>,<block_data>"]
MEMory:DATA:APPend Arguments: <string>,<block_data>
62598fa84e4d562566372363
class TestStaffPhoneReportingByElection(TestCase): <NEW_LINE> <INDENT> def test(self): <NEW_LINE> <INDENT> center = RegistrationCenterFactory() <NEW_LINE> elections = [ {'polling_start_time': now() - datetime.timedelta(days=60)}, {'polling_start_time': now() - datetime.timedelta(days=40)}, {'polling_start_time': now() ...
StaffPhone objects aren't tied explicitly to an election, but a StaffPhone object created after the end of an election shouldn't be reported for that election. Create two StaffPhone objects per election, one at the very start and one at the very end. Verify that, for each election, the reported messages are all Staff...
62598fa863b5f9789fe850a3
class HuntApproval(HuntApprovalBase): <NEW_LINE> <INDENT> def __init__( self, data: user_pb2.ApiHuntApproval, username: str, context: context_lib.GrrApiContext, ): <NEW_LINE> <INDENT> super().__init__( hunt_id=utils.UrnStringToHuntId(data.subject.urn), approval_id=data.id, username=username, context=context) <NEW_LINE>...
Hunt approval object with fetched data.
62598fa82ae34c7f260ab020
class SystemTestSuite(NoseTestSuite): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(SystemTestSuite, self).__init__(*args, **kwargs) <NEW_LINE> self.test_id = kwargs.get('test_id', self._default_test_id) <NEW_LINE> self.fasttest = kwargs.get('fasttest', False) <NEW_LINE> <DEDENT> de...
TestSuite for lms and cms nosetests
62598fa82c8b7c6e89bd3704
class DescribePersonSamplesRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Type = None <NEW_LINE> self.PersonIds = None <NEW_LINE> self.Names = None <NEW_LINE> self.Tags = None <NEW_LINE> self.Offset = None <NEW_LINE> self.Limit = None <NEW_LINE> <DEDENT> def _deserialize(self, ...
DescribePersonSamples请求参数结构体
62598fa8167d2b6e312b6eaf
class AvroDouble(AvroNumber): <NEW_LINE> <INDENT> _schema = avro.schema.PrimitiveSchema("double") <NEW_LINE> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return "double"
Avro "double" type for 64-bit IEEE floating-point numbers.
62598fa899cbb53fe6830e15
class Set_object_union(Set_object_binary): <NEW_LINE> <INDENT> def __init__(self, X, Y): <NEW_LINE> <INDENT> Set_object_binary.__init__(self, X, Y, "union", "\\cup") <NEW_LINE> <DEDENT> def is_finite(self): <NEW_LINE> <INDENT> return self._X.is_finite() and self._Y.is_finite() <NEW_LINE> <DEDENT> def __cmp__(self, righ...
A formal union of two sets.
62598fa8cc0a2c111447af4f
class SystemParameter(_messages.Message): <NEW_LINE> <INDENT> httpHeader = _messages.StringField(1) <NEW_LINE> name = _messages.StringField(2) <NEW_LINE> urlQueryParameter = _messages.StringField(3)
Define a parameter's name and location. The parameter may be passed as either an HTTP header or a URL query parameter, and if both are passed the behavior is implementation-dependent. Fields: httpHeader: Define the HTTP header name to use for the parameter. It is case insensitive. name: Define the name of the ...
62598fa81f037a2d8b9e402b
class MyMazeRobot(MazeRobot): <NEW_LINE> <INDENT> def autoRun(self): <NEW_LINE> <INDENT> raise NotImplementedError("autoRun:Not Implemented") <NEW_LINE> <DEDENT> def doAfterStop(self,runDirection,runDistance,stopReason): <NEW_LINE> <INDENT> raise NotImplementedError("doAfterStop:Not Implemented")
要实现迷宫探索的机器人子类
62598fa88e71fb1e983bb9f1
class ProductReleaseVocabulary(SQLObjectVocabularyBase): <NEW_LINE> <INDENT> implements(IHugeVocabulary) <NEW_LINE> displayname = 'Select a Product Release' <NEW_LINE> step_title = 'Search' <NEW_LINE> _table = ProductRelease <NEW_LINE> _orderBy = [Product.q.name, ProductSeries.q.name, Milestone.q.name] <NEW_LINE> _clau...
All `IProductRelease` objects vocabulary.
62598fa83539df3088ecc1f3
class TestLinterPages(DefaultSiteTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> if not self.site.has_extension('Linter'): <NEW_LINE> <INDENT> self.skipTest( 'The site {} does not use Linter extension'.format(self.site)) <NEW_LINE> <DEDENT> <DEDENT> def test_linter_pages(s...
Test linter_pages methods.
62598fa857b8e32f525080ba
class PDF_Renderer(threading.Thread, GObject.GObject): <NEW_LINE> <INDENT> def __init__(self, model, pdfqueue): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> GObject.GObject.__init__(self) <NEW_LINE> self.model = model <NEW_LINE> self.pdfqueue = pdfqueue <NEW_LINE> self.quit = False <NEW_LINE> <DEDENT>...
Class for rendering thumbnails of pages.
62598fa8adb09d7d5dc0a4ca
class PerceptualLoss(nn.Module): <NEW_LINE> <INDENT> def __init__(self, mode=1, weights=[1.0, 1.0, 1.0, 1.0, 1.0]): <NEW_LINE> <INDENT> super(PerceptualLoss, self).__init__() <NEW_LINE> self.add_module('vgg', VGG19()) <NEW_LINE> if mode == 1: <NEW_LINE> <INDENT> self.criterion = torch.nn.L1Loss() <NEW_LINE> <DEDENT> el...
Perceptual loss, VGG-based https://arxiv.org/abs/1603.08155 https://github.com/dxyang/StyleTransfer/blob/master/utils.py
62598fa856ac1b37e630212b
class CareerDetail(LoginRequiredMixin, DetailView): <NEW_LINE> <INDENT> model = Career <NEW_LINE> context_object_name = 'career' <NEW_LINE> http_method_names = ['get'] <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super(CareerDetail, self).get_context_data(**kwargs) <NEW_LINE> return co...
Detail Career
62598fa8f9cc0f698b1c5268
class Latch(object): <NEW_LINE> <INDENT> def __init__(self, count): <NEW_LINE> <INDENT> count = int(count) <NEW_LINE> if count <= 0: <NEW_LINE> <INDENT> raise ValueError("Count must be greater than zero") <NEW_LINE> <DEDENT> self._count = count <NEW_LINE> self._cond = threading.Condition() <NEW_LINE> <DEDENT> @property...
A class that ensures N-arrivals occur before unblocking. TODO(harlowja): replace with http://bugs.python.org/issue8777 when we no longer have to support python 2.6 or 2.7 and we can only support 3.2 or later.
62598fa844b2445a339b690f
@method_decorator(check_validity_of_license, name='dispatch') <NEW_LINE> class CreateUserView(LoginRequiredMixin, SuccessMessageMixin, CreateView): <NEW_LINE> <INDENT> model = User <NEW_LINE> form_class = UserForm <NEW_LINE> template_name = 'user_form.html' <NEW_LINE> success_message = "%(username)s was created success...
Create new user
62598fa83d592f4c4edbae0d
class TestOptions3(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 testOptions3(self): <NEW_LINE> <INDENT> pass
Options3 unit test stubs
62598fa8460517430c431ffc
class CraneliftDomain(Domain): <NEW_LINE> <INDENT> name = 'clif' <NEW_LINE> label = 'Cranelift' <NEW_LINE> object_types = { 'type': ObjType(l_('type'), 'type'), 'inst': ObjType(l_('instruction'), 'inst') } <NEW_LINE> directives = { 'type': ClifType, 'inst': ClifInst, 'instgroup': ClifInstGroup, } <NEW_LINE> roles = { '...
Cranelift domain for IR objects.
62598fa8851cf427c66b8208
class SendMessageInputSet(InputSet): <NEW_LINE> <INDENT> def set_AWSAccessKeyId(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'AWSAccessKeyId', value) <NEW_LINE> <DEDENT> def set_AWSAccountId(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'AWSAccountId', value) <NEW_LINE> <DEDENT> def set_AWS...
An InputSet with methods appropriate for specifying the inputs to the SendMessage Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
62598fa8d7e4931a7ef3bfdb
class KojiScratchPkgSpec(object): <NEW_LINE> <INDENT> SEP = ':' <NEW_LINE> def __init__(self, text='', user=None, task=None, subpackages=[]): <NEW_LINE> <INDENT> self.user = None <NEW_LINE> self.task = None <NEW_LINE> self.subpackages = [] <NEW_LINE> if text: <NEW_LINE> <INDENT> self.parse(text) <NEW_LINE> <DEDENT> els...
A package specification syntax parser for Koji scratch builds This holds information on user, task and subpackages to be fetched from koji and possibly installed (features external do this class). New objects can be created either by providing information in the textual format or by using the actual parameters for us...
62598fa83539df3088ecc1f4
class WorkoutPdfTableExportTestCase(WgerTestCase): <NEW_LINE> <INDENT> def export_pdf_token(self): <NEW_LINE> <INDENT> user = User.objects.get(username='test') <NEW_LINE> uid, token = make_token(user) <NEW_LINE> response = self.client.get( reverse('manager:workout:pdf-table', kwargs={ 'id': 3, 'uidb64': uid, 'token': t...
Tests exporting a workout as a pdf
62598fa855399d3f05626464
class InlineAdminForm(AdminForm): <NEW_LINE> <INDENT> def __init__(self, formset, form, fieldsets, prepopulated_fields, original, readonly_fields=None, model_admin=None): <NEW_LINE> <INDENT> self.formset = formset <NEW_LINE> self.model_admin = model_admin <NEW_LINE> self.original = original <NEW_LINE> if original is no...
A wrapper around an inline form for use in the admin system.
62598fa899cbb53fe6830e16
class TimestepObjectCache(object): <NEW_LINE> <INDENT> def __init__(self, timestep): <NEW_LINE> <INDENT> self.session = core.Session.object_session(timestep) <NEW_LINE> self._timestep_id = timestep.id <NEW_LINE> <DEDENT> def _initialise_cache(self): <NEW_LINE> <INDENT> all_objects = self.session.query(core.SimulationOb...
A temporary store for all objects in a timestep, allowing objects to be resolved without a further database query
62598fa82c8b7c6e89bd3705
class XMLReceiver(SerializeReceiver): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.format = 'xml'
Data format class for form submission in XML, e.g. for software clients.
62598fa8cc0a2c111447af50
class TestDeleteDocxTableRowRangeResponse(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 testDeleteDocxTableRowRangeResponse(self): <NEW_LINE> <INDENT> pass
DeleteDocxTableRowRangeResponse unit test stubs
62598fa8dd821e528d6d8e75
class AceJumpWithinLineCommand(AceJumpCommand): <NEW_LINE> <INDENT> def prompt(self): <NEW_LINE> <INDENT> return "" <NEW_LINE> <DEDENT> def init_value(self): <NEW_LINE> <INDENT> return " " <NEW_LINE> <DEDENT> def regex(self): <NEW_LINE> <INDENT> return r'\b\w|\w\b|(?<=_)\w|\w(?=_)' <NEW_LINE> <DEDENT> def after_jump(se...
Specialized command for within-line-mode
62598fa8be8e80087fbbefa3
class Stat(object): <NEW_LINE> <INDENT> def __init__(self, mean = [],variance =[],pi=[]): <NEW_LINE> <INDENT> self.mean = mean <NEW_LINE> self.variance=variance <NEW_LINE> self.pi=pi <NEW_LINE> <DEDENT> def SetInitialValues(self,cluster,data): <NEW_LINE> <INDENT> spltdData = list(self.split(np.sort(data),cluster)) <NEW...
Statistic Object for data transfer
62598fa81f5feb6acb162b61
class VCSView(BrowserView): <NEW_LINE> <INDENT> def getVCal(self): <NEW_LINE> <INDENT> context = self.context <NEW_LINE> out = BytesIO() <NEW_LINE> map = { 'dtstamp': rfc2445dt(DateTime()), 'created': rfc2445dt(DateTime(context.CreationDate())), 'uid': IUUID(context), 'modified': rfc2445dt(DateTime(context.Modification...
VCS view.
62598fa832920d7e50bc5f95
class Base(Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> <DEDENT> created = DateTimeField(editable=False) <NEW_LINE> updated = DateTimeField(editable=False) <NEW_LINE> is_active = BooleanField(default=True) <NEW_LINE> def save(self, *args, **kwargs): <NEW_LINE> <INDENT> self.cre...
Base model for all of the models in the application.
62598fa8cb5e8a47e493c118
class DynamicSplit(base.NextNodeMixin, base.UndoViewMixin, base.CancelViewMixin, base.PerformViewMixin, base.DetailsViewMixin, base.Gateway): <NEW_LINE> <INDENT> task_type = 'SPLIT' <NEW_LINE> activation_cls = DynamicSplitActivation <NEW_LINE> def __init__(self, callback): <NEW_LINE> <INDENT> super(DynamicSplit, self)....
Activates several outgoing task instances depends on callback value Example:: spit_on_decision = flow.DynamicSplit(lambda p: 4) \ .Next(this.make_decision) make_decision = flow.View(MyView) \ .Next(this.join_on_decision) join_on_decision = flow.Join() \ .Next(this.end)
62598fa8d486a94d0ba2bf0e
class TLEParserError(Exception): <NEW_LINE> <INDENT> def __init__(self, expr, msg): <NEW_LINE> <INDENT> self.expr = expr <NEW_LINE> self.msg = msg
Exception class to raise on an TLE parse error
62598fa84428ac0f6e658463
class CA(Ordination): <NEW_LINE> <INDENT> short_method_name = 'CA' <NEW_LINE> long_method_name = 'Canonical Analysis' <NEW_LINE> def __init__(self, X, row_ids, column_ids): <NEW_LINE> <INDENT> self.X = np.asarray(X, dtype=np.float64) <NEW_LINE> self._ca() <NEW_LINE> self.row_ids = row_ids <NEW_LINE> self.column_ids = c...
Compute correspondence analysis, a multivariate statistical technique for ordination. In general, rows in the data table will correspond to sites and columns to species, but the method is symmetric. In order to measure the correspondence between rows and columns, the :math:`\chi^2` distance is used, and those distance...
62598fa8009cb60464d0145f
class ListNode: <NEW_LINE> <INDENT> def __init__(self, x): <NEW_LINE> <INDENT> self.val = x <NEW_LINE> self.next = None
Comment out while running in LeetCode Keep while running locally
62598fa80c0af96317c562c3
class CCMapHintField(CCField): <NEW_LINE> <INDENT> TYPE = 7 <NEW_LINE> def __init__(self, hint): <NEW_LINE> <INDENT> if __debug__: <NEW_LINE> <INDENT> if len(hint) > 127 or len(hint) < 0: <NEW_LINE> <INDENT> raise AssertionError("Hint must be from 0 to 127 characters in length. Hint passed is '"+hint+"'") <NEW_LINE> <D...
A class defining a hint Member vars: type_val (int): the type identifier of this class (set to 7) hint (string): the hint for the level max length 127 characters
62598fa86aa9bd52df0d4e09
class CmdNeige(Commande): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Commande.__init__(self, "neige", "snow") <NEW_LINE> self.aide_courte = "gère la construction dans la neige" <NEW_LINE> self.aide_longue = "Cette commande permet la construction de bonhommes " "de neige et de boul...
Commande 'neige'.
62598fa8b7558d5895463570
class StatsTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> scales.reset() <NEW_LINE> <DEDENT> def testJsonCollapse(self): <NEW_LINE> <INDENT> r = Root() <NEW_LINE> r.getChild('here', False).countStat += 1 <NEW_LINE> r.getChild('not', True).countStat += 100 <NEW_LINE> out = StringIO() <...
Test cases for stats classes.
62598fa81b99ca400228f4d0
class CartListSerializer(serializers.ListSerializer): <NEW_LINE> <INDENT> def get_attribute(self, instance): <NEW_LINE> <INDENT> manager = super(CartListSerializer, self).get_attribute(instance) <NEW_LINE> assert isinstance(manager, models.Manager) and issubclass(manager.model, BaseCartItem) <NEW_LINE> return manager.f...
This serializes a list of cart items, whose quantity is non-zero.
62598fa8fff4ab517ebcd725
class DBCancerType(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swagger_types = { 'color': 'str', 'id': 'str', 'name': 'str' } <NEW_LINE> self.attribute_map = { 'color': 'color', 'id': 'id', 'name': 'name' } <NEW_LINE> self._color = None <NEW_LINE> self._id = None <NEW_LINE> self._name = No...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598fa88e71fb1e983bb9f3
class Subscription(object): <NEW_LINE> <INDENT> def __init__(self, recipient, token): <NEW_LINE> <INDENT> self.recipient = recipient <NEW_LINE> self.token = token <NEW_LINE> <DEDENT> @property <NEW_LINE> def recipient_id(self): <NEW_LINE> <INDENT> return self.recipient.id <NEW_LINE> <DEDENT> def confirm(self): <NEW_LIN...
Adds subscription management to a recipient.
62598fa8e5267d203ee6b84c
class InvalidContext(InvalidOperation): <NEW_LINE> <INDENT> def handle(self, context, *args): <NEW_LINE> <INDENT> return _NaN
Invalid context. Unknown rounding, for example. This occurs and signals invalid-operation if an invalid context was detected during an operation. This can occur if contexts are not checked on creation and either the precision exceeds the capability of the underlying concrete representation or an unknown or unsupport...
62598fa8fff4ab517ebcd726
class KeyboardController: <NEW_LINE> <INDENT> def __init__(self, evManager): <NEW_LINE> <INDENT> self.evManager = evManager <NEW_LINE> self.evManager.RegisterListener(self) <NEW_LINE> <DEDENT> def Notify(self, event): <NEW_LINE> <INDENT> if isinstance(event, events.TickEvent): <NEW_LINE> <INDENT> for event in pygame.ev...
KeyboardController takes Pygame events generated by the keyboard and uses them to control the model, by sending Requests or to control the Pygame display directly, as with the QuitEvent
62598fa860cbc95b0636428e
class Users(models.Model): <NEW_LINE> <INDENT> uname = models.CharField(max_length=30, verbose_name='用户名') <NEW_LINE> uphone = models.CharField(max_length=11, verbose_name='电话号码') <NEW_LINE> upwd = models.CharField(max_length=20) <NEW_LINE> uemail = models.EmailField(verbose_name='邮箱') <NEW_LINE> isActive = models.Bool...
docstring for ClassName
62598fa8d6c5a102081e2089
class School(object): <NEW_LINE> <INDENT> def __init__(self,school_name,school_addr): <NEW_LINE> <INDENT> self.school_name = school_name <NEW_LINE> self.school_addr = school_addr <NEW_LINE> self.school_course = {} <NEW_LINE> self.school_class = {} <NEW_LINE> self.school_teacher = {} <NEW_LINE> <DEDENT> def create_cours...
学校类,包含名称,地址,课程,班级,教师
62598fa87cff6e4e811b596b
class Count(Fold): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(Count, self).__init__( subspec=T, init=int, op=lambda cur, val: cur + 1) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '%s()' % self.__class__.__name__
takes a count of how many values occurred >>> glom([1, 2, 3], Count()) 3
62598fa830dc7b766599f78f
class TerritoryCode (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin): <NEW_LINE> <INDENT> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'TerritoryCode') <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('http://ddex.net/xml/20120719/iso3166a2.xsd', 10, 3) <NEW_LINE> _Documentation = 'A...
An ISO 3166-1 two-letter code representing a ddex:Territory.
62598fa8442bda511e95c397
@_assemble(_acq480, 4) <NEW_LINE> class acq2106_acq480x4(_acq2106): <NEW_LINE> <INDENT> pass
ACQ2106 carrier with four ACQ480 modules.
62598fa8bd1bec0571e15064
class ProcessManager(MonitoredProcess): <NEW_LINE> <INDENT> def __init__(self, conf, uuid, namespace=None, service=None, pids_path=None, default_cmd_callback=None, cmd_addl_env=None, pid_file=None, run_as_root=False): <NEW_LINE> <INDENT> self.conf = conf <NEW_LINE> self.uuid = uuid <NEW_LINE> self.namespace = namespace...
An external process manager for Neutron spawned processes. Note: The manager expects uuid to be in cmdline.
62598fa88a43f66fc4bf20be
class Profile(object): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> host = config.get('PROFILE_ELASTICSEARCH_HOST') <NEW_LINE> user = config.get('PROFILE_ELASTICSEARCH_USER') <NEW_LINE> password = config.get('PROFILE_ELASTICSEARCH_PASS') <NEW_LINE> self.es = database.initEs(host, user, password) ...
Profile operations.
62598fa8e5267d203ee6b84d
class ICC_026: <NEW_LINE> <INDENT> pass
Grim Necromancer
62598fa863b5f9789fe850a7
class BaseStore(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.data_path = settings.DATA_PATH <NEW_LINE> <DEDENT> def save(self, obj, id_code): <NEW_LINE> <INDENT> filestream = open('{0}/{1}'.format(self.data_path, id_code), 'w+') <NEW_LINE> pickle.dump(obj, filestream) <NEW_LINE> filestream....
Basic datastore
62598fa892d797404e388b06
class BlueMarbleExamples(GaLabExamples): <NEW_LINE> <INDENT> def startup(self): <NEW_LINE> <INDENT> self.file = self.DataDir + '/model.ctl' <NEW_LINE> <DEDENT> def ex_proj_stereo(self): <NEW_LINE> <INDENT> ga.basemap('nps', opts=(-90.,40.)) <NEW_LINE> ga.blue_marble(Show=True) <NEW_LINE> title("Northern Stereographic P...
Examples based on the Blue Marble image.
62598fa8be8e80087fbbefa5
class PubsubProjectsTopicsSubscriptionsListRequest(_messages.Message): <NEW_LINE> <INDENT> pageSize = _messages.IntegerField(1, variant=_messages.Variant.INT32) <NEW_LINE> pageToken = _messages.StringField(2) <NEW_LINE> topic = _messages.StringField(3, required=True)
A PubsubProjectsTopicsSubscriptionsListRequest object. Fields: pageSize: Maximum number of subscription names to return. pageToken: The value returned by the last ListTopicSubscriptionsResponse; indicates that this is a continuation of a prior ListTopicSubscriptions call, and that the system should return ...
62598fa8a8ecb03325871152
class BlogHome(TemplateView): <NEW_LINE> <INDENT> template_name = 'blogs/index.html' <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super().get_context_data(**kwargs) <NEW_LINE> entries = BlogEntry.objects.order_by('-pub_date')[:6] <NEW_LINE> latest_entry = None <NEW_LINE> other_entries ...
Main blog view
62598fa830bbd72246469919
class Head(Protein): <NEW_LINE> <INDENT> def __init__(self, parent, side): <NEW_LINE> <INDENT> self.parent = parent <NEW_LINE> self.side = side <NEW_LINE> self.bs = binding_site.BindingSite(self) <NEW_LINE> <DEDENT> @property <NEW_LINE> def other_head(self): <NEW_LINE> <INDENT> return self.parent.heads[self.side ^ 1]
Generic head located on a parent protein
62598fa85fcc89381b2660ee
class NinjaAnt(Ant): <NEW_LINE> <INDENT> name = 'Ninja' <NEW_LINE> damage = 1 <NEW_LINE> implemented = True <NEW_LINE> food_cost = 5 <NEW_LINE> blocks_path =False <NEW_LINE> def action(self, colony): <NEW_LINE> <INDENT> for bee in list(self.place.bees): <NEW_LINE> <INDENT> bee.reduce_armor(self.damage)
NinjaAnt does not block the path and damages all bees in its place.
62598fa80c0af96317c562c5
class LoggingModem(models.Model): <NEW_LINE> <INDENT> probe = models.ForeignKey(Probe, verbose_name=_(u'Modem APN')) <NEW_LINE> modem = models.ForeignKey(Modem, verbose_name=_(u'Modem APN')) <NEW_LINE> created = models.DateTimeField(default=django.utils.timezone.now, verbose_name=_(u'Date created')) <NEW_LINE> class Me...
Logging at which time the modem was attached to a particular Probe
62598fa8dd821e528d6d8e78
class Accuracy(Metric): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swig_metric = singa.Accuracy()
Compute the top one accuracy for singel label prediction tasks. It calls the C++ functions to do the calculation.
62598fa88e71fb1e983bb9f5
class AuthMiddleware: <NEW_LINE> <INDENT> def __init__(self, inner): <NEW_LINE> <INDENT> self.inner = inner <NEW_LINE> <DEDENT> def __call__(self, scope): <NEW_LINE> <INDENT> close_old_connections() <NEW_LINE> query_string = scope['query_string'].decode('utf-8') <NEW_LINE> if not query_string: <NEW_LINE> <INDENT> retur...
Middleware which populates scope["user"] from a Django session. Requires SessionMiddleware to function.
62598fa87c178a314d78d3e0
class TestStringEnum(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 testStringEnum(self): <NEW_LINE> <INDENT> """Test OuterEnum""" <NEW_LINE> assert StringEnum.allowed_values[('value',)] == { 'PLA...
StringEnum unit test stubs
62598fa832920d7e50bc5f98
class CharacterTrigramEmbedding(Embedding): <NEW_LINE> <INDENT> def __init__(self, language='en', maxlen=1024): <NEW_LINE> <INDENT> vectors_path = download_path('fasttext', language) <NEW_LINE> final_path = vectors_path.with_suffix('.numpy') <NEW_LINE> url = FAST_TEXT_URL_TEMPLATE.format(language) <NEW_LINE> self.maxle...
Language model base that will download and compile pretrained FastText vectors for a given language. Attributes ---------- embeddings A two dimensional numpy array [term id, vector dimension] storing floating points. This is a memory mapped array to save some I/O. >>> from vectoria import Embeddings >>> charg...
62598fa899fddb7c1ca62d8a
class KLpq(VariationalInference): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> VariationalInference.__init__(self, *args, **kwargs) <NEW_LINE> <DEDENT> def initialize(self, n_minibatch=1, *args, **kwargs): <NEW_LINE> <INDENT> self.n_minibatch = n_minibatch <NEW_LINE> self.samples = tf.pl...
Kullback-Leibler divergence from posterior to variational model, KL( p(z |x) || q(z) ). (Cappe et al., 2008)
62598fa83617ad0b5ee06097
class AssemblyInput(tls.Unicode, TypeMeta): <NEW_LINE> <INDENT> info_text = "KBaseAssembly.AssemblyInput" <NEW_LINE> class v1_0(tls.Unicode, TypeMeta): <NEW_LINE> <INDENT> info_text = "KBaseAssembly.AssemblyInput-1.0"
AssemblyInput type
62598fa84e4d562566372368
class FitbitOAuth1(BaseOAuth1): <NEW_LINE> <INDENT> name = 'fitbit' <NEW_LINE> AUTHORIZATION_URL = 'https://www.fitbit.com/oauth/authorize' <NEW_LINE> REQUEST_TOKEN_URL = 'https://api.fitbit.com/oauth/request_token' <NEW_LINE> ACCESS_TOKEN_URL = 'https://api.fitbit.com/oauth/access_token' <NEW_LINE> ID_KEY = 'encodedId...
Fitbit OAuth1 authentication backend
62598fa8379a373c97d98f55
class VIEW_3D_PT_mypanel(bpy.types.Panel): <NEW_LINE> <INDENT> bl_label = 'My Panel' <NEW_LINE> bl_space_type = 'VIEW_3D' <NEW_LINE> bl_region_type = 'UI' <NEW_LINE> bl_category = 'My Addon' <NEW_LINE> def draw(self, context): <NEW_LINE> <INDENT> layout = self.layout <NEW_LINE> col = layout.column(align = True) <NEW_LI...
Tooltip
62598fa8e76e3b2f99fd8979
class RandomWalk(Initializer): <NEW_LINE> <INDENT> __default_values__ = {'scale': None} <NEW_LINE> def __init__(self, act_func='linear', scale=None): <NEW_LINE> <INDENT> super(RandomWalk, self).__init__() <NEW_LINE> self.act_func = act_func <NEW_LINE> self.scale = scale <NEW_LINE> <DEDENT> def __call__(self, shape): <N...
Initializes a (square) weight matrix with the random walk scheme proposed by: Sussillo, David, and L. F. Abbott. "Random Walk Initialization for Training Very Deep Feedforward Networks." arXiv:1412.6558 [cs, Stat], December 19, 2014. http://arxiv.org/abs/1412.6558.
62598fa8f9cc0f698b1c526a
class TGetTablesResp: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRUCT, 'status', (TStatus, TStatus.thrift_spec), None, ), (2, TType.STRUCT, 'operationHandle', (TOperationHandle, TOperationHandle.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, status=None, operationHandle=None,): <NEW_LINE> <INDENT> se...
Attributes: - status - operationHandle
62598fa838b623060ffa8fdb
class Processor(AwardProcessor): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> AwardProcessor.__init__(self, 'Defender', 'Most Flag Defends', [PLAYER_COL, Column('Defends', Column.NUMBER, Column.DESC)]) <NEW_LINE> <DEDENT> def on_flag_action(self, e): <NEW_LINE> <INDENT> if e.action_type == FlagActionEven...
Overview This processor is awarded to the player with the most flag defends. Implementation Count the flag action events of the appropriate type. Notes None.
62598fa8f7d966606f747f28
class Square: <NEW_LINE> <INDENT> def __init__(self, size=0): <NEW_LINE> <INDENT> if not isinstance(size, int): <NEW_LINE> <INDENT> raise TypeError("size must be an integer") <NEW_LINE> <DEDENT> if size < 0: <NEW_LINE> <INDENT> raise ValueError("size must be >= 0") <NEW_LINE> <DEDENT> self.__size = size
The Square class
62598fa80c0af96317c562c6
class InvincibleEnemy(SimpleEnemy): <NEW_LINE> <INDENT> name = "Invincible Enemy" <NEW_LINE> colour = 'green' <NEW_LINE> points = 10 <NEW_LINE> def __init__(self, grid_size=(.3, .3), grid_speed=5/50, health=400): <NEW_LINE> <INDENT> super().__init__(grid_size, grid_speed, health) <NEW_LINE> <DEDENT> def damage(self, da...
An enemy that can only by killed by EnergyTower.
62598fa821bff66bcd722baa
class ZhiPinSpider(BaseSpider, metaclass=SpiderMeta): <NEW_LINE> <INDENT> request_sleep = 15 <NEW_LINE> def crawl(self): <NEW_LINE> <INDENT> city_code = self._parse_city() <NEW_LINE> if not city_code: <NEW_LINE> <INDENT> self.logger.error('%s 不支持目标城市' % __class__.__name__) <NEW_LINE> return <NEW_LINE> <DEDENT> search_u...
BOSS直聘
62598fa8be383301e025373d
class ArnoldWinther(CiarletElement): <NEW_LINE> <INDENT> def __init__(self, cell, degree): <NEW_LINE> <INDENT> assert degree == 3, "Only defined for degree 3" <NEW_LINE> Ps = ONSymTensorPolynomialSet(cell, degree) <NEW_LINE> Ls = ArnoldWintherDual(cell, degree) <NEW_LINE> mapping = "double contravariant piola" <NEW_LIN...
The definition of the conforming Arnold-Winther element.
62598fa885dfad0860cbfa16
class CPOutlineArtist(matplotlib.collections.LineCollection): <NEW_LINE> <INDENT> def set_paths(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __init__(self, name, labels, *args, **kwargs): <NEW_LINE> <INDENT> lines = [] <NEW_LINE> for l in labels: <NEW_LINE> <INDENT> new_labels, counts = scipy.ndimage.label(l...
An artist that is a plot of the outline around an object This class is here so that we can add and remove artists for certain outlines.
62598fa863b5f9789fe850a9
class SupportedFieldChoices(BaseResource): <NEW_LINE> <INDENT> def __init__(self, dataFinder: DataFinder): <NEW_LINE> <INDENT> super().__init__(dataFinder) <NEW_LINE> <DEDENT> def get(self) -> List[str]: <NEW_LINE> <INDENT> return DataFinder.SUPPORTED_FIELD_CHOICES
List of supported field choices.
62598fa82c8b7c6e89bd370a
class ThreadedServer(object): <NEW_LINE> <INDENT> def __init__(self, host, port): <NEW_LINE> <INDENT> self.host = host <NEW_LINE> self.port = port <NEW_LINE> self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) <NEW_LINE> self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) <NEW_LINE> self.sock.bind...
Socket server where many client CLI can connect to use the OPC UA Client
62598fa8be8e80087fbbefa7
class VoiceprinttopnVerifyResponse(object): <NEW_LINE> <INDENT> openapi_types = { 'scores': 'list[UnionIDScore]' } <NEW_LINE> attribute_map = { 'scores': 'scores' } <NEW_LINE> def __init__(self, scores=None): <NEW_LINE> <INDENT> self._scores = None <NEW_LINE> self.discriminator = None <NEW_LINE> if scores is not None: ...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62598fa87d43ff24874273a4
class WebcomicName(GenericTumblrV1): <NEW_LINE> <INDENT> name = "webcomicname" <NEW_LINE> long_name = "Webcomic Name" <NEW_LINE> url = "https://webcomicname.com"
Class to retrieve Webcomic Name comics.
62598fa867a9b606de545f10
class DeliveryViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = DeliveryHead.objects.all() <NEW_LINE> serializer_class = DeliverySerializer
API endpoint that allows users to be viewed or edited.
62598fa8d486a94d0ba2bf12
class FakeContext: <NEW_LINE> <INDENT> def __init__(self, db={}): <NEW_LINE> <INDENT> self.db = db <NEW_LINE> self.queries = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def db(self): <NEW_LINE> <INDENT> return self.__db <NEW_LINE> <DEDENT> @db.setter <NEW_LINE> def db(self, db): <NEW_LINE> <INDENT> self.__db=db <NEW_...
A fake session, just used to query the database
62598fa891f36d47f2230e47
@zope.interface.implementer(IObjectConfigurationLoadedEvent) <NEW_LINE> class ObjectConfigurationLoadedEvent(ObjectModifiedEvent): <NEW_LINE> <INDENT> pass
Object configuration loaded
62598fa899fddb7c1ca62d8b
class Meta: <NEW_LINE> <INDENT> verbose_name = 'UserRole' <NEW_LINE> verbose_name_plural = 'UserRoles'
Meta definition for UserRole.
62598fa88da39b475be03129
class DivisionDict(typing.TypedDict, total=False): <NEW_LINE> <INDENT> id: typing.Optional[int] <NEW_LINE> name: typing.Optional[str] <NEW_LINE> employees: typing.Sequence["EmployeeDict"]
TypedDict for properties that are not required.
62598fa8f7d966606f747f2a
class MongoNHMStratigraphyTask(MongoTask): <NEW_LINE> <INDENT> module = 'enhmstratigraphy'
Import NHM Stratigraphy Export file into MongoDB
62598fa8851cf427c66b820e
class DNC_Model_V3(DNC_Model): <NEW_LINE> <INDENT> def __init__(self, num_dnc_layers=3, num_fcn_layers=3, *args, **kwargs): <NEW_LINE> <INDENT> super(DNC_Model_V3, self).__init__(*args, **kwargs) <NEW_LINE> self._num_dnc_layers = num_dnc_layers <NEW_LINE> self._num_fcn_layers = num_fcn_layers <NEW_LINE> <DEDENT> def ge...
Multiple Bidirectional DNC layers, AlphaDropout, Multiple FCN layers
62598fa87047854f4633f31f
class Headers(CaseInsensitiveDict): <NEW_LINE> <INDENT> def elements(self, key): <NEW_LINE> <INDENT> return header_elements(key, self.get(key)) <NEW_LINE> <DEDENT> def get_all(self, name): <NEW_LINE> <INDENT> value = self.get(name, '') <NEW_LINE> if isinstance(value, list): <NEW_LINE> <INDENT> return value <NEW_LINE> <...
This class implements a storage for headers as key value pairs. The underlying model of a case insensitive dict matches the requirements for headers quite well, because usually header keys are unique. If several values may be associated with a header key, most HTTP headers represent the values as an enumeration using a...
62598fa87b25080760ed73f2
class TimeTrackingMixin(object): <NEW_LINE> <INDENT> created = Column(DateTime) <NEW_LINE> modified = Column(DateTime)
A model mix-in with created and modified datetime columns.
62598fa83d592f4c4edbae13
class MapObjectAPIViewSet(viewsets.ViewSet): <NEW_LINE> <INDENT> queryset = MapPointer.objects.all() <NEW_LINE> def list(self, request): <NEW_LINE> <INDENT> ct = request.QUERY_PARAMS.get('ct') <NEW_LINE> pk = request.QUERY_PARAMS.get('pk') <NEW_LINE> if ct and pk: <NEW_LINE> <INDENT> pointers = MapPointer.objects.filte...
This viewset is made only for GET requests. It presents entire list of all map objects created by users in proper format. They are then used to populate main map view with map pointers. It is possible to search through certain objects by ID and object type to which the marker referes to. To do so, in the GET parameter...
62598fa88a43f66fc4bf20c2
class ImportResourceType(enum.Enum): <NEW_LINE> <INDENT> CATEGORY = "category" <NEW_LINE> ORDER = "order" <NEW_LINE> ORDER_PATCH = "order-patch" <NEW_LINE> PRICE = "price" <NEW_LINE> PRODUCT = "product" <NEW_LINE> PRODUCT_DRAFT = "product-draft" <NEW_LINE> PRODUCT_TYPE = "product-type" <NEW_LINE> PRODUCT_VARIANT = "pro...
The type of the import resource.
62598fa84e4d56256637236b
class Host(object): <NEW_LINE> <INDENT> __slots__ = [ 'name', 'vars', 'groups' ] <NEW_LINE> def __init__(self, name=None, port=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.vars = {} <NEW_LINE> self.groups = [] <NEW_LINE> if port and port != C.DEFAULT_REMOTE_PORT: <NEW_LINE> <INDENT> self.set_variable('an...
a single ansible host
62598fa8be383301e025373f
class SpeechRecognitionCanceledEventArgs(SpeechRecognitionEventArgs): <NEW_LINE> <INDENT> def __init__(self, evt_args): <NEW_LINE> <INDENT> super().__init__(evt_args) <NEW_LINE> self._cancellation_details = evt_args.cancellation_details <NEW_LINE> <DEDENT> @property <NEW_LINE> def cancellation_details(self) -> "Cancell...
Class for speech recognition canceled event arguments.
62598fa82ae34c7f260ab028