code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Pools(Client): <NEW_LINE> <INDENT> def __init__(self, host=None, port=None, user=None, password=None, api_version=None, ssl_verify=None): <NEW_LINE> <INDENT> super(Pools, self).__init__(host, port, user, password, api_version, ssl_verify) <NEW_LINE> self.config_path = '{0}/config/active/pools/'.format(self.api_ve... | Class for interacting with Pools via the REST API | 6259905cd7e4931a7ef3d694 |
class CirculationTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_get_active_mode_on(self) -> None: <NEW_LINE> <INDENT> circulation = _circulation() <NEW_LINE> circulation.operating_mode = OperatingModes.ON <NEW_LINE> active_mode = circulation.active_mode <NEW_LINE> self.assertEqual(OperatingModes.ON, active_mode.... | Test class. | 6259905c45492302aabfdaf9 |
class AssignMemberView(View): <NEW_LINE> <INDENT> def get(self, *args, **kwargs): <NEW_LINE> <INDENT> ticket = Ticket.objects.get(id=kwargs.get('ticket_id')) <NEW_LINE> assigned = ticket.assigned.all() <NEW_LINE> unassigned = Board.objects.get( id=ticket.lists.board_id).member.exclude(id__in=assigned).values() <NEW_LIN... | Assign member to a card | 6259905c32920d7e50bc7666 |
class BaseProgram(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.defaults = PARAM_DEFAULTS.copy() <NEW_LINE> self.params = PARAM_DEFAULTS.copy() <NEW_LINE> self.codes = PARAM_CODES.copy() <NEW_LINE> <DEDENT> def add_params(self, defaults, codes): <NEW_LINE> <INDENT> self.defaults.update(defau... | Implements the general aspects of robot programs and basic server
communcation. Also manages the parameter dictionary. | 6259905cbe8e80087fbc06a4 |
class MarkdownSlideshowCommand(sublime_plugin.TextCommand): <NEW_LINE> <INDENT> def run(self, edit, themes=None, theme='default', extensions=[], clean=False, output_file=None, browser=True, presenter=False, save=None, path=None): <NEW_LINE> <INDENT> opts = { 'themes': themes, 'theme': theme, 'contents': self.view.subst... | slideshow in your web browser from file contents | 6259905c498bea3a75a5910d |
class semicolon(parser.semicolon): <NEW_LINE> <INDENT> def __init__(self, sString=';'): <NEW_LINE> <INDENT> parser.semicolon.__init__(self) | unique_id = selected_waveform_assignment : semicolon | 6259905c91f36d47f223199f |
class SurfaceBaseSeries(BaseSeries): <NEW_LINE> <INDENT> is_3Dsurface = True <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(SurfaceBaseSeries, self).__init__() <NEW_LINE> self.surface_color = None <NEW_LINE> <DEDENT> def get_color_array(self): <NEW_LINE> <INDENT> np = import_module('numpy') <NEW_LINE> c = sel... | A base class for 3D surfaces. | 6259905c23849d37ff8526e6 |
class CancelFulfillmentOrderInputSet(InputSet): <NEW_LINE> <INDENT> def set_AWSAccessKeyId(self, value): <NEW_LINE> <INDENT> super(CancelFulfillmentOrderInputSet, self)._set_input('AWSAccessKeyId', value) <NEW_LINE> <DEDENT> def set_AWSMarketplaceId(self, value): <NEW_LINE> <INDENT> super(CancelFulfillmentOrderInputSet... | An InputSet with methods appropriate for specifying the inputs to the CancelFulfillmentOrder
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 6259905c8e71fb1e983bd0eb |
class Error(Exception): <NEW_LINE> <INDENT> pass | Base ClientDeployInfo Exception type. | 6259905c8e7ae83300eea6ae |
class Privileges(plugin.VerbosityMixIn, common.WinProcessFilter): <NEW_LINE> <INDENT> name = "privileges" <NEW_LINE> table_header = plugin.PluginHeader( dict(name="Process", type="_EPROCESS"), dict(name="Value", width=3, align="r"), dict(name="Privileges", width=40), dict(name="Attributes", type="list") ) <NEW_LINE> de... | Prints process privileges. | 6259905c16aa5153ce401b04 |
class BlazeShareBuybackAuthLoaderNotInteractiveTestCase( BlazeShareBuybackAuthLoaderTestCase): <NEW_LINE> <INDENT> def loader_args(self, dates): <NEW_LINE> <INDENT> (bound_expr,) = super( BlazeShareBuybackAuthLoaderNotInteractiveTestCase, self, ).loader_args(dates) <NEW_LINE> return swap_resources_into_scope(bound_expr... | Test case for passing a non-interactive symbol and a dict of resources.
| 6259905c4428ac0f6e659b5e |
class Campaign: <NEW_LINE> <INDENT> def __init__(self, parser): <NEW_LINE> <INDENT> self.parser = parser <NEW_LINE> self.name = self.parser.get_text_val("name") <NEW_LINE> self.id = self.parser.get_text_val("id") <NEW_LINE> self.description = self.parser.get_text_val("description") <NEW_LINE> self.levels = len(self.par... | A class for a specific campaign. | 6259905c462c4b4f79dbd027 |
class IAtlasSaver(_object): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, IAtlasSaver, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, IAtlasSaver, name) <NEW_LINE> __repr__ = _swig_rep... | Proxy of C++ FIFE::IAtlasSaver class | 6259905ca17c0f6771d5d6b3 |
class ComplexPasswordValidator: <NEW_LINE> <INDENT> def validate(self, password, user=None): <NEW_LINE> <INDENT> if re.search('([A-Za-z]+[0-9]|[0-9]+[A-Za-z])[A-Za-z0-9]*', password) is None: <NEW_LINE> <INDENT> raise ValidationError("Пароль не удовлетворяет требованиям", ) <NEW_LINE> <DEDENT> <DEDENT> def get_help_tex... | Validate whether the password contains minimum one uppercase, one digit and one symbol. | 6259905c16aa5153ce401b05 |
class Level(): <NEW_LINE> <INDENT> def __init__(self, player): <NEW_LINE> <INDENT> self.backgroundImage = None <NEW_LINE> self.world_shift = 0 <NEW_LINE> self.player = player <NEW_LINE> <DEDENT> def update(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def draw(self, screen): <NEW_LINE> <INDENT> screen.blit(self.b... | This is a generic super-class used to define a level.
Create a child class for each level with level-specific
info. | 6259905c67a9b606de5475b2 |
class SFTPServerFile: <NEW_LINE> <INDENT> def __init__(self, server): <NEW_LINE> <INDENT> self._server = server <NEW_LINE> self._file_obj = None <NEW_LINE> <DEDENT> @asyncio.coroutine <NEW_LINE> def stat(self, path): <NEW_LINE> <INDENT> attrs = self._server.stat(path) <NEW_LINE> if asyncio.iscoroutine(attrs): <NEW_LINE... | A wrapper around SFTPServer used to access files it manages | 6259905c3eb6a72ae038bc82 |
class Question(models.Model): <NEW_LINE> <INDENT> be_asked = models.TextField(verbose_name="вопрос экзаменатора") <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.be_asked <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = 'Вопрос' <NEW_LINE> verbose_name_plural = 'Вопросы' | Возможные вопросы для составления испытания | 6259905c097d151d1a2c2690 |
class ePOSElement: <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> text = None <NEW_LINE> attr = {} <NEW_LINE> local_attributes = {} <NEW_LINE> required_attributes = [] <NEW_LINE> def __init__(self, text=None, attr=None): <NEW_LINE> <INDENT> self.text = text <NEW_LINE> if attr is not None: <NEW_LINE> <INDENT> se... | Base class for the various elements in the ePOS object | 6259905c009cb60464d02b58 |
class TestRequirementFileParserTestCases(unittest.TestCase): <NEW_LINE> <INDENT> def test_empty_file(self): <NEW_LINE> <INDENT> packages = parse_requirements_file(open(os.path.join(BASE_PATH, 'files/requirements_empty.txt'))) <NEW_LINE> self.assertEqual(len(packages), 0) <NEW_LINE> <DEDENT> def test_file_with_comments(... | Test cases for parsing requirements files into packages | 6259905c4e4d562566373a2a |
class ElasticsearchFilterOnlyRetriever(ElasticsearchRetriever): <NEW_LINE> <INDENT> def retrieve(self, query: str, filters: dict = None, top_k: int = 10, index: str = None) -> List[Document]: <NEW_LINE> <INDENT> if index is None: <NEW_LINE> <INDENT> index = self.document_store.index <NEW_LINE> <DEDENT> documents = self... | Naive "Retriever" that returns all documents that match the given filters. No impact of query at all.
Helpful for benchmarking, testing and if you want to do QA on small documents without an "active" retriever. | 6259905c0c0af96317c57870 |
class BufferedConsumer(object): <NEW_LINE> <INDENT> def __init__(self, bytes_producer): <NEW_LINE> <INDENT> self.producer = bytes_producer <NEW_LINE> self.producer.consumer = self <NEW_LINE> self.buffer = StringIO() <NEW_LINE> <DEDENT> def resumeProducing(self): <NEW_LINE> <INDENT> if self.producer: <NEW_LINE> <INDENT>... | Consumer that stores the content in a internal buffer. | 6259905c8a43f66fc4bf37af |
class TestFileResponse(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 testFileResponse(self): <NEW_LINE> <INDENT> pass | FileResponse unit test stubs | 6259905ca219f33f346c7e28 |
class AgnosticClientBase(AgnosticBase): <NEW_LINE> <INDENT> database_names = AsyncRead() <NEW_LINE> server_info = AsyncRead() <NEW_LINE> alive = AsyncRead() <NEW_LINE> close_cursor = AsyncCommand() <NEW_LINE> drop_database = AsyncCommand().unwrap('MotorDatabase') <NEW_LINE> disconnect ... | MotorClient and MotorReplicaSetClient common functionality. | 6259905c91f36d47f22319a0 |
class MultiGroupMetaClass(list): <NEW_LINE> <INDENT> def __setitem__(self, index, element): <NEW_LINE> <INDENT> msg = '{} list elements should be instances of {}'.format( struct.metadata.name, struct_metaclass) <NEW_LINE> assert isinstance(element, struct_metaclass), msg <NEW_LINE> return super(MultiGroupMetaClass, sel... | Multivalued Group Metaclass. Metaclass used to ensure list
elements are instances of right metaclasses. | 6259905c63d6d428bbee3d99 |
class PopulateTestData(APIView): <NEW_LINE> <INDENT> def post(self, request, format=None): <NEW_LINE> <INDENT> new_location = request.data.get('locations') <NEW_LINE> if validate_data(new_location): <NEW_LINE> <INDENT> update_locations(new_location) <NEW_LINE> return HttpResponse(status=201) <NEW_LINE> <DEDENT> return ... | This end point is used to acquire live test data to store in text file as json
data can be used later to test on Android
post data ex:
{"locations": '{"lat": 1, "long": 1}''} | 6259905c3c8af77a43b68a52 |
class EditDistance(MetricBase): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> super(EditDistance, self).__init__(name) <NEW_LINE> self.total_distance = .0 <NEW_LINE> self.seq_num = 0 <NEW_LINE> self.instance_error = 0 <NEW_LINE> <DEDENT> def update(self, distances, seq_num): <NEW_LINE> <INDENT> if n... | Edit distance is a way of quantifying how dissimilar two strings
(e.g., words) are to one another by counting the minimum number
of operations required to transform one string into the other.
Refer to https://en.wikipedia.org/wiki/Edit_distance
Accumulate edit distance sum and sequence number from mini-batches and
com... | 6259905c3539df3088ecd8bf |
class JsonTokenAuthMiddleware(BaseJSONWebTokenAuthentication): <NEW_LINE> <INDENT> def __init__(self, app): <NEW_LINE> <INDENT> self.app = app <NEW_LINE> <DEDENT> async def __call__(self, scope, receive, send): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> jwt_value = get_jwt_value(scope) <NEW_LINE> user_id = jwt_decode... | Token authorization middleware for Django Channels 2 | 6259905c7047854f463409e4 |
class AlignAceConsumer(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> import warnings <NEW_LINE> warnings.warn("Bio.Motif.Parsers.AlignAce.AlignAceConsumer is deprecated; please use the read() function in this module instead.", Bio.BiopythonDeprecationWarning) <NEW_LINE> self.motifs=[] <NEW_LINE> ... | The general purpose consumer for the AlignAceScanner (DEPRECATED).
Should be passed as the consumer to the feed method of the AlignAceScanner. After 'consuming' the file, it has the list of motifs in the motifs property.
This class is DEPRECATED; please use the read() function in this module
instead. | 6259905c24f1403a926863e0 |
class EmbeddingGenerator(nn.Module): <NEW_LINE> <INDENT> def __init__(self, content_layers=[4], style_layers=[1,2,3,4,5]): <NEW_LINE> <INDENT> super(EmbeddingGenerator, self).__init__() <NEW_LINE> pretrained_model = models.vgg19(pretrained=True).features.eval().to(device) <NEW_LINE> for layer in pretrained_model: <NEW_... | Compute activations in content and style layers using pretrained VGG19 model | 6259905c99cbb53fe6832504 |
class TextInputField(RichTextInputField): <NEW_LINE> <INDENT> pass | Generic model for text input field. | 6259905c30dc7b76659a0d92 |
@api.route('/demo') <NEW_LINE> class DemoResource(Resource): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> return { 'status': 'success', 'message': 'get request successful', } | Resource class for demo use | 6259905cd99f1b3c44d06cc5 |
class TranslateProblem(text_problems.Text2TextProblem): <NEW_LINE> <INDENT> def is_generate_per_split(self): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def approx_vocab_size(self): <NEW_LINE> <INDENT> return 2**15 <NEW_LINE> <DEDENT> def source_data_files(self, dataset_split): <NEW_LINE> <INDENT> raise NotImpl... | Base class for translation problems. | 6259905c4a966d76dd5f0516 |
class ParentNodeRelatedField(serializers.PrimaryKeyRelatedField): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> article = Article.objects.get(id=self.context['view'].kwargs['article_id']) <NEW_LINE> return Comment.objects.filter(article=article, is_deleted=False) | 筛选可回复的评论:
1、同一篇文章的所有评论(包括自己的评论)
2、已经被删除的评论不能回复 | 6259905cf548e778e596cbae |
class WebSocketChannel(object): <NEW_LINE> <INDENT> addr = ['127.0.0.1'] <NEW_LINE> closed = 0 <NEW_LINE> def __init__(self, server, conn): <NEW_LINE> <INDENT> self.server = server <NEW_LINE> self.conn = conn <NEW_LINE> <DEDENT> def push(self, producer, send=1): <NEW_LINE> <INDENT> if type(producer) == str: <NEW_LINE> ... | Medusa channel for WebSocket server
| 6259905cb57a9660fecd309f |
class CourseRecord(models.Model): <NEW_LINE> <INDENT> class_obj = models.ForeignKey(verbose_name="班级", to="ClassList", on_delete=models.CASCADE) <NEW_LINE> day_num = models.IntegerField(verbose_name="节次", help_text=u"此处填写第几节课或第几天课程...,必须为数字") <NEW_LINE> teacher = models.ForeignKey(verbose_name="讲师", to='UserInfo',limit... | 上课记录表 (班级记录) | 6259905c097d151d1a2c2691 |
class OpBlacklistParser(object): <NEW_LINE> <INDENT> def __init__(self, blacklist_fp, api_model): <NEW_LINE> <INDENT> self.blacklist_fp = blacklist_fp <NEW_LINE> self.api_model = api_model <NEW_LINE> self._cfg_parser = ConfigParser.RawConfigParser(allow_no_value=True) <NEW_LINE> self._cfg_parser.optionxform = str <NEW_... | Parser for operations blacklist. | 6259905ca8370b77170f19f2 |
class ForwardingTable(_ValidatedDict): <NEW_LINE> <INDENT> def validate(self, dst, entry): <NEW_LINE> <INDENT> if not isinstance(dst, HostEntity): <NEW_LINE> <INDENT> raise ValueError("destination %s is not a host" % dst) <NEW_LINE> <DEDENT> if not isinstance(entry, ForwardingTableEntry): <NEW_LINE> <INDENT> raise Valu... | A forwarding table for a switch.
A `ForwardingTable` instance should be used as a `dict` mapping a
destination host to a ForwardingTableEntry (if any route is known). | 6259905ca79ad1619776b5cf |
class RepairType(models.Model): <NEW_LINE> <INDENT> _name = 'repair.type' <NEW_LINE> _description = 'Vehicle Repair Type' <NEW_LINE> name = fields.Char(string='Repair Type', translate=True) <NEW_LINE> @api.constrains('name') <NEW_LINE> def check_repair_type(self): <NEW_LINE> <INDENT> for repair in self: <NEW_LINE> <IND... | Repair Type. | 6259905c3d592f4c4edbc501 |
class BounterInitTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_default_init(self): <NEW_LINE> <INDENT> counter = bounter(7) <NEW_LINE> self.assertEqual(type(counter), HashTable) <NEW_LINE> <DEDENT> def test_no_size_init(self): <NEW_LINE> <INDENT> with self.assertRaises(ValueError): <NEW_LINE> <INDENT> counter =... | Basic test for factory method.
Tests for CountMinSketch and HashTable implementations found in respective subdirectories | 6259905ce5267d203ee6ced2 |
class TestInlineResponse200(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return InlineRespons... | InlineResponse200 unit test stubs | 6259905c3cc13d1c6d466d65 |
class QuickEntryForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Entry | Form for posting an entry quickly | 6259905cd7e4931a7ef3d696 |
class Pipeline: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._stages = [] <NEW_LINE> self.stats = Stats() <NEW_LINE> <DEDENT> def build(self, configuration): <NEW_LINE> <INDENT> builder = PipelineBuilder() <NEW_LINE> self._stages = builder.build(configuration, self.stats) <NEW_LINE> <DEDENT> def run... | Creates a pipeline and handles flow of the data within the logger. | 6259905c8e71fb1e983bd0ee |
class JsonCluster(Cluster): <NEW_LINE> <INDENT> def __init__(self, cluster_json=None): <NEW_LINE> <INDENT> super(JsonCluster, self).__init__() <NEW_LINE> if cluster_json is None: <NEW_LINE> <INDENT> cluster_json_path = os.path.abspath(os.path.join(os.getcwd(), "cluster.json")) <NEW_LINE> cluster_json = json.load(open(c... | An implementation of Cluster that uses static settings specified in a cluster file. | 6259905c15baa723494635b7 |
class EDTestCasePluginExecuteExecSaxsAddv1_0(EDTestCasePluginExecute): <NEW_LINE> <INDENT> def __init__(self, _strTestName=None): <NEW_LINE> <INDENT> EDTestCasePluginExecute.__init__(self, "EDPluginExecSaxsAddv1_0") <NEW_LINE> self.setDataInputFile(os.path.join(self.getPluginTestsDataHome(), ... | Those are all execution tests for the EDNA Exec plugin SaxsAddv1_0 | 6259905c0a50d4780f7068d1 |
class GraphIds(BrowserView): <NEW_LINE> <INDENT> @json <NEW_LINE> @formreq <NEW_LINE> def __call__(self, deviceIds=(), componentPaths=()): <NEW_LINE> <INDENT> graphIds = set() <NEW_LINE> if isinstance(deviceIds, basestring): <NEW_LINE> <INDENT> deviceIds = [deviceIds] <NEW_LINE> <DEDENT> if isinstance(componentPaths, b... | Get a list of the graph defs available for the given device
and component.
Adapts DeviceClasses. | 6259905ccc0a2c111447c5e1 |
class KlineIndexHandler(BaseHandler): <NEW_LINE> <INDENT> def get(self, *args, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> cur = self.db.cursor() <NEW_LINE> <DEDENT> except Exception as e: <NEW_LINE> <INDENT> logging.error("创建游标失败", e) <NEW_LINE> return self.write(dict(code=RET.DATAERR, errmsg=e)) <NEW_LINE... | kline 数据 | 6259905c2c8b7c6e89bd4e13 |
class TestIDMController(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> contr_params = {"v0": 30, "b": 1.5, "delta": 4, "s0": 2, "noise": 0} <NEW_LINE> vehicles = VehicleParams() <NEW_LINE> vehicles.add( veh_id="test", acceleration_controller=(IDMController, contr_params), routing_controlle... | Tests that the IDM Controller returning mathematically accurate values. | 6259905cbaa26c4b54d508cb |
class GANLoss(nn.Module): <NEW_LINE> <INDENT> def __init__(self, gan_mode, target_real_label=1.0, target_fake_label=0.0, random_label = 1, delta_rand = 0.15,reduction = "mean" ): <NEW_LINE> <INDENT> super(GANLoss, self).__init__() <NEW_LINE> self.register_buffer('real_label', torch.tensor(target_real_label)) <NEW_LINE>... | Define different GAN objectives.
The GANLoss class abstracts away the need to create the target label tensor
that has the same size as the input. | 6259905c24f1403a926863e1 |
@attributes(["command"]) <NEW_LINE> class Sudo(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_args(cls, command_args): <NEW_LINE> <INDENT> return cls(command=" ".join(map(shell_quote, command_args))) | Run a shell command on a remote host.
:param bytes command: The command to run. | 6259905c55399d3f05627b45 |
class CustomAdd(keras.layers.Add): <NEW_LINE> <INDENT> def compute_mask(self, inputs, mask=None): <NEW_LINE> <INDENT> return mask[0] | Embedding layer with weights returned. | 6259905cadb09d7d5dc0bb90 |
class EmbeddedResourceLinkField(SubField): <NEW_LINE> <INDENT> def __init__( self, resource_spec_class: Union[Type[ResourceSpec], str], alti_key: str = None, optional: bool = False, value_is_id: bool = False, ): <NEW_LINE> <INDENT> self._resource_spec_class = resource_spec_class <NEW_LINE> self.alti_key = alti_key <NEW... | An EmbeddedResourceLinkField is a ResourceLinkField where the input is the resource id
only, not a key/value where the value is a resource id.
Examples:
A link to a TestResourceSpec resource::
>>> from altimeter.core.graph.field.list_field import ListField
>>> from altimeter.core.resource.resource_... | 6259905c4a966d76dd5f0518 |
class SLBLoadBalancerAttribute(object): <NEW_LINE> <INDENT> def __init__(self, balancer, listeners, backend_servers, extra=None): <NEW_LINE> <INDENT> self.balancer = balancer <NEW_LINE> self.listeners = listeners or [] <NEW_LINE> self.backend_servers = backend_servers or [] <NEW_LINE> self.extra = extra or {} <NEW_LINE... | This class used to get listeners and backend servers related to a balancer
listeners is a ``list`` of ``dict``, each element contains
'ListenerPort' and 'ListenerProtocol' keys.
backend_servers is a ``list`` of ``dict``, each element contains
'ServerId' and 'Weight' keys. | 6259905c9c8ee82313040c9d |
class Unit(np.ndarray): <NEW_LINE> <INDENT> def __new__(cls, *args, **kwargs): <NEW_LINE> <INDENT> shape = len(baseunits) <NEW_LINE> obj = np.zeros(shape).view(cls) <NEW_LINE> if len(args) == 0: <NEW_LINE> <INDENT> return obj <NEW_LINE> <DEDENT> if len(args) == 1 and isinstance(args[0], basestring): <NEW_LINE> <INDENT>... | A unit representation.
Units are stored as simple vectors of real numbers, where each element is
the exponent of the corresponding base unit. For example, if the base
units are 'm', 's', 'kg', the unit
[1, -2, 0]
would represent an acceleration [m/s^2]. | 6259905cac7a0e7691f73b08 |
class ydError(RuntimeError): <NEW_LINE> <INDENT> def __init__(self, errno, errmsg): <NEW_LINE> <INDENT> self.errno = errno <NEW_LINE> self.errmsg = "{0}".format(errmsg) <NEW_LINE> self.args = (errno, errmsg) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.errmsg | Внутреннее исключение, выбрасываемое в случаях:
* Таймаут запроса к API
* Исчерпание количества попыток запроса к API
* Неверные аргументы, переданные в командной строке | 6259905c21bff66bcd72428b |
class ChewyTester(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_smth(self): <NEW_LINE> <INDENT> pass | Unit tests for [???] | 6259905c3cc13d1c6d466d66 |
class IQCSample(ISample): <NEW_LINE> <INDENT> veracis_id = schema.TextLine( title=_(u"QC Veracis Sample ID"), description=_(u"QC Veracis Sample ID"), defaultFactory=assignVeracisId(), required=True, ) <NEW_LINE> source_id_one = schema.TextLine( title=_(u"Primary QC Source Sample ID"), description=_(u"Primary QC Source ... | QC Sample!
| 6259905c009cb60464d02b5c |
class ConnectionMonitor(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'source': {'required': True}, 'destination': {'required': True}, } <NEW_LINE> _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'source': {'key': 'properties.source', 'type... | Parameters that define the operation to create a connection monitor.
All required parameters must be populated in order to send to Azure.
:param location: Connection monitor location.
:type location: str
:param tags: A set of tags. Connection monitor tags.
:type tags: dict[str, str]
:param source: Required. Describes... | 6259905c2ae34c7f260ac70d |
class TestSetup(unittest.TestCase): <NEW_LINE> <INDENT> layer = EEA_CEFTRANSLATIONS_INTEGRATION_TESTING <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.portal = self.layer['portal'] <NEW_LINE> self.installer = api.portal.get_tool('portal_quickinstaller') <NEW_LINE> <DEDENT> def test_product_installed(self): <NEW_L... | Test that eea.ceftranslations is properly installed. | 6259905ca219f33f346c7e2c |
class ControlList(LoginRequiredMixin, View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> start_year_of_check = date.today().year - 1 <NEW_LINE> list_of_coordinated_topics = get_list_of_coordinated_topics(request.user) <NEW_LINE> controls_in_history = Document.objects. filter(is... | lista kontroli z danego roku.
Pobiera kontrole z historii i bazy po czym wypisuje te których nie ma w historii.
Przenosi do widoku control_documents | 6259905c8e7ae83300eea6b4 |
class UserPasswordForm(FlaskForm): <NEW_LINE> <INDENT> username = StringField('User or Team name', validators=[DataRequired(), Regexp(r"^\w(\w| )*\w$", message="At least 2 alphanumeric characters with only spaces in between.") ] ) <NEW_LINE> password = PasswordField('Password', validators=[DataRequired(), Length(min=4)... | Username password form used for login. | 6259905c627d3e7fe0e084b2 |
class BeautiAccountAddMsg(messages.Message): <NEW_LINE> <INDENT> beautician = messages.MessageField(BeauticianAccountEditMsg, 1) | 美容師アカウント新規登録依頼メッセージ | 6259905c442bda511e95d86d |
class RemovalAgent( RequestAgentBase ): <NEW_LINE> <INDENT> def __init__( self, *args, **kwargs ): <NEW_LINE> <INDENT> self.setRequestType( "removal" ) <NEW_LINE> self.setRequestTask( RemovalTask ) <NEW_LINE> RequestAgentBase.__init__( self, *args, **kwargs ) <NEW_LINE> agentName = args[0] <NEW_LINE> self.monitor.regis... | .. class:: RemovalAgent
This agent is preocessing 'removal' requests read from RequestClient.
Each request is executed in a separate sub-process using ProcessPool and
RemovalTask.
Config Options
--------------
* set the number of requests to be processed in agent's cycle:
RequestsPerCycle = 10
* minimal number o... | 6259905ce64d504609df9ee2 |
@content( 'User', icon='icon-user', add_view='add_user', tab_order=('properties',), propertysheets = ( ('', UserPropertySheet), ) ) <NEW_LINE> @implementer(IUser) <NEW_LINE> class User(Folder): <NEW_LINE> <INDENT> pwd_manager = BCRYPTPasswordManager() <NEW_LINE> groupids = multireference_sourceid_property(UserToGroup) ... | Represents a user. | 6259905ccb5e8a47e493cc99 |
class AbsoluteConstraint(NeuralConstraint): <NEW_LINE> <INDENT> def __init__( self, time_step_spec, action_spec, constraint_network, error_loss_fn=tf.compat.v1.losses.mean_squared_error, comparator_fn=tf.greater, absolute_value=0.0, name='AbsoluteConstraint'): <NEW_LINE> <INDENT> self._absolute_value = absolute_value <... | Class for representing a trainable absolute value constraint.
This constraint class implements an absolute value constraint such as
```
expected_value(action) >= absolute_value
```
or
```
expected_value(action) <= absolute_value
``` | 6259905c3c8af77a43b68a54 |
class no_autoflush(object): <NEW_LINE> <INDENT> def __init__(self, session): <NEW_LINE> <INDENT> self.session = session <NEW_LINE> self.autoflush = session.autoflush <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self.session.autoflush = False <NEW_LINE> <DEDENT> def __exit__(self, *args, **kwargs): <NEW_... | A content manager that disables sqlalchemy's autoflush, restoring it afterwards.
Adapted from https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/DisableAutoflush | 6259905c8e7ae83300eea6b5 |
class TestInterfaceVrrpPriority(BaseActionTestCase): <NEW_LINE> <INDENT> action_cls = interface_vrrp_priority <NEW_LINE> def test_action(self): <NEW_LINE> <INDENT> action = self.get_action_instance() <NEW_LINE> mock_callback = MockCallback() <NEW_LINE> kwargs = { 'username': '', 'name': '10/0/2', 'ip': '', 'vrid': '10'... | Test holder class
| 6259905c3539df3088ecd8c3 |
class AuthProtocol(auth_token.AuthProtocol): <NEW_LINE> <INDENT> def _build_user_headers(self, token_info): <NEW_LINE> <INDENT> rval = super(AuthProtocol, self)._build_user_headers(token_info) <NEW_LINE> rval['X-Auth-Url'] = self.auth_uri <NEW_LINE> return rval | Subclass of keystoneclient auth_token middleware which also
sets the 'X-Auth-Url' header to the value specified in the config. | 6259905c99cbb53fe6832508 |
class ExpectationFailed(BadRequest): <NEW_LINE> <INDENT> code = 417 <NEW_LINE> message = "Expectation failed" <NEW_LINE> detail = ("The server could not meet the requirements indicated in" " the request's Expect header(s).") | Can't. always. get. what you want. | 6259905c435de62698e9d42c |
class MetadataItem: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def decode_int(s): <NEW_LINE> <INDENT> if s.startswith("0x"): <NEW_LINE> <INDENT> return int(s, 16) <NEW_LINE> <DEDENT> elif s.startswith("0"): <NEW_LINE> <INDENT> return int(s, 8) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return int(s, 10) <NEW_LINE>... | Metadata for a single file (or directory or...) from a snapshot. | 6259905c462c4b4f79dbd02d |
class GitHubRepoHandler(GithubClientMixin, BaseHandler): <NEW_LINE> <INDENT> async def get(self, user, repo): <NEW_LINE> <INDENT> response = await self.github_client.get_repo(user, repo) <NEW_LINE> default_branch = json.loads(response_text(response))["default_branch"] <NEW_LINE> new_url = self.from_base( "/", self.form... | redirect /github/user/repo to .../tree/master | 6259905c379a373c97d9a64c |
@pytest.mark.django_db <NEW_LINE> class TestConfirmAccountLink: <NEW_LINE> <INDENT> def setup(self): <NEW_LINE> <INDENT> self.user = UserFactory() <NEW_LINE> self.data = { 'first_name': self.user.first_name, 'last_name': self.user.last_name, 'email': self.user.email, 'password': self.user.password, 'confirm_password': ... | Test ConfrimAccountLink Function. | 6259905cf7d966606f7493cc |
class GyroscopeV1(CDPDataItem): <NEW_LINE> <INDENT> type = 0x012A <NEW_LINE> definition = [DIUInt64Attr('network_time'), DIInt32Attr('x'), DIInt32Attr('y'), DIInt32Attr('z'), DIUInt16Attr('scale')] | CDP Data Item: Ciholas Data Protocol Gyroscope V1 Definition | 6259905c3539df3088ecd8c4 |
class FeedbackDetail(ResourceDetail): <NEW_LINE> <INDENT> def before_get_object(self, view_kwargs): <NEW_LINE> <INDENT> event = None <NEW_LINE> if view_kwargs.get('event_id'): <NEW_LINE> <INDENT> event = safe_query(self, Event, 'id', view_kwargs['event_id'], 'event_id') <NEW_LINE> <DEDENT> elif view_kwargs.get('event_i... | Feedback Resource | 6259905c8da39b475be0480e |
class DiceLoss(nn.Module): <NEW_LINE> <INDENT> def __init__(self, smooth: Optional[float] = 1e-8, square_denominator: Optional[bool] = False, with_logits: Optional[bool] = True, reduction: Optional[str] = "mean") -> None: <NEW_LINE> <INDENT> super(DiceLoss, self).__init__() <NEW_LINE> self.reduction = reduction <NEW_LI... | Dice coefficient for short, is an F1-oriented statistic used to gauge the similarity of two sets.
Given two sets A and B, the vanilla dice coefficient between them is given as follows:
Dice(A, B) = 2 * True_Positive / (2 * True_Positive + False_Positive + False_Negative)
= 2 * |A and B| / (|A| + |B... | 6259905c1f037a2d8b9e537f |
class ISEOConfigTitleSchema_accessibilitypage(Interface): <NEW_LINE> <INDENT> accessibilitypage_title = schema.TextLine( title=_("label_accessibilitypage_title", default=u"Accessibility Title"), required=False) <NEW_LINE> accessibilitypage_description = schema.Text( title=_("label_accessibilitypage_description", defaul... | Schema for Title accessibilitypages | 6259905cac7a0e7691f73b0a |
class MinHashSignature(Signature): <NEW_LINE> <INDENT> def hash_functions(self): <NEW_LINE> <INDENT> def hash_factory(n): <NEW_LINE> <INDENT> return lambda x: hash("salt" + unicode(n) + unicode(x) + "salt") <NEW_LINE> <DEDENT> return [ hash_factory(_) for _ in range(self.dim) ] <NEW_LINE> <DEDENT> def sign(self, s): <N... | Creates signatures for sets/tuples using minhash. | 6259905c8a43f66fc4bf37b5 |
class TestSay(SpeakerbotClientTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestSay, self).setUp() <NEW_LINE> self.client._post = Mock() <NEW_LINE> <DEDENT> def test_calls_post_with_correct_arguments(self): <NEW_LINE> <INDENT> arg_dicts = [ { 'text': 'foo', 'record_utterance': False }, { 'text':... | Test say()
| 6259905c8e71fb1e983bd0f3 |
class Molecule(Body_data): <NEW_LINE> <INDENT> def __init__(self, data, molecule_id): <NEW_LINE> <INDENT> Body_data.__init__(self, data.atom_style) <NEW_LINE> self.extract(data, "molecule", molecule_id) | stores the body_data associated with a specific molecule | 6259905c7d43ff2487427f24 |
class AgentSequence(BaseHandler): <NEW_LINE> <INDENT> @require() <NEW_LINE> def get(self): <NEW_LINE> <INDENT> form = Form(self.request.arguments, list_schema) <NEW_LINE> sql = 'select s.short_name, em.amount eamount, em.remark eremark, ac.amount aamount, ac.remark aremark, ' 'em.created_by, em.created_at ... | 代理商资金明细 | 6259905c63b5f9789fe8679b |
class NucleotideArray(SequenceArray): <NEW_LINE> <INDENT> def __init__(self, input_obj, name='', description='', validate=False): <NEW_LINE> <INDENT> super().__init__(input_obj, name=name, seqtype='nucl', description=description, validate=validate) <NEW_LINE> <DEDENT> def to_codonarray(self): <NEW_LINE> <INDENT> return... | Nucleotide sequence array object constructor
This is a special type of SequenceArray for nucleotide sequences containing additional methods specific for
handling nucleotide sequence data. On instantiation, it constructs a SequenceArray object whose seqtype is set to
'nucl'.
NucleotideArray is suitable for both protei... | 6259905c56b00c62f0fb3ef4 |
class MediaAiAnalysisCoverItem(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.CoverPath = None <NEW_LINE> self.Confidence = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.CoverPath = params.get("CoverPath") <NEW_LINE> self.Confidence = params.get("Con... | 智能封面信息
| 6259905c16aa5153ce401b0d |
class SearchViewTest(TestCase): <NEW_LINE> <INDENT> def test_SearchOk(self): <NEW_LINE> <INDENT> response = self.client.get(reverse('search')) <NEW_LINE> self.assertEqual(response.status_code, 200) <NEW_LINE> <DEDENT> def test_SearchWithQueryOk(self): <NEW_LINE> <INDENT> response = self.client.get(reverse('search')+"?q... | Test search view | 6259905c4a966d76dd5f051c |
class BooleanField(Field): <NEW_LINE> <INDENT> def __init__(self, name=None,default=False): <NEW_LINE> <INDENT> super.__init__(name,'boolean',False,default) | docstring for BooleanField | 6259905c56ac1b37e63037fc |
class NumberedFormatter(FormatterMixin): <NEW_LINE> <INDENT> def notation_for_chord(self, chord): <NEW_LINE> <INDENT> if chord.chord_type == Chord.MINOR: <NEW_LINE> <INDENT> minor = '-' <NEW_LINE> chord_type = '' <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> chord_type = self.CHORD_TYPE_NOTATION.get(chord.chord_type, '... | Formats :class:`Chord`s into the standard numbered notation.
This is the inverse of :class:`NumberedParser`. | 6259905cb57a9660fecd30a5 |
@set_module('numpy') <NEW_LINE> class errstate(contextlib.ContextDecorator): <NEW_LINE> <INDENT> def __init__(self, *, call=_Unspecified, **kwargs): <NEW_LINE> <INDENT> self.call = call <NEW_LINE> self.kwargs = kwargs <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self.oldstate = seterr(**self.kwargs) <NE... | errstate(**kwargs)
Context manager for floating-point error handling.
Using an instance of `errstate` as a context manager allows statements in
that context to execute with a known error handling behavior. Upon entering
the context the error handling is set with `seterr` and `seterrcall`, and
upon exiting it is reset... | 6259905cbe8e80087fbc06ae |
class ValidationTest(APITestCase): <NEW_LINE> <INDENT> def test_if_date_is_future(self): <NEW_LINE> <INDENT> with self.assertRaises(ValidationError): <NEW_LINE> <INDENT> NotFuture(timezone('Europe/Rome').localize(datetime.datetime.now() + datetime.timedelta(days=1))) | Check if the date is from future | 6259905c009cb60464d02b5f |
class MMAEFilterBank(object): <NEW_LINE> <INDENT> def __init__(self, filters, p, dim_x, H=None): <NEW_LINE> <INDENT> assert len(filters) == len(p) <NEW_LINE> assert dim_x > 0 <NEW_LINE> self.filters = filters <NEW_LINE> self.p = asarray(p) <NEW_LINE> self.dim_x = dim_x <NEW_LINE> self.x = None <NEW_LINE> <DEDENT> def p... | Implements the fixed Multiple Model Adaptive Estimator (MMAE). This
is a bank of independent Kalman filters. This estimator computes the
likelihood that each filter is the correct one, and blends their state
estimates weighted by their likelihood to produce the state estimate.
Examples
--------
..code:
ca = make_... | 6259905c3cc13d1c6d466d6a |
class Request(pydantic.BaseModel): <NEW_LINE> <INDENT> symbol: typing.Optional[SYMBOL] <NEW_LINE> timestamp: TIMESTAMP_MS <NEW_LINE> recvWindow: typing.Optional[RECV_WINDOW] | Request model for endpoint GET https://api.binance.com/api/v3/openOrders
Model Fields:
-------------
symbol : str
If symbol is ommited, request weight = 40 (optional)
timestamp : float
Timestamp in millisecond
recvWindow : int
Number of milliseconds after timestamp the request is val... | 6259905ce5267d203ee6ced5 |
class mMulScalar(MulScalar): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> def __imul__(self, other): <NEW_LINE> <INDENT> other = convert(other, self.dtype) <NEW_LINE> for i, x in enumerate(self.flat): <NEW_LINE> <INDENT> self.flat[i] *= other <NEW_LINE> <DEDENT> return self <NEW_LINE> <DEDENT> def __itruediv__(self, o... | Inplace multiplication. | 6259905ca219f33f346c7e30 |
class RefundError(HelcimError): <NEW_LINE> <INDENT> pass | Exception to handle refund errors. | 6259905c009cb60464d02b60 |
class FrozenJobErrorHandler(ErrorHandler): <NEW_LINE> <INDENT> is_monitor = True <NEW_LINE> def __init__(self, output_filename="vasp.out", timeout=21600): <NEW_LINE> <INDENT> self.output_filename = output_filename <NEW_LINE> self.timeout = timeout <NEW_LINE> <DEDENT> def check(self): <NEW_LINE> <INDENT> st = os.stat(se... | Detects an error when the output file has not been updated
in timeout seconds. Changes ALGO to Normal from Fast | 6259905c2ae34c7f260ac711 |
class OraDirectory(OraObject): <NEW_LINE> <INDENT> def __init__(self, directoryOwner="", directoryName=""): <NEW_LINE> <INDENT> OraObject.__init__(self, directoryOwner, directoryName, "DIRECTORY") <NEW_LINE> <DEDENT> def getPath(self, db): <NEW_LINE> <INDENT> result = db.executeAll(directorySql["pathFromName"], [self.g... | Oracle directory object | 6259905cfff4ab517ebcee4f |
class LutronCasetaLight(LutronCasetaDevice, SwitchDevice): <NEW_LINE> <INDENT> async def async_turn_on(self, **kwargs): <NEW_LINE> <INDENT> self._smartbridge.turn_on(self._device_id) <NEW_LINE> <DEDENT> async def async_turn_off(self, **kwargs): <NEW_LINE> <INDENT> self._smartbridge.turn_off(self._device_id) <NEW_LINE> ... | Representation of a Lutron Caseta switch. | 6259905c32920d7e50bc7670 |
class reviews(models.Model): <NEW_LINE> <INDENT> book = models.OneToOneField(books, null=True, on_delete=models.CASCADE, ) <NEW_LINE> grReviewId = models.TextField() <NEW_LINE> dateCreated = models.BigIntegerField() <NEW_LINE> userName = models.TextField() <NEW_LINE> userUrl = models.TextField() <NEW_LINE> url = models... | reviews | 6259905c23e79379d538db26 |
class GPIODevice(Device): <NEW_LINE> <INDENT> def __init__(self, pin=None): <NEW_LINE> <INDENT> super(GPIODevice, self).__init__() <NEW_LINE> self._pin = None <NEW_LINE> if pin is None: <NEW_LINE> <INDENT> raise GPIOPinMissing('No pin given') <NEW_LINE> <DEDENT> if isinstance(pin, int): <NEW_LINE> <INDENT> pin = pin_fa... | Extends :class:`Device`. Represents a generic GPIO device and provides
the services common to all single-pin GPIO devices (like ensuring two
GPIO devices do no share a :attr:`pin`).
:param int pin:
The GPIO pin (in BCM numbering) that the device is connected to. If
this is ``None``, :exc:`GPIOPinMissing` will ... | 6259905c91f36d47f22319a4 |
class CapsuleLayer(nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_unit, in_channel, num_unit, unit_size, use_routing, num_routing, cuda_enabled): <NEW_LINE> <INDENT> super(CapsuleLayer, self).__init__() <NEW_LINE> self.in_unit = in_unit <NEW_LINE> self.in_channel = in_channel <NEW_LINE> self.num_unit = num_unit ... | The core implementation of the idea of capsules | 6259905c8e71fb1e983bd0f5 |
class Standard: <NEW_LINE> <INDENT> Specification = Callable[[DataFrame], DataFrame] <NEW_LINE> @staticmethod <NEW_LINE> def _mean(df: DataFrame) -> Series: <NEW_LINE> <INDENT> mean = df.mean() <NEW_LINE> mean.name = 'mean' <NEW_LINE> return mean <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _stack_as_rows(top: Seri... | Encapsulates Specifications for standardizing data as ``classmethods``.
A Specification is a function taking an (N,M+L) DataFrame ``df `` (to be standardized) as input and returning a (2,M+L) DataFrame.
The first row of the return contains (,M+L) ``loc`` values, the second row (,M+L) ``scale`` values.
Ultimately the ... | 6259905c45492302aabfdb03 |
class WildCard: <NEW_LINE> <INDENT> def __init__(self, wildcard, sep="|"): <NEW_LINE> <INDENT> self.pats = ["*"] <NEW_LINE> if wildcard: <NEW_LINE> <INDENT> self.pats = wildcard.split(sep) <NEW_LINE> <DEDENT> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return f"<{self.__class__.__name__}, patterns = {self.pats}>" <... | This object provides an easy-to-use interface for filename matching with
shell patterns (fnmatch).
>>> w = WildCard("*.nc|*.pdf")
>>> w.filter(["foo.nc", "bar.pdf", "hello.txt"])
['foo.nc', 'bar.pdf']
>>> w.filter("foo.nc")
['foo.nc'] | 6259905c01c39578d7f1424c |
class InjectDependency(): <NEW_LINE> <INDENT> dependencies = {} <NEW_LINE> def __init__(self, *dependenciesToInject): <NEW_LINE> <INDENT> self.dependenciesToInject = dependenciesToInject <NEW_LINE> <DEDENT> def __call__(self, targetObject): <NEW_LINE> <INDENT> for name in self.dependenciesToInject: <NEW_LINE> <INDENT> ... | "Dependency injection decorator for classes | 6259905c7b25080760ed87f5 |
class InternalCompose(object): <NEW_LINE> <INDENT> def __init__(self, transforms): <NEW_LINE> <INDENT> self.transforms = transforms <NEW_LINE> <DEDENT> def __call__(self, img, boxes=None, labels=None): <NEW_LINE> <INDENT> for t in self.transforms: <NEW_LINE> <INDENT> img, boxes, labels = t(img, boxes, labels) <NEW_LINE... | Composes several augmentations together.
Args:
transforms (List[Transform]): list of transforms to compose.
Example:
>>> augmentations.Compose([
>>> transforms.CenterCrop(10),
>>> transforms.ToTensor(),
>>> ]) | 6259905c63d6d428bbee3d9d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.