code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Cancel(TaskSpec): <NEW_LINE> <INDENT> def __init__(self, parent, name, success = False, **kwargs): <NEW_LINE> <INDENT> TaskSpec.__init__(self, parent, name, **kwargs) <NEW_LINE> self.cancel_successfully = success <NEW_LINE> <DEDENT> def test(self): <NEW_LINE> <INDENT> TaskSpec.test(self) <NEW_LINE> if len(self.ou...
This class cancels a complete workflow. If more than one input is connected, the task performs an implicit multi merge. If more than one output is connected, the task performs an implicit parallel split.
62599054dc8b845886d54ae8
class SUSY_Dataset(torch.utils.data.Dataset): <NEW_LINE> <INDENT> def __init__(self, data_file, root_dir, dataset_size, train=True, transform=None, high_level_feats=None): <NEW_LINE> <INDENT> features=['SUSY','lepton 1 pT', 'lepton 1 eta', 'lepton 1 phi', 'lepton 2 pT', 'lepton 2 eta', 'lepton 2 phi', 'missing energy m...
SUSY pytorch dataset.
6259905423849d37ff8525e8
class Level(object): <NEW_LINE> <INDENT> def __init__(self, player): <NEW_LINE> <INDENT> self.platform_list = pygame.sprite.Group() <NEW_LINE> self.enemy_list = pygame.sprite.Group() <NEW_LINE> self.player = player <NEW_LINE> self.background = None <NEW_LINE> self.world_shift = 0 <NEW_LINE> self.level_limit = -1000 <NE...
This is a generic super-class used to define a level.
62599054435de62698e9d327
class EnumParam(InputParam): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> InputParam.__init__(self, *args, **kwargs) <NEW_LINE> self._input = Gtk.ComboBoxText() <NEW_LINE> for option_name in self.param.options.values(): <NEW_LINE> <INDENT> self._input.append_text(option_name) <NEW_LINE> ...
Provide an entry box for Enum types with a drop down menu.
6259905407d97122c42181cf
class Uppercase(AbstractFilter): <NEW_LINE> <INDENT> name = 'Majuscule' <NEW_LINE> description = "Passe le contenu d'une colonne en majuscule" <NEW_LINE> node_in = ['contenu'] <NEW_LINE> node_out = ['resultat'] <NEW_LINE> parameters = [ { 'name': 'Colonne', 'key': 'column', 'type': 'string' } ] <NEW_LINE> def run(self)...
Switch a field to uppercase
6259905424f1403a92686361
class Category(Generic): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = _("category") <NEW_LINE> verbose_name_plural = _("categories") <NEW_LINE> <DEDENT> name = models.CharField(_("category"), max_length=255) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return unicode(self.name)
Categories who selected by admin
62599054462c4b4f79dbcf29
class AbstractVector(StructuredRecord): <NEW_LINE> <INDENT> _level = None <NEW_LINE> cutter = NotImplemented <NEW_LINE> def __new__(cls, *args, **kwargs): <NEW_LINE> <INDENT> cutter_check(cls.cutter, name=cls.__name__) <NEW_LINE> return super(AbstractVector, cls).__new__(cls) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE>...
An abstract modular cloning vector.
62599054b57a9660fecd2fa0
class TrimmedTextResult(TextTestResult): <NEW_LINE> <INDENT> def __init__(self, *args,**kw): <NEW_LINE> <INDENT> super(TrimmedTextResult, self).__init__(*args, **kw) <NEW_LINE> self._error_lookup = {} <NEW_LINE> self._failure_lookup = {} <NEW_LINE> <DEDENT> def _error_identifier(self, err): <NEW_LINE> <INDENT> etype, v...
A patched up version of nose.result.TextTestResult. working with Jason to try and get proper plugin hooks to accomplish this same thing without the monkey business.
62599054baa26c4b54d507c8
class GetRatesService(BaseFetchRatesService): <NEW_LINE> <INDENT> _api_endpoint = 'https://api.cryptonator.com/api/ticker/' <NEW_LINE> def __init__(self, currency_pairs: list): <NEW_LINE> <INDENT> self.currency_pairs = currency_pairs <NEW_LINE> <DEDENT> def _prepare_urls(self) -> list: <NEW_LINE> <INDENT> url_list = [ ...
Service for fetching and saving in the DB rates for currencies currency_pairs: list of tuples (base, target), example [('BTC', 'USD'), ('USD', 'UAH')]
625990547cff6e4e811b6f66
class BridgeExtraInfoDescriptor(ExtraInfoDescriptor): <NEW_LINE> <INDENT> ATTRIBUTES = dict(ExtraInfoDescriptor.ATTRIBUTES, **{ 'ed25519_certificate_hash': (None, _parse_master_key_ed25519_line), 'router_digest_sha256': (None, _parse_router_digest_sha256_line), '_digest': (None, _parse_router_digest_line), }) <NEW_LINE...
Bridge extra-info descriptor (`bridge descriptor specification <https://collector.torproject.org/formats.html#bridge-descriptors>`_) :var str ed25519_certificate_hash: sha256 hash of the original identity-ed25519 :var str router_digest_sha256: sha256 digest of this document .. versionchanged:: 1.5.0 Added the ed25...
6259905416aa5153ce401a0a
class BackgroundBaseZMQServer(BaseZMQServer, threading.Thread): <NEW_LINE> <INDENT> def __init__(self, namespace, port, context=None): <NEW_LINE> <INDENT> BaseZMQServer.__init__(self, namespace, port, context) <NEW_LINE> threading.Thread.__init__(self, name='background RPC server', daemon=True) <NEW_LINE> self.start()
ZMQ server that runs in a background thread.
6259905482261d6c5273095c
class ApplicationRunTests(testing.TestCase): <NEW_LINE> <INDENT> @testing.patch('cep.flaskapp.Application') <NEW_LINE> def test_create_application_curries_arguments(self, app_class): <NEW_LINE> <INDENT> cep.create_application() <NEW_LINE> app_class.assert_called_with() <NEW_LINE> cep.create_application(1, 2, 3) <NEW_LI...
Verify aspects of creating and running the application.
625990546e29344779b01b6f
class Edge(Filter): <NEW_LINE> <INDENT> def __init__(self, compat=False): <NEW_LINE> <INDENT> super(Edge, self).__init__(6, Edge.__inten.features) <NEW_LINE> self.__compat = compat <NEW_LINE> <DEDENT> def __call__(self, im, out=None, region=None, nthreads=1): <NEW_LINE> <INDENT> from ._base import get_image_region, rep...
Computes the edge features of the image. This calculates the gradient magnitude using a second derivative of the Gaussian with a sigma of 1.0 then returns all neighboring offsets in a 7x7 block. The compat flag causes a padding of 0s to be used when needed instead of reflection. This is not a good approach since a tra...
62599054004d5f362081fa7f
class WeChatView(View): <NEW_LINE> <INDENT> token = "" <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> logger.info('- New GET From WeChat -') <NEW_LINE> authenticated, data = self.authenticate(request, kwargs) <NEW_LINE> if authenticated: <NEW_LINE> <INDENT> if data['echostr']: <NEW_LINE> <INDEN...
WeChat API
625990544e696a045264e8b5
class Upper(Validator): <NEW_LINE> <INDENT> def __call__(self, value): <NEW_LINE> <INDENT> if value is None: <NEW_LINE> <INDENT> return (value, None) <NEW_LINE> <DEDENT> return (to_native(to_unicode(value).upper()), None)
Converts to upper case
625990543cc13d1c6d466c63
class ExtractTableToStorageJob(_AsyncJob): <NEW_LINE> <INDENT> _JOB_TYPE = 'extract' <NEW_LINE> def __init__(self, name, source, destination_uris, client): <NEW_LINE> <INDENT> super(ExtractTableToStorageJob, self).__init__(name, client) <NEW_LINE> self.source = source <NEW_LINE> self.destination_uris = destination_uris...
Asynchronous job: extract data from a table into Cloud Storage. :type name: string :param name: the name of the job :type source: :class:`google.cloud.bigquery.table.Table` :param source: Table into which data is to be loaded. :type destination_uris: list of string :param destination_uris: URIs describing Cloud Stor...
62599054d7e4931a7ef3d5a4
class _FoolscapProxy(Protocol): <NEW_LINE> <INDENT> buffered = b"" <NEW_LINE> def dataReceived(self, data): <NEW_LINE> <INDENT> msg("_FoolscapProxy.dataReceived {!r}".format(data)) <NEW_LINE> self.buffered += data <NEW_LINE> if b"\r\n\r\n" in self.buffered: <NEW_LINE> <INDENT> header = self.buffered <NEW_LINE> self.buf...
A protocol which speaks just enough of the first part of a Foolscap conversation to extract the TubID so that a proxy target can be selected based on that value. :ivar bytes buffered: Data which has been received and buffered but not yet interpreted or passed on.
625990543617ad0b5ee0766d
class Client(): <NEW_LINE> <INDENT> def __init__(self, pid): <NEW_LINE> <INDENT> self.pid = pid <NEW_LINE> self.hwnd = self.get_hwnds() <NEW_LINE> self.name = self.get_name() <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '<Flyff.Client %s>' % self.pid <NEW_LINE> <DEDENT> def get_hwnds(self): <NEW_L...
A Flyff client object with hwnd attribute for handling sending keys to a window, and name attribute displaying the logged in character name for easy identification (PIDs and hWnds aren't very identifiable).
6259905471ff763f4b5e8cd5
class BaseActions(object): <NEW_LINE> <INDENT> def __init__(self, request): <NEW_LINE> <INDENT> self.ajax_response = {'rc': 0, 'response': 'ok', 'errors_list': []} <NEW_LINE> self.request = request <NEW_LINE> self.product_id = request.REQUEST.get('product') <NEW_LINE> <DEDENT> def get_testcases(self): <NEW_LINE> <INDEN...
Base class for all Actions
625990547b25080760ed8772
class TodoItem(Base): <NEW_LINE> <INDENT> __tablename__ = 'todoitems' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> task = Column(Text, nullable=False) <NEW_LINE> _due_date = Column('due_date', DateTime) <NEW_LINE> user = Column(Integer, ForeignKey('users.email')) <NEW_LINE> author = relationship('TodoUs...
This is the main model in our application. This is what powers the tasks in the todo list.
62599054e76e3b2f99fd9f25
class nn_se_rReSpecMSE100(p40): <NEW_LINE> <INDENT> blstm_layers = 1 <NEW_LINE> lstm_layers = 1 <NEW_LINE> loss_name = ["real_net_reSpecMse"] <NEW_LINE> relative_loss_epsilon = 1.0/100.0
cnn1blstm1lstm
62599054dd821e528d6da406
class NDArrayDoc(object): <NEW_LINE> <INDENT> pass
The basic class
625990540a50d4780f706852
class ComputeDisksSetLabelsRequest(_messages.Message): <NEW_LINE> <INDENT> project = _messages.StringField(1, required=True) <NEW_LINE> requestId = _messages.StringField(2) <NEW_LINE> resource = _messages.StringField(3, required=True) <NEW_LINE> zone = _messages.StringField(4, required=True) <NEW_LINE> zoneSetLabelsReq...
A ComputeDisksSetLabelsRequest object. Fields: project: Project ID for this request. requestId: An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, con...
625990548e7ae83300eea5bf
class ReactionCompoundMatch(object): <NEW_LINE> <INDENT> def __init__(self, parsed_name, parsed_coeff, parsed_phase, matches): <NEW_LINE> <INDENT> self.parsed_name = parsed_name <NEW_LINE> self.parsed_coeff = parsed_coeff <NEW_LINE> self.parsed_phase = parsed_phase <NEW_LINE> self.matches = matches <NEW_LINE> <DEDENT> ...
A match of a compound in a reaction. Contains the parsed name (what the user entered), the parsed stoichiometric coefficient, and a list of matcher.Match objects of the potential matches.
62599054a79ad1619776b551
class IAMGroup(Resource): <NEW_LINE> <INDENT> TYPE_VALUE: ClassVar = "AWS::IAM::Group" <NEW_LINE> Type: str = TYPE_VALUE <NEW_LINE> Properties: Optional[Resolvable[IAMGroupProperties]] <NEW_LINE> @property <NEW_LINE> def policy_documents(self) -> List[OptionallyNamedPolicyDocument]: <NEW_LINE> <INDENT> result = [] <NEW...
Properties: - Properties: A [IAM Group properties][pycfmodel.model.resources.iam_group.IAMGroupProperties] object. More info at [AWS Docs](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html)
6259905455399d3f05627a46
class PowerSensors: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ina = INA219(shunt_ohms=0.1, max_expected_amps=3.0, address=0x40) <NEW_LINE> self.ina.configure(voltage_range=self.ina.RANGE_16V, gain=self.ina.GAIN_AUTO, bus_adc=self.ina.ADC_128SAMP, shunt_adc=self.ina.ADC_128SAMP) <NEW_LINE> <DEDENT...
docblock
62599054d6c5a102081e3646
class InterStrokeDistance: <NEW_LINE> <INDENT> def __init__(self, filename="dist_between_strokes.csv"): <NEW_LINE> <INDENT> self.filename = prepare_file(filename) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "InterStrokeDistance(%s)" % self.filename <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE...
Analyze how much distance in px is between strokes.
6259905438b623060ffaa2e3
class NamespacesMapping(DictElement): <NEW_LINE> <INDENT> schema = Dict(type=NamespaceMapping)
An internal DSL element for mapping all the used blueprints import namespaces.
625990543539df3088ecd7ce
class TestSearchResultOfPostResponse(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 testSearchResultOfPostResponse(self): <NEW_LINE> <INDENT> pass
SearchResultOfPostResponse unit test stubs
62599054cb5e8a47e493cc1b
class ResxSettingsDto(object): <NEW_LINE> <INDENT> swagger_types = { 'tag_regexp': 'str' } <NEW_LINE> attribute_map = { 'tag_regexp': 'tagRegexp' } <NEW_LINE> def __init__(self, tag_regexp=None): <NEW_LINE> <INDENT> self._tag_regexp = None <NEW_LINE> self.discriminator = None <NEW_LINE> if tag_regexp is not None: <NEW_...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
6259905421a7993f00c67496
class ConfigKeyList(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.keys = [] <NEW_LINE> <DEDENT> def addKey(self, key): <NEW_LINE> <INDENT> if isinstance(key, ConfigKey) and self.findKeyById(key.getId()) is None: <NEW_LINE> <INDENT> self.keys.append(key) <NEW_LINE> <DEDENT> <DEDENT> def getKe...
A class representing a list of Form Tags.
62599054f7d966606f74934c
class _ClosedSets(Collection[Collection[T]]): <NEW_LINE> <INDENT> def __init__(self, topology: FiniteTopologyInterface[T]) -> None: <NEW_LINE> <INDENT> self._topology = topology <NEW_LINE> <DEDENT> def __len__(self) -> int: <NEW_LINE> <INDENT> return len(self._topology.open_sets) <NEW_LINE> <DEDENT> def __iter__(self) ...
Base class for the collection of closed sets
625990540fa83653e46f640d
class CIFARResNeXt(tf.keras.Model): <NEW_LINE> <INDENT> def __init__(self, channels, init_block_channels, cardinality, bottleneck_width, in_channels=3, in_size=(32, 32), classes=10, data_format="channels_last", **kwargs): <NEW_LINE> <INDENT> super(CIFARResNeXt, self).__init__(**kwargs) <NEW_LINE> self.in_size = in_size...
ResNeXt model for CIFAR from 'Aggregated Residual Transformations for Deep Neural Networks,' http://arxiv.org/abs/1611.05431. Parameters: ---------- channels : list of list of int Number of output channels for each unit. init_block_channels : int Number of output channels for the initial unit. cardinality: int...
625990541f037a2d8b9e5300
class PrivateUserApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = create_user( email='test@test.com', password='test123', name='name' ) <NEW_LINE> self.client = APIClient() <NEW_LINE> self.client.force_authenticate(user=self.user) <NEW_LINE> <DEDENT> def test_retrieve_profile_suc...
Test API requests that require authentication
62599054cad5886f8bdc5b15
class controller_dailythresh(object): <NEW_LINE> <INDENT> thresh_high_quant = 1 <NEW_LINE> thresh_low_quant = 0 <NEW_LINE> thresh_high_price = 1 <NEW_LINE> thresh_low_price = 0 <NEW_LINE> def __init__(self, df, thresh_high_quant, thresh_low_quant): <NEW_LINE> <INDENT> self.thresh_high_quant = thresh_high_quant <NEW_LIN...
Describes a daily threshold battery controller and maintains pre-calculated variables. Attributes: thresh_high_price: float, the high threshold price, above which the battery discharges itself thresh_low_price: float, the low threshold price, below which the battery ch...
6259905407f4c71912bb0963
class Prompt: <NEW_LINE> <INDENT> def __init__(self, str='h[%d] >>> '): <NEW_LINE> <INDENT> self.str = str; <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> if _ not in [h[-1], None, h]: h.append(_); <NEW_LINE> <DEDENT> except NameError: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> re...
Create a prompt that stores results (i.e. _) in the array h.
62599054379a373c97d9a54d
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 Class
625990548e7ae83300eea5c1
class RNAalignment: <NEW_LINE> <INDENT> def __init__(self, fn): <NEW_LINE> <INDENT> self.alignment = AlignIO.read(open(fn), "stockholm") <NEW_LINE> <DEDENT> def get_range(self, seqid, offset=0, verbose=True): <NEW_LINE> <INDENT> x = self.alignment[-1].seq <NEW_LINE> x_range = [] <NEW_LINE> seq_found = False <NEW_LINE> ...
RNAalignemnt
6259905482261d6c5273095e
@disruptor(tactics, dtype="ALT", weight=1, args={'conf': ("Change the configuration, with the one provided (by name), of " "all subnodes fetched by @path, one-by-one. [default value is set " "dynamically with the first-found existing alternate configuration]", None, str...
Switch to an alternate configuration.
625990542ae34c7f260ac610
class GetTrackedBotHandler(tornado.web.RequestHandler): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> tracked_bots = BaseStation().bot_manager. get_all_tracked_bots_names() <NEW_LINE> print('Bots Tracked: ' + str(tracked_bots)) <NEW_LINE> self.write(json.dumps(tracked_bots).encode())
Gets bot tracked by BotManager.
62599054ac7a0e7691f73a0a
class MAVLink_memory_vect_message(MAVLink_message): <NEW_LINE> <INDENT> id = MAVLINK_MSG_ID_MEMORY_VECT <NEW_LINE> name = 'MEMORY_VECT' <NEW_LINE> fieldnames = ['address', 'ver', 'type', 'value'] <NEW_LINE> ordered_fieldnames = ['address', 'ver', 'type', 'value'] <NEW_LINE> fieldtypes = ['uint16_t', 'uint8_t', 'uint8_t...
Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output.
6259905415baa723494634bc
class GlobalSettings(object): <NEW_LINE> <INDENT> site_title = 'MxOnline在线教育系统后台管理' <NEW_LINE> site_footer = "Evan's demo"
X-admin 全局配置参数信息设置
6259905494891a1f408ba18b
class WebsiteUser(HttpLocust): <NEW_LINE> <INDENT> task_set = UserBehavior <NEW_LINE> min_wait = 1000 <NEW_LINE> max_wait = 3000
The Locust class (as well as HttpLocust since it’s a subclass) also allows one to specify minimum and maximum wait time—per simulated user—between the execution of tasks (min_wait and max_wait) as well as other user behaviours.
6259905407d97122c42181d4
class OnLoginView(APIView): <NEW_LINE> <INDENT> authentication_classes = (TokenAuthentication,) <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> if (request.user): <NEW_LINE> <INDENT> user = request.user <NEW_LINE> response_data = { 'first_name': user.first_name,...
User passes his telegram chat_id that he got from the chat bot after giving him his phone number
6259905471ff763f4b5e8cd9
class SOC(Constraint): <NEW_LINE> <INDENT> def __init__(self, t, X, axis=0, constr_id=None): <NEW_LINE> <INDENT> assert not t.shape or len(t.shape) == 1 <NEW_LINE> self.axis = axis <NEW_LINE> super(SOC, self).__init__([t, X], constr_id) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "SOC(%s, %s)" % (...
A second-order cone constraint for each row/column. Assumes ``t`` is a vector the same length as ``X``'s columns (rows) for ``axis == 0`` (``1``). Attributes: t: The scalar part of the second-order constraint. X: A matrix whose rows/columns are each a cone. axis: Slice by column 0 or row 1.
62599054f7d966606f74934d
class TcpListener(Listener): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> Listener.__init__(self, "TCP", *args) <NEW_LINE> <DEDENT> def create_socket(self): <NEW_LINE> <INDENT> return socket.socket(socket.AF_INET, socket.SOCK_STREAM) <NEW_LINE> <DEDENT> def identify(self, s, addr): <NEW_LINE> <IND...
A specialization for TCP sockets. Can be used with fake identification.
6259905407f4c71912bb0964
@ZWaveMessage(COMMAND_CLASS_ASSOCIATION, ASSOCIATION_GROUPINGS_GET) <NEW_LINE> class GroupingsGet(Message): <NEW_LINE> <INDENT> NAME = "GROUPINGS_GET"
Command Class message COMMAND_CLASS_ASSOCIATION ASSOCIATION_GROUPINGS_GET
625990541f037a2d8b9e5301
class NovatelU740(NovatelWCDMADevicePlugin): <NEW_LINE> <INDENT> name = "Novatel U740" <NEW_LINE> version = "0.1" <NEW_LINE> author = "Adam King" <NEW_LINE> custom = NovatelU740Customizer() <NEW_LINE> __remote_name__ = "Merlin U740 (HW REV [0:33])" <NEW_LINE> __properties__ = { 'ID_VENDOR_ID': [0x1410], 'ID_MODEL_ID': ...
:class:`~core.plugin.DevicePlugin` for Novatel's U740
62599054097d151d1a2c2597
class BashCharmTemplate(CharmTemplate): <NEW_LINE> <INDENT> def create_charm(self, config, output_dir): <NEW_LINE> <INDENT> self._copy_files(output_dir) <NEW_LINE> for root, dirs, files in os.walk(output_dir): <NEW_LINE> <INDENT> for outfile in files: <NEW_LINE> <INDENT> if self.skip_template(outfile): <NEW_LINE> <INDE...
Creates a bash-based charm
62599054097d151d1a2c2598
class TestExplainerWhyGranted: <NEW_LINE> <INDENT> @pytest.mark.client <NEW_LINE> @pytest.mark.e2e <NEW_LINE> @pytest.mark.explainer <NEW_LINE> def test_why_granted_permission_for_org(self, forseti_cli: ForsetiCli, forseti_model_readonly, forseti_server_service_account: str, organization_id: str): <NEW_LINE> <INDENT> m...
Explainer why_granted tests.
6259905407f4c71912bb0965
class VLblNceSentimentTrainer(SimpleVLblNceSentimentTrainer): <NEW_LINE> <INDENT> def create_model(self): <NEW_LINE> <INDENT> return VLblNce(self.batch_size, self.effective_vocab_size, self.left_context, self.right_context, self.word_embedding_size, self.k, self.unigram, l1_weight=self.l1_weight, l2_weight=self.l2_weig...
Create a vLBL model that trains special sentiment embeddings.
62599054b5575c28eb713761
class NaiveConvolutionalFeatureMap(BaseBPropComponent): <NEW_LINE> <INDENT> def __init__(self, fsize, imsize): <NEW_LINE> <INDENT> super(NaiveConvolutionalFeatureMap, self).__init__() <NEW_LINE> self.convolution = ConvolutionalPlane(fsize, imsize) <NEW_LINE> self.nonlinearity = TanhSigmoid(self.convolution.outsize) <NE...
One way to implement a standard feature map that takes input from a single lower-level image. This serves two purposes: to demonstrate how to write new learning modules by composing two existing modules, and to serve as a sanity check for the more efficient implementation, ConvolutionalFeatureMap. Has, as members, a...
62599054dd821e528d6da40a
class UniformSampler(SingleVideoFrameSampler): <NEW_LINE> <INDENT> def __init__(self, offset, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> assert isinstance(offset, int), "`offset` must be an integer." <NEW_LINE> self._offset = offset <NEW_LINE> <DEDENT> def _sample(self, frames): ...
Uniformly sample video frames starting from an optional offset.
62599054e5267d203ee6ce1a
class KeywordPlanCampaignServiceStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.GetKeywordPlanCampaign = channel.unary_unary( '/google.ads.googleads.v1.services.KeywordPlanCampaignService/GetKeywordPlanCampaign', request_serializer=google_dot_ads_dot_googleads__v1_dot_proto_dot_s...
Proto file describing the keyword plan campaign service. Service to manage Keyword Plan campaigns.
6259905416aa5153ce401a10
class BooleanFieldFilter(django_filters.Filter): <NEW_LINE> <INDENT> def filter(self, qs, value): <NEW_LINE> <INDENT> if value is not None: <NEW_LINE> <INDENT> lc_value = value.lower() <NEW_LINE> if lc_value in ('true', 't', 'yes', 'y', '1'): <NEW_LINE> <INDENT> value = True <NEW_LINE> <DEDENT> elif lc_value in ('false...
This throws a `Validation Error` if a value that is not in the required boolean choices is provided. Choices are (case insensitive): ['true', 't', 'yes', 'y', '1', 'false', 'f', 'no', 'n', '0]
62599054435de62698e9d32e
@dataclass <NEW_LINE> class StandardMessage(Message): <NEW_LINE> <INDENT> level: Level <NEW_LINE> content: str <NEW_LINE> timestamp: datetime <NEW_LINE> topic: str <NEW_LINE> host: str
A message with standard attributes.
62599055b7558d58954649c0
class PrivateUserApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = create_user( email='test@kburakengin', password='test123', name='testuser' ) <NEW_LINE> self.client = APIClient() <NEW_LINE> self.client.force_authenticate(user=self.user) <NEW_LINE> <DEDENT> def test_retrieve_prof...
Test API requests that require authentication
6259905510dbd63aa1c7210e
class StopConversation(Exception): <NEW_LINE> <INDENT> pass
raise if conversation has terminated
6259905576d4e153a661dd11
class IdGeneratorMixIn: <NEW_LINE> <INDENT> def __init__(self, start_value=0): <NEW_LINE> <INDENT> self.id_count = start_value <NEW_LINE> <DEDENT> def init_counter(self, start_value=0): <NEW_LINE> <INDENT> self.id_count = start_value <NEW_LINE> <DEDENT> def generate_id(self): <NEW_LINE> <INDENT> self.id_count += 1 <NEW...
Mixin adding the ability to generate integer uid
625990558da39b475be04717
class _SearchChild(object): <NEW_LINE> <INDENT> def __init__(self, cgroupdir=None, fork=True): <NEW_LINE> <INDENT> self.pid = None <NEW_LINE> self.tempdir = mkdtemp(prefix='diamond-search-') <NEW_LINE> self._started = False <NEW_LINE> self._terminated = False <NEW_LINE> self._fork = fork <NEW_LINE> if fork and cgroupdi...
A forked search process.
62599055baa26c4b54d507cf
class Post(object): <NEW_LINE> <INDENT> def __init__(self, content, handler=None, **metadata): <NEW_LINE> <INDENT> self.content = str(content) <NEW_LINE> self.metadata = metadata <NEW_LINE> self.handler = handler <NEW_LINE> <DEDENT> def __getitem__(self, name): <NEW_LINE> <INDENT> return self.metadata[name] <NEW_LINE> ...
A post contains content and metadata from Front Matter. This is what gets returned by :py:func:`load <frontmatter.load>` and :py:func:`loads <frontmatter.loads>`. Passing this to :py:func:`dump <frontmatter.dump>` or :py:func:`dumps <frontmatter.dumps>` will turn it back into text. For convenience, metadata values are...
6259905521a7993f00c6749a
class Operator(SparseMatrix): <NEW_LINE> <INDENT> def __init__(self, n_qubits : int=1, base = np.zeros((2,2))): <NEW_LINE> <INDENT> if n_qubits <= 0 : <NEW_LINE> <INDENT> raise ValueError('Operator must operate on at least 1 qubit!') <NEW_LINE> <DEDENT> self.n_qubits = n_qubits <NEW_LINE> self.size = 2 ** n_qubits <NEW...
Operator class inherits from SparceMatrix
62599055adb09d7d5dc0ba96
class SNS(PushEventSource): <NEW_LINE> <INDENT> resource_type = 'SNS' <NEW_LINE> principal = 'sns.amazonaws.com' <NEW_LINE> property_types = { 'Topic': PropertyType(True, is_str()) } <NEW_LINE> def to_cloudformation(self, **kwargs): <NEW_LINE> <INDENT> function = kwargs.get('function') <NEW_LINE> if not function: <NEW_...
SNS topic event source for SAM Functions.
62599055097d151d1a2c259a
class Category(models.Model): <NEW_LINE> <INDENT> title = models.CharField(_("title"), max_length=200) <NEW_LINE> parent = models.ForeignKey( "self", blank=True, null=True, on_delete=models.CASCADE, related_name="children", limit_choices_to={"parent__isnull": True}, verbose_name=_("parent"), ) <NEW_LINE> slug = models....
These categories are meant primarily for organizing media files in the library.
62599055cad5886f8bdc5b17
class Room: <NEW_LINE> <INDENT> def __init__(self, name, description, items = [], water_source=False): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.description = description <NEW_LINE> self.items = items <NEW_LINE> self.water_source = water_source <NEW_LINE> self.players = [] <NEW_LINE> <DEDENT> def is_here(sel...
The room is on fire (maybe)
62599055e76e3b2f99fd9f2b
class IntUniformDistribution(BaseDistribution): <NEW_LINE> <INDENT> def __init__(self, low: int, high: int, step: int = 1) -> None: <NEW_LINE> <INDENT> if low > high: <NEW_LINE> <INDENT> raise ValueError( "The `low` value must be smaller than or equal to the `high` value " "(low={}, high={}).".format(low, high) ) <NEW_...
A uniform distribution on integers. This object is instantiated by :func:`~optuna.trial.Trial.suggest_int`, and passed to :mod:`~optuna.samplers` in general. .. note:: If the range :math:`[\mathsf{low}, \mathsf{high}]` is not divisible by :math:`\mathsf{step}`, :math:`\mathsf{high}` will be replaced with the ...
6259905501c39578d7f141ce
class EncoderClient(): <NEW_LINE> <INDENT> def __init__(self, host='0.0.0.0', port=3000): <NEW_LINE> <INDENT> self.channel = grpc.insecure_channel('%s:%d' % (host, port)) <NEW_LINE> self.stub = encoder_pb2.EncoderStub(self.channel) <NEW_LINE> <DEDENT> def encode(self, _url): <NEW_LINE> <INDENT> req = encoder_pb2.Encode...
EncoderClient is a proxy to GRPC EncoderServer.
62599055baa26c4b54d507d0
class UnknownMetaEvent(MetaEvent): <NEW_LINE> <INDENT> meta_command = None <NEW_LINE> name = 'Unknown' <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(UnknownMetaEvent, self).__init__(**kwargs) <NEW_LINE> self.meta_command = kwargs['meta_command']
Unknown Meta Event. Parameters ---------- meta_command : int Value of the meta command.
62599055b830903b9686ef14
class NoLimitLeduc(LeducRules, NoLimitPokerEnv): <NEW_LINE> <INDENT> RULES = LeducRules <NEW_LINE> IS_FIXED_LIMIT_GAME = False <NEW_LINE> IS_POT_LIMIT_GAME = False <NEW_LINE> SMALL_BLIND = 50 <NEW_LINE> BIG_BLIND = 100 <NEW_LINE> ANTE = 0 <NEW_LINE> DEFAULT_STACK_SIZE = 20000 <NEW_LINE> EV_NORMALIZER = 1000.0 / BIG_BLI...
A variant of Leduc with no bet-cap in the no-limit format. It uses blinds instead of antes.
6259905545492302aabfda04
class TestSimilarityScorerConfig(BaseTest): <NEW_LINE> <INDENT> def test_config(self): <NEW_LINE> <INDENT> data_type = 'test:test' <NEW_LINE> index = 'test_index' <NEW_LINE> config = SimilarityScorerConfig(data_type=data_type, index=index) <NEW_LINE> compare_config = { 'index': '{0}'.format(index), 'data_type': '{0}'.f...
Tests for the functionality of the config object.
6259905521bff66bcd724192
class MAVLink_wind_message(MAVLink_message): <NEW_LINE> <INDENT> id = MAVLINK_MSG_ID_WIND <NEW_LINE> name = 'WIND' <NEW_LINE> fieldnames = ['direction', 'speed', 'speed_z'] <NEW_LINE> ordered_fieldnames = [ 'direction', 'speed', 'speed_z' ] <NEW_LINE> format = '<fff' <NEW_LINE> native_format = bytearray('<fff', 'ascii'...
Wind estimation
62599055004d5f362081fa83
class StemmerI(object): <NEW_LINE> <INDENT> def stem(self, token): <NEW_LINE> <INDENT> raise NotImplementedError()
A processing interface for removing morphological affixes from words. This process is known as X{stemming}.
62599055dc8b845886d54af2
class EmailChangeConfirmViewTests(ManifestTestCase): <NEW_LINE> <INDENT> user_data = ["john", "pass"] <NEW_LINE> def test_valid_confirmation(self): <NEW_LINE> <INDENT> user = get_user_model().objects.get(username=self.user_data[0]) <NEW_LINE> user.change_email("john.smith@example.com") <NEW_LINE> self.assertEqual(user....
Tests for :class:`EmailChangeConfirmView <manifest.views.EmailChangeConfirmView>`.
625990553539df3088ecd7d4
class UserAgentMiddleware(object): <NEW_LINE> <INDENT> def __init__(self, user_agent='Scrapy'): <NEW_LINE> <INDENT> self.user_agent = random.choice(USER_AGENT_LIST) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_crawler(cls, crawler): <NEW_LINE> <INDENT> o = cls(crawler.settings['USER_AGENT']) <NEW_LINE> crawler....
This middleware allows spiders to override the user_agent
625990558a43f66fc4bf36bb
class TicTacToe(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.matrix=[[' ' for i in range(3)] for j in range(3)] <NEW_LINE> <DEDENT> def line(self): <NEW_LINE> <INDENT> return('-----') <NEW_LINE> <DEDENT> def line1(self): <NEW_LINE> <INDENT> return self.matrix[0][0]+'|'+self.matrix[1][0]+'|'...
plays a tic tac toe game
62599055d53ae8145f919990
class TestWidgetTest(WidgetTest): <NEW_LINE> <INDENT> def test_process_events_handles_timeouts(self): <NEW_LINE> <INDENT> with self.assertRaises(TimeoutError): <NEW_LINE> <INDENT> self.process_events(until=lambda: False, timeout=0) <NEW_LINE> <DEDENT> <DEDENT> def test_minimum_size(self): <NEW_LINE> <INDENT> return
Meta tests for widget test helpers
62599055d99f1b3c44d06bce
class LazySequence(Sequence): <NEW_LINE> <INDENT> _ref_lru = deque(maxlen=1000) <NEW_LINE> def __init__(self, seq=(), map_func=None): <NEW_LINE> <INDENT> if map_func is not None and not isinstance(map_func, Callable): <NEW_LINE> <INDENT> raise ValueError('LazySequence: map_func must be callable.') <NEW_LINE> <DEDENT> s...
A Sequence that lazily calculates values when needed based on an underlying Sequence of values and a map function. LazySequences can be composed, sliced, copied, and they maintain a cache of both recently used values and all other values that have not yet been garbage collected.
62599055cb5e8a47e493cc1e
class Migrate(APIView): <NEW_LINE> <INDENT> def valid_iaas(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def valid_container(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def get(self, request, container_id, to_iaas_id, format=None): <NEW_LINE> <INDENT> tasks.lxc_migration.delay(container_id, to_iaas_id) <N...
To be determined later
62599055009cb60464d02a67
class TestOptions(dict): <NEW_LINE> <INDENT> def __init__(self, indict=None, attribute=None): <NEW_LINE> <INDENT> if indict is None: <NEW_LINE> <INDENT> indict = {} <NEW_LINE> <DEDENT> self.attribute = attribute <NEW_LINE> dict.__init__(self, indict) <NEW_LINE> self.__initialised = True <NEW_LINE> <DEDENT> def __getatt...
Options for testing purposes. http://code.activestate.com/recipes/389916-example-setattr-getattr-overloading/
62599055adb09d7d5dc0ba98
class DocumentationError(ProjexError): <NEW_LINE> <INDENT> pass
Thrown during the docgen process.
6259905507f4c71912bb0969
class StudentRepo(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__lst = [] <NEW_LINE> <DEDENT> def getAll(self): <NEW_LINE> <INDENT> return self.__lst <NEW_LINE> <DEDENT> def store(self, stud): <NEW_LINE> <INDENT> if stud in self.__lst: <NEW_LINE> <INDENT> raise ValueError('Studentul exista deja')...
Repository pentru student In aceasta clasa se stocheaza obiecte de tip Student
62599055a219f33f346c7d33
class Fedora19GenericJenkinsSlave( FedoraGenericJenkinsSlave, GenericFedora19Box ): <NEW_LINE> <INDENT> pass
Generic Jenkins slave for Fedora 19
625990554428ac0f6e659a68
class PadInvalidId(PadException): <NEW_LINE> <INDENT> pass
The given ``pad_id`` is invalid
62599055d486a94d0ba2d4f7
class Cnameframe(Templated): <NEW_LINE> <INDENT> def __init__(self, original_path, subreddit, sub_domain): <NEW_LINE> <INDENT> Templated.__init__(self, original_path=original_path) <NEW_LINE> if sub_domain and subreddit and original_path: <NEW_LINE> <INDENT> self.title = "%s - %s" % (subreddit.title, sub_domain) <NEW_L...
The frame page.
62599055004d5f362081fa84
class WriterLineProtocol(WriterBase): <NEW_LINE> <INDENT> def __init__(self, handle): <NEW_LINE> <INDENT> super().__init__("InfluxDB", handle) <NEW_LINE> <DEDENT> def write(self, newline=True, **kwargs): <NEW_LINE> <INDENT> fields = kwargs.pop('fields', {}) <NEW_LINE> for field in ('unit', 'item', 'event', 'comment', '...
Write InfluxDB line protocol format log lines. Note: the tags and fields' keys and values must not contain spaces. If values have a space then the values need quoting. This function does not do that. '{collection},{tags} {fields} {timestamp}' Note that 'collection' here, is a 'measurement' in InfluxDB terms.
625990552ae34c7f260ac616
class PreviewPipeline: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.lookupTable = vtk.vtkLookupTable() <NEW_LINE> self.lookupTable.SetRampToLinear() <NEW_LINE> self.lookupTable.SetNumberOfTableValues(2) <NEW_LINE> self.lookupTable.SetTableRange(0, 1) <NEW_LINE> self.lookupTable.SetTableValue(0, 0, ...
Visualization objects and pipeline for each slice view for threshold preview
62599055d6c5a102081e364d
class ResearchExperimentDescriptionBaseSerializer(ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = ResearchExperimentDescription <NEW_LINE> fields = [ 'id', 'experimentdescription', ]
Base serializer for DRY implementation.
62599055d7e4931a7ef3d5ae
class Registro0000(Registro): <NEW_LINE> <INDENT> campos = [ CampoFixo(1, 'REG', '0000'), CampoFixo(2, 'NOME_ESC', 'LECF'), CampoFixo(3, 'COD_VER', '0003'), CampoCNPJ(4, 'CNPJ', obrigatorio=True), CampoAlfanumerico(5, 'NOME', obrigatorio=True), CampoRegex(6, 'IND_SIT_INI_PER', obrigatorio=True, regex='[0-4]'), CampoReg...
Abertura do Arquivo Digital e Identificação da Pessoa Jurídica >>> r = Registro0000() >>> r.REG '0000' >>> r.NOME_ESC 'LECF' >>> line='|0000|LECF|0003|11111111000191|EMPRESA TESTE|0|0|||01012014|31122014|N||0||' >>> r = Registro0000(line) >>> r.as_line() '|0000|LECF|0003|11111111000191|EMPRESA TESTE|0|0|||01012014|311...
6259905576d4e153a661dd13
class PyWebkitServer(PythonPackage): <NEW_LINE> <INDENT> homepage = "https://github.com/niklasb/webkit-server" <NEW_LINE> url = "https://pypi.io/packages/source/w/webkit-server/webkit-server-1.0.tar.gz" <NEW_LINE> version('develop', git="https://github.com/niklasb/webkit-server", branch="master") <NEW_LINE> versio...
a Webkit-based, headless web client
625990558da39b475be0471b
class Resetcog: <NEW_LINE> <INDENT> def __init__(self, bot): <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> <DEDENT> @commands.command() <NEW_LINE> async def reset(self): <NEW_LINE> <INDENT> _3AM = datetime.time(hour=3) <NEW_LINE> _FRI = 4 <NEW_LINE> def next_friday_3am(now): <NEW_LINE> <INDENT> now += datetime.timedelt...
Responds with the time until the next server reset.
62599055baa26c4b54d507d3
class StructCombinedInputOutputBufferType(StructInputOutputBufferType): <NEW_LINE> <INDENT> def passOutput(self, name): <NEW_LINE> <INDENT> return "(%s *)memcpy((char *)%s__out__, (char *)%s__in__, %s)" % (self.type, name, name, self.size)
Like structure buffer -- but same parameter is input and output.
6259905538b623060ffaa2e7
class PathTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> assert not os.system("tar xzf testfiles.tar.gz > /dev/null 2>&1") <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> assert not os.system("rm -rf testfiles tempdir temp2.tar") <NEW_LINE> <DEDENT> def test_deltree(self):...
Test basic path functions
6259905515baa723494634c2
class le(ColumnOperator): <NEW_LINE> <INDENT> def compare(self, value): <NEW_LINE> <INDENT> return self.column <= value
Return ``<=`` filter function using ORM column field.
6259905523849d37ff8525f4
class FeatureSupportRequest(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'feature_type': {'required': True}, } <NEW_LINE> _attribute_map = { 'feature_type': {'key': 'featureType', 'type': 'str'}, } <NEW_LINE> _subtype_map = { 'feature_type': {'AzureBackupGoals': 'AzureBackupGoalFeatureSupportRequest...
Base class for feature request. You probably want to use the sub-classes and not this class directly. Known sub-classes are: AzureBackupGoalFeatureSupportRequest, AzureVMResourceFeatureSupportRequest. All required parameters must be populated in order to send to Azure. :ivar feature_type: Required. backup support fe...
6259905530dc7b76659a0d17
class PageBaseForm(Form): <NEW_LINE> <INDENT> title = StringField( label=_("Title"), validators=[validators.InputRequired()], render_kw={'autofocus': ''} )
Defines the base form for all pages.
62599055435de62698e9d333
class Collectible(object): <NEW_LINE> <INDENT> def __init__(self, logf): <NEW_LINE> <INDENT> self.logf = logf <NEW_LINE> <DEDENT> def readline(self, logdir): <NEW_LINE> <INDENT> path = os.path.join(logdir, self.logf) <NEW_LINE> if os.path.exists(path): <NEW_LINE> <INDENT> return genio.read_one_line(path) <NEW_LINE> <DE...
Abstract class for representing collectibles by sysinfo.
625990558da39b475be0471c
class FacultyEntityAutocompleteView(PermissionRequiredMixin, autocomplete.Select2QuerySetView): <NEW_LINE> <INDENT> login_url = 'access_denied' <NEW_LINE> permission_required = 'partnership.can_access_partnerships' <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> qs = ( EntityProxy.objects .only_valid() .with_tit...
Autocomplete for entities on UCLManagementEntity form
625990552ae34c7f260ac617
class OwnerWriteableMapping(MAP): <NEW_LINE> <INDENT> def __init__( self, dict_: Dict[str, Any] = None, parent: "OwnerWriteableMapping" = None ): <NEW_LINE> <INDENT> super().__init__(dict_, parent) <NEW_LINE> <DEDENT> def _find_owner(self) -> (contract.Contracted, int): <NEW_LINE> <INDENT> for frame in stack_frames(3):...
A MAP variant that is write-locked to the first Contracted function that writes to a given key (becoming the owner). Attempts to write to that key from other functions will receive a WriteLockError showing the owning Contracted function.
625990554e4d562566373937
class UserRegistrationForm(UserCreationForm): <NEW_LINE> <INDENT> password1 = forms.CharField( label="Password", widget=forms.PasswordInput) <NEW_LINE> password2 = forms.CharField( label="Password Confirmation", widget=forms.PasswordInput) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ['em...
Form to be used to register a new user
6259905576e4537e8c3f0abc
class PinData(BaseModel): <NEW_LINE> <INDENT> ecu_name = ForeignKeyField(EcuType, backref="ecu") <NEW_LINE> ecu_ref_number = CharField() <NEW_LINE> ecu_db_number = IntegerField() <NEW_LINE> pin_reading_msgpack = BlobField()
PIN DATA MODEL CLASS
625990557cff6e4e811b6f72