code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Account(object): <NEW_LINE> <INDENT> def __init__(self,intake,whitdrawal,rent = 0.05, amount = 100): <NEW_LINE> <INDENT> self.intake = intake <NEW_LINE> self.rent = rent <NEW_LINE> self.amount = amount <NEW_LINE> self.whitdrawal = whitdrawal <NEW_LINE> <DEDENT> def amount_increase(self): <NEW_LINE> <INDENT> self....
Put in and take out mney from bank. The amount in the bank will increase, thanks to the rent The default beginning amount is 100
62598faf7047854f4633f3e5
class LoginRequiredMiddleware: <NEW_LINE> <INDENT> def process_view(self, request, vfunc, vargs, vkwargs): <NEW_LINE> <INDENT> if request.user.is_authenticated(): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> path = request.path_info.lstrip('/') <NEW_LINE> if not any(m.match(path) for m in EXEMPT_URLS): <NEW_LINE...
Middleware that requires a user to be authenticated to view any page other than LOGIN_URL. Exemptions to this requirement can optionally be specified in settings via a list of regular expressions in LOGIN_EXEMPT_URLS (which you can copy from your urls.py). Requires authentication middleware and template context proces...
62598faf2c8b7c6e89bd37d0
class CGCType1RopExploit(CGCType1Exploit): <NEW_LINE> <INDENT> def __init__(self, crash, register, reg_bitmask, ip_bitmask, ch_mem, value_var, ip_var): <NEW_LINE> <INDENT> super(CGCType1RopExploit, self).__init__(crash, register, bypasses_nx=True, bypasses_aslr=True, reg_bitmask=reg_bitmask, ip_bitmask=ip_bitmask) <NEW...
A CGC type1 exploit object, which sets a register via Rop.
62598faf32920d7e50bc605f
class PolarionTestcases(object): <NEW_LINE> <INDENT> def __init__(self, repo_dir): <NEW_LINE> <INDENT> self.repo_dir = os.path.expanduser(repo_dir) <NEW_LINE> self.wi_cache = WorkItemCache(self.repo_dir) <NEW_LINE> self.available_testcases = {} <NEW_LINE> <DEDENT> def load_active_testcases(self): <NEW_LINE> <INDENT> ca...
Loads and access Polarion testcases.
62598faf26068e7796d4c960
class PartitionType_Enum (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin): <NEW_LINE> <INDENT> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'PartitionType.Enum') <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('/home/afcastel/hmc_rest_api/code/pmc.schema.pcm-8.8.5.0/schema/common/in...
An atomic simple type.
62598faf627d3e7fe0e06eb8
class Solution: <NEW_LINE> <INDENT> def majorityNumber(self, nums): <NEW_LINE> <INDENT> nums_sort = sorted(nums) <NEW_LINE> return nums_sort[int(len(nums)/2)]
@param: nums: a list of integers @return: find a majority number
62598faf76e4537e8c3ef5b8
class BackupResourceConfig(Model): <NEW_LINE> <INDENT> _attribute_map = { 'storage_type': {'key': 'storageType', 'type': 'str'}, 'storage_type_state': {'key': 'storageTypeState', 'type': 'str'}, } <NEW_LINE> def __init__(self, storage_type=None, storage_type_state=None): <NEW_LINE> <INDENT> self.storage_type = storage_...
The resource storage details. :param storage_type: Storage type. Possible values include: 'Invalid', 'GeoRedundant', 'LocallyRedundant' :type storage_type: str or :class:`StorageType <azure.mgmt.recoveryservicesbackup.models.StorageType>` :param storage_type_state: Locked or Unlocked. Once a machine is registered a...
62598faf99cbb53fe6830ee3
class RandomMask(TokenResource): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> parser = reqparse.RequestParser() <NEW_LINE> parser.add_argument('size', type=int, help='可不填, 默认返回一个头像id') <NEW_LINE> args = parser.parse_args() <NEW_LINE> mask_size = args['size'] if args['size'] else 1 <NEW_LINE> sample = connecti...
随机取一个 mask_id 放在原列表第一位, 删掉原列表最末位
62598faf4e4d562566372431
class StopBaseClient(object): <NEW_LINE> <INDENT> def __init__(self, srv_name='stop_base'): <NEW_LINE> <INDENT> rospy.wait_for_service(srv_name) <NEW_LINE> self.proxy = rospy.ServiceProxy(srv_name, StopBase) <NEW_LINE> <DEDENT> def stop_base(self, status, requester): <NEW_LINE> <INDENT> return self.proxy(make_request(s...
Proxy class for making stop_base calls.
62598fafe76e3b2f99fd8a42
class GetNormalsNode(bpy.types.Node, SverchCustomTreeNode): <NEW_LINE> <INDENT> bl_idname = 'GetNormalsNode' <NEW_LINE> bl_label = 'Calc Normals' <NEW_LINE> bl_icon = 'OUTLINER_OB_EMPTY' <NEW_LINE> def sv_init(self, context): <NEW_LINE> <INDENT> self.inputs.new('VerticesSocket', "Vertices") <NEW_LINE> self.inputs.new('...
Calculate normals of faces and vertices
62598faf7b25080760ed74bb
class PluginMeta(type): <NEW_LINE> <INDENT> def __init__(cls, name, bases, attrs): <NEW_LINE> <INDENT> if not hasattr(cls, 'plugins'): <NEW_LINE> <INDENT> cls.plugins = [] <NEW_LINE> cls.aliases = {} <NEW_LINE> cls.source = {} <NEW_LINE> cls.source[cls.__name__] = inspect.getsource(cls) <NEW_LINE> <DEDENT> else: <NEW_L...
Based on http://martyalchin.com/2008/jan/10/simple-plugin-framework/
62598faf2ae34c7f260ab0ed
class RadioSettingGroup(object): <NEW_LINE> <INDENT> def _validate(self, element): <NEW_LINE> <INDENT> if not isinstance(element, RadioSettingGroup): <NEW_LINE> <INDENT> raise InternalError("Incorrect type %s" % type(element)) <NEW_LINE> <DEDENT> <DEDENT> def __init__(self, name, shortname, *elements): <NEW_LINE> <INDE...
A group of settings
62598faf3346ee7daa33764d
class DocumentList(list): <NEW_LINE> <INDENT> def __init__(self, package_name, has_more, offset): <NEW_LINE> <INDENT> list.__init__(self) <NEW_LINE> self._package_name = package_name <NEW_LINE> self._has_more = has_more <NEW_LINE> self._offset = offset <NEW_LINE> <DEDENT> def package_name(self): <NEW_LINE> <INDENT> ret...
DocumentList is a list object providing extra methods for obtaining extra document list statuses, such as the number of elements found, the current elements list offset, and if there are more elements on the remote service.
62598fafd486a94d0ba2bfda
class FileProxySource(BaseProxySource): <NEW_LINE> <INDENT> def __init__(self, path, **kwargs): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> super(FileProxySource, self).__init__(**kwargs) <NEW_LINE> <DEDENT> def load_raw_data(self): <NEW_LINE> <INDENT> with open(self.path) as inp: <NEW_LINE> <INDENT> return inp.rea...
Proxy source that loads list from the file
62598faf99cbb53fe6830ee4
class Result(PrintableResultMixin): <NEW_LINE> <INDENT> def __init__(self, group, provider, checker, code, messages): <NEW_LINE> <INDENT> self.group = group <NEW_LINE> self.provider = provider <NEW_LINE> self.checker = checker <NEW_LINE> self.code = code <NEW_LINE> self.messages = messages
Placeholder for analysis results.
62598fafbe8e80087fbbf070
class Email(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Rc = RC.ReadConfig() <NEW_LINE> self.server = self.Rc.getMail('Smtp_Server') <NEW_LINE> self.sender = self.Rc.getMail('Smtp_Sender') <NEW_LINE> self.password = self.Rc.getMail('Password') <NEW_LINE> self.LReceiver = self.Rc.getMail('O...
创建一个邮件类
62598faf4a966d76dd5eeee3
class DistortedColormap2(object): <NEW_LINE> <INDENT> n = 100 <NEW_LINE> def __init__(self, name='jet', vmin=0.0, vmax=1.0, xmid1=0.25, ymid1=0.25, xmid2=0.75, ymid2=0.75): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.original = cm.get_cmap(name) <NEW_LINE> self.set_lim(vmin, vmax) <NEW_LINE> self.set_mid(xmid1...
dcm = DistortedColormap('jet', xmid1=0.5, ymid1=0.5, xmid2=0.5, ymid2=0.5) dcm.distorted
62598faf7d847024c075c3cf
class CDPlayer: <NEW_LINE> <INDENT> def __init__(self, cdda, audio_output, next_track_callback=lambda: None): <NEW_LINE> <INDENT> self.command_queue = Queue.Queue() <NEW_LINE> self.worker = CDPlayerThread(cdda, audio_output, self.command_queue) <NEW_LINE> self.thread = threading.Thread(target=self.worker.run, args=(nex...
A class for operating a CDDA player. The player itself runs in a seperate thread, which this sends commands to.
62598faf851cf427c66b82c8
class BaseError(Exception): <NEW_LINE> <INDENT> def __init__(self, code=400, message='', status='', field=None): <NEW_LINE> <INDENT> Exception.__init__(self) <NEW_LINE> self.code = code <NEW_LINE> self.message = message <NEW_LINE> self.status = status <NEW_LINE> self.field = field <NEW_LINE> <DEDENT> def to_dict(self):...
Base Error Class
62598faf71ff763f4b5e777d
class AbstractView(FloatLayout): <NEW_LINE> <INDENT> adapter = ObjectProperty(None)
View using an :class:`~kivy.adapters.adapter.Adapter` as a data provider.
62598fafa8370b77170f03e7
class WithSeededRandomPipelineEngine(WithTradingSessions, WithAssetFinder): <NEW_LINE> <INDENT> SEEDED_RANDOM_PIPELINE_SEED = 42 <NEW_LINE> @classmethod <NEW_LINE> def init_class_fixtures(cls): <NEW_LINE> <INDENT> super(WithSeededRandomPipelineEngine, cls).init_class_fixtures() <NEW_LINE> cls._sids = cls.asset_finder.s...
ZiplineTestCase mixin providing class-level fixtures for running pipelines against deterministically-generated random data. Attributes ---------- SEEDED_RANDOM_PIPELINE_SEED : int Fixture input. Random seed used to initialize the random state loader. seeded_random_loader : SeededRandomLoader Fixture output. Lo...
62598faffff4ab517ebcd7f1
class SendUSMSMessageRequestSchema(schema.RequestSchema): <NEW_LINE> <INDENT> fields = { "ExtendCode": fields.Str(required=False, dump_to="ExtendCode"), "PhoneNumbers": fields.List(fields.Str()), "ProjectId": fields.Str(required=True, dump_to="ProjectId"), "Region": fields.Str( required=False, dump_to="Region" ), "SigC...
SendUSMSMessage - 调用接口SendUSMSMessage发送短信
62598fafff9c53063f51a659
class TestGatherWater(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_that_functions_exist(self): <NEW_LINE> <INDENT> empty_rain_terrace = { 'total_water': 0, 'left_idx': 0, 'right_idx': 0, 'l...
Tests Gather Water function from rain_terrace.py
62598fafbe383301e0253805
class accept2: <NEW_LINE> <INDENT> def __init__(self, mimetype): <NEW_LINE> <INDENT> self.mimetype = mimetype <NEW_LINE> <DEDENT> def __call__(self, next): <NEW_LINE> <INDENT> def inner(*args, **kwargs): <NEW_LINE> <INDENT> accepted = parse_accept_header() <NEW_LINE> def set_depth(mimetype): <NEW_LINE> <INDENT> if 'dep...
Decorator class to handle parsing the HTTP Accept header.
62598faf63d6d428bbee27b8
@skipUnless(getattr(settings, 'SELENIUM_TESTS', False), 'Selenium tests disabled. Set SELENIUM_TESTS = True in your settings.py to enable.') <NEW_LINE> class ProjectSeleniumTests(ProjectTestsMixin, SeleniumTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.projects = dict([(slugify(title), title) ...
Selenium tests for Projects.
62598faf4f6381625f1994c5
class TestRLCount(unittest.TestCase): <NEW_LINE> <INDENT> def test_tpc(self): <NEW_LINE> <INDENT> dir = os.path.dirname(__file__) <NEW_LINE> tpc = os.path.join(dir, '2016', 'M04_5m_001.tpc') <NEW_LINE> res = tu.ResData(tpc) <NEW_LINE> t = res.rlCount() <NEW_LINE> self.assertEqual(t, 3) <NEW_LINE> <DEDENT> def test_info...
Test rlCount() function
62598faffff4ab517ebcd7f2
class ExampleTop0(Unit): <NEW_LINE> <INDENT> def _config(self): <NEW_LINE> <INDENT> self.DATA_WIDTH = Param(2) <NEW_LINE> <DEDENT> def _declr(self): <NEW_LINE> <INDENT> addClkRstn(self) <NEW_LINE> with self._paramsShared(): <NEW_LINE> <INDENT> self.a = Handshaked() <NEW_LINE> self.b = Handshaked()._m() <NEW_LINE> <DEDE...
Lorem Ipsum componet to have something to compile
62598faf2c8b7c6e89bd37d2
class SubjectGuideView(SubjectBaseView): <NEW_LINE> <INDENT> featured_database = {} <NEW_LINE> def __init__(self,context,request): <NEW_LINE> <INDENT> super(SubjectGuideView, self).__init__(context,request) <NEW_LINE> self.databases = SubjectFactory._safe_pop(self.research_databases,0,3) + SubjectFactory._safe_pop(self...
This controller class extends and adds functionality for the main subject guide view. @author: David Hietpas @version: 1.1
62598faf442bda511e95c464
class cancelJob_result(object): <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.t...
Attributes: - success
62598fafcc0a2c111447b01e
class ExportAction(BaseAction): <NEW_LINE> <INDENT> _cmd_ = 'export' <NEW_LINE> _help_ = 'export apk file(s)' <NEW_LINE> path = Argument('--path', '-p', default='/app', action='store', help='app source path') <NEW_LINE> def handler(self, path='/app'): <NEW_LINE> <INDENT> options = { 'path': path } <NEW_LINE> project = ...
Export action that inherits from BaseAction to show the apk(s) path to be exported from the container.
62598faf3d592f4c4edbaecd
class LeaveController(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.base_url = "http://qa.eipsev.com//ApplicationForPay/SubmitApplicationForPay" <NEW_LINE> self.cookie = get_cookie.get_cookies() <NEW_LINE> <DEDENT> def test_leave_all_true(self): <NEW_LINE> <INDENT> payload = {"WorkFl...
报销
62598faf76e4537e8c3ef5ba
class BlogPageTag(TaggedItemBase): <NEW_LINE> <INDENT> content_object = ParentalKey( 'BlogPage', related_name='tagged_items', on_delete=models.CASCADE )
Support for tagging posts.
62598faf91f36d47f2230ead
class OLDWorkflowField(with_metaclass(models.SubfieldBase, models.CharField)): <NEW_LINE> <INDENT> description = "Workflow field" <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> defaults = { 'max_length': 32, 'db_index': True, } <NEW_LINE> defaults.update(kwargs) <NEW_LINE> defaults.update({ 'null': True, ...
OLD DONT USE
62598faf16aa5153ce400510
class Stacked(Transducer): <NEW_LINE> <INDENT> def __init__(self, *layers): <NEW_LINE> <INDENT> self.layers = layers <NEW_LINE> <DEDENT> def start(self): <NEW_LINE> <INDENT> for layer in self.layers: <NEW_LINE> <INDENT> layer.start() <NEW_LINE> <DEDENT> <DEDENT> def start_from(self, other): <NEW_LINE> <INDENT> for laye...
Several stacked recurrent networks, or, the composition of several FSTs.
62598faf5fcc89381b266153
class AppInfoAction(Action): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Action.__init__(self, "app_info", Action.TK_INSTANCE, "Shows a breakdown of your installed apps.", "Developer") <NEW_LINE> self.supports_api = True <NEW_LINE> <DEDENT> def run_noninteractive(self, log, parameters): <NEW_LINE> <INDE...
Action that gives a breakdown of all engines and apps in an environment
62598fafcc0a2c111447b01f
class Enum(_messages.Message): <NEW_LINE> <INDENT> class SyntaxValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> SYNTAX_PROTO2 = 0 <NEW_LINE> SYNTAX_PROTO3 = 1 <NEW_LINE> <DEDENT> enumvalue = _messages.MessageField('EnumValue', 1, repeated=True) <NEW_LINE> name = _messages.StringField(2) <NEW_LINE> options = _messag...
Enum type definition. Enums: SyntaxValueValuesEnum: The source syntax. Fields: enumvalue: Enum value definitions. name: Enum type name. options: Protocol buffer options. sourceContext: The source context. syntax: The source syntax.
62598fafeab8aa0e5d30bd9a
class FlaskDefaults(Enum): <NEW_LINE> <INDENT> SECRET_KEY = Config.get_random_secret_key() <NEW_LINE> LOGGER_NAME = 'netify'
Default values for the Flask section of the config file.
62598faf2c8b7c6e89bd37d3
class UserGrantedNodeAssetsApi(UserPermissionCacheMixin, AssetsFilterMixin, ListAPIView): <NEW_LINE> <INDENT> permission_classes = (IsOrgAdminOrAppUser,) <NEW_LINE> serializer_class = AssetGrantedSerializer <NEW_LINE> pagination_class = LimitOffsetPagination <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> user_id ...
查询用户授权的节点下的资产的api, 与上面api不同的是,只返回某个节点下的资产
62598fafaad79263cf42e7e1
class CentralBank: <NEW_LINE> <INDENT> def __init__(self, variables, parameters): <NEW_LINE> <INDENT> self.var = variables <NEW_LINE> self.par = parameters <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return 'central_bank' <NEW_LINE> <DEDENT> def sell(self, amount, price, t): <NEW_LINE> <INDENT> if self....
Class holding central bank properties
62598faf379a373c97d99022
class Profiler(object): <NEW_LINE> <INDENT> def __init__(self, sortby="tottime"): <NEW_LINE> <INDENT> self.sortby = sortby <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self.pr = cProfile.Profile() <NEW_LINE> self.pr.enable() <NEW_LINE> <DEDENT> def __exit__(self, *args): <NEW_LINE> <INDENT> self.pr.disa...
Allows to profile code running in the context of the Profiler. Usage: from time import sleep with Profiler(): for _ in range(10): sleep(0.1)
62598faf3d592f4c4edbaecf
class BaseHandler(RequestHandler): <NEW_LINE> <INDENT> HTTP_error = 406 <NEW_LINE> @property <NEW_LINE> def db(self)->any: <NEW_LINE> <INDENT> return self.application.db <NEW_LINE> <DEDENT> @property <NEW_LINE> def redis(self)->any: <NEW_LINE> <INDENT> return self.application.redis <NEW_LINE> <DEDENT> def initialize(se...
基础 Handler
62598faf3d592f4c4edbaed0
class TwoTDCM(TuringMachine): <NEW_LINE> <INDENT> outSymbols = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] <NEW_LINE> maxSteps = 200 <NEW_LINE> def writeSymbol(self, symbol): <NEW_LINE> <INDENT> if symbol in TwoTDCM.outSymbols: <NEW_LINE> <INDENT> self.outTape.append(symbol) <NEW_LINE> <DEDENT> else: <NEW_LINE> ...
A TwoTDCM object models a 2TDCM as described in the textbook. It does not support blocks or nondeterminism.
62598faf26068e7796d4c964
class Vars(object): <NEW_LINE> <INDENT> Bench = 8 <NEW_LINE> Squat = 4 <NEW_LINE> Shoulder_Press = 2 <NEW_LINE> Deadlift = 1
Class to store the enum values for compound lifts.
62598faf99cbb53fe6830ee7
class ChatSessionMessage(TrackableDateModel): <NEW_LINE> <INDENT> user = models.ForeignKey(User, on_delete=models.PROTECT) <NEW_LINE> chat_session = models.ForeignKey( ChatSession, related_name='messages', on_delete=models.PROTECT ) <NEW_LINE> message = models.TextField(max_length=2000) <NEW_LINE> def to_json(self): <N...
Store messages for a session
62598faf3317a56b869be552
class LinkedList(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.tail = LinkedListElement(None) <NEW_LINE> self.head = LinkedListElement(None) <NEW_LINE> self.head.next = self.tail <NEW_LINE> self.tail.prev = self.head <NEW_LINE> self.index = {} <NEW_LINE> self.lock = threading.RLock() <NEW_LINE> <D...
A linked list that is used by yas3fs as a LRU index for the file system cache.
62598faf4527f215b58e9ee5
class rustTool(RunEnvTool): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> def getDeps(self): <NEW_LINE> <INDENT> if self._isGlobalRust(): <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> return ['rustup'] <NEW_LINE> <DEDENT> def getVersionParts(self): <NEW_LINE> <INDENT> return 3 <NEW_LINE> <DEDENT> def _isGlobalRust(...
Rust is a systems programming language. Home: https://www.rust-lang.org
62598faf460517430c432065
class OutboxEvent(BaseModel): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> table_name = OUTBOX_TABLE_NAME <NEW_LINE> region = "eu-west-1" <NEW_LINE> <DEDENT> event_id = UnicodeAttribute(hash_key=True) <NEW_LINE> event_content = UnicodeAttribute()
Outbox event data model
62598faf4428ac0f6e658534
class Version(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'version' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(Version, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '<{0}(id={1...
Schema version for the search-index database
62598faff548e778e596b5b3
class rule_203(Rule): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Rule.__init__(self, 'function', '203') <NEW_LINE> self.message.append('Rule ' + self.unique_id + ' has been moved to rule subprogram_body_203.')
This rule has been moved to rule `subprogram_body_203 <subprogram_rules.html#subprogram-body-203>`_.
62598faf38b623060ffa90aa
class MessagePool(object): <NEW_LINE> <INDENT> pass
global = query = session =
62598faf8e7ae83300ee90b1
class Diary(db.Model, Utility): <NEW_LINE> <INDENT> __tablename__ = "Diaries" <NEW_LINE> id = db.Column(UUID(as_uuid=True), unique=True, nullable=False, default=lambda: uuid4().hex, primary_key=True) <NEW_LINE> user_id = db.Column(UUID(as_uuid=True), ForeignKey("Users.id")) <NEW_LINE> title = db.Column(db.String(255), ...
Diary model for storing user's diary information
62598faf7cff6e4e811b5a3c
class MotionEncoder(abstractcodec.Encoder): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> @abc.abstractmethod <NEW_LINE> def _compress(self, image): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> def encode(self, image): <NEW_LINE> <INDENT> return self._compress(image)
A simple video encoder. This class represents a simple video encoder that only compresses a single video frame using a spatial compressor.
62598faf55399d3f05626533
class QuoteDecoder(json.JSONDecoder): <NEW_LINE> <INDENT> def default(self, json_obj): <NEW_LINE> <INDENT> if json_obj['mimetype'] == Quote.json_mimetype: <NEW_LINE> <INDENT> q = Quote() <NEW_LINE> q.id = int(json_obj['id']) <NEW_LINE> q.up_votes = int(json_obj['up']) <NEW_LINE> q.down_votes = int(json_obj['down']) <NE...
Custom decoder class. Can throw TypeErrors
62598faf2ae34c7f260ab0f1
class NewDBPerTestUnitTest(BaseDBUnitTest): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setup_db(cls): <NEW_LINE> <INDENT> print('No-op for db setup in class init') <NEW_LINE> <DEDENT> def setUp(self): <NEW_LINE> <INDENT> print('Setting up new db connection') <NEW_LINE> init_db() <NEW_LINE> <DEDENT> def tearDown(se...
Unit test where each test gets a freshly initialized database in-memory to ensure no overlap between tests.
62598faff548e778e596b5b4
class FlockerScriptRunner(object): <NEW_LINE> <INDENT> _react = staticmethod(task.react) <NEW_LINE> def __init__(self, script, options, logging=True, reactor=None, sys_module=None): <NEW_LINE> <INDENT> self.script = script <NEW_LINE> self.options = options <NEW_LINE> self.logging = logging <NEW_LINE> if reactor is None...
An API for running standard flocker scripts. :ivar ICommandLineScript script: See ``script`` of ``__init__``. :ivar _react: A reference to ``task.react`` which can be overridden for testing purposes.
62598faf97e22403b383af1d
class _PostsListView(ListView): <NEW_LINE> <INDENT> template_name = '{0}/blog_posts_list.html'.format(settings.CURRENT_SKIN) <NEW_LINE> context_object_name = 'posts' <NEW_LINE> paginate_by = settings.BLOG_POSTS_PAGINATE_BY <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return super().get_queryset().prefetch_rel...
Base class for displaying post lists
62598fafd268445f26639b8b
class hello: <NEW_LINE> <INDENT> def print(self, what): <NEW_LINE> <INDENT> if what == 1: <NEW_LINE> <INDENT> printString = 'world' <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> printString = 'BSB' <NEW_LINE> <DEDENT> print('hello ' + printString)
an example class
62598faf5166f23b2e2433e9
class Tests(IMP.test.TestCase): <NEW_LINE> <INDENT> def test_printing(self): <NEW_LINE> <INDENT> m = IMP.Model() <NEW_LINE> sf = IMP._ConstRestraint(m, [], 1).create_scoring_function() <NEW_LINE> IMP.set_log_level(IMP.MEMORY) <NEW_LINE> m.update() <NEW_LINE> sf.evaluate(False)
Test RestraintSets
62598faf85dfad0860cbfa7b
class APITestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(APITestCase, self).setUp() <NEW_LINE> def fake_keystoneclient(request, admin=False): <NEW_LINE> <INDENT> return self.stub_keystoneclient() <NEW_LINE> <DEDENT> self._original_glanceclient = api.glance.glanceclient <NEW_LINE> self...
The ``APITestCase`` class is for use with tests which deal with the underlying clients rather than stubbing out the horizon.api.* methods.
62598faf0c0af96317c56392
class OSUServer(TestbedDevice): <NEW_LINE> <INDENT> def __init__(self, prog_name): <NEW_LINE> <INDENT> TestbedDevice.__init__(self, prog_name) <NEW_LINE> self.dev_type = "OSUSERVER"
The class of OSU server device.
62598faf8a43f66fc4bf218a
class SubscriberDBStreamerCallbackTests(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> store = SqliteStore('file::memory:') <NEW_LINE> self._streamer_callback = SubscriberDBStreamerCallback(store, loop=asyncio.new_event_loop()) <NEW_LINE> ServiceRegistry.add_service('test', '0.0...
Tests for the SubscriberDBStreamerCallback detach_deleted_subscribers
62598fafbe8e80087fbbf074
class TradeListAPIView(generics.ListAPIView): <NEW_LINE> <INDENT> permission_classes = (IsFromUser,) <NEW_LINE> serializer_class = TradeSerializerComplete <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return Trade.objects.filter(portfolio=self.request.user.portfolio)
Vue qui permet de recuperer les trades
62598faf4f88993c371f0512
class HealthDict(PrintableDict): <NEW_LINE> <INDENT> def _get_health(self): <NEW_LINE> <INDENT> health = True <NEW_LINE> for item in self.keys(): <NEW_LINE> <INDENT> if self[item] != []: <NEW_LINE> <INDENT> health = False <NEW_LINE> <DEDENT> <DEDENT> return health <NEW_LINE> <DEDENT> health = property(fget=_get_health)
This class adds a 'health' check to a standard dictionary. This check looks into the dict values, and considers empty lists as healthy and all else as unhealthy. If one or more entries is 'unhealthy' the health method returns False.
62598fafac7a0e7691f72519
class FileSourceInfo(SourceInfo): <NEW_LINE> <INDENT> def is_my_business(self, action, **keywords): <NEW_LINE> <INDENT> status = SourceInfo.is_my_business(self, action, **keywords) <NEW_LINE> if status: <NEW_LINE> <INDENT> file_name = keywords.get("file_name", None) <NEW_LINE> if file_name: <NEW_LINE> <INDENT> if is_st...
Plugin description for a file source
62598faf7d43ff248742740a
class UnknownValue(Exception): <NEW_LINE> <INDENT> pass
Raised when a *Config element has a valid type and inappropriate value
62598faf23849d37ff8510c4
class PhaseReassignment(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def reassign(self, spec_t, spec_f, spec): <NEW_LINE> <INDENT> phase = np.angle(spec) <NEW_LINE> dt = spec_t[1] - spec_t[0] <NEW_LINE> df = spec_f[1] - spec_f[0] <NEW_LINE> ps_df,ps_dt = np.gradient(phas...
NOTE: doesn't work...
62598faf1b99ca400228f538
class Game: <NEW_LINE> <INDENT> def __init__(self, log_level=logging.DEBUG): <NEW_LINE> <INDENT> self.turn_number = 0 <NEW_LINE> raw_constants = read_input() <NEW_LINE> constants.load_constants(json.loads(raw_constants)) <NEW_LINE> num_players, self.my_id = map(int, read_input().split()) <NEW_LINE> logging.basicConfig(...
The game object holds all metadata pertinent to the game and all its contents
62598faf7047854f4633f3eb
class Golimar: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.client = golimar.client.Client() <NEW_LINE> <DEDENT> def open(self): <NEW_LINE> <INDENT> self.client.open() <NEW_LINE> <DEDENT> def send(self): <NEW_LINE> <INDENT> self.client.send() <NEW_LINE> <DEDENT> def chatWith(self, username): <NEW_LI...
Acts as a facade layer to the skype client.
62598faffff4ab517ebcd7f5
class SecretAttributes(Attributes): <NEW_LINE> <INDENT> _validation = { 'created': {'readonly': True}, 'updated': {'readonly': True}, 'recovery_level': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'enabled': {'key': 'enabled', 'type': 'bool'}, 'not_before': {'key': 'nbf', 'type': 'unix-time'}, 'expires': {'key':...
The secret management attributes. Variables are only populated by the server, and will be ignored when sending a request. :ivar enabled: Determines whether the object is enabled. :vartype enabled: bool :ivar not_before: Not before date in UTC. :vartype not_before: ~datetime.datetime :ivar expires: Expiry date in UTC....
62598fafcc40096d6161a1e2
class BaseBenchmarkLogger(object): <NEW_LINE> <INDENT> def log_evaluation_result(self, eval_results): <NEW_LINE> <INDENT> if not isinstance(eval_results, dict): <NEW_LINE> <INDENT> tf.logging.warning("eval_results should be dictionary for logging. " "Got %s", type(eval_results)) <NEW_LINE> return <NEW_LINE> <DEDENT> gl...
Class to log the benchmark information to STDOUT.
62598faf32920d7e50bc6065
class ApplicationGatewaySslPredefinedPolicy(SubResource): <NEW_LINE> <INDENT> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'cipher_suites': {'key': 'properties.cipherSuites', 'type': '[str]'}, 'min_protocol_version': {'key': 'properties.minProtocolVersion', 'type': 'str...
An Ssl predefined policy. :param id: Resource ID. :type id: str :param name: Name of the Ssl predefined policy. :type name: str :param cipher_suites: Ssl cipher suites to be enabled in the specified order for application gateway. :type cipher_suites: list[str or ~azure.mgmt.network.v2019_07_01.models.ApplicationGate...
62598fafa17c0f6771d5c246
class ImageRepoTargetsRoleTypeMismatchUptane(Uptane): <NEW_LINE> <INDENT> class ImageStep(Step): <NEW_LINE> <INDENT> TARGETS_KEYS_IDX = [1] <NEW_LINE> SNAPSHOT_KEYS_IDX = [2] <NEW_LINE> TIMESTAMP_KEYS_IDX = [3] <NEW_LINE> UPDATE_ERROR = 'SecurityException::Targets' <NEW_LINE> ROOT_KWARGS = { 'root_keys_idx': [0], 'targ...
The type of role must have an appropriate name in the metadata file. ImageRepo role Targets: _type = "Targets"
62598faf5fc7496912d48289
class NetworkWatcherListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[NetworkWatcher]'}, } <NEW_LINE> def __init__( self, *, value: Optional[List["NetworkWatcher"]] = None, **kwargs ): <NEW_LINE> <INDENT> super(NetworkWatcherListResult, self).__init__(**k...
Response for ListNetworkWatchers API service call. :param value: List of network watcher resources. :type value: list[~azure.mgmt.network.v2019_07_01.models.NetworkWatcher]
62598faf99cbb53fe6830ee9
class DataTableClientRenderedColoum(DataTableColoum): <NEW_LINE> <INDENT> pass
This class is still under planning.
62598faf38b623060ffa90ac
class FakeQuantizePerTensorBaseOpBenchmark(op_bench.TorchBenchmarkBase): <NEW_LINE> <INDENT> def init(self, N, C, H, W, nbits, device, op_func): <NEW_LINE> <INDENT> self.quant_min = 0 <NEW_LINE> self.quant_max = 2 ** nbits - 1 <NEW_LINE> self.quant_range = 2 ** nbits <NEW_LINE> self.input = torch.rand(N, C, H, W, dtype...
Benchmarks 3 different fake quantize per tensor operators.
62598fafeab8aa0e5d30bd9e
class Agent(): <NEW_LINE> <INDENT> def __init__(self, state_size, action_size, seed, double_dqn=False, duel_q=False): <NEW_LINE> <INDENT> self.state_size = state_size <NEW_LINE> self.action_size = action_size <NEW_LINE> self.seed = random.seed(seed) <NEW_LINE> if duel_q: <NEW_LINE> <INDENT> self.qnetwork_local = DuelQN...
Interacts with and learns from the environment.
62598faff7d966606f747ff6
class ReadStatsCounts(AnnotationsAssociated): <NEW_LINE> <INDENT> pattern = "(.*)_readmap$" <NEW_LINE> mTable = "readmap" <NEW_LINE> mColumns = "COUNT(DISTINCT read_id)" <NEW_LINE> def __call__(self, track, slice=None): <NEW_LINE> <INDENT> data = [] <NEW_LINE> data.append( ("known", self.getValue(self.getStatement(trac...
simple join between a data table and table defining slices. The join works from transcripts to reads. :attr:`mTable` table to join with :attr:`mColums` columns to output Note: the default slices have been disabled, only known, ambiguous and unknown are returned.
62598faf009cb60464d01532
class Producer(Object): <NEW_LINE> <INDENT> id = Field(String) <NEW_LINE> name = Field(String) <NEW_LINE> cat = Field(Array(String)) <NEW_LINE> domain = Field(String)
This object describes the content of a site or app, depending on which object its parent is embedded in. The producer is useful when content where the ad is shown is syndicated, and may appear on a completely different publisher. The producer object itself and all of its parameters are optional, so default values are ...
62598fafe1aae11d1e7ce82c
class DECLGROUP_WITHPATH(CIMElement): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> CIMElement.__init__(self, 'DECLGROUP.WITHPATH') <NEW_LINE> self.appendChildren(data)
The DECLGROUP.WITHPATH element defines a logical set of CIM Class and Instance declarations. Each object is declared with its own independent naming and location information. :: <!ELEMENT DECLGROUP.WITHPATH (VALUE.OBJECTWITHPATH | VALUE.OBJECTWITHLOCALPATH)*>
62598faf2ae34c7f260ab0f3
class Solution: <NEW_LINE> <INDENT> def computeLastDigit(self, A, B): <NEW_LINE> <INDENT> factor=1 <NEW_LINE> value = B <NEW_LINE> while value> A: <NEW_LINE> <INDENT> factor=((value%10)*factor)%10 <NEW_LINE> if int(factor)==0: <NEW_LINE> <INDENT> return int(factor) <NEW_LINE> <DEDENT> value-=1 <NEW_LINE> <DEDENT> retur...
@param A: the given number @param B: another number @return: the last digit of B! / A!
62598faf99cbb53fe6830eea
class Course(Base): <NEW_LINE> <INDENT> offering = ndb.StringProperty() <NEW_LINE> institution = ndb.StringProperty() <NEW_LINE> display_name = ndb.StringProperty() <NEW_LINE> instructor = ndb.KeyProperty(User, repeated=True) <NEW_LINE> active = ndb.BooleanProperty(default=True) <NEW_LINE> @property <NEW_LINE> def staf...
Courses are expected to have a unique offering.
62598faf4a966d76dd5eeee9
class BM_coverageType(object): <NEW_LINE> <INDENT> def __init__(self, cType, cUpper, cLower): <NEW_LINE> <INDENT> self.cType = cType <NEW_LINE> self.cUpper = cUpper <NEW_LINE> self.cLower = cLower
Container class for storing the type of coverage to calculate
62598faf851cf427c66b82cd
class _OVHLexiconClient(dns_common_lexicon.LexiconClient): <NEW_LINE> <INDENT> def __init__(self, endpoint, application_key, application_secret, consumer_key, ttl): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> config = dns_common_lexicon.build_lexicon_config('ovh', { 'ttl': ttl, }, { 'auth_entrypoint': endpoint, '...
Encapsulates all communication with the OVH API via Lexicon.
62598fafd58c6744b42dc2e0
class TestDonationAnalytics: <NEW_LINE> <INDENT> def setup_class(self): <NEW_LINE> <INDENT> self.donation_anaytics = DonationAnalytics(30,"/tmp/repeat_donors.txt") <NEW_LINE> <DEDENT> def test_process_data(self): <NEW_LINE> <INDENT> record1 = RecipientRecord("C00384516","SABOURIN, JAMES","02895","01262016","230") <NEW_...
This class is to test the process data method of DonationAnalytics class
62598faf283ffb24f3cf389e
class SmartPointerTransformation(typehandlers.TypeTransformation): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(SmartPointerTransformation, self).__init__() <NEW_LINE> self.rx = re.compile(r'(ns3::|::ns3::|)Ptr<([^>]+)>\s*$') <NEW_LINE> print("{0!r}".format(self), file=sys.stderr) <NEW_LINE> <DEDEN...
This class provides a "type transformation" that tends to support NS-3 smart pointers. Parameters such as "Ptr<Foo> foo" are transformed into something like Parameter.new("Foo*", "foo", transfer_ownership=False). Return values such as Ptr<Foo> are transformed into ReturnValue.new("Foo*", caller_owns_return=False). S...
62598faf7b180e01f3e49059
class ACLQueueError(TriggerError): <NEW_LINE> <INDENT> pass
Raised when we encounter errors communicating with the Queue.
62598faf32920d7e50bc6066
class BackupLog(Base): <NEW_LINE> <INDENT> __tablename__ = 'backup' <NEW_LINE> event = db.Column(db.String(256)) <NEW_LINE> level = db.Column(db.String(128)) <NEW_LINE> admin = db.Column(db.String(128)) <NEW_LINE> msg = db.Column(db.Text()) <NEW_LINE> ip = db.Column(db.String(128)) <NEW_LINE> def __unicode__(self): <NE...
数据备份表
62598faf63b5f9789fe85179
class StudyDirection(enum.Enum): <NEW_LINE> <INDENT> NOT_SET = 0 <NEW_LINE> MINIMIZE = 1 <NEW_LINE> MAXIMIZE = 2
Direction of a :class:`~diego.study.Study`. Attributes: NOT_SET: Direction has not been set. MNIMIZE: :class:`~diego.study.Study` minimizes the objective function. MAXIMIZE: :class:`~diego.study.Study` maximizes the objective function.
62598faf71ff763f4b5e7783
class Movie(object): <NEW_LINE> <INDENT> SINGULAR = "movie" <NEW_LINE> PLURAL = "movies" <NEW_LINE> ID = "id" <NEW_LINE> ACTIVE = "is_active" <NEW_LINE> TITLE = "title" <NEW_LINE> CREATED_AT = "created_at" <NEW_LINE> RELEASED_AT = "released_at" <NEW_LINE> class Release(object): <NEW_LINE> <INDENT> YEAR = "year" <NEW_LI...
Movie constants.
62598fafdd821e528d6d8f47
class RemovedInFlaskBB3(FlaskBBDeprecation): <NEW_LINE> <INDENT> version = (3, 0, 0)
warning for features removed in FlaskBB3
62598faf6e29344779b0066e
class IPMPToolListDescriptor(BaseDescriptor, object): <NEW_LINE> <INDENT> def __init__(self, offset=0, descr_tag=DescrTag_IPMP_ToolsListDescrTag): <NEW_LINE> <INDENT> super(IPMPToolListDescriptor, self).__init__(offset, descr_tag) <NEW_LINE> self.ipmpTool = [] <NEW_LINE> <DEDENT> def decode(self, file_strm): <NEW_LINE>...
7.2.6.14.3.1.1 Syntax class IPMP_ToolListDescriptor extends BaseDescriptor : bit(8) tag=IPMP_ToolsListDescrTag { IPMP_Tool ipmpTool[0 .. 255]; } 7.2.6.14.3.1.2 Semantics IPMP_Tool – a class describing a logical IPMP Tool required to access the content.
62598fafaad79263cf42e7e6
class CrewStatus(enum.Enum): <NEW_LINE> <INDENT> healthy = 0 <NEW_LINE> damaged = 1
Indicators used by crew members to describe what happened during the execution of the most recent task that was assigned to them
62598faf442bda511e95c46a
class PhotosListApiView(ListAPIView): <NEW_LINE> <INDENT> serializer_class = PhotoListSerializer <NEW_LINE> permission_classes = [AllowAny] <NEW_LINE> pagination_class = MyPageNumberPagination <NEW_LINE> queryset = Photo.objects.all()
Endpoint to view photos list
62598faf0c0af96317c56395
class CheckNameAvailabilityOperations: <NEW_LINE> <INDENT> models = _models <NEW_LINE> def __init__(self, client, config, serializer, deserializer) -> None: <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._serialize = serializer <NEW_LINE> self._deserialize = deserializer <NEW_LINE> self._config = config <NEW...
CheckNameAvailabilityOperations async operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~azure.mgmt.rdbms.mysql_flexible...
62598fafcc40096d6161a1e3
class BearerTokenAuth(requests.auth.AuthBase): <NEW_LINE> <INDENT> def __init__(self, access_token): <NEW_LINE> <INDENT> self.access_token = access_token <NEW_LINE> <DEDENT> def __call__(self, r): <NEW_LINE> <INDENT> r.headers['Authorization'] = "Bearer %s" % self.access_token <NEW_LINE> return r
Authentication using the protocol: Bearer <access_token>
62598faf26068e7796d4c968
class IChooseMyOwnDamnName(IHTTPRequest): <NEW_LINE> <INDENT> pass
We need to be able to adapt the request for PloneRelease objects to get to our own IUserPreferredURLNormalizer.
62598fafa17c0f6771d5c248
class PublicTagsAPITests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> <DEDENT> def test_login_required(self): <NEW_LINE> <INDENT> res = self.client.get(TAGS_URL) <NEW_LINE> self.assertEqual(res.status_code, status.HTTP_401_UNAUTHORIZED)
Test the publicly available tags API
62598faf92d797404e388b6d
class UnrewardedCondition(stimuli.StimulusConditionWav): <NEW_LINE> <INDENT> def __init__(self, file_path="", recursive=False): <NEW_LINE> <INDENT> super(UnrewardedCondition, self).__init__(name="Unrewarded", response=True, is_rewarded=False, is_punished=False, file_path=file_path, recursive=recursive)
Unrewarded stimuli are not consequated and should be pecked through (i.e. Go stimuli)
62598faf4428ac0f6e658538
class UserTokenRequestInnerUserField(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swagger_types = { '_id': 'int' } <NEW_LINE> self.attribute_map = { '_id': '_id' } <NEW_LINE> self._id = None <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> properties = [] <NEW_LINE> for p in self...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598fafbaa26c4b54d4f2c7
class Requester( object ): <NEW_LINE> <INDENT> def __init__( self, logger ): <NEW_LINE> <INDENT> self.logger = logger <NEW_LINE> self.valid_search_keys = [ 'ISBN', 'ISSN', 'LCCN', 'OCLC', 'PHRASE' ] <NEW_LINE> <DEDENT> def request_item( self, patron_barcode, search_key, search_value, pickup_location, api_url_root, api_...
Enables easy calls to the BorrowDirect request webservice. BorrowDirect 'RequestItem Web Service' docs: <http://borrowdirect.pbworks.com/w/page/90133541/RequestItem%20Web%20Service> (login required) Called by BorrowDirect.run_request_item()
62598faf97e22403b383af21