code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
@description("Offlines a disk in a volume") <NEW_LINE> class OfflineVdevCommand(Command): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> self.parent = parent <NEW_LINE> <DEDENT> def run(self, context, args, kwargs, opargs): <NEW_LINE> <INDENT> if len(args) == 0: <NEW_LINE> <INDENT> raise CommandExc...
Usage: offline <disk> Example: offline ada1 Offlines a disk in a volume"
625990564a966d76dd5f0450
class TaskRetrieveUpdateDestroyViewSet(TaskBaseViewSet, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, mixins.DestroyModelMixin): <NEW_LINE> <INDENT> pass
Task retrieve, update, destroy view sets
62599056379a373c97d9a584
class DescribeImageQuotaResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ImageNumQuota = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.ImageNumQuota = params.get("ImageNumQuota") <NEW_LINE> self.RequestId = par...
DescribeImageQuota返回参数结构体
6259905629b78933be26ab74
class RolesController(wsgi.Controller): <NEW_LINE> <INDENT> def __init__(self, options): <NEW_LINE> <INDENT> self.options = options <NEW_LINE> <DEDENT> @utils.wrap_error <NEW_LINE> def create_role(self, req): <NEW_LINE> <INDENT> role = utils.get_normalized_request_content(Role, req) <NEW_LINE> return utils.send_result(...
Controller for Role related operations
6259905673bcbd0ca4bcb7f1
class ConvertEnergy: <NEW_LINE> <INDENT> def __init__(self, temperature=None, debug=False): <NEW_LINE> <INDENT> self._deg_c = temperature <NEW_LINE> self._debug = debug <NEW_LINE> if self._debug: <NEW_LINE> <INDENT> print("*Init:", self.__class__) <NEW_LINE> print("*Init: ", self.__dict__) <NEW_LINE> <DEDENT> <DEDENT> ...
energy helper class.
6259905610dbd63aa1c72129
class WeboobProxy(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def version(): <NEW_LINE> <INDENT> return Weboob.VERSION <NEW_LINE> <DEDENT> def __init__(self): <NEW_LINE> <INDENT> self.weboob = Weboob() <NEW_LINE> self.backend = None <NEW_LINE> <DEDENT> def install_modules(self, capability=None, name=None): <N...
Connector is a tool that connects to common websites like bank website, phone operator website... and that grabs personal data from there. Credentials are required to make this operation. Technically, connectors are weboob backend wrappers.
62599056b830903b9686ef2e
class Meta: <NEW_LINE> <INDENT> ordering = ['-created_date'] <NEW_LINE> verbose_name = 'Weight Entry' <NEW_LINE> verbose_name_plural = 'Weight Entries'
Meta data, in this case we instruct to order list views by due_back.
625990560fa83653e46f6445
class AvailableConnectWiseBoardManager(models.Manager): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> return super().get_queryset().filter(inactive=False)
Return only active ConnectWise boards.
6259905694891a1f408ba1a6
class ResponseBusinessUnarrangedAccountOverdraftData(object): <NEW_LINE> <INDENT> swagger_types = { 'brand': 'BusinessUnarrangedAccountOverdraftBrand' } <NEW_LINE> attribute_map = { 'brand': 'brand' } <NEW_LINE> def __init__(self, brand=None): <NEW_LINE> <INDENT> self._brand = None <NEW_LINE> self.discriminator = None ...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62599056462c4b4f79dbcf65
class Arc(object): <NEW_LINE> <INDENT> def __init__(self, from_node, to_node): <NEW_LINE> <INDENT> self.from_node = from_node <NEW_LINE> self.to_node = to_node <NEW_LINE> self.to_node.addArcConnection(self.from_node.getName(),self.from_node.getSize()) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return s...
Arc between two nodes :Attributes: - from_node (Node): Node where the arc starts - to_node (Node): Node where the arc points
625990563539df3088ecd807
class EncoderResnet(object): <NEW_LINE> <INDENT> def __init__(self, params, mode): <NEW_LINE> <INDENT> self.params = params <NEW_LINE> self.mode = mode <NEW_LINE> self.encoder_params = ENCODER_DEFUALT_PARAM <NEW_LINE> <DEDENT> def __call__(self, features): <NEW_LINE> <INDENT> inputs = features['image'] <NEW_LINE> with ...
Residual encoder using off-the-shelf interface.
62599056435de62698e9d363
class UserInfo(Resource): <NEW_LINE> <INDENT> @authorize <NEW_LINE> @add_default_HTTP_returns <NEW_LINE> def get(self): <NEW_LINE> <INDENT> return {"username": request.headers["Adfs-Login"], "name": request.headers["Adfs-Name"], "group": request.headers["Adfs-Group"], "email": request.headers["Adfs-Email"]}
Documentation for UserInfo
6259905682261d6c5273097a
class pisaTagPDFBARCODE(pisaTag): <NEW_LINE> <INDENT> def start(self, c): <NEW_LINE> <INDENT> c.addPara() <NEW_LINE> attr = self.attr <NEW_LINE> bc = Standard39() <NEW_LINE> bc.value = attr.value <NEW_LINE> bc.barHeight = 0.5 * inch <NEW_LINE> bc.lquiet = 0 <NEW_LINE> bc.rquiet = 0 <NEW_LINE> bc.hAlign = attr.align.upp...
<pdf:barcode value="" align="">
625990564e4d562566373968
class FederalDashboard(StateDashboard, ABC): <NEW_LINE> <INDENT> provider: str = "federal" <NEW_LINE> def _prep_df(self, df: pd.DataFrame) -> Tuple[pd.DataFrame, str]: <NEW_LINE> <INDENT> insert_op = str(uuid.uuid4()) <NEW_LINE> to_ins = df.rename(columns={"vintage": "last_updated"}).assign( insert_op=insert_op, provid...
Parent class for scrapers working directly with federal sources See `StateDashboard` for more information
625990567d847024c075d93b
class FftSpectraDataPointFftSpectra(object): <NEW_LINE> <INDENT> openapi_types = { 'frequencies': 'list[float]', 'x': 'list[float]', 'y': 'list[float]', 'z': 'list[float]' } <NEW_LINE> attribute_map = { 'frequencies': 'frequencies', 'x': 'x', 'y': 'y', 'z': 'z' } <NEW_LINE> def __init__(self, frequencies=None, x=None, ...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62599056d7e4931a7ef3d5df
class FocalLoss(nn.Module): <NEW_LINE> <INDENT> def __init__(self, class_num, alpha=None, gamma=2, size_average=True): <NEW_LINE> <INDENT> super(FocalLoss, self).__init__() <NEW_LINE> if alpha is None: <NEW_LINE> <INDENT> self.alpha = Variable(torch.ones(class_num, 1)) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if i...
This criterion is a implemenation of Focal Loss, which is proposed in Focal Loss for Dense Object Detection. Loss(x, class) = - \alpha (1-softmax(x)[class])^gamma \log(softmax(x)[class]) The losses are averaged across observations for each minibatch. Args: alpha(1D Tensor, Variable) : the scalar factor for t...
6259905621a7993f00c674cd
class GetCcnRegionBandwidthLimitsResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.CcnBandwidthSet = None <NEW_LINE> self.TotalCount = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("CcnBandwidthSet") is...
GetCcnRegionBandwidthLimits返回参数结构体
62599056adb09d7d5dc0bacb
class EffectWalker(PropertiesWalker): <NEW_LINE> <INDENT> @property <NEW_LINE> def list(self): <NEW_LINE> <INDENT> obj = self.obj <NEW_LINE> element_effect = getattr(obj, 'element_effect', None) <NEW_LINE> effects = [] <NEW_LINE> while element_effect: <NEW_LINE> <INDENT> effects.append(element_effect) <NEW_LINE> elemen...
TreeWalker for an effect
625990563eb6a72ae038bbc0
class TestSupport(object): <NEW_LINE> <INDENT> def _generate_test_questions(self): <NEW_LINE> <INDENT> count, t = parse_test_def(self.header.test) <NEW_LINE> q = list(range(len(self.m_questions))) * count <NEW_LINE> random.shuffle(q) <NEW_LINE> return q <NEW_LINE> <DEDENT> def get_test_num_questions(self): <NEW_LINE> <...
Lessonfile classes can add this class to the list of classes it inherits from if the exercise want to have tests.
625990562c8b7c6e89bd4d4f
class OnInput(AWSProperty): <NEW_LINE> <INDENT> props: PropsDictType = { "Events": ([Event], False), "TransitionEvents": ([TransitionEvent], False), }
`OnInput <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iotevents-detectormodel-oninput.html>`__
6259905632920d7e50bc75a7
class PostLike(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'postlike' <NEW_LINE> author_id = db.Column(db.Integer, db.ForeignKey('user.user_id'), primary_key=True) <NEW_LINE> post_id = db.Column(db.Integer, db.ForeignKey('posts.post_id'), primary_key=True) <NEW_LINE> create_time = db.Column(db.DateTime, default=date...
点赞关系表
6259905671ff763f4b5e8d11
class SortedDict(dict): <NEW_LINE> <INDENT> def __init__(self, data=None): <NEW_LINE> <INDENT> if data is None: <NEW_LINE> <INDENT> data = {} <NEW_LINE> <DEDENT> dict.__init__(self, data) <NEW_LINE> if isinstance(data, dict): <NEW_LINE> <INDENT> self.keyOrder = data.keys() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> ...
A dictionary that keeps its keys in the order in which they're inserted.
62599056507cdc57c63a6306
class TestGetActionSelection(unittest.TestCase): <NEW_LINE> <INDENT> def testGetActionSolution(self): <NEW_LINE> <INDENT> actionlist = [1,2,3,4,5] <NEW_LINE> for action in actionlist: <NEW_LINE> <INDENT> if action == 1: <NEW_LINE> <INDENT> val = getActionSelection(action) <NEW_LINE> self.assertEqual(val,"Show All Books...
Test for getting action solution
62599056fff4ab517ebced84
class Binomial: <NEW_LINE> <INDENT> def __init__(self, data=None, n=1, p=0.5): <NEW_LINE> <INDENT> if data is not None: <NEW_LINE> <INDENT> n = int(len(data) / 2) <NEW_LINE> q = 1 - p <NEW_LINE> for x in data: <NEW_LINE> <INDENT> p += np.power(p,x)*np.power(q,n-x) <NEW_LINE> <DEDENT> <DEDENT> self.n = n <NEW_LINE> self...
Sets the instance attributes n and p
62599056be8e80087fbc05e4
class PostSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> url = serializers.HyperlinkedIdentityField(view_name='blog:post-detail') <NEW_LINE> category = serializers.SlugRelatedField(read_only=True, slug_field='name') <NEW_LINE> tag = serializers.SlugRelatedField(many=True, read_only=True, slug_field='name'...
文章列表接口需要的serializer
62599056b7558d58954649dc
class Partial(Item): <NEW_LINE> <INDENT> duration = None <NEW_LINE> def partial_length(self): <NEW_LINE> <INDENT> if self.duration: <NEW_LINE> <INDENT> base, scaling = self.duration.base_scaling <NEW_LINE> return base * scaling
A \partial command.
62599056a8ecb03325872779
class TestIndex(_BaseData.BaseIndex): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.calcType = None <NEW_LINE> self.num = None <NEW_LINE> self.min = 0 <NEW_LINE> self.max = 1 <NEW_LINE> self.step = 1
Index class for TestData :var calcType: calculation type, 'num' or 'rnd' :var num: number of elements :var min: minimal value :var max: maximal value, 'rnd' only :var step: step size for num only
62599056462c4b4f79dbcf67
class VirtualPatientState(object): <NEW_LINE> <INDENT> def __init__( self, bg, sensor_bg, bg_prediction, pump_state, iob, iob_prediction, sensor_bg_prediction, isf, cir, ): <NEW_LINE> <INDENT> self.bg = bg <NEW_LINE> self.sensor_bg = sensor_bg <NEW_LINE> self.bg_prediction = bg_prediction <NEW_LINE> self.sensor_bg_pred...
A class of instantaneous patient information.
6259905694891a1f408ba1a7
class Sprite(sfml.Sprite, Thing): <NEW_LINE> <INDENT> depth = 0 <NEW_LINE> def __lt__(self, other): <NEW_LINE> <INDENT> return self.depth < other.depth <NEW_LINE> <DEDENT> def update(self): <NEW_LINE> <INDENT> pass
Sfmllän Sprite paitsi että sen voi laitella syvyyden mukaan
62599056ac7a0e7691f73a43
class ResearchModelOpsAPIView(WdCreateAPIView): <NEW_LINE> <INDENT> model = ResearchModel <NEW_LINE> POST_CHECK_REQUEST_PARAMETER = ('ops_type', 'model_id') <NEW_LINE> OPS_TYPE_RELEASE = 'release' <NEW_LINE> OPS_TYPE_INHERIT = 'inherit' <NEW_LINE> def post_check_parameter(self, kwargs): <NEW_LINE> <INDENT> err_code = s...
模型的发布与派生
62599056baa26c4b54d50807
class discrete_var_bounds_MILP(_ModelClassBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> _ModelClassBase.__init__(self) <NEW_LINE> self.linear = True <NEW_LINE> self.integer = True <NEW_LINE> self.disable_suffix_tests = True <NEW_LINE> self.results_file = join(thisDir,"discrete_var_bounds_MILP.resul...
A discrete model where discrete variables have custom bounds
6259905601c39578d7f141e8
class TestDeterminant(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self) -> None: <NEW_LINE> <INDENT> self.func = Determinant() <NEW_LINE> self.simplifier = StepSimplifier() <NEW_LINE> <DEDENT> def create_call_expr(self, *args): <NEW_LINE> <INDENT> return Call(self.func, args) <NEW_LINE> <DEDENT> def test_call(sel...
Tests the functionalities and properties of a `matstep.matrices .Determinant` instance.
6259905621a7993f00c674cf
class StorageAccountCreateParameters(Model): <NEW_LINE> <INDENT> _validation = { 'resource_id': {'required': True}, 'active_key_name': {'required': True}, 'auto_regenerate_key': {'required': True}, } <NEW_LINE> _attribute_map = { 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'active_key_name': {'key': 'activeKey...
The storage account create parameters. All required parameters must be populated in order to send to Azure. :param resource_id: Required. Storage account resource id. :type resource_id: str :param active_key_name: Required. Current active storage account key name. :type active_key_name: str :param auto_regenerate_key...
6259905676e4537e8c3f0aee
@dataclass(order=True) <NEW_LINE> class Favourite: <NEW_LINE> <INDENT> lcn: int = field( init=True, repr=True, compare=True, ) <NEW_LINE> channelno: str = field( init=True, repr=True, compare=False, ) <NEW_LINE> channelname: str = field( init=True, repr=True, compare=False, ) <NEW_LINE> sid: str = field( init=True, rep...
SkyQ favourite Class.
625990564e4d56256637396a
class IrBlaster(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def periods_to_microseconds(frequency, pattern): <NEW_LINE> <INDENT> period = 1000000. / frequency <NEW_LINE> return [period * x for x in pattern] <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def microseconds_to_periods(frequency, pattern): <NEW_LINE...
Infrared blaster facade.
6259905607f4c71912bb099d
class ParameterParameter(ParameterExpressionItem): <NEW_LINE> <INDENT> datatype = "" <NEW_LINE> def __init__(self, _datatype="", _operator=None): <NEW_LINE> <INDENT> super(ParameterParameter, self).__init__(_operator) <NEW_LINE> self.datatype = _datatype <NEW_LINE> <DEDENT> def _generate_sql(self, _db_type): <NEW_LINE>...
Holds a parameter to be used in prepared statements.
6259905632920d7e50bc75a9
class GdwATMetatags(ATMetatags): <NEW_LINE> <INDENT> implements(IOpengraphMetatags) <NEW_LINE> @property <NEW_LINE> def admins(self): <NEW_LINE> <INDENT> pwManager = getUtility(IPasswordManager, 'facebookadmins') <NEW_LINE> admins = self.settings.admins or pwManager.username <NEW_LINE> return admins <NEW_LINE> <DEDENT>...
Facebook informations for gdw
625990562c8b7c6e89bd4d51
class _AbsConverge(_ConvergeFunction): <NEW_LINE> <INDENT> def is_converge(self, loss): <NEW_LINE> <INDENT> if loss <= self.eps: <NEW_LINE> <INDENT> converge_flag = True <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> converge_flag = False <NEW_LINE> <DEDENT> return converge_flag
Judge converge by absolute loss value. When loss value smaller than eps, converge flag will be provided.
625990564a966d76dd5f0454
class User(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> uuid = models.UUIDField( default=uuid.uuid4, editable=False, unique=True, verbose_name=_('uuid') ) <NEW_LINE> email = models.EmailField( _('email address'), unique=True, db_index=True ) <NEW_LINE> first_name = models.CharField( _('first name'), max_len...
User model
6259905673bcbd0ca4bcb7f5
class Following(ListView): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> following = self.get_queryset() <NEW_LINE> if len(following) == 0: <NEW_LINE> <INDENT> return redirect(reverse('following-add')) <NEW_LINE> <DEDENT> context = {'followed_resource': following} <NEW_LINE> return render(request, 'fo...
Display the list of resources that are being followed by the user.
62599056e5267d203ee6ce52
class BookInstance(models.Model): <NEW_LINE> <INDENT> id = models.UUIDField(primary_key=True, default=uuid.uuid4, help_text="Unique ID for this particular book across whole library") <NEW_LINE> book = models.ForeignKey('Book', on_delete=models.SET_NULL, null=True) <NEW_LINE> imprint = models.CharField(max_length=200) <...
Model representing a specific copy of a book (i.e. that can be borrowed from the library).
625990568e7ae83300eea5f1
class Solution(object): <NEW_LINE> <INDENT> def twoSum(self, nums: list, target: int)-> list: <NEW_LINE> <INDENT> m_dict = dict() <NEW_LINE> out_list = list() <NEW_LINE> for i in range(0, len(nums)): <NEW_LINE> <INDENT> if nums[i] in m_dict: <NEW_LINE> <INDENT> out_list.append(m_dict.get(nums[i])) <NEW_LINE> out_list.a...
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. Example: Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1].
6259905615baa723494634f6
class MyDocTemplate(BaseDocTemplate): <NEW_LINE> <INDENT> _invalidInitArgs = ('pageTemplates',) <NEW_LINE> def __init__(self, filename, **kw): <NEW_LINE> <INDENT> frame1 = Frame(2.5*cm, 2.5*cm, 15*cm, 25*cm, id='F1') <NEW_LINE> self.allowSplitting = 0 <NEW_LINE> BaseDocTemplate.__init__(self, filename, **kw) <NEW_LINE>...
The document template used for all PDF documents.
62599056b7558d58954649dd
class Deck: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.cards = [] <NEW_LINE> for rank in ["two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "jack", "queen", "king", "ace"]: <NEW_LINE> <INDENT> for suit in ["clubs", "diamonds", "hearts", "spades"]: <NEW_LINE> <INDENT> self.car...
Deck class for representing and manipulating 52 instances of Card
62599056097d151d1a2c25cf
class HMLight(HMDevice, Light): <NEW_LINE> <INDENT> @property <NEW_LINE> def brightness(self): <NEW_LINE> <INDENT> if self._state == "LEVEL": <NEW_LINE> <INDENT> return int(self._hm_get_state() * 255) <NEW_LINE> <DEDENT> return None <NEW_LINE> <DEDENT> @property <NEW_LINE> def is_on(self): <NEW_LINE> <INDENT> try: <NEW...
Representation of a Homematic light.
62599056d99f1b3c44d06c04
class TechnicalParameterName(models.Model): <NEW_LINE> <INDENT> index_weight = 7 <NEW_LINE> category = models.ForeignKey(Category,verbose_name=_("material category")) <NEW_LINE> name = models.CharField(_("name"),max_length=const.DB_CHAR_NAME_40) <NEW_LINE> status = models.BooleanField(_("in use"),default=True) <NEW_LIN...
技术参数-名称,将技术参数绑定于物料分类上,在此分类下的物料自动继承全部技术参数
625990568da39b475be04750
class ProfileFeedItem(models.Model): <NEW_LINE> <INDENT> user_profile = models.ForeignKey('UserProfile',on_delete=models.CASCADE) <NEW_LINE> status_text = models.CharField(max_length=255) <NEW_LINE> created_on = models.DateTimeField(auto_now_add=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.status...
Profile status update
62599056a219f33f346c7d69
class PredEvtWaitQueue: <NEW_LINE> <INDENT> def __init__(self, env, pred, get_evt): <NEW_LINE> <INDENT> self.evts = deque() <NEW_LINE> self.env = env <NEW_LINE> self.pred = pred <NEW_LINE> def loop(): <NEW_LINE> <INDENT> while True: <NEW_LINE> <INDENT> if self.evts: <NEW_LINE> <INDENT> evt = self.evts.popleft() <NEW_LI...
Takes a function returning a predicate and an function returning an event. When someone queues, will return an event that either is succeeded instantly if the predicat is true otherwise will succeed when an event is triggered is true in FIFO order.
6259905630dc7b76659a0d31
class User_Admin_EditForm(User_Form): <NEW_LINE> <INDENT> class Meta(User_Form.Meta): <NEW_LINE> <INDENT> exclude = ('password','last_login','is_staff','date_joined')
Form with sensitive fields.
625990563539df3088ecd80b
class SimpleConfig(DoconfConfig): <NEW_LINE> <INDENT> pass
name: simple_app # The environment {default} [main_section] HOST (str:"127.0.0.1"): who the server hosts the app to PORT (int:8080): the default port, defined as an integer with default 8080 TIMEOUT (int): this is required because no default was defined MILES_PER_HOUR (int:null): this is NOT required and is default N...
62599056097d151d1a2c25d0
class ifeof(IfCommand): <NEW_LINE> <INDENT> def invoke(self, tex): <NEW_LINE> <INDENT> tex.readNumber() <NEW_LINE> tex.processIfContent(False) <NEW_LINE> return []
Test for end of file
62599056596a897236129062
class Place: <NEW_LINE> <INDENT> def __init__(self, name, exit=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.exit = exit <NEW_LINE> self.bees = [] <NEW_LINE> self.ant = None <NEW_LINE> self.entrance = None <NEW_LINE> if exit != None: <NEW_LINE> <INDENT> exit.entrance = self <NEW_LINE> <DEDENT> <DEDENT> de...
A Place holds insects and has an exit to another Place.
625990563c8af77a43b689f2
class FileField(BaseField): <NEW_LINE> <INDENT> def __init__( self, name, value=None, ajax=False ): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.ajax = ajax <NEW_LINE> self.value = value <NEW_LINE> <DEDENT> def get_html( self, prefix="" ): <NEW_LINE> <INDENT> value_text = "" <NEW_LINE> if self.value: <NEW_LINE>...
A file upload input. >>> print FileField( "foo" ).get_html() <input type="file" name="foo"> >>> print FileField( "foo", ajax = True ).get_html() <input type="file" name="foo" galaxy-ajax-upload="true">
6259905699cbb53fe6832443
class PUTOrderPatchRequestType(object): <NEW_LINE> <INDENT> swagger_types = { 'custom_fields': 'OrderObjectCustomFields', 'subscriptions': 'list[PUTOrderPatchRequestTypeSubscriptions]' } <NEW_LINE> attribute_map = { 'custom_fields': 'customFields', 'subscriptions': 'subscriptions' } <NEW_LINE> def __init__(self, custom...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
625990564e696a045264e8d4
class AllSubDevicesGetPerformSelfTest(TestMixins.AllSubDevicesGetMixin, OptionalParameterTestFixture): <NEW_LINE> <INDENT> PID = 'PERFORM_SELFTEST'
Send a Get PERFORM_SELFTEST to ALL_SUB_DEVICES.
625990567d847024c075d93f
class ResourceSetupException(ResourceException): <NEW_LINE> <INDENT> pass
Resource setup failed
625990564e4d56256637396c
class NumpyToTensor(AbstractTransform): <NEW_LINE> <INDENT> def __call__(self, **data_dict): <NEW_LINE> <INDENT> import torch <NEW_LINE> data = data_dict.get("data") <NEW_LINE> seg = data_dict.get("seg") <NEW_LINE> assert isinstance(data, np.ndarray) <NEW_LINE> data_dict["data"] = torch.from_numpy(data) <NEW_LINE> if s...
Utility function for pytorch. Converts data (and seg) numpy ndarrays to pytorch tensors
62599056379a373c97d9a589
@register_message('shortvideo') <NEW_LINE> class ShortVideoMessage(BaseMessage): <NEW_LINE> <INDENT> type = 'shortvideo' <NEW_LINE> media_id = StringField('MediaId') <NEW_LINE> thumb_media_id = StringField('ThumbMediaId')
短视频消息 详情请参阅 http://mp.weixin.qq.com/wiki/10/79502792eef98d6e0c6e1739da387346.html
625990562ae34c7f260ac64c
class XianHua(object): <NEW_LINE> <INDENT> def run(self, tel_num, session): <NEW_LINE> <INDENT> session.get() <NEW_LINE> return tel_num
处理过程 生成结果文件 ==>> xianhua.xlsx
625990568e7ae83300eea5f3
class RaspiledControlSite(Site, object): <NEW_LINE> <INDENT> ip_address = None <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> resource = kwargs.pop("resource", RaspiledControlResource()) <NEW_LINE> super(RaspiledControlSite, self).__init__(resource=resource, requestFactory=SmartRequest, *args, **kw...
Site thread which initialises the RaspiledControlResource properly
62599056460517430c432b04
class Solution: <NEW_LINE> <INDENT> def maxPathSum(self, root): <NEW_LINE> <INDENT> if root is None: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> single, double = self.helper(root) <NEW_LINE> return max(single, double) <NEW_LINE> <DEDENT> def helper(self, root): <NEW_LINE> <INDENT> if root is None: <NEW_LINE> <INDE...
@param root: The root of binary tree. @return: An integer
62599056004d5f362081faa0
class BlockStream(object): <NEW_LINE> <INDENT> def __init__(self, new_blocks): <NEW_LINE> <INDENT> b = Bigchain() <NEW_LINE> self.new_blocks = new_blocks <NEW_LINE> self.unvoted_blocks = [] <NEW_LINE> if not b.federation_nodes: <NEW_LINE> <INDENT> self.unvoted_blocks = b.get_unvoted_blocks() <NEW_LINE> <DEDENT> <DEDENT...
Combine the stream of new blocks coming from the changefeed with the list of unvoted blocks. This is a utility class that abstracts the source of data for the `Voter`.
62599056b830903b9686ef31
class FirmwareCompatibilityResponseTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_firmware_compatibility_response(self): <NEW_LINE> <INDENT> firmware_compatibility_response_obj = FirmwareCompatibilityResponse() <NEW_LINE> self.assertNotEqual(firmware_compatibility_response_obj, None)
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62599056d99f1b3c44d06c06
class ConstFAC_DCDC(ConstPSBSMP): <NEW_LINE> <INDENT> V_PS_SOFT_INTERLOCKS = 31 <NEW_LINE> V_PS_HARD_INTERLOCKS = 32 <NEW_LINE> V_I_LOAD_MEAN = 33 <NEW_LINE> V_I_LOAD1 = 34 <NEW_LINE> V_I_LOAD2 = 35 <NEW_LINE> V_V_CAPBANK = 36 <NEW_LINE> V_DUTY_CYCLE = 37 <NEW_LINE> V_V_INPUT_IIB = 38 <NEW_LINE> V_I_INPUT_IIB = 39 <NEW...
Namespace for organizing power supply FAC_DCDC BSMP constants.
6259905691af0d3eaad3b38f
class MigrationsController(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.compute_api = compute.API() <NEW_LINE> <DEDENT> def index(self, req): <NEW_LINE> <INDENT> context = req.environ['patron.context'] <NEW_LINE> authorize(context, "index") <NEW_LINE> patron_context.require_admin_context(co...
Controller for accessing migrations in OpenStack API.
625990568da39b475be04752
class BaseModel(models.Model): <NEW_LINE> <INDENT> creat_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间') <NEW_LINE> update_time = models.DateTimeField(auto_now=True, verbose_name='更新时间') <NEW_LINE> is_delete = models.BooleanField(default=False, verbose_name='删除标记') <NEW_LINE> class Meta: <NEW_LINE> ...
抽象模型类基类
625990564e4d56256637396d
class ofp_action_push(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.type = 0 <NEW_LINE> self.len = 0 <NEW_LINE> self.ethertype = 0 <NEW_LINE> self.pad= [0,0] <NEW_LINE> <DEDENT> def __assert(self): <NEW_LINE> <INDENT> if(not isinstance(self.pad, list)): <NEW_LINE> <INDENT> return (False, "se...
Automatically generated Python class for ofp_action_push Date 2013-01-06 Created by of.pythonize.pythonizer Core structure: Messages do not include ofp_header Does not include var-length arrays
6259905630dc7b76659a0d32
@register <NEW_LINE> class SourceBreakpoint(BaseSchema): <NEW_LINE> <INDENT> __props__ = { "line": { "type": "integer", "description": "The source line of the breakpoint or logpoint." }, "column": { "type": "integer", "description": "An optional source column of the breakpoint." }, "condition": { "type": "string", "des...
Properties of a breakpoint or logpoint passed to the setBreakpoints request. Note: automatically generated code. Do not edit manually.
6259905663b5f9789fe866d9
class MoreKFragsThanArrangements(TypeError): <NEW_LINE> <INDENT> pass
Raised when a Policy has been used to generate Arrangements with Ursulas insufficient number such that we don't have enough KFrags to give to each Ursula.
6259905699cbb53fe6832446
class Input(Port): <NEW_LINE> <INDENT> def __init__(self, shape, name, dtype=None): <NEW_LINE> <INDENT> self.shape = shape <NEW_LINE> self._name = name <NEW_LINE> if dtype is None: <NEW_LINE> <INDENT> dtype = FLOATX <NEW_LINE> <DEDENT> self._dtype = dtype <NEW_LINE> self._variable = [TENSOR_TYPES[self.ndim](name=self._...
writeme. shape = ... None -> scalar [1,] -> vector [1, 2, ] -> matrix [1, 2, 3, ] -> tensor3 [1, 2, 3, 4, ] -> tensor4
6259905621a7993f00c674d3
class ProcTestOutput(proctest.ProcTest): <NEW_LINE> <INDENT> def test_process_output_nonewline(self): <NEW_LINE> <INDENT> p = processhandler.ProcessHandler([self.python, "procnonewline.py"], cwd=here) <NEW_LINE> p.run() <NEW_LINE> p.processOutput(timeout=5) <NEW_LINE> p.wait() <NEW_LINE> detected, output = proctest.che...
Class to test operations related to output handling
62599056dd821e528d6da433
class RelatedReferral(models.Model): <NEW_LINE> <INDENT> from_referral = models.ForeignKey( Referral, on_delete=models.PROTECT, related_name="from_referral" ) <NEW_LINE> to_referral = models.ForeignKey( Referral, on_delete=models.PROTECT, related_name="to_referral" ) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> re...
Intermediate class for relationships between Referral objects. Trying to create this relationship without the intermediate class generated some really odd recursion errors.
625990567d847024c075d941
class YoConfigManager: <NEW_LINE> <INDENT> def __init__(self, filename, defaults=None): <NEW_LINE> <INDENT> defaults = defaults or {} <NEW_LINE> self.config_data = configparser.ConfigParser( inline_comment_prefixes=';') <NEW_LINE> self.config_data['yo_general'] = {'log_level': 'INFO', 'yo_db_url': ''} <NEW_LINE> self.c...
A class for handling configuration details all in one place Also handles generation of missing keys where this is appropriate to do so
625990564e4d56256637396e
class HostPinger: <NEW_LINE> <INDENT> def __init__(self, PassedCommand): <NEW_LINE> <INDENT> self._command = PassedCommand <NEW_LINE> <DEDENT> def ping(self, PassedHostname): <NEW_LINE> <INDENT> myStatus, myOutput = commands.getstatusoutput(self._command + " " + PassedHostname) <NEW_LINE> return myStatus
Simple generic class whose funciton is to attempt to ping a given host.
62599056097d151d1a2c25d2
class Bullet(Sprite): <NEW_LINE> <INDENT> def __init__(self, ai_game): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.screen = ai_game.screen <NEW_LINE> self.settings = ai_game.settings <NEW_LINE> self.color = self.settings.bullet_color <NEW_LINE> self.image = pygame.image.load('images/bullet.bmp') <NEW_LINE> s...
A class to manage bullets fired from the ship
6259905621bff66bcd7241cb
class Regression(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def calculate(self, samples): <NEW_LINE> <INDENT> raise NotImplementedError
Base class for regression algorithms
625990562ae34c7f260ac64d
class KILOGRAM_FORCE( Unit ): <NEW_LINE> <INDENT> name= "kg_f" <NEW_LINE> standard= NEWTON <NEW_LINE> factor= 1/9.8065
Kg (force)
6259905671ff763f4b5e8d17
class MoneyField(serializers.Field): <NEW_LINE> <INDENT> def to_representation(self, obj): <NEW_LINE> <INDENT> return { 'amount': "%f" % (obj.amount), 'currency': "%s" % (obj.currency), } <NEW_LINE> <DEDENT> def to_internal_value(self, data): <NEW_LINE> <INDENT> return Money(data['amount'], data['currency'])
MoneyField is not officially supported by Django REST framework so a new field serializer class should be implemented
625990564a966d76dd5f0458
class AirbusScraper(Scraper): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def scrape_jobs(cls, response): <NEW_LINE> <INDENT> jobs = [] <NEW_LINE> soup = BeautifulSoup(response.text, 'html.parser') <NEW_LINE> for job_posting in cls._iter_job_postings(soup): <NEW_LINE> <INDENT> title, url = job_posting.text, job_posting...
Scraper objects for Airbus html content.
62599056be383301e0254d40
class Characteristic(object): <NEW_LINE> <INDENT> def __init__(self, handle, value): <NEW_LINE> <INDENT> self.handle = handle <NEW_LINE> self.value = value <NEW_LINE> self.props = value[0] <NEW_LINE> self.char_handle = struct.unpack('<H', value[1:3])[0] <NEW_LINE> self.raw_uuid = value[3:] <NEW_LINE> self.uuid = pp_hex...
Represents a BLE characteristic within a service
6259905629b78933be26ab78
class AppsHandler(BaseHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> self.template('apps/list.html', { 'repo': (config.githubAppListUser, config.githubAppListRepo), 'apps': AppStore().apps, })
Displays apps available on github
62599056be8e80087fbc05ea
class DateEditor(wx.adv.DatePickerCtrl): <NEW_LINE> <INDENT> def __init__(self, olv,row,col, **kwargs): <NEW_LINE> <INDENT> wx.adv.DatePickerCtrl.__init__(self,olv, **kwargs) <NEW_LINE> self.SetValue(None) <NEW_LINE> olv.editor = {col:self} <NEW_LINE> self.Bind(wx.EVT_CHAR_HOOK, self._OnChar) <NEW_LINE> self.row = row ...
This control uses standard datetime. wx.DatePickerCtrl works only with wx.DateTime, but they are strange beasts. wx.DataTime use 0 indexed months, i.e. January==0 and December==11.
625990568a43f66fc4bf36f5
class TaggedObjectListView(ListView): <NEW_LINE> <INDENT> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> slug = kwargs.get('slug') <NEW_LINE> self.tag = get_object_or_404(Tag, slug=slug) <NEW_LINE> self.object_list = self.get_queryset() <NEW_LINE> context = self.get_context_data(object_list=self.object_li...
Return all objects (from model or queryset) with specified tag
62599056498bea3a75a5908e
class Dataset(ArtifactType): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__(metadata_store_pb2.ArtifactType.DATASET)
Dataset is a system pre-defined artifact type.
6259905663d6d428bbee3d3b
class BLive_OT_videotexture_playlist_clear(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "blive.videotexture_playlist_clear" <NEW_LINE> bl_label = "BLive empty playlist entry" <NEW_LINE> @classmethod <NEW_LINE> def poll(self, context): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return bool(context.active_objec...
Videotexture clear playlist
62599056b830903b9686ef32
class CloudtrailLogHasErrors(CloudtrailLogging): <NEW_LINE> <INDENT> active = True <NEW_LINE> severity = 2 <NEW_LINE> def __init__(self, app): <NEW_LINE> <INDENT> self.title = "CloudTrail: Logs delivered without errors" <NEW_LINE> self.description = ( "Checks that CloudTrail is able to write successfully to the S3 buck...
TODO
62599056cc0a2c111447c554
class wrapcauchy_gen(rv_continuous): <NEW_LINE> <INDENT> def _argcheck(self, c): <NEW_LINE> <INDENT> return (c > 0) & (c < 1) <NEW_LINE> <DEDENT> def _pdf(self, x, c): <NEW_LINE> <INDENT> return (1.0-c*c)/(2*np.pi*(1+c*c-2*c*np.cos(x))) <NEW_LINE> <DEDENT> def _cdf(self, x, c): <NEW_LINE> <INDENT> output = np.zeros(x.s...
A wrapped Cauchy continuous random variable. %(before_notes)s Notes ----- The probability density function for `wrapcauchy` is: .. math:: f(x, c) = \frac{1-c^2}{2\pi (1+c^2 - 2c \cos(x))} for :math:`0 \le x \le 2\pi`, :math:`0 < c < 1`. `wrapcauchy` takes ``c`` as a shape parameter for :math:`c`. %(after_not...
6259905607d97122c4218213
class proxy_ip3366(object): <NEW_LINE> <INDENT> pass
http://www.ip3366.net/free/?page=2
62599056adb09d7d5dc0bad3
class World(Named, cache_size=20, cache_ttu=3600.0): <NEW_LINE> <INDENT> collection = 'world' <NEW_LINE> data: WorldData <NEW_LINE> id_field = 'world_id' <NEW_LINE> _model = WorldData <NEW_LINE> id: int <NEW_LINE> name: LocaleData <NEW_LINE> state: str <NEW_LINE> description: Optional[LocaleData] <NEW_LINE> async def e...
A world (or server) in the game. .. attribute:: id :type: int The unique ID of the world. In the API payload, this field is called ``world_id``. .. attribute:: name :type: auraxium.types.LocaleData Localised name of the world. .. attribute:: state :type: str The current state (i.e. online sta...
62599056baa26c4b54d5080d
class MainMenu(Level): <NEW_LINE> <INDENT> def __init__(self, player): <NEW_LINE> <INDENT> Level.__init__(self, player) <NEW_LINE> self.background = pygame.image.load("resources/main_menu.png").convert() <NEW_LINE> self.background.set_colorkey(constants.WHITE) <NEW_LINE> self.level_limit = 100 <NEW_LINE> level = [ (str...
Definition for Main Menu
625990562ae34c7f260ac64f
class ImageData(PRAWBase): <NEW_LINE> <INDENT> pass
Class for image data that's part of a :class:`.CustomWidget`. **Typical Attributes** This table describes attributes that typically belong to objects of this class. Since attributes are dynamically provided (see :ref:`determine-available-attributes-of-an-object`), there is not a guarantee that these attributes will a...
6259905632920d7e50bc75af
class MarketingWeibo(BaseHandler): <NEW_LINE> <INDENT> product_source = PRODUCT_SOURCE.get("weibo") <NEW_LINE> product_types = PRODUCT_TYPES_WEIBO_LIKE <NEW_LINE> template = "marketing/weibo.html" <NEW_LINE> @power_check("MARKETING_WEIBO") <NEW_LINE> def get(self, *args, **kwargs): <NEW_LINE> <INDENT> where = {"source"...
微博营销类
62599056cb5e8a47e493cc3b
class CrapStream(io.BytesIO): <NEW_LINE> <INDENT> def __init__(self, *args, modulus=2, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self._count = 0 <NEW_LINE> self._modulus = modulus <NEW_LINE> <DEDENT> def read(self, size=-1): <NEW_LINE> <INDENT> self._count += 1 <NEW_LINE> if self._coun...
Raises an exception on every second read call.
62599056b7558d58954649df
class RamException(Exception): <NEW_LINE> <INDENT> pass
Base exception class.
6259905616aa5153ce401a4d
class IMotionDetector(metaclass=ABCMeta): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def warmup(self, frames: list) -> None: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> async def findMotionBoxes(self, frame : object) -> list: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <...
Class holding and providing functionality for a motiondetector. Starts from either cv2.createBackgroundSubtractorKNN() or cv2.createBackgroundSubtractorMOG(). Additional custom processing such as dilation or erosion etc can be added as a part of the detect() method. __init__ should contain atleast a backgroundsubtra...
625990568e7ae83300eea5f7
class BasicSerializer: <NEW_LINE> <INDENT> REST_API_DATE_FORMAT = '%Y-%m-%dT%H:%M:%S.%f+00:00' <NEW_LINE> fields = () <NEW_LINE> datetime_fields = () <NEW_LINE> nested_fields = {} <NEW_LINE> def dump(self, model_object) -> dict: <NEW_LINE> <INDENT> if model_object is None: <NEW_LINE> <INDENT> return self._dump_nones() ...
Basic serializer for better performance than marshmallow or restful serializers The usage not so clean/user-friendly, but this performs serialization the fastest Example: >>> class TestSerializer(BasicSerializer): ... fields = ('id', 'comment') ... datetime_fields = ('timestamp', ) ... nested_fields = { ... 'item...
62599056dc8b845886d54b2f
class FileSampleInfo(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Code = None <NEW_LINE> self.CreatedAt = None <NEW_LINE> self.EvilType = None <NEW_LINE> self.FileMd5 = None <NEW_LINE> self.FileName = None <NEW_LINE> self.FileType = None <NEW_LINE> self.Id = None <NEW_LINE> self.Labe...
文件样本返回信息
62599056460517430c432b06
class UserMixin: <NEW_LINE> <INDENT> def save_model(self, request, obj, form, change): <NEW_LINE> <INDENT> _ = form <NEW_LINE> if not change: <NEW_LINE> <INDENT> obj.created_by = request.user <NEW_LINE> <DEDENT> obj.save()
Mixin saves the current admin user into the models.
62599056d6c5a102081e3689
class AttributeTable(object): <NEW_LINE> <INDENT> def __init__(self, py_class, parents): <NEW_LINE> <INDENT> self.py_class = py_class <NEW_LINE> self.parents = parents <NEW_LINE> self.attributedict = {} <NEW_LINE> self.attributes = None <NEW_LINE> self.inherited = set() <NEW_LINE> <DEDENT> def to_struct(self): <NEW_LIN...
Type for extension type attributes.
62599056462c4b4f79dbcf6f
class Counterdict(dict): <NEW_LINE> <INDENT> def __missing__(self, key): <NEW_LINE> <INDENT> value = self[key] = 0 <NEW_LINE> return value
dict that always have an int 0 as value on new keys
62599056435de62698e9d36d