code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class SearchResultsAnswer(Answer): <NEW_LINE> <INDENT> _validation = { '_type': {'required': True}, 'id': {'readonly': True}, 'web_search_url': {'readonly': True}, 'follow_up_queries': {'readonly': True}, 'total_estimated_matches': {'readonly': True}, 'is_family_friendly': {'readonly': True}, } <NEW_LINE> _attribute_ma...
SearchResultsAnswer. You probably want to use the sub-classes and not this class directly. Known sub-classes are: Videos Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. :param _type: Required. Constant fille...
6259905956b00c62f0fb3e86
class Cache(_BaseCache): <NEW_LINE> <INDENT> def __new__(cls, *args, **kwargs): <NEW_LINE> <INDENT> if config.CACHE_ENABLED: <NEW_LINE> <INDENT> new_cls = TimedCache <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> new_cls = NullCache <NEW_LINE> <DEDENT> instance = super(Cache, cls).__new__(new_cls) <NEW_LINE> instance.__...
A factory class which returns an instance of a cache subclass. If config.CACHE_ENABLED is False, the dummy inactive cache will be returned
625990591b99ca4002290015
class UserAvatar(Model): <NEW_LINE> <INDENT> __core__ = False <NEW_LINE> AVATAR_TYPES = ( (0, 'letter_avatar'), (1, 'upload'), (2, 'gravatar'), ) <NEW_LINE> ALLOWED_SIZES = (20, 32, 48, 52, 64, 80, 96, 120) <NEW_LINE> user = FlexibleForeignKey('sentry.User', unique=True, related_name='avatar') <NEW_LINE> file = Flexibl...
A UserAvatar associates a User with their avatar photo File and contains their preferences for avatar type.
625990597cff6e4e811b6ffe
class Cartesian(Space): <NEW_LINE> <INDENT> def __init__(self, *spaces): <NEW_LINE> <INDENT> def wrap(space): <NEW_LINE> <INDENT> if isinstance(space, Space): return space <NEW_LINE> if not islist(space): return Singular(space) <NEW_LINE> if len(space) == 1: return Singular(space[0]) <NEW_LINE> return Nominal(*space) <...
Cartesian product of multiple Spaces. A multidimensional set of allowed values for a given combination of knobs. Each multi-value is a tuple.
6259905991af0d3eaad3b3e3
class Tokenizer(ABC): <NEW_LINE> <INDENT> languages = [] <NEW_LINE> def __init__(self, normalize: bool, lower: bool, language: str = "unk"): <NEW_LINE> <INDENT> if language not in self.languages: <NEW_LINE> <INDENT> raise NotImplementedError( "{} is not in {}".format(language, self.languages) ) <NEW_LINE> <DEDENT> self...
Base Tokenizer Attributes: tokenizer: tokenizer e.g. MeCab, Sudachi
62599059baa26c4b54d5085f
class _DbfsHost(ParamType): <NEW_LINE> <INDENT> def convert(self, value, param, ctx): <NEW_LINE> <INDENT> if value.startswith("https://"): <NEW_LINE> <INDENT> return value <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.fail("The host does not start with https://")
Used to validate the configured host
6259905915baa7234946354d
@collection( name='quality-metrics-fastqc', properties={ 'title': 'FastQC Quality Metrics', 'description': 'Listing of FastQC Quality Metrics', }) <NEW_LINE> class QualityMetricFastqc(QualityMetric): <NEW_LINE> <INDENT> item_type = 'quality_metric_fastqc' <NEW_LINE> schema = load_schema('encoded:schemas/quality_metric_...
Subclass of quality metrics for fastq files.
62599059097d151d1a2c2627
class Merge(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def merge_sort(array): <NEW_LINE> <INDENT> length = len(array) <NEW_LINE> if length < 2: <NEW_LINE> <INDENT> return array <NEW_LINE> <DEDENT> middle = length//2 <NEW_LINE> left = Merge.merge_sort(array[:middle]) <NEW_LINE> right = Merge.merge_sort(array[...
Contains various merge sort implementations. http://en.wikipedia.org/wiki/Merge_sort
625990590fa83653e46f64a1
class SimpleTrajectoryWriter(TrajectoryWriter): <NEW_LINE> <INDENT> header = "frame ID x y z\n" <NEW_LINE> row_template = Template("$frame $id $x $y $z\n") <NEW_LINE> def write_header(trajectory_file: pathlib.Path) -> None: <NEW_LINE> <INDENT> with trajectory_file.open("w") as f: <NEW_LINE> <INDENT> f.write(SimpleTraje...
First simple trajectory writer, output is a csv with spaces as delimiter. First line contains the information, what kind of data the specific column holds. Note: The z-coordinate is currently just the level information! This needs to be replaced when we have a proper mapping of (x,y)-position+level to the z posi...
62599059a79ad1619776b59b
class QandAInline(admin.TabularInline): <NEW_LINE> <INDENT> model = QandA <NEW_LINE> extra = 2
Set up a tabular list of questions and answers for the admin interface
6259905929b78933be26aba2
class Assign(Code): <NEW_LINE> <INDENT> def __init__(self, lhs, rhs): <NEW_LINE> <INDENT> self.lhs = lhs <NEW_LINE> self.rhs = rhs <NEW_LINE> super(Assign, self).__init__()
Assign object on right to object on left.
625990598da39b475be047a2
class Configuration(object): <NEW_LINE> <INDENT> def __init__(self, baseConfiguration): <NEW_LINE> <INDENT> self.baseUri = baseConfiguration.baseUri or "" <NEW_LINE> self.hostname = baseConfiguration.uriHostname or "" <NEW_LINE> self.basePath = baseConfiguration.uriPath or "/" <NEW_LINE> self.username = baseConfigurati...
Defines a set of SFTP configuration parameters.
625990593eb6a72ae038bc1b
class AllMarketDataSchema(MarketDataSchema): <NEW_LINE> <INDENT> history = f.List(f.Nested(HistoryItemSchema()), required=True) <NEW_LINE> asks = f.List(f.Nested(OrderItemSchema()), required=True) <NEW_LINE> bids = f.List(f.Nested(OrderItemSchema()), required=True)
A list of open buy and sell market orders, and the purchase history
6259905907d97122c4218260
class SugiyamaGraphWidget(RelationalVisualizationWidget): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> verbose_name = _("Sugiyama Graph") <NEW_LINE> verbose_name_plural = _("Sugiyama Graphs")
Widget which shows Sugiyama layered graph.
625990597b25080760ed87bd
class SearchVariantAnnotationSetsRunner(AbstractSearchRunner): <NEW_LINE> <INDENT> def __init__(self, args): <NEW_LINE> <INDENT> super(SearchVariantAnnotationSetsRunner, self).__init__(args) <NEW_LINE> self._variantSetId = args.variantSetId <NEW_LINE> <DEDENT> def _run(self, variantSetId): <NEW_LINE> <INDENT> iterator ...
Runner class for the variantannotationsets/search method.
62599059b7558d5895464a09
class Meta(object): <NEW_LINE> <INDENT> model = User <NEW_LINE> exclude = []
Meta options for the User Admin Form
62599059baa26c4b54d50860
class IOPubChannel(ZMQSocketChannel): <NEW_LINE> <INDENT> def __init__(self, context, session, address): <NEW_LINE> <INDENT> super(IOPubChannel, self).__init__(context, session, address) <NEW_LINE> self.ioloop = ioloop.IOLoop() <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> self.socket = self.context.socket(zmq...
The iopub channel which listens for messages that the kernel publishes. This channel is where all output is published to frontends.
625990590c0af96317c5783d
class hReview(LocationAwareMicroformat): <NEW_LINE> <INDENT> ITEM_TYPE = ( ('product', _('Product')), ('business', _('Business')), ('event', _('Event')), ('person', _('Person')), ('place', _('Place')), ('website', _('Website')), ('url', _('URL')), ('book', _('Book')), ('film', _('Film')), ('music', _('Music')), ('softw...
hReview is a simple, open, distributed format, suitable for embedding reviews (of products, services, businesses, events, etc.) in HTML, XHTML, Atom, RSS, and arbitrary XML. hReview is one of several microformats open standards. For more information see: http://microformats.org/wiki/hreview (I've omitted the "versio...
625990596e29344779b01c08
class UserSettingsForm(forms.Form): <NEW_LINE> <INDENT> username = forms.CharField(required=False, max_length=30) <NEW_LINE> email = forms.EmailField(required=False) <NEW_LINE> mobile_phone = forms.CharField(required=False, max_length=20) <NEW_LINE> desk_phone = forms.CharField(required=False, max_length=20) <NEW_LINE>...
Form to set BuildingSpeak user login info.
625990594e4d5625663739c3
class SumIntegerRV(RandomVariable): <NEW_LINE> <INDENT> def __init__(self, mass_function, ndraw): <NEW_LINE> <INDENT> mass_function = np.array(mass_function) <NEW_LINE> mass_function /= mass_function.sum() <NEW_LINE> self._rv = Multinomial(mass_function) <NEW_LINE> self._mass_fn = mass_function <NEW_LINE> self._mass_fu...
Given a mass function on non-negative integers, form the random variable that is the convolution of this mass function `ndraw` times The mass function specifies a random variable that is i with probability proportional to mass_function[i] is specifi
6259905916aa5153ce401aa0
class GroupMembershipAuth(AmivTokenAuth): <NEW_LINE> <INDENT> def has_resource_write_permission(self, user_id): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def has_item_write_permission(self, user_id, item): <NEW_LINE> <INDENT> if user_id == str(get_id(item['user'])): <NEW_LINE> <INDENT> return True <NEW_LINE> ...
Auth for group memberships.
62599059ac7a0e7691f73a9d
@python_2_unicode_compatible <NEW_LINE> class Country(models.Model): <NEW_LINE> <INDENT> country = CountryField( db_index=True, unique=True, help_text=ugettext_lazy("Two character ISO country code.") ) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return "{name} ({code})".format( name=str(self.country.name), code=s...
Representation of a country. This is used to define country-based access rules. There is a data migration that creates entries for each country code. .. no_pii:
62599059379a373c97d9a5e1
class InputFiles: <NEW_LINE> <INDENT> def __init__(self, file1: BinaryIO, interleaved: bool = False): <NEW_LINE> <INDENT> self.file1 = file1 <NEW_LINE> self.interleaved = interleaved <NEW_LINE> <DEDENT> def open(self): <NEW_LINE> <INDENT> return dnaio.open(self.file1, interleaved=self.interleaved, mode="r")
this is from cutadapt - basically just creates a dnaio object
625990598e7ae83300eea64a
class DatabaseExercise(models.Model): <NEW_LINE> <INDENT> name = models.CharField( max_length=128 ) <NEW_LINE> description = models.TextField( max_length=256, null=True, blank=True ) <NEW_LINE> image = models.ImageField( null=True, blank=True ) <NEW_LINE> is_active = models.BooleanField( verbose_name='activity', defaul...
DatabaseExercise model stores information about all exercises used in the training process.
62599059460517430c432b30
class TrainingHistory: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.data = [] <NEW_LINE> <DEDENT> def add(self, epoch_result): <NEW_LINE> <INDENT> self.data.append(epoch_result) <NEW_LINE> <DEDENT> def frame(self): <NEW_LINE> <INDENT> return pd.DataFrame(self.data).set_index('epoch_idx')
Simple aggregator for the training history. An output of training storing scalar metrics in a pandas dataframe.
6259905915baa7234946354f
class _PRO(object): <NEW_LINE> <INDENT> __slot__ = 'name', 'maxx', 'allocation', 'need', 'flag' <NEW_LINE> def __init__(self, name, maxx, allocation, need, flag=False): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.maxx = maxx <NEW_LINE> self.allocation = allocation <NEW_LINE> self.need = need <NEW_LINE> self.fl...
内部节点类 用于实现进程的独立
625990592c8b7c6e89bd4dab
class LabelSmoothing(nn.Module): <NEW_LINE> <INDENT> def __init__(self, size, padding_idx, smoothing=0.0): <NEW_LINE> <INDENT> super(LabelSmoothing, self).__init__() <NEW_LINE> self.criterion = nn.KLDivLoss(size_average=False) <NEW_LINE> self.padding_idx = padding_idx <NEW_LINE> self.confidence = 1.0 - smoothing <NEW_L...
Implement label smoothing.
62599059a79ad1619776b59c
class UserOauthToken(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField( User, on_delete=models.CASCADE, help_text='User for whom token is generated', ) <NEW_LINE> access_token = models.CharField( max_length=255, blank=False, help_text='Access Token of the user which is used to access the content' ) <NEW_LI...
Stores User's Oauth2 details
62599059e5267d203ee6ce9f
class AmE06(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> input = open("./Corpus/AmE06/AmE06.pkl", 'rb') <NEW_LINE> reader = load(input) <NEW_LINE> input.close() <NEW_LINE> <DEDENT> except IOError as e: <NEW_LINE> <INDENT> filelist = [] <NEW_LINE> words = [] <NEW_LINE> fo...
Class for the AmE06 Wordlist corpora construction and encapsulation.
62599059d7e4931a7ef3d63d
class Parameter(object): <NEW_LINE> <INDENT> EQUALS_OPERATION = '=' <NEW_LINE> NOT_EQUALS_OPERATION = '!=' <NEW_LINE> GREATER_THAN_OPERATION = '>' <NEW_LINE> GREATER_THAN_OR_EQUALS_OPERATION = '>=' <NEW_LINE> LESS_THAN_OPERATION = '<' <NEW_LINE> LESS_THAN_OR_EQUALS_OPERATION = '<=' <NEW_LINE> CONTAINS_OPERATION = '=~' ...
A data-filtering parameter.
62599059a17c0f6771d5d680
class RequestResult(object): <NEW_LINE> <INDENT> def __init__(self, request_id): <NEW_LINE> <INDENT> self.request_id = request_id <NEW_LINE> self.request_timeout_count = 60 <NEW_LINE> self.request_timeout = 5 <NEW_LINE> <DEDENT> def status(self, service): <NEW_LINE> <INDENT> for count in range(self.request_timeout_coun...
operate on azure request ID and provide methods to get status information as well as define operations based on the request status
6259905973bcbd0ca4bcb851
class View(object): <NEW_LINE> <INDENT> methods = None <NEW_LINE> decorators = () <NEW_LINE> def dispatch_request(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def as_view(cls, name, *class_args, **class_kwargs): <NEW_LINE> <INDENT> def view(*args, **kwargs): <NEW_LI...
Alternative way to use view functions. A subclass has to implement :meth:`dispatch_request` which is called with the view arguments from the URL routing system. If :attr:`methods` is provided the methods do not have to be passed to the :meth:`~flask.Flask.add_url_rule` method explicitly:: class MyView(View): ...
625990594428ac0f6e659af9
class TestProbKill(object): <NEW_LINE> <INDENT> def setup(self): <NEW_LINE> <INDENT> self.copy_prob_kill = Carnivore.prob_kill <NEW_LINE> self.copy_params = Carnivore.params.copy() <NEW_LINE> self.carn = Carnivore(20, 13) <NEW_LINE> self.herb = Herbivore(20, 13) <NEW_LINE> <DEDENT> def teardown(self): <NEW_LINE> <INDEN...
Collects test that uses different parameters than default and allows us to override methods.
625990590c0af96317c5783e
class DockerImage(object): <NEW_LINE> <INDENT> def __init__(self, repo, tag, client=None): <NEW_LINE> <INDENT> self.repo = repo <NEW_LINE> self.tag = tag <NEW_LINE> self.client = client <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "<DockerImage(" + self.repo + "," + self.tag + ")>" <NEW_LINE> <DED...
Simple representation of a docker image as defined by the repo and tag fields
6259905976e4537e8c3f0b4a
class DivFunction(DiffFunction): <NEW_LINE> <INDENT> def __init__(self, f1, f2): <NEW_LINE> <INDENT> if f1.ndim != f2.ndim: <NEW_LINE> <INDENT> raise ValueError('functions dimension mismatch.') <NEW_LINE> <DEDENT> DiffFunction.__init__(self, _intersection(f1.input_ranges, f2.input_ranges), delta_list=None) <NEW_LINE> s...
division of two DiffFunctions Parameters ---------- f1 : DiffFunction the first function. f2 : DiffFunction the second function.
62599059b5575c28eb7137ab
class DropdownToolButton(QToolButtonBase): <NEW_LINE> <INDENT> TOOLTIP = '' <NEW_LINE> def __init__(self, icon, parent=None): <NEW_LINE> <INDENT> super(DropdownToolButton, self).__init__(icon, parent) <NEW_LINE> self.setToolTip(self.TOOLTIP) <NEW_LINE> self.setPopupMode(QToolButtonBase.InstantPopup) <NEW_LINE> self.set...
A toolbutton with a dropdown menu.
62599059379a373c97d9a5e3
class Configuration(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.username = getpass.getuser() <NEW_LINE> self.email = getpass.getuser()+'@localhost'
Class provides configuration parameters to all commands and sub commands
6259905945492302aabfda96
class InvalidPluginFileMethodAlreadyExistError(Exception): <NEW_LINE> <INDENT> pass
Raise when two methods with the same name exist in a plugin file
62599059d6c5a102081e36df
class Ubicacion(models.Model): <NEW_LINE> <INDENT> nombreCorto = models.CharField(max_length = 25) <NEW_LINE> nombreLargo = models.CharField(max_length = 50, blank = True) <NEW_LINE> idPincel = models.CharField(max_length = 25, unique = True) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.nombreCorto
Representa un tipo de ubicación dentro del centro escolar.
625990593617ad0b5ee07709
class FlowField( HasPrivateTraits ): <NEW_LINE> <INDENT> digest = Property <NEW_LINE> def _get_digest( self ): <NEW_LINE> <INDENT> return '' <NEW_LINE> <DEDENT> def v( self, xx): <NEW_LINE> <INDENT> v = array((0., 0., 0.)) <NEW_LINE> dv = array(((0., 0., 0.), (0., 0., 0.), (0., 0., 0.))) <NEW_LINE> return -v, -dv
An abstract base class for a spatial flow field.
625990590fa83653e46f64a5
class FeatureNotSpecifiedError(FeatureError): <NEW_LINE> <INDENT> pass
Exception raised when a feature is unexpectedly not specified.
6259905982261d6c527309aa
class MultilineText(Element): <NEW_LINE> <INDENT> def __init__(self, text="", size=None, elements=None, normal_params=None): <NEW_LINE> <INDENT> Element.__init__(self, text, elements, normal_params) <NEW_LINE> self._size = size <NEW_LINE> self.visible = False <NEW_LINE> <DEDENT> def finish(self): <NEW_LINE> <INDENT> El...
Simple text on multiple lines.
62599059a219f33f346c7dc4
class OrderedCounter(Counter, OrderedDict): <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> return "%s(%r)" % (self.__class__.__name__, OrderedDict(self)) <NEW_LINE> <DEDENT> def __reduce__(self): <NEW_LINE> <INDENT> return self.__class__, (OrderedDict(self),)
Counter that remembers the order elements are first encountered Examples: >>> OrderedCounter('abracadabra') OrderedCounter(OrderedDict([('a', 5), ('b', 2), ('r', 2), ('c', 1), ('d', 1)]))
625990599c8ee82313040c6a
class InitialReissuanceTokenTest(BitcoinTestFramework): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.setup_clean_chain = True <NEW_LINE> self.num_nodes = 2 <NEW_LINE> self.node_args = [["-initialreissuancetokens=200000000", "-initialfreecoins=2000000000000000"], ["-init...
Test creation of initial reissuance token for default asset on chain set up
625990598e71fb1e983bd089
class SpatialImage4D(SpatialImage3D): <NEW_LINE> <INDENT> def __init__(self, file_path, name, interp_order, output_pixdim, output_axcodes, loader): <NEW_LINE> <INDENT> SpatialImage3D.__init__(self, file_path=file_path, name=name, interp_order=interp_order, output_pixdim=output_pixdim, output_axcodes=output_axcodes, loa...
4D image from a set of 3D volumes, supports resampling and reorientation. The 3D volumes are concatenated in the fifth dim (modality dim) (4D image from a single file is currently not supported)
625990597d847024c075d99c
@Registers.agent <NEW_LINE> class CartpoleDqn(Agent): <NEW_LINE> <INDENT> def __init__(self, env, alg, agent_config, **kwargs): <NEW_LINE> <INDENT> super(CartpoleDqn, self).__init__(env, alg, agent_config, **kwargs) <NEW_LINE> self.epsilon = 1.0 <NEW_LINE> self.episode_count = agent_config.get("episode_count", 100000) ...
Cartpole Agent with dqn algorithm.
62599059cb5e8a47e493cc66
class TestStructure(unittest.TestCase): <NEW_LINE> <INDENT> def test_structure(self): <NEW_LINE> <INDENT> structure = foundations.data_structures.Structure(John="Doe", Jane="Doe") <NEW_LINE> self.assertIn("John", structure) <NEW_LINE> self.assertTrue(hasattr(structure, "John")) <NEW_LINE> setattr(structure, "John", "Ne...
Defines :class:`foundations.data_structures.Structure` class units tests methods.
625990597b25080760ed87bf
class Transactional(object): <NEW_LINE> <INDENT> def __init__(self, method): <NEW_LINE> <INDENT> self.method = method <NEW_LINE> <DEDENT> def __get__(self, obj, T): <NEW_LINE> <INDENT> def transaction(*args, **kwargs): <NEW_LINE> <INDENT> state = memento(obj) <NEW_LINE> try: <NEW_LINE> <INDENT> return self.method(obj, ...
Adds transactional semantics to methods. Methods decorated with @Transactional will rollback to entry-state upon exceptions.
6259905963b5f9789fe86732
class ItemSelectedEvent(Event): <NEW_LINE> <INDENT> def __init__(self, item): <NEW_LINE> <INDENT> self.__item = item <NEW_LINE> <DEDENT> @property <NEW_LINE> def item(self): <NEW_LINE> <INDENT> return self.__item
Item selected in the project tree.
6259905976e4537e8c3f0b4c
class MessagePrinter: <NEW_LINE> <INDENT> def __init__(self, dbg): <NEW_LINE> <INDENT> self.debugMode = dbg <NEW_LINE> self.verboseMode = False <NEW_LINE> self.prefix = '' <NEW_LINE> <DEDENT> def setVerbose(self): <NEW_LINE> <INDENT> self.verboseMode = True <NEW_LINE> <DEDENT> def setPrefix(self, prefix): <NEW_LINE> <I...
i dunno. stuff.
62599059b5575c28eb7137ac
class Scale(Widget): <NEW_LINE> <INDENT> def __init__(self, master=None, cnf={}, **kw): <NEW_LINE> <INDENT> Widget.__init__(self, master, 'scale', cnf, kw) <NEW_LINE> <DEDENT> def get(self): <NEW_LINE> <INDENT> value = self.tk.call(self._w, 'get') <NEW_LINE> try: <NEW_LINE> <INDENT> return self.tk.getint(value) <NEW_LI...
Scale widget which can display a numerical scale.
6259905945492302aabfda98
class RunningMeter(object): <NEW_LINE> <INDENT> def __init__(self, name, val=None, smooth=0.99): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._sm = smooth <NEW_LINE> self._val = val <NEW_LINE> <DEDENT> def __call__(self, value): <NEW_LINE> <INDENT> val = (value if self._val is None else value*(1-self._sm) + se...
running meteor of a scalar value (useful for monitoring training loss)
625990594a966d76dd5f04b2
class PosteriorTrace(SampleStream): <NEW_LINE> <INDENT> def __init__(self, generator=None, plot_every=1000, window=False, block=False, file='trace.pdf'): <NEW_LINE> <INDENT> self.__dict__.update(locals()) <NEW_LINE> self.posteriors = [] <NEW_LINE> self.priors = [] <NEW_LINE> self.likelihoods = [] <NEW_LINE> SampleStrea...
A class for plotting/showing a posterior summary trace plot.
62599059d6c5a102081e36e1
@method_decorator(user_passes_test(is_center), name="dispatch") <NEW_LINE> class AnnounTfmCreateView(CreateView): <NEW_LINE> <INDENT> model = AnnouncementsTfm <NEW_LINE> template_name = "announcements/announcements_form.html" <NEW_LINE> form_class = CreateAnnouncementsTfmForm <NEW_LINE> success_url = reverse_lazy("anno...
Controlador para la actualización de la información de una convocatoria. Atributos model(models.Model): Modelo que se quiere crear. template_name(str): template donde se va a renderizar la vista. form_class(forms.Modelform): formulario para la creación del modelo. success_url(str): url de redirección c...
6259905932920d7e50bc7607
class TXTJSONFormatter(TXTFormatter): <NEW_LINE> <INDENT> ext = 'json' <NEW_LINE> def write(self, content, stream): <NEW_LINE> <INDENT> collection = [{'id': doc.id, 'text': ''.join(self._iter_text(doc))} for doc in content.units('document')] <NEW_LINE> json.dump(collection, stream)
Formatter for multiple plain-text documents embedded in JSON.
62599059baa26c4b54d50865
class Players(OOBTree): <NEW_LINE> <INDENT> implements(interfaces.IPlayers) <NEW_LINE> def get_player(self, player_id): <NEW_LINE> <INDENT> return self.get(player_id) <NEW_LINE> <DEDENT> def create_player(self, name, details): <NEW_LINE> <INDENT> player_id = str(uuid.uuid4()) <NEW_LINE> self[player_id] = Player(name, d...
Players container, which contains individual player data objects
625990597d847024c075d99e
class NUMERIC(_NumericType, sqltypes.NUMERIC): <NEW_LINE> <INDENT> __visit_name__ = 'NUMERIC' <NEW_LINE> def __init__(self, precision=None, scale=None, asdecimal=True, **kw): <NEW_LINE> <INDENT> super(NUMERIC, self).__init__(precision=precision, scale=scale, asdecimal=asdecimal, **kw)
MySQL NUMERIC type.
6259905999cbb53fe68324a1
class Products(models.Model): <NEW_LINE> <INDENT> openfoodfats_id = models.BigIntegerField(null=True) <NEW_LINE> name_product = models.CharField(max_length=150, unique=True) <NEW_LINE> nutriscore_product = models.CharField(max_length=1) <NEW_LINE> store_product = models.CharField(max_length=100) <NEW_LINE> picture = mo...
Second class to load lot of product of each categories on the site openfoodfacts
62599059b7558d5895464a0c
class Attention(nn.Module): <NEW_LINE> <INDENT> def __init__(self, d_model=300): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.q_linear = nn.Linear(d_model, d_model) <NEW_LINE> self.v_linear = nn.Linear(d_model, d_model) <NEW_LINE> self.k_linear = nn.Linear(d_model, d_model) <NEW_LINE> self.out = nn.Linear(d_m...
Attention1つ分
6259905907d97122c4218266
class WindowsFileLock(BaseFileLock): <NEW_LINE> <INDENT> def _acquire(self): <NEW_LINE> <INDENT> open_mode = os.O_RDWR | os.O_CREAT | os.O_TRUNC <NEW_LINE> try: <NEW_LINE> <INDENT> fd = os.open(self._lock_file, open_mode) <NEW_LINE> <DEDENT> except OSError: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> else: <NEW_LINE> ...
Uses the :func:`msvcrt.locking` function to hard lock the lock file on windows systems.
6259905923e79379d538dabe
class ModelOnProbation(models.Model): <NEW_LINE> <INDENT> last_encountered = models.DateTimeField(auto_now_add=True) <NEW_LINE> last_encountered_admin_field_entry = ('Scraping information', {'fields': ['last_encountered'], 'classes': ['collapse']}) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> <...
An abstract model that includes a field representing the last time it was encountered during scraping. If this item is not encountered during a scraping pass, it should be deleted (since it no longer exists).
62599059fff4ab517ebcede6
class RootDirectory(Directory): <NEW_LINE> <INDENT> default_icon = 'server.png' <NEW_LINE> icon_map = [] <NEW_LINE> _rootdirs = {} <NEW_LINE> def __new__(cls, path, autoindex=None): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return RootDirectory._rootdirs[(path, autoindex)] <NEW_LINE> <DEDENT> except KeyError as e: <...
This class wraps a root directory.
6259905945492302aabfda9a
class AdviceBar(base.BaseGadget): <NEW_LINE> <INDENT> short_description = 'Advice Bar' <NEW_LINE> description = 'Allows learners to receive advice from predefined tips.' <NEW_LINE> height_px = 300 <NEW_LINE> width_px = 100 <NEW_LINE> panel = 'bottom' <NEW_LINE> _dependency_ids = [] <NEW_LINE> _customization_arg_specs =...
Base gadget for providing an AdviceBar.
625990597047854f46340982
class NamedObject: <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return self.name == other.name <NEW_LINE> <DEDENT> def __ne__(self, other): <NEW_LINE> <INDENT> return not (self == other) <NEW_LINE> <DEDENT> def __hash...
Provides functionality for an object to be described by name. If this is listed as a parent class, an object will use name in equality comparisons, hash functions, and string outputs.
625990597cff6e4e811b7006
class LayerNorm(nn.Module): <NEW_LINE> <INDENT> def __init__(self, d): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.gamma = nn.Parameter(torch.ones(d), requires_grad=True) <NEW_LINE> self.beta = nn.Parameter(torch.zeros(d), requires_grad=True) <NEW_LINE> <DEDENT> def forward(self, x): <NEW_LINE> <INDENT> mean...
Applies layer normalization to last dimension Args: d: dimension of hidden units
62599059627d3e7fe0e0844f
class TestBootFromVolumeIsolatedHostsFilter( test.TestCase, integrated_helpers.InstanceHelperMixin): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestBootFromVolumeIsolatedHostsFilter, self).setUp() <NEW_LINE> self.useFixture(nova_fixtures.RealPolicyFixture()) <NEW_LINE> self.useFixture(nova_fixtures....
Regression test for bug #1746483 The IsolatedHostsFilter checks for images restricted to certain hosts via config options. When creating a server from a root volume, the image is in the volume (and it's related metadata from Cinder). When creating a volume-backed server, the imageRef is not required. The regression i...
62599059097d151d1a2c262f
class Pylearn2DatasetNoise(Dataset): <NEW_LINE> <INDENT> def __init__(self, dataset, batch_size, noise_dim, which_sources=[0,1], **kwargs): <NEW_LINE> <INDENT> self.pylearn2_dataset = dataset <NEW_LINE> self.sources = self.pylearn2_dataset.get_data_specs()[1] <NEW_LINE> self.sources = tuple([self.sources[i] for i in wh...
Pylearn2DatasetNoise is the same as `Pylearn2Dataset` with some an extra batch of random nubmer. Parameters ---------- dataset: `pylearn2.dataset` object Note that this is expecting the actual the object will be initialized inside batch_size: int Batch size to be used by the `pylearn2.dataset` iterator. no...
625990591b99ca4002290019
class MatrixFactorizationConfig(object): <NEW_LINE> <INDENT> learning_rate = 2e-2 <NEW_LINE> epochs = 1000 <NEW_LINE> max_users_num = 943 <NEW_LINE> max_items_num = 1682 <NEW_LINE> decay_rate = 1.0 <NEW_LINE> data_file = os.path.join(BasicConfig.DATA_ROOT, 'mf/u.data') <NEW_LINE> checkpoints_dir = os.path.join(BasicCon...
configuration for matrix factorization model
62599059507cdc57c63a6368
class AdapterInterface(object): <NEW_LINE> <INDENT> def __init__(self, container): <NEW_LINE> <INDENT> self.settings = get_settings(container) <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return '{}.{}'.format(self.__module__, type(self).__name__) <NEW_LINE> <DEDENT> def describe_adapter...
Common interface allowing functionality overriding using an adapter implementation.
62599059a17c0f6771d5d683
class CompanyName(db.Model): <NEW_LINE> <INDENT> id = db.Column(db.Integer, db.Sequence('company_name_id_seq'), primary_key=True) <NEW_LINE> company_id = db.Column(db.Integer, db.ForeignKey('company.id'), nullable=False) <NEW_LINE> company = db.relationship('Company', backref=db.backref('names', lazy=True)) <NEW_LINE> ...
회사 이름(다국어)
6259905924f1403a926863b0
class SetDescriptions(Resource): <NEW_LINE> <INDENT> def put(self): <NEW_LINE> <INDENT> roomId = request.form['roomId'] <NEW_LINE> description = request.form['description'] <NEW_LINE> try: <NEW_LINE> <INDENT> r = rocket.groups_set_description(room_id=roomId,description=description) <NEW_LINE> <DEDENT> except Exception ...
设置群组描述 https://rocket.chat/docs/developer-guides/rest-api/groups/setdescription/
625990594428ac0f6e659aff
class TwentyTwenty(AbstractCMS): <NEW_LINE> <INDENT> left_legend = models.CharField(_(u'Left Legend'), max_length=200, blank=True) <NEW_LINE> left_image = models.ImageField(_(u'Left Image'), upload_to='product_onepage') <NEW_LINE> right_legend = models.CharField(_(u'Right Legend'), max_length=200, blank=True) <NEW_LINE...
TwentyTwenty content to use the TwentyTwenty library that merge two images in divided slider to visually compare them
62599059379a373c97d9a5e8
class Database(object): <NEW_LINE> <INDENT> def __init__(self, url, **kwargs): <NEW_LINE> <INDENT> self._engine = create_engine(url, pool_pre_ping=True, pool_recycle=3600, **kwargs) <NEW_LINE> self._Session = sessionmaker(bind=self._engine, expire_on_commit=False) <NEW_LINE> <DEDENT> def get_engine(self): <NEW_LINE> <I...
Maintains state for accessing the database.
625990593eb6a72ae038bc23
class SecurityPolicy(ParanoidSecurityPolicy): <NEW_LINE> <INDENT> classProvides(ISecurityPolicy) <NEW_LINE> implements(IInteraction) <NEW_LINE> def checkPermission(self, permission, object): <NEW_LINE> <INDENT> return checkPermission(permission, object)
Security policy that bridges between zope.security security mechanisms and Zope 2's security policy. Don't let the name of the base class fool you... This really just delegates to Zope 2's security manager.
625990596e29344779b01c10
class AssertionCredentials(OAuth2Credentials): <NEW_LINE> <INDENT> def __init__(self, assertion_type, user_agent, token_uri='https://accounts.google.com/o/oauth2/token', **kwargs): <NEW_LINE> <INDENT> super(AssertionCredentials, self).__init__( None, None, None, None, None, token_uri, user_agent) <NEW_LINE> self.assert...
Abstract Credentials object used for OAuth 2.0 assertion grants This credential does not require a flow to instantiate because it represents a two legged flow, and therefore has all of the required information to generate and refresh its own access tokens. It must be subclassed to generate the appropriate assertion s...
6259905956ac1b37e63037c9
class ApiTaskStatus(Enum): <NEW_LINE> <INDENT> STARTING = 'starting' <NEW_LINE> PAUSING = 'pausing' <NEW_LINE> STOPPING = 'stopping' <NEW_LINE> DELETING = 'deleting' <NEW_LINE> DELETED = 'deleted' <NEW_LINE> COMPLETED = 'completed' <NEW_LINE> ERROR = 'error'
Enumeration with all possible(supported) api statuses
62599059e64d504609df9eb1
class DynamicFormatMiddleware: <NEW_LINE> <INDENT> def _flatten_dict(self, obj, prefix=''): <NEW_LINE> <INDENT> encoded_dict = QueryDict('').copy() <NEW_LINE> if hasattr(obj, 'items'): <NEW_LINE> <INDENT> for key, value in obj.items(): <NEW_LINE> <INDENT> item_key = '%(prefix)s%(key)s' % { 'prefix': prefix, 'key': key ...
Provides support for dynamic content negotiation, both in request and reponse.
625990598e7ae83300eea651
class Strategy(object, metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> def master_setup(self): <NEW_LINE> <INDENT> self.scheduled_functions = [] <NEW_LINE> self.setup() <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def get_signals(self, event): <NEW_LINE> <INDENT> raise NotImplementedError("Should implement get_signal...
Class defining a trading strategy. ... Attributes ---------- scheduled_functions(list) A list of scheduled functions for the strategy Methods ------- get_signals
62599059a8ecb033258727db
class EventLogModel(BaseModel): <NEW_LINE> <INDENT> start_time = pw.DateTimeField(default=datetime.now) <NEW_LINE> end_time = pw.DateTimeField(default=datetime.now) <NEW_LINE> category = pw.CharField() <NEW_LINE> subcommand = pw.CharField(null=True) <NEW_LINE> message = pw.CharField(null=True) <NEW_LINE> returncode = p...
Keep a log of background jobs.
6259905955399d3f05627ae4
class ProfileHandlerAPI(SessionHandler): <NEW_LINE> <INDENT> def get(self, profile_id): <NEW_LINE> <INDENT> viewer = self.user_model <NEW_LINE> q = User.query(User.username == profile_id) <NEW_LINE> user = q.get() <NEW_LINE> user_json = {} <NEW_LINE> if user != None: <NEW_LINE> <INDENT> user_json['type'] = "user" <NEW_...
handler to display a profile page
625990597047854f46340984
class Bonk(TBase): <NEW_LINE> <INDENT> def __init__(self, type=None, message=None,): <NEW_LINE> <INDENT> self.type = type <NEW_LINE> self.message = message <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> L = ['%s=%r' % (key, value) for key, value in self.__dict__.items()] <NEW_LINE> return '%s(%s)' % (self....
Attributes: - type - message
6259905991f36d47f2231972
class TestMatch(TestCase): <NEW_LINE> <INDENT> def test_show_hide(self): <NEW_LINE> <INDENT> vim = Mock() <NEW_LINE> arg = _MatchArg(Mark(1, 3), Mark(5, 9), 'sent') <NEW_LINE> match = _Match(arg, vim) <NEW_LINE> vim.add_match.side_effect = [12] <NEW_LINE> match.show(3) <NEW_LINE> vim.add_match.assert_called_once_with( ...
Test for call `_Match`.
625990594a966d76dd5f04b6
class undoiter: <NEW_LINE> <INDENT> def __init__(self, base_iter): <NEW_LINE> <INDENT> self._itr = base_iter <NEW_LINE> self._undo_stack=[] <NEW_LINE> <DEDENT> def next(self): <NEW_LINE> <INDENT> if self._undo_stack: <NEW_LINE> <INDENT> return self._undo_stack.pop() <NEW_LINE> <DEDENT> return self._itr.next() <NEW_LINE...
Undoable iterator class
6259905999cbb53fe68324a4
class CTD_ANON_24 (pyxb.binding.basis.complexTypeDefinition): <NEW_LINE> <INDENT> _TypeDefinition = pyxb.binding.datatypes.decimal <NEW_LINE> _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_SIMPLE <NEW_LINE> _Abstract = False <NEW_LINE> _ExpandedName = None <NEW_LINE> _XSDLocation = pyxb.utils.utility.Lo...
Complex type [anonymous] with content type SIMPLE
62599059009cb60464d02af9
class Credential: <NEW_LINE> <INDENT> credential_list=[] <NEW_LINE> def __init__(self,account_name,password): <NEW_LINE> <INDENT> self.account_name = account_name <NEW_LINE> self.password = password <NEW_LINE> <DEDENT> credential_list=[] <NEW_LINE> def save_credential(self): <NEW_LINE> <INDENT> Credential.credential_li...
class that generates new instance for credentials
62599059d99f1b3c44d06c66
class PlaceTypeForm(ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = PlaceType <NEW_LINE> exclude = ('slug', ) <NEW_LINE> widgets = { 'label':TextInput(attrs={'class':'input-medium search-query'}) }
PlaceType model form
62599059a17c0f6771d5d684
class LowLevelClient: <NEW_LINE> <INDENT> def __init__(self, access_token, service_url): <NEW_LINE> <INDENT> self.accessToken = access_token <NEW_LINE> if service_url is None: <NEW_LINE> <INDENT> self.serviceUrl = TAGLIATELLE_URL <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.serviceUrl = service_url <NEW_LINE> <DE...
This class wraps all the low level operations with Tagliatelle API
6259905945492302aabfda9d
class DelayedEvent(_messages.Message): <NEW_LINE> <INDENT> cause = _messages.StringField(1) <NEW_LINE> metrics = _messages.StringField(2, repeated=True)
An event generated whenever a resource limitation or transient error delays execution of a pipeline that was otherwise ready to run. Fields: cause: A textual description of the cause of the delay. The string can change without notice because it is often generated by another service (such as Compute Engine). ...
625990590a50d4780f7068a1
class Limits(object): <NEW_LINE> <INDENT> def __init__(self, max_text_features=80, max_css_features=120, max_links=2500): <NEW_LINE> <INDENT> self.max_text_features = max_text_features <NEW_LINE> self.max_css_features = max_css_features <NEW_LINE> self.max_links = max_links
Limits to avoid exploding memory consumption in some cases
6259905921a7993f00c67533
class ExecutionError(Exception): <NEW_LINE> <INDENT> def __init__(self, msg): <NEW_LINE> <INDENT> self.message = self.msg = msg <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "Execution Error: {0}".format(self.msg)
Exception for errors in the runtime module. Args: msg (str): A message describing the error.
62599059fff4ab517ebcedea
class Resize(object): <NEW_LINE> <INDENT> def __init__(self, size=256): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> <DEDENT> def __call__(self, sample): <NEW_LINE> <INDENT> image_x, image_ir, image_depth, binary_mask, spoofing_label = sample['image_x'], sample['image_ir'], sample['image_depth'], sample['binary_mask...
Convert ndarrays in sample to Tensors. process only one batch every time
62599059435de62698e9d3ca
class IapProjectsIapTunnelZonesInstancesGetIamPolicyRequest(_messages.Message): <NEW_LINE> <INDENT> getIamPolicyRequest = _messages.MessageField('GetIamPolicyRequest', 1) <NEW_LINE> resource = _messages.StringField(2, required=True)
A IapProjectsIapTunnelZonesInstancesGetIamPolicyRequest object. Fields: getIamPolicyRequest: A GetIamPolicyRequest resource to be passed as the request body. resource: REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this fiel...
625990594e4d5625663739cd
class BuildFeed(Command): <NEW_LINE> <INDENT> def get_options(self): <NEW_LINE> <INDENT> return [ Option('-v', '--validate', dest='validate', action="store_true", default=False), Option('-e', '--extract', dest='extract', action="store_true", default=False), Option('-u', '--upload', dest='upload', action="store_true", d...
Builds a feed
62599059498bea3a75a590df
class A: <NEW_LINE> <INDENT> def __setattr__(self, *args): <NEW_LINE> <INDENT> pass
Not an attrs class on purpose to prevent accidental resets that would render the asserts meaningless.
62599059b5575c28eb7137af
class UserInfoResponse(Response): <NEW_LINE> <INDENT> def __init__(self, user, *args, **kwargs): <NEW_LINE> <INDENT> super(UserInfoResponse, self).__init__(*args, **kwargs) <NEW_LINE> self.user = user
Inherits from :class:`.Response`, adds :attr:`~UserInfoResponse.user` attribute.
6259905955399d3f05627ae6
class DiscoveryAwsKmsMasterKeyProvider(BaseKMSMasterKeyProvider): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(DiscoveryAwsKmsMasterKeyProvider, self).__init__(**kwargs) <NEW_LINE> self.vend_masterkey_on_decrypt = True <NEW_LINE> <DEDENT> def validate_config(self): <NEW_LINE> <INDENT> if ...
Discovery Master Key Provider for KMS. This can only be used for decryption. It is configured with an optional Discovery Filter containing AWS account ids and partitions that should be trusted for decryption. If a ciphertext was encrypted with an AWS KMS master key that matches an account and partition listed by this...
6259905932920d7e50bc760c
class Api(object): <NEW_LINE> <INDENT> def __init__(self, loop, port=8099, site=None): <NEW_LINE> <INDENT> loop = loop or asyncio.get_event_loop() <NEW_LINE> self.app = web.Application(loop=loop) <NEW_LINE> self.port = port <NEW_LINE> self.site = site <NEW_LINE> self.app.router.add_get('/', self.index) <NEW_LINE> self....
Application Interface for RPS
62599059be8e80087fbc064a
class MockDailyBarSpotReader(object): <NEW_LINE> <INDENT> def spot_price(self, sid, day, column): <NEW_LINE> <INDENT> return 100.0
A BcolzDailyBarReader which returns a constant value for spot price.
625990598a43f66fc4bf3754
class Mc(AutotoolsPackage): <NEW_LINE> <INDENT> homepage = "https://midnight-commander.org" <NEW_LINE> url = "http://ftp.midnight-commander.org/mc-4.8.20.tar.bz2" <NEW_LINE> version('4.8.20', 'dcfc7aa613c62291a0f71f6b698d8267') <NEW_LINE> depends_on('ncurses') <NEW_LINE> depends_on('pkgconfig', type='build') <NEW_...
The GNU Midnight Commander is a visual file manager.
625990598e71fb1e983bd090
class UShortStat(DoubleBufferedStat): <NEW_LINE> <INDENT> buffer_type = ctypes.c_uint16
16bit Double Buffered Unsigned Integer field
62599059adb09d7d5dc0bb31