code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class DSF_MaxValue(DescriptiveStatisticFn): <NEW_LINE> <INDENT> def __call__(self, d): <NEW_LINE> <INDENT> p = self.value_scale[1] * (d.max_value_bin() + self.value_scale[0]) <NEW_LINE> s = self.selectivity_scale[1] * (self.selectivity(d)+self.selectivity_scale[0]) <NEW_LINE> return {"": Pref(preference=p, selectivity=...
Return the peak value of the given distribution
62598fb6a8370b77170f04ce
class Decision(object): <NEW_LINE> <INDENT> def __call__(self, simulation, source): <NEW_LINE> <INDENT> raise NotImplementedError
The base decision class. A decision is a functor that performs selective and structured agent computation during a simulation step.
62598fb6be8e80087fbbf158
class SizeProbe(ProbeModule): <NEW_LINE> <INDENT> def __init__(self, key, echo=True, out=None): <NEW_LINE> <INDENT> ProbeModule.__init__(self, key) <NEW_LINE> self.echo = print if echo is True else echo <NEW_LINE> self.out = out <NEW_LINE> <DEDENT> def do_probe(self, x): <NEW_LINE> <INDENT> size_info = x.shape if hasat...
Inspect the size of upstream data.
62598fb6cc0a2c111447b0ff
class Trie: <NEW_LINE> <INDENT> def __init__(self, c): <NEW_LINE> <INDENT> self.children = [None] * 26 <NEW_LINE> self.char = c <NEW_LINE> self.s_node = [None] * 26 <NEW_LINE> self.is_end_of_word = False <NEW_LINE> self.name_or_surname = [] <NEW_LINE> <DEDENT> def add_child(self, ch, index): <NEW_LINE> <INDENT> if not ...
Trie to make searching faster
62598fb6f548e778e596b694
class DiscreteEnv(Env): <NEW_LINE> <INDENT> def __init__(self, nS, nA, P, isd): <NEW_LINE> <INDENT> self.action_space = spaces.Discrete(nA) <NEW_LINE> self.observation_space = spaces.Discrete(nS) <NEW_LINE> self.nA = nA <NEW_LINE> self.P = P <NEW_LINE> self.isd = isd <NEW_LINE> self.lastaction=None <NEW_LINE> <DEDENT> ...
Has the following members - nS: number of states - nA: number of actions - P: transitions (*) - isd: initial state distribution (**) (*) dictionary dict of dicts of lists, where P[s][a] == [(probability, nextstate, reward, done), ...] (**) list or array of length nS
62598fb663d6d428bbee289e
class A(AutotoolsPackage): <NEW_LINE> <INDENT> homepage = "http://www.example.com" <NEW_LINE> url = "http://www.example.com/a-1.0.tar.gz" <NEW_LINE> version('1.0', '0123456789abcdef0123456789abcdef') <NEW_LINE> version('2.0', '2.0_a_hash') <NEW_LINE> variant( 'foo', values=('bar', 'baz', 'fee'), default='bar', des...
Simple package with one optional dependency
62598fb6091ae35668704d0f
class DaggingClassifier(BaseDagging, ClassifierMixin): <NEW_LINE> <INDENT> def __init__(self, base_estimator=None, n_estimators=10, random_state=None): <NEW_LINE> <INDENT> super(DaggingClassifier, self).__init__( base_estimator=base_estimator, n_estimators=n_estimators, random_state=random_state, ) <NEW_LINE> <DEDENT> ...
A Dagging classifier. This meta classifier creates a number of disjoint, stratified folds out of the data and feeds each chunk of data to a copy of the supplied base classifier. Predictions are made via hard or soft voting. Useful for base classifiers that are quadratic or worse in time behavior, regarding number of in...
62598fb6097d151d1a2c1120
class TestEmailTools(BaseCase): <NEW_LINE> <INDENT> def test_email_split(self): <NEW_LINE> <INDENT> cases = [ ("John <12345@gmail.com>", ['12345@gmail.com']), ("d@x; 1@2", ['d@x', '1@2']), ("'(ss)' <123@gmail.com>, 'foo' <foo@bar>", ['123@gmail.com', 'foo@bar']), ('"john@gmail.com"<johnny@gmail.com>', ['johnny@gmail.co...
Test some of our generic utility functions for emails
62598fb667a9b606de5460c0
class HealthView(FlaskView): <NEW_LINE> <INDENT> route_base = '/api/1/inf/gateway/healthcheck' <NEW_LINE> trailing_slash = False <NEW_LINE> def get(self): <NEW_LINE> <INDENT> stime = time() <NEW_LINE> version = pkg_resources.get_distribution('vlab-gateway-api').version <NEW_LINE> return ujson.dumps({'latency' : time() ...
Logic for checking service health
62598fb692d797404e388bdc
class MyQtEnumComboBoxPlugin(QPyDesignerCustomWidgetPlugin): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> super(MyQtEnumComboBoxPlugin, self).__init__(parent) <NEW_LINE> self.initialized = False <NEW_LINE> <DEDENT> def initialize(self, core): <NEW_LINE> <INDENT> if self.initialized: <NEW_LIN...
MyPyQtEnumComboBoxPlugin(QPyDesignerCustomWidgetPlugin) Provides a Python custom plugin for Qt Designer by implementing the QDesignerCustomWidgetPlugin via a PyQt-specific custom plugin class.
62598fb65fcc89381b2661c5
class SessionState(dict): <NEW_LINE> <INDENT> def __init__(self, shell, prompt_template, speed, aliases=None, envvars=None, test_mode=False, commentecho=False): <NEW_LINE> <INDENT> aliases = aliases or [] <NEW_LINE> envvars = envvars or [] <NEW_LINE> dict.__init__(self, shell=shell, prompt_template=prompt_template, spe...
Stores information about a fake terminal session.
62598fb621bff66bcd722d5a
class LoggingError(Exception): <NEW_LINE> <INDENT> pass
This exception is for various errors that occur in the astropy logger, typically when activating or deactivating logger-related features.
62598fb6e5267d203ee6b9f0
class inidseccdcc(models.Model): <NEW_LINE> <INDENT> cobert = u'Cobertura del documento de caracterización cultural' <NEW_LINE> variab = u'Variables culturales caracterizadas' <NEW_LINE> cobert_help = u'Regional, municipal, otros' <NEW_LINE> caracter = models.ForeignKey('inidseccdet', verbose_name = u'Caracterización c...
Socioeconómico y Cultural Caracterización Cultural Cobertura del documento de caracterización cultural
62598fb676e4537e8c3ef699
class artistSongs(object): <NEW_LINE> <INDENT> artist = "" <NEW_LINE> songs = [] <NEW_LINE> def __init__(self, artist, songs): <NEW_LINE> <INDENT> self.artist = artist <NEW_LINE> self.songs = songs <NEW_LINE> <DEDENT> def findArtist(self, artistString): <NEW_LINE> <INDENT> queryString = "https://api.genius.com/search" ...
This is the artist class used to house songs... maybe
62598fb644b2445a339b69ec
class Patient(AuditModelBase): <NEW_LINE> <INDENT> MALE = 'M' <NEW_LINE> FEMALE = 'F' <NEW_LINE> SEX_CHOICES = ( ('', ''), (MALE, _('Male')), (FEMALE, _('Female')), ) <NEW_LINE> name = models.CharField(max_length=255) <NEW_LINE> sex = models.CharField(max_length=1, choices=SEX_CHOICES, blank=True, default='') <NEW_LINE...
Storage model for basic patient information.
62598fb6be383301e02538ed
class DecodeHook(session_run_hook.SessionRunHook): <NEW_LINE> <INDENT> def __init__(self, source, target, output_dir, output_filename="decode.out", every_n_iter=2500): <NEW_LINE> <INDENT> self.source = source <NEW_LINE> self.target = target <NEW_LINE> self.output_dir = output_dir <NEW_LINE> self.output_filename = outpu...
Prints decoded sentences every N local steps, or at end. params: source: array of source sentences target: array of target sentences output_dir: output_filename: every_n_iter: decode sentences every N interations
62598fb63d592f4c4edbafb3
class NeuralNetwork(NN.NeuralNetwork): <NEW_LINE> <INDENT> def __init__(self,layers,activeFn = 'sigmoid'): <NEW_LINE> <INDENT> NN.NeuralNetwork.__init__(self,layers,activeFn) <NEW_LINE> <DEDENT> def setActivationFn(self,activeFn): <NEW_LINE> <INDENT> return super().setActivationFn(activeFn) <NEW_LINE> <DEDENT> def getL...
General Purpose Neural Network activation_dict = {'sigmoid': [sigmoid,sigmoidDerivative], 'tanh': [tanh,tanhDerivative], 'arctan': [arctan,arctanDerivative], 'sin': [sin,sinDerivative], 'gaussian': [gaussian,gaussianDerivative], ...
62598fb6097d151d1a2c1122
class TransformedRV(S.TensorVariable): <NEW_LINE> <INDENT> def __init__(self, type=None, owner=None, index=None, name=None, distribution=None, model=None, transform=None, total_size=None): <NEW_LINE> <INDENT> if type is None: <NEW_LINE> <INDENT> type = distribution.type <NEW_LINE> <DEDENT> super(TransformedRV, self).__...
Parameters ---------- type : theano type (optional) owner : theano owner (optional) name : str distribution : Distribution model : Model total_size : scalar Tensor (optional) needed for upscaling logp
62598fb656ac1b37e63022dd
class VolMorphology(ExternalLib): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> ExternalLib.Init(self, 'VolMorphology') <NEW_LINE> <DEDENT> def SetupParameters(self, Image, Structure, Gray=None): <NEW_LINE> <INDENT> p = list(Image.shape[::-1]) <NEW_LINE> p.extend([Structure.shape[0], self.npt, bool(Gray)]...
This is a wrapper class for VolMorphology.{dll,so,dylib} written in C/C++
62598fb67cff6e4e811b5b12
class TupleField(Field): <NEW_LINE> <INDENT> def __init__(self, fields, name=None, default=None): <NEW_LINE> <INDENT> Field.__init__(self, name=name, default=default or (None, ) * len(fields)) <NEW_LINE> res = [] <NEW_LINE> for field in fields: <NEW_LINE> <INDENT> if type(field) is type: <NEW_LINE> <INDENT> if issubcla...
Field type for tuple of other fields, with possibly different types. >>> from couchdb import Server >>> server = Server('http://localhost:5984/') >>> db = server.create('python-tests') >>> class Post(Document): ... title = TextField() ... content = TextField() ... pubdate = DateTimeField(default=datetime....
62598fb6f548e778e596b697
class _DBRow(object): <NEW_LINE> <INDENT> def __init__(self, parent_schema, table, pk, value_dict): <NEW_LINE> <INDENT> self._schema = parent_schema <NEW_LINE> self._up = table <NEW_LINE> self._pk = pk <NEW_LINE> self._columns = dict() <NEW_LINE> for i, val in value_dict.iteritems(): <NEW_LINE> <INDENT> self._columns[i...
Contains dict of _DBValue. Public methods of this class, belong to the interface of the module, but class it self should be instantiated only by `_DBTable`.
62598fb6fff4ab517ebcd8da
class Trellis: <NEW_LINE> <INDENT> trell = [] <NEW_LINE> def __init__(self, hmm, observations): <NEW_LINE> <INDENT> self.tracker = [] <NEW_LINE> temp = {} <NEW_LINE> for label in hmm.labels: <NEW_LINE> <INDENT> temp[label] = [0,None] <NEW_LINE> <DEDENT> for observation in observations: <NEW_LINE> <INDENT> self.tracker....
As taken from https://stackoverflow.com/a/9730066
62598fb62c8b7c6e89bd38b7
class RelatedLocalRoleAdapter(object): <NEW_LINE> <INDENT> implements(ILocalRoleProvider) <NEW_LINE> def __init__(self, context): <NEW_LINE> <INDENT> self.context = context <NEW_LINE> <DEDENT> def getRoles(self, principal): <NEW_LINE> <INDENT> if not self.related_roles.get(principal, []): <NEW_LINE> <INDENT> return () ...
borg.localrole adapter to set related localroles following annotation
62598fb6d268445f26639bfd
class ConcatenateDataset(DatasetV2): <NEW_LINE> <INDENT> def __init__(self, input_dataset, dataset_to_concatenate, name=None): <NEW_LINE> <INDENT> self._input_dataset = input_dataset <NEW_LINE> self._dataset_to_concatenate = dataset_to_concatenate <NEW_LINE> try: <NEW_LINE> <INDENT> self._structure = tf_nest.map_struct...
A `Dataset` that concatenates its input with given dataset.
62598fb67b25080760ed75a5
class VoltageMapVoltages(object): <NEW_LINE> <INDENT> openapi_types = { 'voltage': 'float', 'pmt_index': 'int' } <NEW_LINE> attribute_map = { 'voltage': 'voltage', 'pmt_index': 'pmt_index' } <NEW_LINE> def __init__(self, voltage=None, pmt_index=None, local_vars_configuration=None): <NEW_LINE> <INDENT> if local_vars_con...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62598fb64f6381625f19953a
@BlockchainInstance.inject <NEW_LINE> class Amount(GrapheneAmount): <NEW_LINE> <INDENT> def define_classes(self): <NEW_LINE> <INDENT> from graphenecommon.price import Price <NEW_LINE> self.asset_class = Asset <NEW_LINE> self.price_class = Price
This class deals with Amounts of any asset to simplify dealing with the tuple:: (amount, asset) :param list args: Allows to deal with different representations of an amount :param float amount: Let's create an instance with a specific amount :param str asset: Let's you create an instance with a specific asset (sy...
62598fb699fddb7c1ca62e64
class EFC(object): <NEW_LINE> <INDENT> def __init__(self, years=[2017]): <NEW_LINE> <INDENT> self.years = years <NEW_LINE> self.df = pd.DataFrame() <NEW_LINE> <DEDENT> def extract(self): <NEW_LINE> <INDENT> init_df = pd.DataFrame({'pypeds_init': [True]}) <NEW_LINE> for year in self.years: <NEW_LINE> <INDENT> year_info ...
Residence and migration of first-time freshman from the Fall Enrollment survey.
62598fb67047854f4633f4ce
class get_hostpool_info_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.STRING, 'success', None, None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtocolA...
Attributes: - success
62598fb69f288636728188b7
class CloseOpenBankPaymentOrderResult(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.OutOrderId = None <NEW_LINE> self.ChannelOrderId = None <NEW_LINE> self.OrderStatus = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.OutOrderId = params.get("OutOrder...
云企付-关单响应
62598fb697e22403b383aff9
class MetricCalculator(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.accuracy = 0 <NEW_LINE> self.loss_accumulated = 0 <NEW_LINE> self.average_loss = 0 <NEW_LINE> self.updated_cnt = 0 <NEW_LINE> self.predicted_labels_holder = [] <NEW_LINE> self.actual_labels_holder = [] <NEW_LINE> <DEDENT> def upd...
loss와 accuracy를 기록하기 위한 도구입니다.
62598fb655399d3f05626608
class VisibleOnHomepageExtension(ContentExtension): <NEW_LINE> <INDENT> is_visible_on_homepage = meta_property() <NEW_LINE> def extend_form(self, form_class, request): <NEW_LINE> <INDENT> if self.parent_id is None: <NEW_LINE> <INDENT> return form_class <NEW_LINE> <DEDENT> class VisibleOnHomepageForm(form_class): <NEW_L...
Extends any class that has a meta dictionary field with the ability to a boolean indicating if the page should be shown on the homepage or not.
62598fb64a966d76dd5eefcb
class MorphFaceRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Images = None <NEW_LINE> self.Urls = None <NEW_LINE> self.GradientInfos = None <NEW_LINE> self.Fps = None <NEW_LINE> self.OutputType = None <NEW_LINE> self.OutputWidth = None <NEW_LINE> self.OutputHeight = None <NEW_...
MorphFace请求参数结构体
62598fb644b2445a339b69ed
class NativeTypeError(TypeError): <NEW_LINE> <INDENT> pass
Type is unable to be constructed from a serialized value.
62598fb64527f215b58e9fca
class MtimeFileWatcher(object): <NEW_LINE> <INDENT> def __init__(self, directory): <NEW_LINE> <INDENT> self._directory = directory <NEW_LINE> self._quit_event = threading.Event() <NEW_LINE> self._filename_to_mtime = None <NEW_LINE> self._has_changes = False <NEW_LINE> self._has_changes_lock = threading.Lock() <NEW_LINE...
Monitors a directory tree for changes using mtime polling.
62598fb6f548e778e596b698
class StripController: <NEW_LINE> <INDENT> def __init__(self, host, port, beatProcessor, valProcessor): <NEW_LINE> <INDENT> self.strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS) <NEW_LINE> self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) <NEW_LINE> self.recent_va...
Controller for neopixel things
62598fb601c39578d7f12e6e
class ModeratorRequestHandler(LoggedInRequestHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> super(ModeratorRequestHandler,self).get() <NEW_LINE> if not self.user_info.moderator: <NEW_LINE> <INDENT> raise BasicRequestHandlerException(403, 'Not moderator') <NEW_LINE> <DEDENT> <DEDENT> def post(self): <N...
Обработчик запроса, проверяющий право модерирования
62598fb67cff6e4e811b5b14
class PXEAndIPMINativeDriver(base.BaseDriver): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.power = ipminative.NativeIPMIPower() <NEW_LINE> self.deploy = pxe.PXEDeploy() <NEW_LINE> self.rescue = self.deploy <NEW_LINE> self.vendor = pxe.VendorPassthru()
PXE + Native IPMI driver. This driver implements the `core` functionality, combining :class:`ironic.drivers.modules.ipminative.NativeIPMIPower` for power on/off and reboot with :class:`ironic.driver.modules.pxe.PXE` for image deployment. Implementations are in those respective classes; this class is merely the glue be...
62598fb67b180e01f3e490cb
class MediaCategory(models.Model): <NEW_LINE> <INDENT> MEDIA_CATEGORY_CHOICES = ( ('Action & Adventure', 'Action & Adventure'), ('Ads & Promotional', 'Ads & Promotional'), ('Anime & Animation', 'Anime & Animation'), ('Art & Experimental', 'Art & Experimental'), ('Business', 'Business'), ('Children & Family', 'Children ...
Category model for Media RSS
62598fb657b8e32f52508197
class test_popup_wizard(TransactionCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(test_popup_wizard, self).setUp() <NEW_LINE> self.env.ref('core.jd').credit_limit = 100000 <NEW_LINE> self.order = self.env.ref('sell.sell_order_2') <NEW_LINE> self.order.sell_order_done() <NEW_LINE> self.delivery = ...
发货单缺货向导
62598fb6adb09d7d5dc0a682
class Suggestion(models.Model): <NEW_LINE> <INDENT> STATE_NEW = 0 <NEW_LINE> STATE_IN_PROGRESS = 1 <NEW_LINE> STATE_COMPLETED = 2 <NEW_LINE> STATE_REJECTED = 3 <NEW_LINE> STATE_SPAM = 4 <NEW_LINE> RESOLVED_STATES = (STATE_COMPLETED, STATE_REJECTED) <NEW_LINE> OPEN_STATES = (STATE_NEW, STATE_IN_PROGRESS) <NEW_LINE> STAT...
Represents a suggestion for videos to be added to the site.
62598fb64527f215b58e9fcb
class GoogleShopping(): <NEW_LINE> <INDENT> def __init__( self, data ): <NEW_LINE> <INDENT> self.soup = BeautifulSoup( data, 'lxml' ) <NEW_LINE> <DEDENT> def parse( self ): <NEW_LINE> <INDENT> shpu = self.soup.findAll( "a", "_po" ) <NEW_LINE> durl = self.soup.findAll( "h3", "r" ) <NEW_LINE> links = [ x['href'] for x in...
Shopping Search Results Parser
62598fb63346ee7daa3376c2
class CardsContext(CardsCollection): <NEW_LINE> <INDENT> def __init__(self, token, client): <NEW_LINE> <INDENT> super(CardsContext, self).__init__(client) <NEW_LINE> self.token = token <NEW_LINE> self.transitions = self.Transitions(self.token, Collection(client, CardTransitionResponse)) <NEW_LINE> <DEDENT> class Transi...
class to specify sub endpoints for cards
62598fb62c8b7c6e89bd38b9
class MockPlayer(Player): <NEW_LINE> <INDENT> def __init__(self, player, move): <NEW_LINE> <INDENT> Player.__init__(self) <NEW_LINE> self.history = copy.deepcopy(player.history) <NEW_LINE> self.cooperations = player.cooperations <NEW_LINE> self.defections = player.defections <NEW_LINE> self.move = move <NEW_LINE> <DEDE...
Creates a mock player that enforces a particular next move for a given player.
62598fb63317a56b869be5c7
class IAR_phi(Base): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Data = ['magnitude', 'time', 'error'] <NEW_LINE> <DEDENT> def IAR_phi_kalman(self,x,t,y,yerr,standarized=True,c=0.5): <NEW_LINE> <INDENT> n=len(y) <NEW_LINE> Sighat=np.zeros(shape=(1,1)) <NEW_LINE> Sighat[0,0]=1 <NEW_LINE> if standari...
functions to compute an IAR model with Kalman filter. Author: Felipe Elorrieta.
62598fb6377c676e912f6de9
class ConfigServerGitProperty(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'uri': {'required': True}, } <NEW_LINE> _attribute_map = { 'repositories': {'key': 'repositories', 'type': '[GitPatternRepository]'}, 'uri': {'key': 'uri', 'type': 'str'}, 'label': {'key': 'label', 'type': 'str'}, 'search_pat...
Property of git. All required parameters must be populated in order to send to Azure. :ivar repositories: Repositories of git. :vartype repositories: list[~azure.mgmt.appplatform.v2021_06_01_preview.models.GitPatternRepository] :ivar uri: Required. URI of the repository. :vartype uri: str :ivar label: Label of the r...
62598fb6dc8b845886d536ad
class stmt(AST, commonloc): <NEW_LINE> <INDENT> pass
Base class for statement nodes.
62598fb62ae34c7f260ab1d2
class TestCheckFileSize(unittest.TestCase): <NEW_LINE> <INDENT> def testBasic(self): <NEW_LINE> <INDENT> results = check_file_size(size=1) <NEW_LINE> self.assertTrue(results)
Test that the size function returns something.
62598fb6aad79263cf42e8ca
class RepresentativeViewSet(viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> serializer_class = serializers.ShortRepresentativeSerializer <NEW_LINE> queryset = models.Representative.objects.all()
Listado y vista en detalle de los representantes de la Universidad
62598fb65166f23b2e2434d1
class Meta: <NEW_LINE> <INDENT> model = models.OrderItem <NEW_LINE> fields = ('id', 'order', 'item', 'quantity', 'price', 'user', 'created', 'updated') <NEW_LINE> read_only_fields = ('order', 'price', 'user')
Metaclass definition
62598fb6d486a94d0ba2c0c8
class WangKejun(TSFEDL_BaseModule): <NEW_LINE> <INDENT> def __init__(self, in_features: int, top_module: Optional[nn.Module] = WangKejun_Classifier(256, 5), loss: Callable[[torch.Tensor, torch.Tensor], torch.Tensor] = nn.CrossEntropyLoss(), metrics: Dict[str, Callable[[torch.Tensor, torch.Tensor], torch.Tensor]] = None...
CNN 1D-LSTM Parameters ---------- in_features: int Number of features of the input tensors top_module: nn.Module, defaults=WangKejun_Classifier(256, 5) The optional nn.Module to be used as additional top layers. loss: Callable[[torch.Tensor, torch.Tensor], torch.Tensor] The loss ...
62598fb6d486a94d0ba2c0c9
class MedianMetric(BaseMetric): <NEW_LINE> <INDENT> def run(self, dataSlice, slicePoint=None): <NEW_LINE> <INDENT> return np.median(dataSlice[self.colname])
Calculate the median of a simData column slice.
62598fb67b180e01f3e490cc
class Avmu_Exception(Exception): <NEW_LINE> <INDENT> pass
Base exception class that all library exceptions inherit from. This can be used to easily catch all exceptions that are specifically thrown by the ``avmu`` library.
62598fb656ac1b37e63022e2
class TeamSupport(Document): <NEW_LINE> <INDENT> collection = DB.team_support <NEW_LINE> @classmethod <NEW_LINE> def get_team_support(cls, battle_id, team_name): <NEW_LINE> <INDENT> team_support = cls.collection.find_one( {'battle_id': ObjectId(battle_id), 'team_name': team_name}) <NEW_LINE> return cls(team_support) if...
站队支持
62598fb64f6381625f19953c
class UpdateTypeAlreadyQueued(DMSError): <NEW_LINE> <INDENT> def __init__(self, name, update_type): <NEW_LINE> <INDENT> message = ("Zone '%s' - Update type of '%s' already queued" % (name, update_type)) <NEW_LINE> super().__init__(message) <NEW_LINE> self.data['name'] = name <NEW_LINE> self.data['update_type'] = update...
An update of the given type is already queued for the zone * JSONRPC Error: -86 * JSONRPC data keys: * 'name' - domain name * 'update_type' - update type
62598fb667a9b606de5460c7
class SectionListView(ListView): <NEW_LINE> <INDENT> u <NEW_LINE> model = Employees <NEW_LINE> paginate_by = 10 <NEW_LINE> groups = ['А-Г', 'Д-З', 'И-М', 'Н-Р', 'С-Ф', 'Х-Ш','Щ-Я'] <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super(SectionListView, self).get_context_data(**kwargs) <NEW...
Список работников
62598fb6796e427e5384e88b
class URLException(BaseException): <NEW_LINE> <INDENT> pass
Raise this when a URL is illegal
62598fb660cbc95b06364435
class SettingsInvalid(BadRequest): <NEW_LINE> <INDENT> ID = "SETTINGS_INVALID" <NEW_LINE> MESSAGE = __doc__
Invalid settings were provided
62598fb64428ac0f6e658619
class GameMaxPlayersExceeded(Exception): <NEW_LINE> <INDENT> pass
MaxPlayersExceeded - exception
62598fb6956e5f7376df56f9
class UFOsToGlyphsRT(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def add_tests(cls, testable): <NEW_LINE> <INDENT> pass
The the whole chain from a collection of UFOs to .glyphs and back
62598fb630bbd722464699f5
class FakeArticle: <NEW_LINE> <INDENT> def __init__(self, settings, metadata, title, url): <NEW_LINE> <INDENT> self.settings = settings <NEW_LINE> self.metadata = metadata <NEW_LINE> self.title = title <NEW_LINE> self.url = url <NEW_LINE> <DEDENT> def set_custom_data(self, data): <NEW_LINE> <INDENT> for key, value in d...
Mock Pelican Article object.
62598fb671ff763f4b5e786e
class Sequence(task.Task): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self._tasks = config['tasks'] <NEW_LINE> self._waiting = False <NEW_LINE> self._index = 0 <NEW_LINE> <DEDENT> def __call__(self): <NEW_LINE> <INDENT> if not self._waiting and self._index < len(self._tasks): <NEW_LINE> <INDENT...
Executes nested tasks in sequence. This task is only stopped after the last nested task has stopped.
62598fb6b7558d5895463725
class NinjaAnt(Ant): <NEW_LINE> <INDENT> name = 'Ninja' <NEW_LINE> food_cost = 6 <NEW_LINE> damage = 1 <NEW_LINE> def __init__(self, armor=1): <NEW_LINE> <INDENT> Insect.__init__(self, armor) <NEW_LINE> <DEDENT> blocks_path = False <NEW_LINE> implemented = True <NEW_LINE> def action(self, colony): <NEW_LINE> <INDENT> f...
NinjaAnt does not block the path and damages all bees in its place.
62598fb6be8e80087fbbf160
class GenericAssociation(BaseAudit): <NEW_LINE> <INDENT> ordering = models.IntegerField(default=1) <NEW_LINE> source_type = models.ForeignKey(ContentType) <NEW_LINE> source_id = models.PositiveIntegerField() <NEW_LINE> source_object = generic.GenericForeignKey('source_type', 'source_id') <NEW_LINE> entity_type = models...
http://weispeaks.wordpress.com/2009/11/04/overcoming-limitations-in-django-using-generic-foreign-keys/ Uses the contenttypes framework to create one big "meta-association table" between media elements (photos, audio files, mapimages, etc.) and groups. See the reference above for more information about the contenttypes...
62598fb68a43f66fc4bf2272
class UsersListCreateView(MethodSerializerView, generics.ListCreateAPIView): <NEW_LINE> <INDENT> queryset = models.Order.objects.all() <NEW_LINE> method_serializer_classes = { ('GET',): ser.OrderListSerializer, ('POST'): ser.OrderCreateSerializer }
API: /users Method: GET/POST
62598fb67b180e01f3e490cd
class TestUSPSBase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> trytond.tests.test_tryton.install_module('shipping_usps') <NEW_LINE> self.Address = POOL.get('party.address') <NEW_LINE> self.USPSConfiguration = POOL.get('usps.configuration') <NEW_LINE> self.CarrierConfig = POOL.get('carri...
Test USPS Integration
62598fb6d268445f26639c00
class SignAnnounceWidget(QWidget): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> super(SignAnnounceWidget, self).__init__(parent) <NEW_LINE> self.dialog = parent <NEW_LINE> self.manager = parent.manager <NEW_LINE> self.status_edit = QLineEdit() <NEW_LINE> self.status_edit.setReadOnly(True) <NEW_LI...
Widget that displays information about signing a Masternode Announce.
62598fb60fa83653e46f4fd9
class CloudServerActionCreatedSchema(BaseEventSchema): <NEW_LINE> <INDENT> cloudserveraction_id = fields.String()
Schema for the CloudServerActionCreated events.
62598fb623849d37ff8511ab
class transaction(object): <NEW_LINE> <INDENT> def __init__(self, TXInputs, TXOutputs): <NEW_LINE> <INDENT> self.TXInputs = TXInputs <NEW_LINE> self.TXOutputs = TXOutputs <NEW_LINE> self.ID = hashlib.sha256(pickle.dumps( self)).hexdigest().encode("utf-8") <NEW_LINE> <DEDENT> def isCoinbase(self): <NEW_LINE> <INDENT> re...
交易类,实例化就是一个UTXO交易,有id,Vin,Vout
62598fb663b5f9789fe85266
@ddt.ddt <NEW_LINE> @unittest.skip <NEW_LINE> class FindAssetTest(unittest.TestCase): <NEW_LINE> <INDENT> perf_test = True <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(FindAssetTest, self).setUp() <NEW_LINE> self.export_dir = mkdtemp() <NEW_LINE> self.addCleanup(rmtree, self.export_dir, ignore_errors=True) <NE...
This class exists to time asset finding in different modulestore classes with different amounts of asset metadata.
62598fb64428ac0f6e65861b
class FieldGroupSizeError(Exception): <NEW_LINE> <INDENT> def __init__(self, field, index, alignment): <NEW_LINE> <INDENT> message = ( f"{field.__class__.__name__}: Field alignment size " f"'{field.alignment.byte_size}' does not match field group size " f"'{alignment.byte_size}' at index ({index.byte}, {index.bit}).") ...
Raised if the alignment size of a field does not match with its field group.
62598fb6627d3e7fe0e06faa
class RomanAPI(ButlerInterface): <NEW_LINE> <INDENT> ROMAN = 1 <NEW_LINE> @classmethod <NEW_LINE> def get_uid(cls) -> UUID: <NEW_LINE> <INDENT> return ROMAN_INTERFACE_UID
Roman Service Request Codes.
62598fb65fcc89381b2661c9
class _VirtualNonCollection(DAVNonCollection): <NEW_LINE> <INDENT> def __init__(self, path, environ): <NEW_LINE> <INDENT> DAVNonCollection.__init__(self, path, environ) <NEW_LINE> <DEDENT> def getContentLength(self): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> def getContentType(self): <NEW_LINE> <INDENT> retur...
Abstract base class for all non-collection resources.
62598fb630bbd722464699f6
class Area: <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> def __init__(self, pile_type: Type[Pile], num_piles: int): <NEW_LINE> <INDENT> self._pile_type = pile_type <NEW_LINE> self._num_piles = num_piles <NEW_LINE> self._piles: List[Type[Pile]] = [pile_type(i) for i in range(num_piles)] <NEW_LINE> <DEDENT>...
Provides a area abstraction.
62598fb6f9cc0f698b1c5349
class DevelopmentConfig(BaseConfig): <NEW_LINE> <INDENT> DEBUG = True <NEW_LINE> BCRYPT_LOG_ROUNDS = 4 <NEW_LINE> WTF_CSRF_ENABLED = False <NEW_LINE> SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'db.sqlite') <NEW_LINE> DEBUG_TB_ENABLED = True
Development configuration.
62598fb62ae34c7f260ab1d6
class TwistedHttpConnectionAdapter(object): <NEW_LINE> <INDENT> def __init__(self, request): <NEW_LINE> <INDENT> self.request = request <NEW_LINE> <DEDENT> def write(self, data): <NEW_LINE> <INDENT> self.request.transport.reactor.callFromThread(self._write, data) <NEW_LINE> <DEDENT> def close(self): <NEW_LINE> <INDENT>...
Twisted http connection adapter
62598fb6851cf427c66b83b0
class HandShake(object): <NEW_LINE> <INDENT> def __init__(self, way, shakeway): <NEW_LINE> <INDENT> self._waitedconn = {} <NEW_LINE> self._way = way <NEW_LINE> self._shakeway = shakeway <NEW_LINE> <DEDENT> def __call__(self, conn, eventloop): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> while b'\n' not in self._waitedc...
Waiting for the other side choice of connection.
62598fb67c178a314d78d598
class DataUpdate(DataUpdate): <NEW_LINE> <INDENT> resource = 'users' <NEW_LINE> def forwards(self, mongodb_collection, mongodb_database): <NEW_LINE> <INDENT> for user in mongodb_collection.find({}): <NEW_LINE> <INDENT> stages = get_resource_service(self.resource).get_invisible_stages_ids(user.get(config.ID_FIELD)) <NEW...
Updates the user collection with invisible stages. Refer to https://dev.sourcefabric.org/browse/SD-5077 for more information
62598fb6bf627c535bcb159b
class YapcapPacket(BitStructure): <NEW_LINE> <INDENT> _formats = {} <NEW_LINE> def __init__(self, data, base_cls): <NEW_LINE> <INDENT> BitStructure.__init__(self, self.__class__.__name__) <NEW_LINE> self.data = data <NEW_LINE> self.base_cls = base_cls <NEW_LINE> self.protocols = [] <NEW_LINE> <DEDENT> def decode(self):...
Yapcap Packet Class
62598fb63d592f4c4edbafbb
class Collection(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._all_values = {} <NEW_LINE> <DEDENT> def add(self, dimensions, value): <NEW_LINE> <INDENT> name = json.dumps(dimensions) <NEW_LINE> if name in self._all_values: <NEW_LINE> <INDENT> raise DuplicateValueException( "Counter {} is al...
A collection of statistics parameters It's just a singleton, which is hold in this module, but we use it as a regular class for unittests
62598fb67d847024c075c4b5
class TlsValidationContextSdsTrust(AWSProperty): <NEW_LINE> <INDENT> props: PropsDictType = { "SecretName": (str, True), }
`TlsValidationContextSdsTrust <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appmesh-virtualnode-tlsvalidationcontextsdstrust.html>`__
62598fb656b00c62f0fb29b3
class PokemonScreen(foreground_object.ForegroundObject): <NEW_LINE> <INDENT> def __init__(self, screen, pokemonMenuNode, party, startPoke): <NEW_LINE> <INDENT> self.screen = screen <NEW_LINE> self.menuNode = pokemonMenuNode <NEW_LINE> self.party = party <NEW_LINE> self.currentPoke = startPoke <NEW_LINE> self.currentPag...
The pokemon summary screen object.
62598fb6d7e4931a7ef3c18f
class ResourceEnvironment: <NEW_LINE> <INDENT> def __init__( self, resource_configs, common_configs, dependency_database, *, reverse_order=False): <NEW_LINE> <INDENT> self._resource_configs = resource_configs <NEW_LINE> self._common_configs = common_configs <NEW_LINE> self._database = dependency_database <NEW_LINE> sel...
An environment in which information resources are updated. Class Interface --------------- update Update a resource configured in this environment. update_all Update all resources configured in this environment. update_dependents Update all resources that depend on a given input file.
62598fb663d6d428bbee28a8
@pytest.mark.usefixtures('clean_artifacts', 'create_environment', 'get_mkv') <NEW_LINE> class TestGoldenPath: <NEW_LINE> <INDENT> def test_pre_proc(self): <NEW_LINE> <INDENT> self.mkv.pre_process() <NEW_LINE> out = pathlib.Path('tests/processing/0_analyze/orig_Stage 0 Test Good.mkv') <NEW_LINE> assert self.mkv.video.co...
The MKV used in this test class has the following streams: Input #0, matroska,webm, from 'Stage 0 Test Good.mkv': Metadata: title : Stage 0 Test Good creation_time : 2017-05-29T06:23:24.000000Z ENCODER : Lavf57.83.100 Duration: 00:00:05.26, start: 0.000000, bitrate: 14704 kb/s ...
62598fb67b25080760ed75ad
class GCSRecordInputReader(GCSInputReader): <NEW_LINE> <INDENT> def __getstate__(self): <NEW_LINE> <INDENT> result = self.__dict__.copy() <NEW_LINE> if "_record_reader" in result: <NEW_LINE> <INDENT> result.pop("_record_reader") <NEW_LINE> <DEDENT> return result <NEW_LINE> <DEDENT> def __next__(self): <NEW_LINE> <INDEN...
Read data from a Google Cloud Storage file using LevelDB format. See the GCSInputReader for additional configuration options.
62598fb67b180e01f3e490ce
class TlacASCII(TlacFile): <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> TlacFile.__init__(self, filename) <NEW_LINE> self.filename = filename <NEW_LINE> self.rawdat = [] <NEW_LINE> self.dat = {} <NEW_LINE> self.icollst = [] <NEW_LINE> self.set_icollst() <NEW_LINE> <DEDENT> def __getitem__(self,...
For reading tlac *dat and *uvdat files.
62598fb666656f66f7d5a4eb
class MediasTestCase(OrigamiTestCase): <NEW_LINE> <INDENT> def test_get_medias_list(self): <NEW_LINE> <INDENT> result = self.simulate_get("/medias", headers={"Authorization": "Bearer " + self.token}).json <NEW_LINE> target = [ { "id": 1, "media_type": "audio", "media_name": "audio1.mp3", "url": None }, { "id": 2, "medi...
Class for testing medias.
62598fb656ac1b37e63022e6
class TagDetail(generics.RetrieveAPIView): <NEW_LINE> <INDENT> queryset = Tag.objects.all() <NEW_LINE> serializer_class = TagSerializer
Retrieve a tag. No need to update or destroy a tag. The system will clean up unused tags periodically. TODO
62598fb62c8b7c6e89bd38bf
class StatementStructure: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.input_origin = None <NEW_LINE> self.segments_full = [] <NEW_LINE> self.segments_imp = [] <NEW_LINE> self.segments_graph = [] <NEW_LINE> self.segments_standard = [] <NEW_LINE> self.result = None <NEW_LINE> self.result_desc = None
descrip the nl structure after parse
62598fb6796e427e5384e88f
class Dropout3d(_DropoutNd): <NEW_LINE> <INDENT> def forward(self, input): <NEW_LINE> <INDENT> return F.dropout3d(input, self.p, self.training, self.inplace)
Randomly zeroes whole channels of the input tensor. The channels to zero are randomized on every forward call. Usually the input comes from :class:`nn.Conv3d` modules. As described in the paper `Efficient Object Localization Using Convolutional Networks`_ , if adjacent pixels within feature maps are strongly correlat...
62598fb697e22403b383b000
class EnabledButtonTests(TavastiaTestCase): <NEW_LINE> <INDENT> test_qml_file = "%s/%s.qml" % (os.path.dirname(os.path.realpath(__file__)),"EnabledButtonTests") <NEW_LINE> def test_can_select_button(self): <NEW_LINE> <INDENT> btn = self.app.select_single('Button') <NEW_LINE> self.assertThat(btn, Not(Is(None))) <NEW_LIN...
Tests for an enabled Button component.
62598fb6167d2b6e312b706e
class VtableEntry(object): <NEW_LINE> <INDENT> def __init__(self, offset, names, value, is_undefined): <NEW_LINE> <INDENT> self.offset = offset <NEW_LINE> self.names = names <NEW_LINE> self.value = value <NEW_LINE> self.is_undefined = is_undefined <NEW_LINE> <DEDENT> def __lt__(self, other): <NEW_LINE> <INDENT> return ...
This class contains an entry in Vtable. The names attribute constains all the possible symbol names for this entry due to symbol aliasing. Attributes: offset: Offset with respect to vtable. names: A list of possible symbol names of the entry. value: Value of the entry. is_undefined: If entry has a sym...
62598fb671ff763f4b5e7872
class WorkflowsIndividualApi(object): <NEW_LINE> <INDENT> def __init__(self, api_client=None): <NEW_LINE> <INDENT> config = Configuration() <NEW_LINE> if api_client: <NEW_LINE> <INDENT> self.api_client = api_client <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if not config.api_client: <NEW_LINE> <INDENT> config.api_cl...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. Ref: https://github.com/swagger-api/swagger-codegen
62598fb68a349b6b43686337
class BlastIDIndex(object): <NEW_LINE> <INDENT> def __init__(self, seqDB): <NEW_LINE> <INDENT> self.seqDB = seqDB <NEW_LINE> self.seqInfoDict = BlastIDInfoDict(self) <NEW_LINE> <DEDENT> id_delimiter='|' <NEW_LINE> def unpack_id(self, id): <NEW_LINE> <INDENT> return id.split(self.id_delimiter) <NEW_LINE> <DEDENT> def in...
This class acts as a wrapper around a regular seqDB, and handles the mangled IDs returned by BLAST to translate them to the correct ID. Since NCBI treats FASTA ID as a blob into which they like to stuff many fields... and then NCBI BLAST mangles those IDs when it reports hits, so they no longer match the true ID... we ...
62598fb6956e5f7376df56fb
class ListChainService(ListCommand): <NEW_LINE> <INDENT> resource = 'chain_service' <NEW_LINE> log = logging.getLogger(__name__ + '.ListChainService') <NEW_LINE> list_columns = ['id', 'chain_id', 'service_id', 'sequence_number'] <NEW_LINE> pagination_support = True <NEW_LINE> sorting_support = True <NEW_LINE> def add_k...
List ChainServices that belong to a given tenant.
62598fb6bf627c535bcb159d
class ProblemPage(PageObject): <NEW_LINE> <INDENT> url = None <NEW_LINE> def is_browser_on_page(self): <NEW_LINE> <INDENT> return self.q(css='.xblock-student_view').present <NEW_LINE> <DEDENT> @property <NEW_LINE> def problem_name(self): <NEW_LINE> <INDENT> return self.q(css='.problem-header').text[0]
View of problem page.
62598fb65fdd1c0f98e5e08a
class DimensionRegistryTest(TestCase): <NEW_LINE> <INDENT> def test_registry_contains_dimension(self): <NEW_LINE> <INDENT> time = registry.get_dimension('time') <NEW_LINE> self.assertIsNotNone(time) <NEW_LINE> self.assertIsInstance(time, models.TimeDimension) <NEW_LINE> <DEDENT> def test_registry_size(self): <NEW_LINE>...
Test the dimension registry
62598fb6d486a94d0ba2c0ce
class Random: <NEW_LINE> <INDENT> def __init__(self,seed=5555): <NEW_LINE> <INDENT> self.seed = seed <NEW_LINE> self.m_v = np.uint64(4101842887655102017) <NEW_LINE> self.m_w = np.uint64(1) <NEW_LINE> self.m_u = np.uint64(1) <NEW_LINE> self.m_u = np.uint(self.seed) ^ self.m_v <NEW_LINE> self.int64() <NEW_LINE> self.m_v ...
A random number generator class
62598fb6aad79263cf42e8cf
class FlaskGroup(AppGroup): <NEW_LINE> <INDENT> def __init__(self, add_default_commands=True, create_app=None, **extra): <NEW_LINE> <INDENT> AppGroup.__init__(self, **extra) <NEW_LINE> self.create_app = create_app <NEW_LINE> if add_default_commands: <NEW_LINE> <INDENT> self.add_command(run_command) <NEW_LINE> self.add_...
Special subclass of the :class:`AppGroup` group that supports loading more commands from the configured Flask app. Normally a developer does not have to interface with this class but there are some very advanced use cases for which it makes sense to create an instance of this. For information as of why this is useful...
62598fb63d592f4c4edbafbd
class VERSE_SCENE_panel(bpy.types.Panel): <NEW_LINE> <INDENT> bl_space_type = 'PROPERTIES' <NEW_LINE> bl_region_type = 'WINDOW' <NEW_LINE> bl_context = 'scene' <NEW_LINE> bl_label = 'Verse Scenes' <NEW_LINE> bl_description = 'Panel with Verse scenes shared at Verse server' <NEW_LINE> @classmethod <NEW_LINE> def poll(cl...
GUI of Verse scene shared at Verse server
62598fb6be8e80087fbbf164
class Page(object): <NEW_LINE> <INDENT> qtb3_url = 'http://118.178.112.3:8006' <NEW_LINE> def __init__(self,driver,base_url = qtb3_url,parent =None): <NEW_LINE> <INDENT> self.driver = driver <NEW_LINE> self.base_url = base_url <NEW_LINE> self.timeout = 30 <NEW_LINE> self.parent = parent <NEW_LINE> <DEDENT> def _openPag...
'页面基础类,用于所有页面的继承
62598fb6d7e4931a7ef3c191