code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Mallory1(AbstractMallory): <NEW_LINE> <INDENT> def request_groups(self, p, g): <NEW_LINE> <INDENT> self.bob.request_groups(p, 1) <NEW_LINE> <DEDENT> def easy_decrypt(self, ct: bytes, iv: bytes): <NEW_LINE> <INDENT> recovered_pt = aes_cbc_decrypt(1, ct, iv) <NEW_LINE> print("recovered pt (g = 1):", recovered_pt)
g = 1
6259906be5267d203ee6cfc3
class UserDelegateSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Delegate <NEW_LINE> fields = ('id', 'delegate',)
Serializer for UserDelegate Model
6259906b0c0af96317c57964
class GroupMemberRecord(BaseGroupMember): <NEW_LINE> <INDENT> group = models.ForeignKey(BaseGroup, related_name="member_records", verbose_name=_('group')) <NEW_LINE> user = models.ForeignKey(User, related_name="group_records", verbose_name=_('user')) <NEW_LINE> datetime = models.DateTimeField(auto_now_add=True) <NEW_LI...
A snapshot of a user's group status at a particular point in time.
6259906b1b99ca400229013b
class ConnectivityInformation(Model): <NEW_LINE> <INDENT> _validation = { 'hops': {'readonly': True}, 'connection_status': {'readonly': True}, 'avg_latency_in_ms': {'readonly': True}, 'min_latency_in_ms': {'readonly': True}, 'max_latency_in_ms': {'readonly': True}, 'probes_sent': {'readonly': True}, 'probes_failed': {'...
Information on the connectivity status. Variables are only populated by the server, and will be ignored when sending a request. :ivar hops: List of hops between the source and the destination. :vartype hops: list[~azure.mgmt.network.v2017_06_01.models.ConnectivityHop] :ivar connection_status: The connection status. ...
6259906b99cbb53fe68326f2
class Assignment(base.Assignment): <NEW_LINE> <INDENT> implements(ILatestSectionableNITFPortlet) <NEW_LINE> header = u"" <NEW_LINE> limit = 10 <NEW_LINE> pretty_date = True <NEW_LINE> filter_collection = None <NEW_LINE> def __init__(self, header=u"", limit=10, pretty_date=True, filter_collection=None): <NEW_LINE> <INDE...
Portlet assignment. This is what is actually managed through the portlets UI and associated with columns.
6259906b97e22403b383c718
class YubikeyFactor(SecondFactor, type='yubikey'): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.yubikey_client_id = kwargs.pop('yubikey_client_id', None) <NEW_LINE> self.yubikey_secret_key = kwargs.pop('yubikey_secret_key', None) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def args_from_ap...
Implements a yubikey factor for the :class:`Auth` class.
6259906b66673b3332c31c09
class HexSnowflake(Model): <NEW_LINE> <INDENT> def __init__(self, width=50, height=50): <NEW_LINE> <INDENT> self.schedule = SimultaneousActivation(self) <NEW_LINE> self.grid = HexGrid(width, height, torus=True) <NEW_LINE> for (contents, x, y) in self.grid.coord_iter(): <NEW_LINE> <INDENT> cell = Cell((x, y), self) <NEW...
Represents the hex grid of cells. The grid is represented by a 2-dimensional array of cells with adjacency rules specific to hexagons.
6259906bfff4ab517ebcf026
class Command(BaseCommand): <NEW_LINE> <INDENT> def __copy__(self): <NEW_LINE> <INDENT> _ = Command(copy.copy(self._receiver), self._method) <NEW_LINE> _.append_arg(*self._args) <NEW_LINE> return _
An runnable/executable Command that acts as a prototype through the 'copy' python magic function. When a command instance is invoked with 'copy', the receiver is copied explicitly in a shallow way. The rest of the command arguments are assumed to be performance invariant (eg it is not expensive to copy the 'method' at...
6259906b21bff66bcd724472
class DescribeLimitsInputSet(InputSet): <NEW_LINE> <INDENT> def set_AWSAccessKeyId(self, value): <NEW_LINE> <INDENT> super(DescribeLimitsInputSet, self)._set_input('AWSAccessKeyId', value) <NEW_LINE> <DEDENT> def set_AWSSecretKeyId(self, value): <NEW_LINE> <INDENT> super(DescribeLimitsInputSet, self)._set_input('AWSSec...
An InputSet with methods appropriate for specifying the inputs to the DescribeLimits Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
6259906bcc0a2c111447c6d6
class V1PyTorchJobList(object): <NEW_LINE> <INDENT> openapi_types = { 'api_version': 'str', 'items': 'list[V1PyTorchJob]', 'kind': 'str', 'metadata': 'V1ListMeta' } <NEW_LINE> attribute_map = { 'api_version': 'apiVersion', 'items': 'items', 'kind': 'kind', 'metadata': 'metadata' } <NEW_LINE> def __init__(self, api_vers...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
6259906b0a50d4780f7069c6
class HousesIndexHandler(BaseHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> ret = self.redis.get("home_page_data") <NEW_LINE> <DEDENT> except Exception as e: <NEW_LINE> <INDENT> logging.error(e) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if ret: <NEW_LINE> <INDENT> resp = '...
获取房屋主页图片信息
6259906b32920d7e50bc7852
class SigGraInferNet_GCN(nn.Module): <NEW_LINE> <INDENT> def __init__(self,feature_input_size,feature_output_size,PPI_input_size,PPI_output_size,num_GCN,drop_prob): <NEW_LINE> <INDENT> super(SigGraInferNet_GCN, self).__init__() <NEW_LINE> self.PPIGE_GCN=PPIGE_GCN(PPI_input_size,PPI_output_size,num_GCN,drop_prob) <NEW_L...
SigGraInferNet_GCN with PPIGE-GCN Args: feature_input_size: the input dimension of genomic feature feature_output_size: the output dimension of genomic feature PPI_input_size: the input dimension of protein-protein database feature PPI_output_size:the output dimension of protein-protein database feature...
6259906b5fc7496912d48e6e
class WTASelection: <NEW_LINE> <INDENT> def __init__(self, network, threshold): <NEW_LINE> <INDENT> self.network = network <NEW_LINE> self.threshold = threshold <NEW_LINE> <DEDENT> def process(self, inputs): <NEW_LINE> <INDENT> results = self.network.process(inputs) <NEW_LINE> winner_index = max(range(len(results)), ke...
Selects a neuron chain which produced the strongest response, which has passed the threshold. The chain can be used to construct a new network.
6259906b67a9b606de5476a8
class Meta: <NEW_LINE> <INDENT> types = registry.settings.types
Can change over time.
6259906bbe8e80087fbc0898
class ContentStream(BaseMixin, db.Model): <NEW_LINE> <INDENT> __tablename__ = u'content_stream' <NEW_LINE> name = db.Column(db.String(STRING_LEN)) <NEW_LINE> uri = db.Column(db.String(200)) <NEW_LINE> description = db.Column(db.String(1000)) <NEW_LINE> ok_to_play = db.Column(db.Boolean) <NEW_LINE> created_by = db.Colum...
Definition of a stream
6259906b92d797404e389761
class CheckThreads(argparse.Action): <NEW_LINE> <INDENT> def __init__(self, option_strings, dest, nargs=None, **kwargs): <NEW_LINE> <INDENT> if nargs is not None: <NEW_LINE> <INDENT> raise ValueError('nargs not allowed for ThreadCheck') <NEW_LINE> <DEDENT> super(CheckThreads, self).__init__(option_strings, dest, **kwar...
Argparse Action that ensures number of threads requested is valid Example: .. code-block:: Python >>> from arandomness.argparse import CheckThreads >>> parser = argparse.ArgumentParser() >>> parser.add_argument('test', ... type=int, ... action=CheckThrea...
6259906b3cc13d1c6d466f52
class Judgment(SaveReversionMixin, TimestampMixin): <NEW_LINE> <INDENT> url = models.URLField( verbose_name=_("URL"), max_length=250, ) <NEW_LINE> actor = models.TextField( verbose_name=_("Actor"), null=False, ) <NEW_LINE> resume = models.TextField( verbose_name=_("Resumen"), null=False, ) <NEW_LINE> defendant = models...
Judgment info.
6259906b6e29344779b01e61
class TwoLayerNet(object): <NEW_LINE> <INDENT> def __init__(self, input_dim=3*32*32, hidden_dim=100, num_classes=10, weight_scale=1e-3, reg=0.0): <NEW_LINE> <INDENT> self.params = {} <NEW_LINE> self.reg = reg <NEW_LINE> self.params['W1'] = np.random.normal(scale=weight_scale, size=(input_dim, hidden_dim)) <NEW_LINE> se...
A two-layer fully-connected neural network with ReLU nonlinearity and softmax loss that uses a modular layer design. We assume an input dimension of D, a hidden dimension of H, and perform classification over C classes. The architecure should be affine - relu - affine - softmax. Note that this class does not implemen...
6259906b8da39b475be049f8
class InjectShell(Callback): <NEW_LINE> <INDENT> def __init__(self, file='INJECT_SHELL.tmp', shell='ipython'): <NEW_LINE> <INDENT> self._file = file <NEW_LINE> assert shell in ['ipython', 'pdb'] <NEW_LINE> self._shell = shell <NEW_LINE> logger.info("Create a file '{}' to open {} shell.".format(file, shell)) <NEW_LINE> ...
Allow users to create a specific file as a signal to pause and iteratively debug the training. Once the :meth:`trigger` method is called, it detects whether the file exists, and opens an IPython/pdb shell if yes. In the shell, ``self`` is this callback, ``self.trainer`` is the trainer, and from that you can access ever...
6259906b45492302aabfdce4
class Coordinate: <NEW_LINE> <INDENT> def __init__(self, pos: complex, **kwargs: Any) -> None: <NEW_LINE> <INDENT> self._pos: complex = pos <NEW_LINE> <DEDENT> @property <NEW_LINE> def pos(self) -> complex: <NEW_LINE> <INDENT> return self._pos <NEW_LINE> <DEDENT> @pos.setter <NEW_LINE> def pos(self, value: complex) -> ...
Base class for a coordinate in a 2D grid. A Coordinate object knows its location in the grid (represented as a complex number) and how to calculate the distance from it to another location.
6259906b8a43f66fc4bf39a0
class BridgeLibTest(base.BaseTestCase): <NEW_LINE> <INDENT> _NAMESPACE = 'test-namespace' <NEW_LINE> _BR_NAME = 'test-br' <NEW_LINE> _IF_NAME = 'test-if' <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(BridgeLibTest, self).setUp() <NEW_LINE> mock.patch.object(netutils, 'is_ipv6_enabled', return_value=True).start(...
A test suite to exercise the bridge libraries
6259906bf548e778e596cd9a
class TestOperators(unittest.TestCase): <NEW_LINE> <INDENT> def runSingleParticleBasis(self): <NEW_LINE> <INDENT> basis = SingleParticleBasis([['u', 'd'], [0, 1]]) <NEW_LINE> self.assertTrue(basis.getStateAlgebraically(13) == 'c^(\'u\', 0) c^(\'d\', 0) c^(\'d\', 1)') <NEW_LINE> self.assertTrue(basis.getFockspaceNr((1,0...
def __init__(self, *args, **kwargs): super(TestOperators, self).__init__(*args, **kwargs)
6259906b66673b3332c31c0b
class ThreadPool: <NEW_LINE> <INDENT> def __init__(self,num_workers,q_size=0,resq_size=0,poll_timeout=5): <NEW_LINE> <INDENT> self._requestQueue = queue.Queue() <NEW_LINE> self._resultQueue = queue.Queue() <NEW_LINE> self.workers = [] <NEW_LINE> self.dismissedWorkers = [] <NEW_LINE> self.workRequests = {} <NEW_LINE> se...
@param num_workers:初始化的线程数量 @param q_size,resq_size: requestQueue和result队列的初始大小 @param poll_timeout: 设置工作线程WorkerThread的timeout,也就是等待requestQueue的timeout
6259906b44b2445a339b7566
class SAPHDBPart(PacketNoPadded): <NEW_LINE> <INDENT> name = "SAP HANA SQL Command Network Protocol Part" <NEW_LINE> fields_desc = [ EnumField("partkind", 0, hdb_partkind_values, fmt="<b"), LESignedByteField("partattributes", 0), FieldLenField("argumentcount", None, count_of="buffer", fmt="<h"), LESignedIntField("bigar...
SAP HANA SQL Command Network Protocol Part This packet represents a part within a HDB packet. The part header is comprised of 16 bytes.
6259906b8e7ae83300eea89d
class DatabaseAccountPatchParameters(Model): <NEW_LINE> <INDENT> _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, } <NEW_LINE> def __init__(self, tags=None, capabilities=None): <NEW_LINE> <INDENT> super(DatabaseAccountPatchParameter...
Parameters for patching Azure Cosmos DB database account properties. :param tags: :type tags: dict[str, str] :param capabilities: List of Cosmos DB capabilities for the account :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability]
6259906b4a966d76dd5f06f8
class UserEditForm(FlaskForm): <NEW_LINE> <INDENT> username = StringField('Username', validators=[DataRequired()]) <NEW_LINE> email = StringField('E-mail', validators=[DataRequired(), Email()]) <NEW_LINE> image_url = StringField('(Optional) Image URL') <NEW_LINE> header_image_url = StringField('(Optional) Header Image ...
Form for editing users.
6259906b0a50d4780f7069c7
class FakeConfig(object): <NEW_LINE> <INDENT> def IsCluster(self): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def GetNodeList(self): <NEW_LINE> <INDENT> return ["a", "b", "c"] <NEW_LINE> <DEDENT> def GetRsaHostKey(self): <NEW_LINE> <INDENT> return FAKE_CLUSTER_KEY <NEW_LINE> <DEDENT> def GetDsaHostKey(self): <...
Fake configuration object
6259906b3346ee7daa338265
class Aggregation(object): <NEW_LINE> <INDENT> def __init__(self, agg=None): <NEW_LINE> <INDENT> if hasattr(agg, 'items'): <NEW_LINE> <INDENT> self.__dict__.update(agg) <NEW_LINE> <DEDENT> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> return self.get(name, None) <NEW_LINE> <DEDENT> def __setattr__(self, nam...
Generic object to hold Elastic aggregation.
6259906baad79263cf42ffc3
class AbstractAuthenticator: <NEW_LINE> <INDENT> def __init__(self, token_type): <NEW_LINE> <INDENT> self.access_token = None <NEW_LINE> self.token_type = token_type <NEW_LINE> <DEDENT> def has_token(self): <NEW_LINE> <INDENT> return self.access_token != None <NEW_LINE> <DEDENT> def get_websocket_auth_query(self): <NEW...
Abstract base class for managing a user's auth token.
6259906ba17c0f6771d5d7af
class LazyTrello(object): <NEW_LINE> <INDENT> __metaclass__ = TrelloMeta <NEW_LINE> @property <NEW_LINE> def _prefix(self): <NEW_LINE> <INDENT> raise NotImplementedError("LazyTrello subclasses MUST define a _prefix") <NEW_LINE> <DEDENT> def __init__(self, conn, obj_id, data=None): <NEW_LINE> <INDENT> self._id = obj_id ...
Parent class for Trello objects (cards, lists, boards, members, etc). This should always be subclassed, never used directly.
6259906bd486a94d0ba2d7cd
class CollectionListResource(BaseResource): <NEW_LINE> <INDENT> path = ['collections'] <NEW_LINE> methods = { 'find': FindListResourceMethod, 'count': CountListResourceMethod, }
Many collections manupulation object
6259906be76e3b2f99fda20f
class VeranstaltungAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> fieldsets = [ ('Stammdaten', {'fields': ['typ', 'name', 'semester', 'status', 'lv_nr', 'grundstudium', 'evaluieren', 'veranstalter', 'link_veranstalter', ]}), ('Bestellung', {'fields': ['sprache', 'anzahl', 'verantwortlich', 'ergebnis_empfaenger', 'primaer...
Admin View für Veranstaltung
6259906ba8370b77170f1bd4
class ArduinoUno(_ArduinoABC): <NEW_LINE> <INDENT> CLASS = pyfirmata.Arduino <NEW_LINE> IDS = [(0x2341, 0x0043), (0x2341, 0x0001), (0x2A03, 0x0043), (0x2341, 0x0243)] <NEW_LINE> def __init__(self, serial_number): <NEW_LINE> <INDENT> _ArduinoABC.__init__(self, serial_number)
Object wrapper for an Arduino Uno running StandardFirmata. Args: serial_number: String of the USB iSerialNumber associated with the device.
6259906b92d797404e389762
class PdfrateProxy(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.submit_url = config.get('pdfrateproxy', 'submit_url') <NEW_LINE> self.report_url = config.get('pdfrateproxy', 'report_url') <NEW_LINE> self.metadata_url = config.get('pdfrateproxy', 'metadata_url') <NEW_LINE> <DEDENT> def _invo...
A class representing a local proxy object for PDFrate. Submit your PDFrate queries to this class and it will run them against PDFrate. It's not designed be used directly, but by a query scheduler. For batch or manual submissions, use the PdfrateQueryHandler class.
6259906b8da39b475be049fa
class Class(Base): <NEW_LINE> <INDENT> __tablename__ = 'class' <NEW_LINE> class_id = Column(Integer, primary_key=True) <NEW_LINE> name = Column(String) <NEW_LINE> description = Column(Text) <NEW_LINE> club_id = Column(Integer, ForeignKey('club.club_id')) <NEW_LINE> club = relationship("Club", back_populates="classes") ...
Represents a class offered by the club.
6259906b7047854f46340bc5
class VDSR3D(BaseNet): <NEW_LINE> <INDENT> def __init__(self, num_classes, w_initializer=None, w_regularizer=None, b_initializer=None, b_regularizer=None, acti_func='relu', name='VDSR3D'): <NEW_LINE> <INDENT> super(VDSR3D, self).__init__( num_classes=num_classes, w_initializer=w_initializer, w_regularizer=w_regularizer...
Implementation of VDSR [1] with 3D Kernel Spatial Support, based on NiftyNet [2]. This implementation utilizes highres3dnet.py [3] as template. [1] J. Kim et al., "Accurate Image Super-Resolution Using Very Deep Convolutional Networks". In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages...
6259906b2c8b7c6e89bd4ff4
class CreateView(generics.ListCreateAPIView): <NEW_LINE> <INDENT> queryset = Bucketlist.objects.all() <NEW_LINE> serializer_class = BucketlistSerializer <NEW_LINE> def perform_create(self, serializer): <NEW_LINE> <INDENT> serializer.save()
get list of bucketlists and post a bucketlist
6259906b5166f23b2e244be1
class CharacteristicUserDescriptionDescriptor(Descriptor): <NEW_LINE> <INDENT> def __init__(self, bus, index, characteristic, description): <NEW_LINE> <INDENT> self.writable = False <NEW_LINE> self.value = bytes(description, encoding='utf-8') <NEW_LINE> Descriptor.__init__( self, bus, index, CHAR_USER_DESCRIPTION_DESC_...
Read only User descriptions, useful while using gatt tools on remote side.
6259906b32920d7e50bc7855
class SecurityProfile(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'uefi_settings': {'key': 'uefiSettings', 'type': 'UefiSettings'}, 'encryption_at_host': {'key': 'encryptionAtHost', 'type': 'bool'}, 'security_type': {'key': 'securityType', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, uefi...
Specifies the Security profile settings for the virtual machine or virtual machine scale set. :ivar uefi_settings: Specifies the security settings like secure boot and vTPM used while creating the virtual machine. :code:`<br>`:code:`<br>`Minimum api-version: 2020-12-01. :vartype uefi_settings: ~azure.mgmt.compute.v20...
6259906bd486a94d0ba2d7ce
class TestGenericThrottlePolicy4(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 testGenericThrottlePolicy4(self): <NEW_LINE> <INDENT> pass
GenericThrottlePolicy4 unit test stubs
6259906b71ff763f4b5e8fb6
class SafePickler(pickle.Unpickler): <NEW_LINE> <INDENT> def find_class(self, module, name): <NEW_LINE> <INDENT> global sk_whitelist <NEW_LINE> if not sk_whitelist: <NEW_LINE> <INDENT> whitelist_file = os.path.join(os.path.dirname(__file__), 'sk_whitelist.json') <NEW_LINE> with open(whitelist_file, 'r') as f: <NEW_LINE...
Used to safely deserialize scikit-learn model objects serialized by cPickle.dump Usage: eg.: SafePickler.load(pickled_file_object)
6259906b3d592f4c4edbc6ef
@register_exporter(name="tflite_dynamic_range") <NEW_LINE> class TFLiteDynamicRangeExporter(TFLiteExporter): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__(quantization="dynamic_range")
TensorFlow Lite exporter with dynamic range quantization.
6259906b21bff66bcd724476
class BoxWithOne(gegede.builder.Builder): <NEW_LINE> <INDENT> defaults = dict( material = 'Air', dim = (Q('1m'),Q('1m'),Q('1m')), off = (Q('0m'),Q('0m'),Q('0m')), sbind = 0, volind = 0, ) <NEW_LINE> def construct(self, geom): <NEW_LINE> <INDENT> dim = [0.5*d for d in self.dim] <NEW_LINE> shape = geom.shapes.Box(self.na...
Build a simple box that holds one child taken from a particular builder.
6259906b56ac1b37e63038ea
class HTTPError(OpenTDBException): <NEW_LINE> <INDENT> pass
The HTTP request returned an unsuccessful status code.
6259906b8e7ae83300eea89f
class FesB2304(FesRequest): <NEW_LINE> <INDENT> def __init__(self, settle_date, org_nick_name): <NEW_LINE> <INDENT> super().__init__("2304") <NEW_LINE> self.data = { "trans_code": "2304", "settle_date": settle_date, "org_nick_name": org_nick_name }
联机交易生成清算数据请求类
6259906b44b2445a339b7567
class TestHash: <NEW_LINE> <INDENT> def test_hash_uses_the_entity_id_and_model_name(self) -> None: <NEW_LINE> <INDENT> entity = Entity(id_=1) <NEW_LINE> result = entity.__hash__() <NEW_LINE> assert result == hash("Entity-1")
Test the hashing of entities.
6259906b3317a56b869bf14b
class iface_engin_ioctrl_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.I32, '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.__class__ == TBinaryProtocol.TBinaryProtocolAcc...
Attributes: - success
6259906bd486a94d0ba2d7cf
class SynchronousSuiteClearingTests(SuiteClearingMixin, unittest.SynchronousTestCase): <NEW_LINE> <INDENT> TestCase = unittest.SynchronousTestCase
Tests for our extension that allows us to clear out a L{TestSuite} in the synchronous case. See L{twisted.trial.test.test_tests.SuiteClearingMixin}
6259906bfff4ab517ebcf02b
class Place(BaseModel): <NEW_LINE> <INDENT> city_id = "" <NEW_LINE> user_id = "" <NEW_LINE> name = "" <NEW_LINE> description = "" <NEW_LINE> number_rooms = 0 <NEW_LINE> number_bathrooms = 0 <NEW_LINE> max_guest = 0 <NEW_LINE> price_by_night = 0 <NEW_LINE> latitude = 0.0 <NEW_LINE> longitude = 0.0 <NEW_LINE> amenity_ids...
[Place] Args: BaseModel ([class]): class that inherited by Place
6259906b67a9b606de5476aa
class SwiftBackendTest(BaseTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> BaseTest.setUp(self) <NEW_LINE> self.backend = Swift() <NEW_LINE> self.conn = mock.Mock() <NEW_LINE> mock.patch.object(self.backend, 'conn', self.conn).start() <NEW_LINE> <DEDENT> def test_download_missing(self): <NEW_LINE> <INDE...
We can talk to Swift as expected.
6259906b3cc13d1c6d466f56
class RoleType(TypeDefinition): <NEW_LINE> <INDENT> DEVELOPER = 1 <NEW_LINE> SELLER = 2
角色对象类型
6259906b92d797404e389763
class PygameMouseController(Controller): <NEW_LINE> <INDENT> import pygame <NEW_LINE> import pygame.locals <NEW_LINE> def __init__(self,event_handler): <NEW_LINE> <INDENT> Controller.__init__(self,event_handler) <NEW_LINE> self.MOUSE_MOVE=event_handler.new_event_type() <NEW_LINE> self.MOUSE_BTN1_DOWN=event_handler.new_...
A Mouse controller The tyes have the format {'Type': ID, 'Pos': Position (where? in Viewer?)where the event ocurred, 'BTN1': True o False if button 1 is pressed, 'BTN2' idem, 'BTN3' idem}
6259906b8da39b475be049fc
class invisibility_of(object): <NEW_LINE> <INDENT> def __init__(self, element): <NEW_LINE> <INDENT> self.element = element <NEW_LINE> <DEDENT> def __call__(self, driver): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return (not self.element.is_displayed()) <NEW_LINE> <DEDENT> except EC.StaleElementReferenceException: <...
Checks for a known element to be invisible. Much like the builtin visibility_of: https://github.com/SeleniumHQ/selenium/search?utf8=%E2%9C%93&q=visibility_of
6259906b6e29344779b01e65
class FlipUD(Scale): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__(1, [-1, 1])
Flip up-down.
6259906b2ae34c7f260ac8f9
class CustomLoginViewTests(ViewTestingMixin, TestCase): <NEW_LINE> <INDENT> data = TestData() <NEW_LINE> view_class = CustomLoginView <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> data = self.data.get_customer_data() <NEW_LINE> form = CustomerCreationForm(data=data) <NEW_LINE> form.is_valid() <NEW_LINE> self.user_cus...
Testing login view permissions and redirection. Only the perrmisions are tested because the view inherts the login behaviour from the Django built-in LoginView.
6259906bdd821e528d6da589
class AuthorizationMixin(object): <NEW_LINE> <INDENT> authorization_filter_class = None <NEW_LINE> def get_authorization_filter_class(self): <NEW_LINE> <INDENT> return self.authorization_filter_class <NEW_LINE> <DEDENT> def get_queryset(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> queryset = super().get_queryset...
Mixin for filter queryset according the defined list of backend. :keyword filter_backends: filter backend list
6259906bac7a0e7691f73cf8
class EventsTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> events.unbindAll() <NEW_LINE> self.ctr = 0 <NEW_LINE> self.responses = None <NEW_LINE> <DEDENT> def _raiseException(self, event): <NEW_LINE> <INDENT> raise Exception('Failure condition') <NEW_LINE> <DEDENT> def _increment(...
This test case is just a unit test of the girder.events system. It does not require the server to be running, or any use of the database.
6259906b23849d37ff8528c7
class HotClient(redis.Redis): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> kwargs.setdefault("decode_responses", True) <NEW_LINE> super(HotClient, self).__init__(*args, **kwargs) <NEW_LINE> requires_luabit = ("number_and", "number_or", "number_xor", "number_lshift", "number_rshift") <NEW...
A Redis client wrapper that loads Lua functions and creates client methods for calling them.
6259906b3d592f4c4edbc6f1
class loginTest(myunit.MyTest): <NEW_LINE> <INDENT> def user_login_verify(self,username,password): <NEW_LINE> <INDENT> login(self.driver).user_login(username,password) <NEW_LINE> <DEDENT> def test_login(self): <NEW_LINE> <INDENT> self.user_login_verify("username111","password111") <NEW_LINE> function.screenshot_name(se...
百度登录测试
6259906b1b99ca400229013e
class AsyncRequestHandler(RequestHandler): <NEW_LINE> <INDENT> def on_response(self, response): <NEW_LINE> <INDENT> if response.error: <NEW_LINE> <INDENT> self.send_error(500) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> data = json.loads(response.body) <NEW_LINE> self.write(data) <NEW_LINE> <DEDENT> self.finish() <NE...
类比diango中的视图
6259906bf548e778e596cd9e
class User: <NEW_LINE> <INDENT> def __init__(self, username, password): <NEW_LINE> <INDENT> self.username = username <NEW_LINE> self.password = password
A user object.
6259906b5fcc89381b266d5f
class AccelStamped(metaclass=Metaclass): <NEW_LINE> <INDENT> __slots__ = [ '_header', '_accel', ] <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> assert all(['_' + key in self.__slots__ for key in kwargs.keys()]), 'Invalid arguments passed to constructor: %r' % kwargs.keys() <NEW_LINE> from std_...
Message class 'AccelStamped'.
6259906b8e7ae83300eea8a0
class TensorBoardCallBack(tf.keras.callbacks.TensorBoard): <NEW_LINE> <INDENT> def on_train_batch_begin(self, batch, logs=None): <NEW_LINE> <INDENT> super(TensorBoardCallBack, self).on_train_batch_begin(batch, logs) <NEW_LINE> try: <NEW_LINE> <INDENT> lr = self.model.optimizer.learning_rate(batch) <NEW_LINE> <DEDENT> e...
Tensorboard callback with added metrics.
6259906b4a966d76dd5f06fc
class WorkloadProtectableItem(Model): <NEW_LINE> <INDENT> _validation = { 'protectable_item_type': {'required': True}, } <NEW_LINE> _attribute_map = { 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, 'protection_state': {'key': 'protectio...
Base class for backup item. Workload-specific backup items are derived from this class. :param backup_management_type: Type of backup managemenent to backup an item. :type backup_management_type: str :param friendly_name: Friendly name of the backup item. :type friendly_name: str :param protection_state: State of the...
6259906b4e4d562566373c18
class SegmentationFeeder: <NEW_LINE> <INDENT> def __call__(self, affinities, segmentation, foreground_mask=None): <NEW_LINE> <INDENT> if foreground_mask is not None: <NEW_LINE> <INDENT> assert foreground_mask.shape == segmentation.shape <NEW_LINE> segmentation = segmentation.astype('int64') <NEW_LINE> segmentation = np...
A simple function that expects affinities and initial segmentation (with optional foreground mask) and can be used as "superpixel_generator" for GASP
6259906b4f6381625f19a0b0
class TestTransactionFlags(TestPythonClientBase, vtgate_client_testsuite.TestTransactionFlags): <NEW_LINE> <INDENT> pass
Success test cases for the Python client.
6259906b7b25080760ed88eb
class TestHeldKarp(unittest.TestCase): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def read_process_tsp(file_name): <NEW_LINE> <INDENT> file_ = open(file_name, 'rb') <NEW_LINE> count, cities = q1.parse_cities(file_) <NEW_LINE> return held_karp.held_karp_dicts(cities, count, False) <NEW_LINE> <DEDENT> @staticmethod <NE...
unittest module for testing the held-karp algo on example TSPs.
6259906b8da39b475be049fe
class CosmosPatchTransformPolicy(SansIOHTTPPolicy): <NEW_LINE> <INDENT> def on_request(self, request): <NEW_LINE> <INDENT> if request.http_request.method == "PATCH": <NEW_LINE> <INDENT> _transform_patch_to_cosmos_post(request.http_request)
Policy to transform PATCH requests into POST requests with the "X-HTTP-Method":"MERGE" header set.
6259906b92d797404e389764
class TestAuthentication(TestController): <NEW_LINE> <INDENT> application_under_test = 'main' <NEW_LINE> def test_forced_login(self): <NEW_LINE> <INDENT> resp = self.app.get('/secc/', status=302) <NEW_LINE> ok_( resp.location.startswith('http://localhost/login')) <NEW_LINE> resp = resp.follow(status=200) <NEW_LINE> for...
Tests for the default authentication setup. If your application changes how the authentication layer is configured those tests should be updated accordingly
6259906b2ae34c7f260ac8fb
class AbsoluteURLRedirectMiddleware(object): <NEW_LINE> <INDENT> def process_response(self, request, response): <NEW_LINE> <INDENT> if (_uses_relative_redirects and 'Location' in response and request.get_host()): <NEW_LINE> <INDENT> response['Location'] = request.build_absolute_uri(response['Location']) ...
Middleware that turns all relative URL redirects to absolute. Django 1.9 changed URL redirects to be relative by default (so long as they're redirecting to the same host). For compatibility across Django versions (and to theoretically work around some broken HTTP implementations out in the wild), this middleware will ...
6259906b45492302aabfdcea
class ResetInstancesResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.RequestId = params.get("RequestId")
ResetInstances返回参数结构体
6259906bdd821e528d6da58a
class CadernetaList(generics.ListAPIView): <NEW_LINE> <INDENT> queryset = Caderneta.objects.all() <NEW_LINE> serializer_class = CadernetaSerializer <NEW_LINE> paginate_by = 10
List all Cadernetas in EBD.
6259906b435de62698e9d619
class frontend: <NEW_LINE> <INDENT> title_color = color("steelblue2") <NEW_LINE> subtitle_color = color("dodgerblue4") <NEW_LINE> @staticmethod <NEW_LINE> def flavortext(body, delay_ms, *, end=None, factor = 10): <NEW_LINE> <INDENT> if end == None: <NEW_LINE> <INDENT> end = '' <NEW_LINE> <DEDENT> stream.echo(" *" + " ...
Frontend collections
6259906b3539df3088ecdab1
class SynoNasSensor(Entity): <NEW_LINE> <INDENT> def __init__(self, api, variable, variable_info, monitor_device=None): <NEW_LINE> <INDENT> self.var_id = variable <NEW_LINE> self.var_name = variable_info[0] <NEW_LINE> self.var_units = variable_info[1] <NEW_LINE> self.var_icon = variable_info[2] <NEW_LINE> self.monitor_...
Representation of a Synology NAS Sensor.
6259906ba8370b77170f1bd9
class TestKernel(kernels_lib.PositiveSemidefiniteKernel): <NEW_LINE> <INDENT> def __init__(self, multiplier): <NEW_LINE> <INDENT> self._multiplier = tf.convert_to_tensor(multiplier) <NEW_LINE> super(TestKernel, self).__init__(feature_ndims=1) <NEW_LINE> <DEDENT> def _batch_shape(self): <NEW_LINE> <INDENT> return self._...
A PositiveSemidefiniteKernel implementation just for testing purposes. k(x, y) = m * sum(x + y) Not at all positive semidefinite, but we don't care about this here.
6259906b23849d37ff8528c9
class MFloatVectorArray( api.MFloatVectorArray, ArrayBase ): <NEW_LINE> <INDENT> _apicls = api.MFloatVectorArray <NEW_LINE> def __iter__( self ): <NEW_LINE> <INDENT> for i in xrange(len(self)): <NEW_LINE> <INDENT> yield _floatvectorarray_getitem( self, i )
Wrap MFloatVector to make it compatible to pythonic contructs. :note: for performance reasons, we do not provide negative index support
6259906b97e22403b383c720
class TestMain(unittest.TestCase): <NEW_LINE> <INDENT> @patch.object(main, 'get_logger') <NEW_LINE> @patch.object(main.docker, 'from_env') <NEW_LINE> @patch.object(main.time, 'sleep') <NEW_LINE> def test_main(self, fake_sleep, fake_from_env, fake_get_logger): <NEW_LINE> <INDENT> fake_sleep.side_effect = RuntimeError('b...
A suite of test cases for the ``main`` function
6259906bf548e778e596cda0
class HostnamePoll(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.counterlist = [] <NEW_LINE> <DEDENT> def highest_count_type(self): <NEW_LINE> <INDENT> winner = '' <NEW_LINE> notzeroflag = False <NEW_LINE> for o in self.counterlist: <NEW_LINE> <INDENT> if o.count > 0: <NEW_LINE> <INDENT> notzerofl...
Holder for all HostnameCounters. Has methods to sort based on highest count.
6259906ba219f33f346c801b
class Volume_type_access(extensions.ExtensionDescriptor): <NEW_LINE> <INDENT> name = "VolumeTypeAccess" <NEW_LINE> alias = "os-volume-type-access" <NEW_LINE> namespace = ("http://docs.openstack.org/volume/" "ext/os-volume-type-access/api/v1") <NEW_LINE> updated = "2014-06-26T00:00:00Z" <NEW_LINE> def get_resources(self...
Volume type access support.
6259906b76e4537e8c3f0d96
class Stream(PlotlyDict): <NEW_LINE> <INDENT> pass
A dictionary-like object representing a data stream.
6259906b99fddb7c1ca639da
class ST_Transform(GenericFunction): <NEW_LINE> <INDENT> name = 'ST_Transform' <NEW_LINE> type = Geometry
Exposes PostGIS ST_Transform function
6259906b3539df3088ecdab2
class NytNotFoundError(NytCongressError): <NEW_LINE> <INDENT> pass
Exception for things not found
6259906be1aae11d1e7cf417
class LIRCMOP4(LIRCMOP2): <NEW_LINE> <INDENT> def __init__(self, number_of_variables: int = 30): <NEW_LINE> <INDENT> super(LIRCMOP4, self).__init__(number_of_variables) <NEW_LINE> <DEDENT> def evaluate_constraints(self, solution: FloatSolution) -> FloatSolution: <NEW_LINE> <INDENT> x = solution.variables <NEW_LINE> con...
Class representing problem LIR-CMOP4, defined in: * An Improved epsilon-constrained Method in MOEA/D for CMOPs with Large Infeasible Regions. Fan, Z., Li, W., Cai, X. et al. Soft Comput (2019). https://doi.org/10.1007/s00500-019-03794-x
6259906b2ae34c7f260ac8fc
class TaskRegistry(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._registry = {} <NEW_LINE> <DEDENT> def __contains__(self, item): <NEW_LINE> <INDENT> return item in self._registry <NEW_LINE> <DEDENT> def register(self, task): <NEW_LINE> <INDENT> if not isinstance(task, Task): <NEW_LINE> <IND...
A registry for the vPoller tasks
6259906be76e3b2f99fda215
class ConnectionMonitorResultProperties(ConnectionMonitorParameters): <NEW_LINE> <INDENT> _validation = { 'source': {'required': True}, 'destination': {'required': True}, } <NEW_LINE> _attribute_map = { 'source': {'key': 'source', 'type': 'ConnectionMonitorSource'}, 'destination': {'key': 'destination', 'type': 'Connec...
Describes the properties of a connection monitor. All required parameters must be populated in order to send to Azure. :param source: Required. Describes the source of connection monitor. :type source: ~azure.mgmt.network.v2018_08_01.models.ConnectionMonitorSource :param destination: Required. Describes the destinati...
6259906b01c39578d7f1433f
class SD(_SDPacketBase): <NEW_LINE> <INDENT> SOMEIP_MSGID_SRVID = 0xffff <NEW_LINE> SOMEIP_MSGID_SUBID = 0x1 <NEW_LINE> SOMEIP_MSGID_EVENTID = 0x100 <NEW_LINE> SOMEIP_CLIENT_ID = 0x0000 <NEW_LINE> SOMEIP_MINIMUM_SESSION_ID = 0x0001 <NEW_LINE> SOMEIP_PROTO_VER = 0x01 <NEW_LINE> SOMEIP_IFACE_VER = 0x01 <NEW_LINE> SOMEIP_...
SD Packet NOTE : when adding 'entries' or 'options', do not use list.append() method but create a new list e.g. : p = SD() p.option_array = [SDOption_Config(),SDOption_IP6_EndPoint()]
6259906b7b25080760ed88ec
class HostBase(object): <NEW_LINE> <INDENT> @property <NEW_LINE> def fields(self): <NEW_LINE> <INDENT> return {"id", "name"} <NEW_LINE> <DEDENT> @property <NEW_LINE> def key(self): <NEW_LINE> <INDENT> return const.MN_HOSTS
Expected format: "hosts": [{"id": UUID, "name": String}, ...],
6259906b4e4d562566373c1b
class Highlander(Exception): <NEW_LINE> <INDENT> pass
There can be only one Layout or Widget with certain options set (designed to fill the rest of the screen). If you hit this exception you have a bug in your application. If you don't get the name, take a look at this link: https://en.wikipedia.org/wiki/Highlander_(film)
6259906b8e71fb1e983bd2dc
class GlobalWaypoint: <NEW_LINE> <INDENT> def __init__(self,lat=None,lon=None,alt=None): <NEW_LINE> <INDENT> self.latitude = lat <NEW_LINE> self.longitude = lon <NEW_LINE> self.altitude = alt <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_waypoint_message(cls,wp): <NEW_LINE> <INDENT> if msg.Waypoint.FRAME_GLOBAL ...
Utility class for representing waypoints in global frame
6259906b2ae34c7f260ac8fd
class DnsService(service_description.ServiceDescription): <NEW_LINE> <INDENT> supported_versions = { '2': _proxy.Proxy }
The DNS service.
6259906bd486a94d0ba2d7d4
class Collections(enum.Enum): <NEW_LINE> <INDENT> PROJECTS = ( 'projects', 'projects/{projectsId}', {}, [u'projectsId'] ) <NEW_LINE> PROJECTS_LOCATIONS = ( 'projects.locations', '{+name}', { '': 'projects/{projectsId}/locations/{locationsId}', }, [u'name'] ) <NEW_LINE> PROJECTS_LOCATIONS_INSTANCES = ( 'projects.locatio...
Collections for all supported apis.
6259906b460517430c432c60
class ExecComparison(object): <NEW_LINE> <INDENT> def get_command(self, reference_filepath, other_filepath, **kwargs): <NEW_LINE> <INDENT> raise NotImplementedError("Method must be implemented")
Class ExecComparison is interface for comparison which compares two files using external binary file
6259906b55399d3f05627d36
@implementer(IATTopicSearchCriterion) <NEW_LINE> class ATRelativePathCriterion(ATBaseCriterion): <NEW_LINE> <INDENT> security = ClassSecurityInfo() <NEW_LINE> schema = ATRelativePathCriterionSchema <NEW_LINE> meta_type = 'ATRelativePathCriterion' <NEW_LINE> archetype_name = 'Relative Path Criterion' <NEW_LINE> shortDes...
A path criterion
6259906b99cbb53fe68326fc
class BadPropertyError (PyXBException): <NEW_LINE> <INDENT> pass
Raised when a schema component property is accessed on a component instance that does not define that property.
6259906bd268445f2663a767
class AccessoryMDNSServiceInfo(ServiceInfo): <NEW_LINE> <INDENT> def __init__(self, accessory, state, zeroconf_server=None): <NEW_LINE> <INDENT> self.accessory = accessory <NEW_LINE> self.state = state <NEW_LINE> adv_data = self._get_advert_data() <NEW_LINE> valid_name = self._valid_name() <NEW_LINE> short_mac = self.s...
A mDNS service info representation of an accessory.
6259906b1b99ca4002290140
class Region(object): <NEW_LINE> <INDENT> def __init__(self, region_name, profile=None): <NEW_LINE> <INDENT> self.session = botocore.session.get_session() <NEW_LINE> self.session.profile = profile <NEW_LINE> self.region_name = region_name <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return self.region_na...
Represents a specific region and a specific set of credentials. Using the ``Region`` object you can then create ``ServiceEndpoints`` to talk to a specific service within that region and using those credentials. :type region_name: str :param region_name: The name of the region (e.g. us-east-1). :type profile: str :par...
6259906b76e4537e8c3f0d98
@dependency.provider('endpoint_filter_api') <NEW_LINE> @dependency.requires('catalog_api', 'resource_api') <NEW_LINE> class Manager(manager.Manager): <NEW_LINE> <INDENT> driver_namespace = 'keystone.endpoint_filter' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(Manager, self).__init__(CONF.endpoint_filter.dr...
Default pivot point for the Endpoint Filter backend. See :mod:`keystone.common.manager.Manager` for more details on how this dynamically calls the backend.
6259906bf7d966606f7494c6
class SearchForUsers(ListModelView): <NEW_LINE> <INDENT> resource = UserResource <NEW_LINE> permissions = (IsAuthenticated, IsAnyAdmin) <NEW_LINE> minimum_characters = 2 <NEW_LINE> response_limit = 10 <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> querystring = self.request.GET.get('query', '') <NEW_LINE> if le...
Provides an API suited for autocompleting users. # GET Search for users by: - Full name - Username - Email Uses case-ignore-contains search. ## Parameters The search is specified in the ``query`` parameter in the querystring. ## Response A list of 0 to 10 users with the following attributes for each user: - ``id`...
6259906b44b2445a339b756a
class CityJsonLoaderDialogTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.dialog = CityJsonLoaderDialog(None) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self.dialog = None <NEW_LINE> <DEDENT> def test_dialog_ok(self): <NEW_LINE> <INDENT> button = self.dialog.butto...
Test dialog works.
6259906b4428ac0f6e659d48
class TissueRadiusFitter(object): <NEW_LINE> <INDENT> def __init__(self, sim_params): <NEW_LINE> <INDENT> self.sim_params = sim_params <NEW_LINE> self.krogh_sol = KroghSolution2DCone(sim_params) <NEW_LINE> <DEDENT> def fit_mean_oxygen_extraction_rate(self, hb_a, hb_v): <NEW_LINE> <INDENT> self.sim_params['HbInlet'] = h...
Provides fitting functions for the oxygen extraction from a capillary as a function of RBC flow and hemoglobin saturation drop. The computations rely on the Krogh cylinder model. Attributes: sim_params (SimulationParameters): simulation parameters krogh_sol (KroghSolution2DCone): solver for Krogh model
6259906b4f6381625f19a0b2