code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Connector(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.connections = {} <NEW_LINE> self._nextid = 0 <NEW_LINE> <DEDENT> def emit(self, signal_id, payload): <NEW_LINE> <INDENT> if signal_id in self.connections: <NEW_LINE> <INDENT> for action in self.connections[signal_id].values(): <NEW_LINE...
Simple signal-slot connector
6259906f4f88993c371f1164
class MeasurewiseQTarget(QTarget): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> def __init__(self, items: typing.Sequence[QTargetMeasure] | None = None): <NEW_LINE> <INDENT> super().__init__(items) <NEW_LINE> <DEDENT> def _notate( self, grace_handler: GraceHandler, attack_point_optimizer: AttackPointOptimizer, attach_...
Measurewise quantization target. Not composer-safe. Used internally by ``Quantizer``.
6259906fe5267d203ee6d001
class ChatUser(models.Model): <NEW_LINE> <INDENT> room = models.ForeignKey(ChatRoom, verbose_name="房间名") <NEW_LINE> user = models.ForeignKey(User, verbose_name="用户名") <NEW_LINE> add_time = models.DateTimeField(default=datetime.now, verbose_name="添加时间") <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = " 在线会员" <...
在线会员: 房间id,房间名称,会员id,会员名,时间
6259906f71ff763f4b5e9031
class PluginRule(Rule.PluginRuleBase): <NEW_LINE> <INDENT> def __init__(self, module): <NEW_LINE> <INDENT> super().__init__(module) <NEW_LINE> self.param = { 'NAME':'G', 'ENABLE':False, 'TIMER':3000, 'FILTER':'', 'name_t':'T', 'name_h':'H', 'name_p':'P', 'abc':123, 'xyz':456, 'sel':2, 'qwe':'Lorem ipsum', 'asd':[1,2,3,...
TODO
6259906fd486a94d0ba2d847
class Login(Resource): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> creditentials = request.json <NEW_LINE> userCheck = session.query(User) .filter(User.name == creditentials['username'], User.password == creditentials['password']) .first() <NEW_LINE> if userCheck != None: <NEW_LINE> <I...
rout to log in user
6259906f97e22403b383c78c
class NSNitroNserrGslbDbTimeout(NSNitroGslbErrors): <NEW_LINE> <INDENT> pass
Nitro error code 1975 Static proximity database server is not responding.
6259906f1f5feb6acb16447a
class ReadOnlyCursorWrapper(object): <NEW_LINE> <INDENT> def __init__(self, cursor, db): <NEW_LINE> <INDENT> self.cursor = cursor <NEW_LINE> self.db = db <NEW_LINE> <DEDENT> def execute(self, sql, params=()): <NEW_LINE> <INDENT> self.db.validate_no_broken_transaction() <NEW_LINE> with self.db.wrap_database_errors: <NEW...
This is a wrapper for a database cursor. This sits between django's own wrapper at `django.db.backends.util.CursorWrapper` and the database specific cursor at `django.db.backends.*.base.*CursorWrapper`. It overrides two specific methods: `execute` and `executemany`. If the site is in read-only mode, then the SQL is ex...
6259906f283ffb24f3cf5132
class CategoryListView(LoginRequiredMixin, ListView): <NEW_LINE> <INDENT> queryset = (Category.objects .filter(_has_banners_q, level=1) .distinct() .order_by('parent__name', 'name')) <NEW_LINE> template_name = 'banners/generator/categories.html' <NEW_LINE> context_object_name = 'categories'
List all categories.
6259906f4527f215b58eb5e4
class MinHeap: <NEW_LINE> <INDENT> def __init__(self, init_list=None): <NEW_LINE> <INDENT> self.priority_queue = [] <NEW_LINE> self.priority_queue.append(None) <NEW_LINE> if init_list is not None: <NEW_LINE> <INDENT> for i in init_list: <NEW_LINE> <INDENT> self.add(i) <NEW_LINE> <DEDENT> <DEDENT> <DEDENT> def add(self,...
最小堆 是一个完全二叉树,树及子树的根一定是树里面最小的元素 添加或删除元素会通过上浮或下沉调整节点使得保持堆的定义 由于是完全二叉树,使用数组实现会比较简单,数组索引0位置留空,从1开始使用, 若节点的索引是k,则此节点的父节点是k/2,两个子节点是2k和2k+1
6259906ff548e778e596ce16
@dataclass() <NEW_LINE> class LDR(AbstractAccessMechanism): <NEW_LINE> <INDENT> component: str = "" <NEW_LINE> offset: int = 0 <NEW_LINE> name: str = "ldr" <NEW_LINE> def is_read(self): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def is_write(self): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> def is_me...
Access mechanism for reading a system control coprocessor register
6259906f26068e7796d4e1c5
class Player: <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.power = 100 <NEW_LINE> self.speciality = None <NEW_LINE> self.spells_available = [] <NEW_LINE> self.position = [] <NEW_LINE> self.this_spell = None <NEW_LINE> self.move_log = [] <NEW_LINE> <DEDENT> def hit(s...
Player Class: gives player objects
6259906f4c3428357761bb3d
class State(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField(settings.AUTH_USER_MODEL, verbose_name=_('user')) <NEW_LINE> state = models.BooleanField(verbose_name=_('state'), default=(False))
Docstrings are only dragging us down.
6259906f8da39b475be04a77
class NearestEmbedFunc(Function): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def forward(ctx, input, emb): <NEW_LINE> <INDENT> if input.size(1) != emb.size(0): <NEW_LINE> <INDENT> raise RuntimeError('invalid argument: input.size(1) ({}) must be equal to emb.size(0) ({})'. format(input.size(1), emb.size(0))) <NEW_LINE...
Input: ------ x - (batch_size, emb_dim, *) Last dimensions may be arbitrary emb - (emb_dim, num_emb)
6259906fa8370b77170f1c52
class Environment: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.init_state() <NEW_LINE> <DEDENT> def init_state(self): <NEW_LINE> <INDENT> self.state = None <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def get_states(): <NEW_LINE> <INDENT> states = [] <NEW_LINE> return states <NEW_LINE> <DEDENT> @st...
Generic environment. Reward only depends on the target state.
6259906fa219f33f346c8093
class EmbeddingCollection(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_dim, embedding_dim, max_len=5000): <NEW_LINE> <INDENT> super(EmbeddingCollection, self).__init__() <NEW_LINE> self.__input_dim = input_dim <NEW_LINE> self.__embedding_dim = embedding_dim <NEW_LINE> self.__max_len = max_len <NEW_LINE> sel...
Provide word vector and position vector encoding.
6259906f5fdd1c0f98e5f810
class BasePenetrance(BaseOperator): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> _simuPOP_laop.BasePenetrance_swiginit(self, _simuPOP_laop.n...
Details: A penetrance model models the probability that an individual has a certain disease provided that he or she has certain genetic (genotype) and environmental (information field) riske factors. A penetrance operator calculates this probability according to provided information and set his or ...
6259906f2ae34c7f260ac973
@script_interface_register <NEW_LINE> class Cluster(ScriptInterfaceHelper): <NEW_LINE> <INDENT> _so_name = "ClusterAnalysis::Cluster" <NEW_LINE> _so_bind_methods = ("particle_ids", "size", "longest_distance", "radius_of_gyration", "fractal_dimension", "center_of_mass") <NEW_LINE> _so_creation_policy = "LOCAL" <NEW_LINE...
Class representing a cluster of particles. Methods ------- particle_ids() Returns list of particle ids in the cluster size() Returns the number of particles in the cluster center_of_mass() Center of mass of the cluster (folded coordinates) longest_distance() Longest distance between any combination ...
6259906f009cb60464d02dc1
class TestCheckFullPathSubFolder(TestCheckAbsoluteSubFolder): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def patch_site(self): <NEW_LINE> <INDENT> conf_path = os.path.join(self.target_dir, "conf.py") <NEW_LINE> with io.open(conf_path, "r", encoding="utf-8") as inf: <NEW_LINE> <INDENT> data = inf.read() <NEW_LINE> data...
Validate links in a site which is: * built in URL_TYPE="full_path" * deployable to a subfolder (BASE_URL="https://example.com/foo/")
6259906f67a9b606de5476e8
class Prover(object): <NEW_LINE> <INDENT> rules = [] <NEW_LINE> goalId = 100 <NEW_LINE> trace = 0 <NEW_LINE> @staticmethod <NEW_LINE> def unify (srcTerm, srcEnv, destTerm, destEnv) : <NEW_LINE> <INDENT> nargs = len(srcTerm.args) <NEW_LINE> if nargs != len(destTerm.args) : return 0 <NEW_LINE> if srcTerm.pred != d...
class for prolog style proof of query
6259906fe76e3b2f99fda28d
class PluginInstaller: <NEW_LINE> <INDENT> def __init__(self, connector=None, loop=None): <NEW_LINE> <INDENT> self.connector = connector <NEW_LINE> self.loop = loop <NEW_LINE> <DEDENT> async def request_repo(self, pluginname): <NEW_LINE> <INDENT> url = ( GitHubRoute( "DecoraterBot-devs", "DecoraterBot-cogs", "master", ...
Class that implements all of the Plugin Instalation / updating system for DecoraterBot.
6259906f63b5f9789fe869ee
class RandomNanoflares(object): <NEW_LINE> <INDENT> @u.quantity_input <NEW_LINE> def __init__(self, duration: u.s, stress): <NEW_LINE> <INDENT> self.duration = duration.to(u.s).value <NEW_LINE> self.stress = stress <NEW_LINE> <DEDENT> def calculate_event_properties(self, loop): <NEW_LINE> <INDENT> self.number_events = ...
Add a single nanoflare at a random time during the simulation period Parameters ---------- duration : `~astropy.units.Quantity` Duration of each event stress : `float` Fraction of field energy density to input into the loop
6259906f097d151d1a2c28fc
class ExportTwoPointOhLibraries(BaseView): <NEW_LINE> <INDENT> decorators = [advertise('scopes', 'rate_limit')] <NEW_LINE> scopes = ['user'] <NEW_LINE> rate_limit = [1000, 60*60*24] <NEW_LINE> def get(self, export): <NEW_LINE> <INDENT> if export not in current_app.config['HARBOUR_EXPORT_TYPES']: <NEW_LINE> <INDENT> ret...
End point to return ADS 2.0 libraries in a format that users can use to import them to other services. Currently, the following third-party services are supported: - Zotero (https://www.zotero.org/) - Papers (http://www.papersapp.com/) - Mendeley (https://www.mendeley.com/)
6259906f4527f215b58eb5e5
class Course(): <NEW_LINE> <INDENT> tasks = {} <NEW_LINE> exam_score = 0 <NEW_LINE> lab_max = 1 <NEW_LINE> def_task_num = 0 <NEW_LINE> def __init__(self, course_config): <NEW_LINE> <INDENT> self.exam_max = course_config["exam_max"] <NEW_LINE> self.lab_max = course_config["lab_max"] <NEW_LINE> self.lab_num = course_conf...
Course
6259906f7d847024c075dc69
class Adafruit_BME680_I2C(Adafruit_BME680): <NEW_LINE> <INDENT> def __init__(self, i2c, address=0x77, debug=False, *, refresh_rate=10): <NEW_LINE> <INDENT> self._i2c = i2c <NEW_LINE> self._debug = debug <NEW_LINE> super().__init__(refresh_rate=refresh_rate) <NEW_LINE> <DEDENT> def _read(self, register, length): <NEW_LI...
Driver for I2C connected BME680. :param int address: I2C device address :param bool debug: Print debug statements when True. :param int refresh_rate: Maximum number of readings per second. Faster property reads will be from the previous reading.
6259906f167d2b6e312b81d4
class ServiceFee(): <NEW_LINE> <INDENT> def __init__(self, term): <NEW_LINE> <INDENT> self.fee_discount = np.repeat(0.99, term)
lendingclub charge a constant service fee of 1% of payments
6259906fa8370b77170f1c54
class _ErrorReportingLoggingAPI(object): <NEW_LINE> <INDENT> def __init__( self, project, credentials=None, _http=None, client_info=None, client_options=None, ): <NEW_LINE> <INDENT> self.logging_client = google.cloud.logging.client.Client( project, credentials, _http=_http, client_info=client_info, client_options=clien...
Report to Stackdriver Error Reporting via Logging API :type project: str :param project: the project which the client acts on behalf of. If not passed falls back to the default inferred from the environment. :type credentials: :class:`google.auth.credentials.Credentials` or ...
6259906fa8370b77170f1c55
class RealActualClass: <NEW_LINE> <INDENT> doing_impossible_stuff = False <NEW_LINE> doing_possible_stuff = False <NEW_LINE> def impossibleMethod(self): <NEW_LINE> <INDENT> self.doing_impossible_stuff = True <NEW_LINE> raise AssertionError("Trying to do impossible stuff.") <NEW_LINE> <DEDENT> def testableMethod(self): ...
A class that's hard to test.
6259906fe1aae11d1e7cf452
class HelloApiView(APIView): <NEW_LINE> <INDENT> serializer_class = serializers.HelloSerializer <NEW_LINE> def get(self, request, format=None): <NEW_LINE> <INDENT> an_api_view = [ 'Uses HTTP methods as function (get, post, patch, put, delete)', 'It is similar to traditional Django View', 'Gives you the most control ove...
Test API View.
6259906fa219f33f346c8095
class UserListCreateAPIView(ListCreateAPIView): <NEW_LINE> <INDENT> serializer_class = UserRegisterSerializer <NEW_LINE> queryset = User.objects.all() <NEW_LINE> permission_classes = [CreateListUserPermission] <NEW_LINE> filter_backends = (SearchFilter, OrderingFilter) <NEW_LINE> search_fields = ('name', 'email') <NEW_...
Controller that allows any logged user see all users and only not logged user and admin user to create user.
6259906f4428ac0f6e659dbf
class Tags(BrowserView): <NEW_LINE> <INDENT> def __call__(self): <NEW_LINE> <INDENT> self.request.response.setHeader("Content-type", "application/json; charset=utf-8") <NEW_LINE> catalog = getToolByName(self.context, 'portal_catalog') <NEW_LINE> tags = catalog.uniqueValuesFor('Subject') <NEW_LINE> tags = [cgi.escape(ta...
Support view for select2subject. Returns Subject tags in json
6259906f67a9b606de5476e9
class VirtualWanSecurityProviders(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'supported_providers': {'key': 'supportedProviders', 'type': '[VirtualWanSecurityProvider]'}, } <NEW_LINE> def __init__( self, *, supported_providers: Optional[List["VirtualWanSecurityProvider"]] = None, **kwargs ): <N...
Collection of SecurityProviders. :param supported_providers: List of VirtualWAN security providers. :type supported_providers: list[~azure.mgmt.network.v2019_12_01.models.VirtualWanSecurityProvider]
6259906fd268445f2663a7a3
class TokenManager(object): <NEW_LINE> <INDENT> def get_token(self): <NEW_LINE> <INDENT> return None
An abstract base class for token managers. Every token manager must derive from this base class and override get_token method.
6259906fcc0a2c111447c717
class RCServicer(object): <NEW_LINE> <INDENT> def ExecuteRC(self, request, context): <NEW_LINE> <INDENT> pass <NEW_LINE> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!')
The greeting service definition.
6259906f460517430c432c9d
class SupplierAttributes2201(object): <NEW_LINE> <INDENT> swagger_types = { 'enable': 'int', 'entry': 'SupplierAttributes2201Entry' } <NEW_LINE> attribute_map = { 'enable': 'enable', 'entry': 'entry' } <NEW_LINE> def __init__(self, enable=None, entry=None): <NEW_LINE> <INDENT> self._enable = None <NEW_LINE> self._entry...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
6259906fe76e3b2f99fda28f
class Phone(Region): <NEW_LINE> <INDENT> @property <NEW_LINE> def phone(self) -> str: <NEW_LINE> <INDENT> return self.phone_field.get_attribute('value') <NEW_LINE> <DEDENT> @phone.setter <NEW_LINE> def phone(self, number: Union[int, str]): <NEW_LINE> <INDENT> Utility.click_option(self.driver, element=self.phone_field) ...
A telephone form field. .. note:: Must define ``_phone_locator`` and ``_phone_error_message_locator``
6259906f63b5f9789fe869f0
class TestTask332(unittest.TestCase): <NEW_LINE> <INDENT> @parameterized.expand( [ (1, [1, 0, 0, 0]), (4, [2, 0, 0, 0]), (234, [15, 3, 0, 0]), (1646, [40, 6, 3, 1]), (2141, [46, 5, 0, 0]), (2137, [46, 4, 2, 1]), (2149, [46, 5, 2, 2]), (12412, [111, 9, 3, 1]), (90475, [300, 21, 5, 3]), ] ) <NEW_LINE> def test_task332(se...
Testing task 332 class main logic
6259906fadb09d7d5dc0bdf8
class ApasxolisiType(models.Model): <NEW_LINE> <INDENT> aptyp = models.CharField("Τύπος απασχόλησης", max_length=50) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> ordering = ["id"] <NEW_LINE> verbose_name = "ΑΠΑΣΧΟΛΗΣΗ ΤΥΠΟΣ" <NEW_LINE> verbose_name_plural = "ΠΡΟΣΛΗΨΕΙΣ-ΤΥΠΟΣ ΑΠΑΣΧΟΛΗΣΗΣ" <NEW_LINE> <DEDENT> def __str__(s...
Αορίστου, ορισμένου, έργου
6259906fec188e330fdfa12f
class _OpenBLASModule(_Module): <NEW_LINE> <INDENT> def get_version(self): <NEW_LINE> <INDENT> get_config = getattr(self._dynlib, "openblas_get_config", lambda: None) <NEW_LINE> get_config.restype = ctypes.c_char_p <NEW_LINE> config = get_config().split() <NEW_LINE> if config[0] == b"OpenBLAS": <NEW_LINE> <INDENT> retu...
Module class for OpenBLAS
6259906f4e4d562566373c94
class HelloApiView(APIView): <NEW_LINE> <INDENT> serializer_class = serializers.HelloSerializer <NEW_LINE> def get(self, request, format=None): <NEW_LINE> <INDENT> an_apiview = [ 'Uses HTTP methods as function (get, post, patch, put, delete)', 'Is similar to a traditional Django View', 'Gives you the most control over ...
Test API View
6259906f627d3e7fe0e08715
class BackendAddressPool(SubResource): <NEW_LINE> <INDENT> _validation = { 'backend_ip_configurations': {'readonly': True}, 'load_balancing_rules': {'readonly': True}, 'outbound_nat_rule': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'et...
Pool of backend IP addresses. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :param name: Gets name of the resource that is unique within a resource group. This name can be used to access the resource. :type name: str :param etag: A uniqu...
6259906f26068e7796d4e1c9
class InertiaEffect(Effect): <NEW_LINE> <INDENT> def __init__(self, player): <NEW_LINE> <INDENT> super().__init__(player) <NEW_LINE> self.name = 'inertia' <NEW_LINE> <DEDENT> def set_effect(self, up, down, left, right): <NEW_LINE> <INDENT> if up: <NEW_LINE> <INDENT> if self.player.onGround: <NEW_LINE> <INDENT> self.pla...
level effect
6259906fa05bb46b3848bd73
class ExprAssign(Expr): <NEW_LINE> <INDENT> __slots__ = Expr.__slots__ + ["_dst", "_src"] <NEW_LINE> def __init__(self, dst, src): <NEW_LINE> <INDENT> assert isinstance(dst, Expr) <NEW_LINE> assert isinstance(src, Expr) <NEW_LINE> if dst.size != src.size: <NEW_LINE> <INDENT> raise ValueError( "sanitycheck: ExprAssign a...
An ExprAssign represent an assignment from an Expression to another one. Some use cases: - var1 <- 2
6259906ff9cc0f698b1c5f11
class SkodaSensor(SkodaEntity): <NEW_LINE> <INDENT> @property <NEW_LINE> def state(self): <NEW_LINE> <INDENT> _LOGGER.debug('Getting state of %s' % self.instrument.attr) <NEW_LINE> return self.instrument.state <NEW_LINE> <DEDENT> @property <NEW_LINE> def unit_of_measurement(self): <NEW_LINE> <INDENT> return self.instru...
Representation of a Skoda Carnet Sensor.
6259906f4c3428357761bb41
class PlmVectorFieldAnalysisLogic(ScriptedLoadableModuleLogic): <NEW_LINE> <INDENT> def hasImageData(self,volumeNode): <NEW_LINE> <INDENT> if not volumeNode: <NEW_LINE> <INDENT> print('no volume node') <NEW_LINE> return False <NEW_LINE> <DEDENT> if volumeNode.GetImageData() == None: <NEW_LINE> <INDENT> print('no image ...
This class should implement all the actual computation done by your module. The interface should be such that other python code can import this class and make use of the functionality without requiring an instance of the Widget
6259906f3539df3088ecdb2a
class CardFactory(factory.django.DjangoModelFactory): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Card <NEW_LINE> <DEDENT> assigned_to = factory.SubFactory(UserFactory) <NEW_LINE> category = factory.SubFactory(CategoryFactory) <NEW_LINE> title = factory.Faker('word') <NEW_LINE> description = factory.Fak...
Create a test card for writing tests.
6259906f7b180e01f3e49cab
class Material(Parameters): <NEW_LINE> <INDENT> pass
Material specific parameters. Inherits from :class:`parameters.Parameters`.
6259906ff548e778e596ce1b
class update_detail_view_CBV_mixin(JsonResponseMixin, View): <NEW_LINE> <INDENT> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> data = { "count": 1000, "content": "using django JsonResponse with CBV" } <NEW_LINE> return self.render_to_json_response(data)
using django JsonResponse with CBV with mixin
6259906f99fddb7c1ca63a19
class AbinsCASTEPIsotopes(stresstesting.MantidStressTest, HelperTestingClass): <NEW_LINE> <INDENT> tolerance = None <NEW_LINE> ref_result = None <NEW_LINE> def runTest(self): <NEW_LINE> <INDENT> HelperTestingClass.__init__(self) <NEW_LINE> name = "LiOH_H2O_2D2O_CASTEP" <NEW_LINE> self.ref_result = name + ".nxs" <NEW_LI...
In this benchmark it is tested if calculation of the system with isotopic substitutions: H -> 2H, Li -> 7Li, produces correct results. Input data is generated by CASTEP. This system test should be fast so no need for excludeInPullRequests flag.
6259906f4f88993c371f1167
class SshfsAccess: <NEW_LINE> <INDENT> def name(self): <NEW_LINE> <INDENT> return 'sshfs' <NEW_LINE> <DEDENT> def make_available(self, user, server, remote_path, path): <NEW_LINE> <INDENT> if os.path.ismount(path): <NEW_LINE> <INDENT> return 201 <NEW_LINE> <DEDENT> if len(os.listdir(path)) > 0: <NEW_LINE> <INDENT> prin...
This class mounts and umounts the remote files using sshfs. This will work on any system that fuse runs on, namely GNU/Linux, FreeBSD and Mac.
6259906f67a9b606de5476ea
class BootstrapQCPostProcessor(BootstrapPlugin): <NEW_LINE> <INDENT> def on_initial_bootstrap(self, process, config, **kwargs): <NEW_LINE> <INDENT> return <NEW_LINE> if os.environ.get('PYCC_MODE'): <NEW_LINE> <INDENT> log.info('PYCC_MODE: skipping qc_post_processor launch') <NEW_LINE> return <NEW_LINE> <DEDENT> if self...
Sets up one QC Post Processing worker and initiates the Scheduler Service's interval every 24 hours.
6259906fe5267d203ee6d004
class ThreadLocals(object): <NEW_LINE> <INDENT> def process_request(self, request): <NEW_LINE> <INDENT> _thread_locals.sarvuser = getattr(request, 'sarvuser', None)
Middleware that gets various objects from the request object and saves them in thread local storage.
6259906fcc0a2c111447c718
class BroadcastCmdResponse(Base): <NEW_LINE> <INDENT> def __init__(self, msg, callback, on_done=None, num_retry=3): <NEW_LINE> <INDENT> super().__init__(on_done, num_retry) <NEW_LINE> self.addr = msg.to_addr <NEW_LINE> self.cmd = msg.cmd1 <NEW_LINE> self.callback = callback <NEW_LINE> self._device_ACK = False <NEW_LINE...
Handles Broadcast Messages Received in Response to a Direct Request`. This class handles responses from the device where the device sends an ACK but a subsequent broadcast message is sent with the requested payload. The handler watches for the proper PLM ACK, followed by a standard length ACK from the device, and the...
6259906fadb09d7d5dc0bdfa
class PrincipalPassword(form.EditForm): <NEW_LINE> <INDENT> interface.implements(IPrincipalPasswordForm, IPersonalPasswordForm) <NEW_LINE> ignoreContext = True <NEW_LINE> label = _('Change password') <NEW_LINE> fields = field.Fields(SChangePasswordForm, SPasswordForm) <NEW_LINE> def update(self, *args, **kw): <NEW_LINE...
change password form
6259906f38b623060ffaa49b
class Nalu(CMakePackage): <NEW_LINE> <INDENT> homepage = "https://github.com/NaluCFD/Nalu" <NEW_LINE> git = "https://github.com/NaluCFD/Nalu.git" <NEW_LINE> version('master', branch='master') <NEW_LINE> variant('shared', default=(sys.platform != 'darwin'), description='Build dependencies as shared libraries') <NEW...
Nalu: a generalized unstructured massively parallel low Mach flow code designed to support a variety of energy applications of interest built on the Sierra Toolkit and Trilinos solver Tpetra/Epetra stack
6259906f66673b3332c31c8d
class MinAvgTwoSliceTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_min_avg(self): <NEW_LINE> <INDENT> self.assertEqual(solution(A), S)
The output from solution() must be equal to S
6259906f167d2b6e312b81d6
class AttributeSearch(models.Model): <NEW_LINE> <INDENT> __metaclass__ = TransMeta <NEW_LINE> name = models.CharField(_('Name'), max_length=64) <NEW_LINE> categ = models.ManyToManyField('ProductCategory', null=True, blank=True, related_name='attribute_search_set', verbose_name=_('Categories')) <NEW_LINE> price = models...
Attribute Search
6259906f097d151d1a2c2900
class FormatFlowedDecoder: <NEW_LINE> <INDENT> def __init__(self, delete_space=False, character_set='us-ascii', error_handling='strict'): <NEW_LINE> <INDENT> self.delete_space = delete_space <NEW_LINE> self.character_set = character_set <NEW_LINE> self.error_handling = error_handling <NEW_LINE> <DEDENT> def _stripquote...
Object for converting a format=flowed bytestring to other formats The following instance attributes influence the interpretation of format=flowed bytestring: delete_space (default: False) Delete the trailing space before the CRLF on flowed lines before interpreting the line on flowed input, corresponds to th...
6259906f7047854f46340c47
class StrEnum(str, Enum): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return str(self.value)
Base class for str enums.
6259906f23849d37ff852945
class ConcreteDiGraph(DiGraph): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.nodes = [] <NEW_LINE> self.edges = dict() <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> result = "Di-graph with %d nodes." % len(self.nodes) <NEW_LINE> for node, outs in list(self.edges.items()): <NEW_LINE> <IN...
Represents a directed graph as a list of nodes and lists of edges.
6259906f7c178a314d78e833
class AboutSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = About <NEW_LINE> fields = '__all__'
about serializer
6259906fdd821e528d6da5c9
class Solution_Multiple_Source: <NEW_LINE> <INDENT> def wallsAndGates(self, rooms): <NEW_LINE> <INDENT> if not rooms or not rooms[0]: <NEW_LINE> <INDENT> return rooms <NEW_LINE> <DEDENT> queue = deque() <NEW_LINE> for row in range(len(rooms)): <NEW_LINE> <INDENT> for col in range(len(rooms[0])): <NEW_LINE> <INDENT> if ...
@param rooms: m x n 2D grid @return: nothing
6259906f4a966d76dd5f077a
class Sound(object): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> @abstractmethod <NEW_LINE> def generate(self, fs, d): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def save_to_wav(self, fs, d): <NEW_LINE> <INDENT> x = self.generate(fs, d) <NEW_LINE> dir_name = 'sound_generation/generated_sounds/' <NEW_LINE> ...
Abstract class for all modules creating sound_generation
6259906f2ae34c7f260ac979
class CeleryLoader(BaseLoader): <NEW_LINE> <INDENT> def now(self): <NEW_LINE> <INDENT> return timezone.now() <NEW_LINE> <DEDENT> def read_configuration(self): <NEW_LINE> <INDENT> self.configured = True <NEW_LINE> return settings.CELERY_SETTINGS <NEW_LINE> <DEDENT> def on_worker_init(self): <NEW_LINE> <INDENT> if settin...
Modified from celery default loader and django-celery DjangoLoader
6259906f009cb60464d02dc7
class UpdateProjectCardInput(sgqlc.types.Input): <NEW_LINE> <INDENT> __schema__ = github_schema <NEW_LINE> __field_names__ = ('project_card_id', 'is_archived', 'note', 'client_mutation_id') <NEW_LINE> project_card_id = sgqlc.types.Field(sgqlc.types.non_null(ID), graphql_name='projectCardId') <NEW_LINE> is_archived = sg...
Autogenerated input type of UpdateProjectCard
6259906f4f88993c371f1168
class BuildConfig(CMakeProjectConfig): <NEW_LINE> <INDENT> DEFAULT_NAME = "default" <NEW_LINE> CMAKE_BUILD_TYPE_AUTO_DETECT = True <NEW_LINE> def __init__(self, name=None, data=None, **kwargs): <NEW_LINE> <INDENT> CMakeProjectConfig.__init__(self, data, **kwargs) <NEW_LINE> self.name = name or self.DEFAULT_NAME <NEW_LI...
Represent the configuration data related to a build-configuration. .. code-block:: YAML # -- FILE: cmake_build.yaml ... build_configs: - Linux_arm64_Debug: cmake_build_type: Debug cmake_toolchain: cmake/toolchain/linux_gcc_arm64.cmake cmake_defines: - CMAKE...
6259906f7b25080760ed892b
class OrderAsk(Order): <NEW_LINE> <INDENT> pass
AKA sell
6259906f4428ac0f6e659dc4
class AutoConnectEngine(BaseProxyEngine): <NEW_LINE> <INDENT> def __init__(self, dburi, **kwargs): <NEW_LINE> <INDENT> BaseProxyEngine.__init__(self) <NEW_LINE> self.dburi = dburi <NEW_LINE> self.kwargs = kwargs <NEW_LINE> self._engine = None <NEW_LINE> <DEDENT> def get_engine(self): <NEW_LINE> <INDENT> if self._engine...
An SQLEngine proxy that automatically connects when necessary.
6259906fd268445f2663a7a5
class check_dep(Command): <NEW_LINE> <INDENT> description = "Check if dependencies are installed" <NEW_LINE> user_options = [] <NEW_LINE> test_commands = {} <NEW_LINE> def initialize_options(self): pass <NEW_LINE> def finalize_options(self): pass <NEW_LINE> def run(self): <NEW_LINE> <INDENT> packages = self.distributio...
Check if the dependencies listed in `install_requires` and `extras_require` are currently installed and on the Python path.
6259906f16aa5153ce401d6a
class TestUserListTestCase(APITestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.url = reverse('user-list') <NEW_LINE> self.user_data = {'username': 'test', 'password': 'test'} <NEW_LINE> <DEDENT> def test_post_request_with_no_data_fails(self): <NEW_LINE> <INDENT> response = self.client.post(self....
Tests /users list operations.
6259906f4e4d562566373c97
class Store(object): <NEW_LINE> <INDENT> @property <NEW_LINE> def current_appliance(self): <NEW_LINE> <INDENT> from utils import appliance <NEW_LINE> return appliance.current_appliance <NEW_LINE> <DEDENT> def __init__(self): <NEW_LINE> <INDENT> self.config = None <NEW_LINE> self.session = None <NEW_LINE> self.paralleli...
pytest object store If a property isn't available for any reason (including being accessed outside of a pytest run), it will be None.
6259906faad79263cf430046
class NeedsStart(object): <NEW_LINE> <INDENT> started = False <NEW_LINE> def prepare(self): <NEW_LINE> <INDENT> if self.api.prepare(): <NEW_LINE> <INDENT> if not self.started: <NEW_LINE> <INDENT> self.Start() <NEW_LINE> <DEDENT> return self.started <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return False <NEW_LINE> <...
This mixin enforces Start/Finish routines
6259906f5166f23b2e244c64
class PackagePathEntry(Fixture): <NEW_LINE> <INDENT> def __init__(self, packagename, directory): <NEW_LINE> <INDENT> self.packagename = packagename <NEW_LINE> self.directory = directory <NEW_LINE> <DEDENT> def setUp(self): <NEW_LINE> <INDENT> Fixture.setUp(self) <NEW_LINE> path = sys.modules[self.packagename].__path__ ...
Add a path to the path of a python package. The python package needs to be already imported. If this new path is already in the packages __path__ list then the __path__ list will not be altered.
6259906f1f5feb6acb164482
class CLI(object): <NEW_LINE> <INDENT> POLL_INTERVAL = int(os.environ.get('POLL_INTERVAL', 5)) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.cgc = ambassador.cgc.ticlient.TiClient.from_env() <NEW_LINE> self.notifier = Notifier(tries_threshold=3) <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> while Tru...
A docstring
6259906f97e22403b383c794
class Article2Tag(models.Model): <NEW_LINE> <INDENT> nid = models.AutoField(primary_key=True) <NEW_LINE> article = models.ForeignKey(to='Article', to_field='nid') <NEW_LINE> tag = models.ForeignKey(to='Tag', to_field='nid') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> unique_together = (('article', 'tag'), )
文章和标签关系表
6259906fbe8e80087fbc0920
@ft.total_ordering <NEW_LINE> class Match: <NEW_LINE> <INDENT> def __init__(self, filename, template, variables): <NEW_LINE> <INDENT> self.__filename = filename <NEW_LINE> self.__template = template <NEW_LINE> self.__variables = variables <NEW_LINE> <DEDENT> @property <NEW_LINE> def filename(self): <NEW_LINE> <INDENT...
A ``Match`` object represents a file with a name matching a template in a ``FileTree``. The :meth:`FileTree.query` method returns ``Match`` objects.
6259906ff9cc0f698b1c5f13
class webshellPostSpiderRootShell(AbstractWebshellPostSpider): <NEW_LINE> <INDENT> name = "webshell_post_RootShell" <NEW_LINE> url = "http://10.108.114.132/dvwa/hackable/uploads/php-webshells-master/rootshell.php" <NEW_LINE> allowed_domains = AbstractWebshellPostSpider.allowed_domains <NEW_LINE> if url in AbstractWebsh...
webshell功能 -- shell
6259906f99cbb53fe683277a
@PBRTv3Addon.addon_register_class <NEW_LINE> class world(world_panel): <NEW_LINE> <INDENT> bl_label = 'PBRTv3 World Settings' <NEW_LINE> display_property_groups = [ ( ('scene',), 'pbrtv3_world' ) ]
PBRTv3 World Settings
6259906f2c8b7c6e89bd5078
class BlocklistPermission(permissions.BasePermission): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> if str(view.__class__.__name__).lower().find('store') != -1: <NEW_LINE> <INDENT> if request.method == 'GET': <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT...
Global permission check for blocked IPs.
6259906f5fdd1c0f98e5f818
class Command(BaseCommand): <NEW_LINE> <INDENT> help = "Load Sequence Ontology" <NEW_LINE> def add_arguments(self, parser): <NEW_LINE> <INDENT> parser.add_argument( "--file", help="Sequence Ontology file obo." "Available at https://github.com/" "The-Sequence-Ontology/SO-Ontologies", required=True, type=str, ) <NEW_LINE...
Load sequence ontology.
6259906fa219f33f346c809b
class MaintenanceActionPlugin(mb.FenixBase): <NEW_LINE> <INDENT> __tablename__ = 'action_plugins' <NEW_LINE> id = _id_column() <NEW_LINE> session_id = sa.Column(sa.String(36), sa.ForeignKey('sessions.session_id'), nullable=False) <NEW_LINE> plugin = sa.Column(sa.String(length=255), nullable=False) <NEW_LINE> type = sa....
Maintenance action plugin
6259906f7b180e01f3e49cad
class AllEventsFeed(ICalFeed): <NEW_LINE> <INDENT> product_id = '-//happening.com//Example//EN' <NEW_LINE> timezone = 'UTC' <NEW_LINE> file_name = "events.ics" <NEW_LINE> def items(self): <NEW_LINE> <INDENT> return Event.objects.all().order_by('-start') <NEW_LINE> <DEDENT> def item_title(self, item): <NEW_LINE> <INDENT...
Feed of all events.
6259906fe5267d203ee6d006
class TemplatesHandler(XMLHandlerBase): <NEW_LINE> <INDENT> def __init__(self, templateViewer=None): <NEW_LINE> <INDENT> XMLHandlerBase.__init__(self) <NEW_LINE> self.startDocumentSpecific = self.startDocumentTemplates <NEW_LINE> self.elements.update({ 'Templates' : (self.startTemplates, self.defaultEndElement), 'Templ...
Class implementing a sax handler to read an XML templates file.
6259906f4f6381625f19a0f1
class MAVLink_mission_request_message(MAVLink_message): <NEW_LINE> <INDENT> id = MAVLINK_MSG_ID_MISSION_REQUEST <NEW_LINE> name = 'MISSION_REQUEST' <NEW_LINE> fieldnames = ['target_system', 'target_component', 'seq'] <NEW_LINE> ordered_fieldnames = [ 'seq', 'target_system', 'target_component' ] <NEW_LINE> format = '<HB...
Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. http://qgroundcontrol.org/mavlink/waypoint_protocol
6259906f8e7ae83300eea923
class PortfolioData(object): <NEW_LINE> <INDENT> def __init__(self, port_id, cur_holding, hist_holding, av_ts): <NEW_LINE> <INDENT> self.id = port_id <NEW_LINE> self.curholding = cur_holding <NEW_LINE> self.histholding = hist_holding <NEW_LINE> self.assetvalue_ts = av_ts <NEW_LINE> <DEDENT> @property <NEW_LINE> def upd...
用于存储组合的数据,数据包含组合的最新持仓、历史持仓、组合当前资产总值时间序列
6259906f2ae34c7f260ac97c
class package(dict): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> @classmethod <NEW_LINE> def nested(cls, src:dict, delim:str, root_key:str) -> "package": <NEW_LINE> <INDENT> pkg = cls() <NEW_LINE> for k, v in src.items(): <NEW_LINE> <INDENT> d = pkg <NEW_LINE> *first, last = k.split(delim) <NEW_LINE> for i in first: ...
Dict for nesting objects (specifically Python modules) under path-like string keys. Has a special icon.
6259906f9c8ee82313040dd1
class NameSerializer(TagListSerializerField): <NEW_LINE> <INDENT> default_error_messages = { 'invalid': _("Not permitted create 'name' instances") } <NEW_LINE> @staticmethod <NEW_LINE> def update_or_create(photo, names, cleanup=True): <NEW_LINE> <INDENT> if cleanup: <NEW_LINE> <INDENT> photo.names.clear() <NEW_LINE> <D...
Name serializer to create, update or render Tagged names of photos.
6259906f091ae356687064c8
class DigitalStoreError(object): <NEW_LINE> <INDENT> def __init__(self, code, message, status_code=400): <NEW_LINE> <INDENT> self.error_code = code <NEW_LINE> self.error_message = message <NEW_LINE> self.status_code = status_code <NEW_LINE> <DEDENT> def as_response(self, status_code=None): <NEW_LINE> <INDENT> if status...
Base Error class for Connyct
6259906fe76e3b2f99fda295
class Command(command.DirectOnlyCommand): <NEW_LINE> <INDENT> def collect_args(self, message): <NEW_LINE> <INDENT> return re.search(r'(?:remove|delete)\s*filter\s*(\S+)', message.content, re.I) <NEW_LINE> <DEDENT> def matches(self, message): <NEW_LINE> <INDENT> return self.collect_args(message) is not None <NEW_LINE> <...
Remove a filter from the current channel. If you are the owner of the filter, this also deletes the filter. **Usage** ```@Idea delete filter <name>``` Where **`<name>`** is the name of the filter you want to remove If you own the filter you want to remove, include `-r` in your message.
6259906f8a43f66fc4bf3a27
class RpmRepoTestBase(ComponentTestBase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setup_class(cls): <NEW_LINE> <INDENT> super(RpmRepoTestBase, cls).setup_class() <NEW_LINE> cls.manifest = RepoManifest(os.path.join(RPM_TEST_DATA_DIR, 'test-repo-manifest.xml')) <NEW_LINE> cls.orig_repos = {} <NEW_LINE> for prj, b...
Baseclass for tests run in a Git repository with packaging data
6259906faad79263cf430048
class ListFilteredMixin(object): <NEW_LINE> <INDENT> filter_set = None <NEW_LINE> def get_filter_set(self): <NEW_LINE> <INDENT> if self.filter_set: <NEW_LINE> <INDENT> return self.filter_set <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise Exception( "ListFilterMixin requires either a definition of " "'filter_set' o...
Mixin that adds support for django-filter
6259906f4e4d562566373c99
class MilesApp(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> app = QApplication(sys.argv) <NEW_LINE> app.aboutToQuit.connect(self.cleanUp) <NEW_LINE> car = Car() <NEW_LINE> model = World(car) <NEW_LINE> self.preloadedPaths = preloadedPath.PreloadedPaths(model) <NEW_LINE> self.spi = StmController.StmCon...
This is the main class initializing the model and the controllers. Architecture MVC.
6259906fd486a94d0ba2d851
class Singleton(Borg): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> Borg.__init__(self) <NEW_LINE> self._shared_state.update(kwargs) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return str(self._shared_state)
docstring for Singleton
6259906f01c39578d7f1437e
class SettingsApplicationController(Gtk.Application): <NEW_LINE> <INDENT> def __init__(self, args=[]): <NEW_LINE> <INDENT> super(SettingsApplicationController, self).__init__( application_id=APPLICATION_ID) <NEW_LINE> self._args = args <NEW_LINE> self.connect("activate", self.setup_ui) <NEW_LINE> <DEDENT> def get_confi...
Core application controller for the landscape settings application.
6259906fbaa26c4b54d50b3e
class DarkSkyData: <NEW_LINE> <INDENT> def __init__(self, api_key, latitude, longitude, units): <NEW_LINE> <INDENT> self._api_key = api_key <NEW_LINE> self.latitude = latitude <NEW_LINE> self.longitude = longitude <NEW_LINE> self.requested_units = units <NEW_LINE> self.data = None <NEW_LINE> self.currently = None <NEW_...
Get the latest data from Dark Sky.
6259906f23849d37ff852949
class ManageUserView(generics.RetrieveUpdateAPIView): <NEW_LINE> <INDENT> serializer_class = UserSerializer <NEW_LINE> authentication_classes = (authentication.TokenAuthentication,) <NEW_LINE> permission_classes = (permissions.IsAuthenticated,) <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> return self.request.us...
Manage the authenticated user
6259906fa8370b77170f1c5c
class SubCategory(CategoryTemplate): <NEW_LINE> <INDENT> category = models.ForeignKey('Category', on_delete=models.CASCADE, default='id') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = 'sub-category' <NEW_LINE> verbose_name_plural = 'sub-categories' <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> ...
subcategory model
6259906f7b180e01f3e49cae
class Player(object): <NEW_LINE> <INDENT> def blast(self, enemy): <NEW_LINE> <INDENT> print("The player blasts an enemy.\n") <NEW_LINE> enemy.die()
A player in a shooter game.
6259906fdd821e528d6da5cb
class Pipeline: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.message = 0 <NEW_LINE> self.producer_lock = threading.Lock() <NEW_LINE> self.consumer_lock = threading.Lock() <NEW_LINE> self.consumer_lock.acquire() <NEW_LINE> <DEDENT> def get_message(self, name): <NEW_LINE> <INDENT> logging.debug(f'{nam...
Class to allow a single element pipeline between producer and consumer.
6259906f99cbb53fe683277d
class MreTes4(MreHeaderBase): <NEW_LINE> <INDENT> rec_sig = b'TES4' <NEW_LINE> melSet = MelSet( MelStruct(b'HEDR', [u'f', u'2I'], (u'version', 1.0), u'numRecords', (u'nextObject', 0x800)), MelNull(b'OFST'), MelBase(b'DELE','dele_p',), MreHeaderBase.MelAuthor(), MreHeaderBase.MelDescription(), MreHeaderBase.MelMasterNam...
TES4 Record. File header.
6259906f4f6381625f19a0f2
class TestTransformRegistration(IntegrationTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.portal = self.layer['portal'] <NEW_LINE> setRoles(self.portal, TEST_USER_ID, ['Manager']) <NEW_LINE> folder = self.portal[self.portal.invokeFactory('Folder', 'folder')] <NEW_LINE> self.board = _createObje...
Test transform registration
6259906f4428ac0f6e659dc8