code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class AudioEmbeddingsNet(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_dim, output_dim, fc1_size=100, fc2_size=100): <NEW_LINE> <INDENT> super(AudioEmbeddingsNet, self).__init__() <NEW_LINE> self.fc1 = nn.Linear(input_dim, fc1_size) <NEW_LINE> self.fc2 = nn.Linear(fc1_size, fc2_size) <NEW_LINE> self.fc3 = nn...
Network for embedding audio data, forawrd model outputs an embedding Didn't use normal weight initialization like Kevin, just used pytorch default. To perform normal weight initialization: https://stackoverflow.com/a/55546528
62598f16187af65679d29253
class res_partner_mail_sms(osv.Model): <NEW_LINE> <INDENT> _name = "res.partner" <NEW_LINE> _inherit = ['res.partner', 'mail.thread'] <NEW_LINE> def message_post(self, cr, uid, thread_id, **kwargs): <NEW_LINE> <INDENT> if kwargs.get('type') == 'sms': <NEW_LINE> <INDENT> id = kwargs['context']['default_res_id'] <NEW_LIN...
Update partner to add sms support
62598f16091ae356687038a5
class ListParams(object): <NEW_LINE> <INDENT> def __init__(self, symbol, startTag, endTag): <NEW_LINE> <INDENT> self.symbol = symbol <NEW_LINE> self.startTag = startTag <NEW_LINE> self.endTag = endTag
Параметры списков в парсере
62598f167cff6e4e811b4688
@override_settings(ROOT_URLCONF=__name__, URL_ROOT=URL_ROOT) <NEW_LINE> class EdxOAuth2LogoutView(LogoutViewTestMixin, TestCase): <NEW_LINE> <INDENT> def get_redirect_url(self): <NEW_LINE> <INDENT> return LOGOUT_REDIRECT_URL
Tests for EdxOAuth2ConnectLogoutView.
62598f16099cdd3c63674a25
class HugeTensor(object): <NEW_LINE> <INDENT> def __init__( self, tensor_list, broadcastable=None, ): <NEW_LINE> <INDENT> c_axis = 1 if K.image_data_format() == 'channels_first' else -1 <NEW_LINE> self.tensor_list = tensor_list <NEW_LINE> if broadcastable == None: <NEW_LINE> <INDENT> self.broadcastable = (len(tensor_li...
Huge tensor Huge tensors break the constraint that the size of a tensor cannot exceed 2G. It contains a bunch of tensors logically stacked in channel-dimension.
62598f16ab23a570cc2d43bb
class TestModel: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.text_field = torch.load(TEXT_FIELD_PATH) <NEW_LINE> self.tokenizer = hazm.word_tokenize <NEW_LINE> self.model_path = MODEL_PATH <NEW_LINE> <DEDENT> def init_model(self): <NEW_LINE> <INDENT> model = CNN(vocab_size=len(self.text_field.vocab...
In this class we start training and testing model
62598f1660cbc95b06362fcf
class Image: <NEW_LINE> <INDENT> def get_torso_thumbnail(id): <NEW_LINE> <INDENT> url = "https://www.roblox.com/bust-thumbnail/json?userId=" + str(id) + "&height=180&width=180" <NEW_LINE> r = requests.get(url) <NEW_LINE> res = r.json()['Url'] <NEW_LINE> return res <NEW_LINE> <DEDENT> def get_head_thumbnail(id): <NEW_LI...
Get an image of a torso, head,, outfit, or asset
62598f16099cdd3c63674a26
class EncryptionProtector(ProxyResource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'readonly': True}, 'subregion': {'readonly': True}, 'uri': {'readonly': True}, 'thumbprint': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'i...
The server encryption protector. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str :param kind: Kind of encryption protector. This is metadata used ...
62598f16956e5f7376df4ccd
class ParentScoreExtractor(BaseExtractor): <NEW_LINE> <INDENT> def extract(self, html): <NEW_LINE> <INDENT> soup = BeautifulSoup(html, self._parser) <NEW_LINE> if soup.title: <NEW_LINE> <INDENT> self._paragraphs.append(soup.title.get_text(strip=True)) <NEW_LINE> <DEDENT> scoreboard = defaultdict(int) <NEW_LINE> content...
the parent with the highest score (most text) is the content source
62598f16bf627c535bcb0119
class ItemFragment(Command): <NEW_LINE> <INDENT> size = 2 <NEW_LINE> macro_name = "db" <NEW_LINE> base_label = "ItemFragment_" <NEW_LINE> override_byte_check = True <NEW_LINE> param_types = { 0: {"name": "item", "class": ItemLabelByte}, 1: {"name": "quantity", "class": DecimalParam}, } <NEW_LINE> def __init__(self, add...
used by ItemFragmentParam and PeopleEvent (for items placed on a map)
62598f169f2886367281749b
class GetSystemReport(graphene.Field): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__( SystemReport, name=graphene.String( required=True, description='Name of the system report to get.' ), sensor_id=graphene.UUID( description='Optional scanner ID of a sensor to collect' ' the data from.' )...
Gets a single system (performance) report. Args: name (str): Name of the system report to get. sensor_id (str, optional): Optional scanner ID of a sensor to collect the data from. duration: (int, optional): Optional number of seconds the report should cover. start_time (datetime, opt...
62598f160fa83653e46f3b89
@validation.add("required_platform", platform="openstack", users=True) <NEW_LINE> @context.configure(name=CONTEXT_NAME, platform="openstack", order=445) <NEW_LINE> class SecurityServices(context.Context): <NEW_LINE> <INDENT> CONFIG_SCHEMA = { "type": "object", "$schema": rally_consts.JSON_SCHEMA, "properties": { "secur...
This context creates 'security services' for Manila project.
62598f16ad47b63b2c5a64b2
class Door(MapObject): <NEW_LINE> <INDENT> def __init__(self, point = None): <NEW_LINE> <INDENT> MapObject.__init__(self, ".", True, point)
Defines a door object.
62598f168a349b6b43684ee7
class Resource(XmlBase): <NEW_LINE> <INDENT> def __init__(self, href, resourceType, name, disc, section, searchURL=None): <NEW_LINE> <INDENT> self.href = href <NEW_LINE> self.resourceType = resourceType <NEW_LINE> self.name = name <NEW_LINE> self.disc = disc <NEW_LINE> self.section = section <NEW_LINE> self.search = op...
Rousource Model
62598f16956e5f7376df4cce
class MoneyFieldProxy(object): <NEW_LINE> <INDENT> def __init__(self, field): <NEW_LINE> <INDENT> self.field = field <NEW_LINE> self.currency_field_name = currency_field_name(self.field.name) <NEW_LINE> <DEDENT> def _money_from_obj(self, obj): <NEW_LINE> <INDENT> return Money(obj.__dict__[self.field.name], obj.__dict__...
An equivalent to Django's default attribute descriptor class (enabled via the SubfieldBase metaclass, see module doc for details). However, instead of callig to_python() on our MoneyField class, it stores the two different parts separately, and updates them whenever something is assigned. If the attribute is read, it b...
62598f1660cbc95b06362fd5
class KodiCloseIntentHandler(AbstractRequestHandler): <NEW_LINE> <INDENT> def can_handle(self, handler_input): <NEW_LINE> <INDENT> return ask_utils.is_intent_name("KodiClose")(handler_input) <NEW_LINE> <DEDENT> def handle(self, handler_input): <NEW_LINE> <INDENT> speak_output = "Sending intent KodiClose to server." <NE...
Handler for KodiClose Intent.
62598f16187af65679d29257
class Output(sams.base.Output): <NEW_LINE> <INDENT> def __init__(self, id, config): <NEW_LINE> <INDENT> super(Output, self).__init__(id, config) <NEW_LINE> self.static_map = self.config.get([self.id, "static_map"], {}) <NEW_LINE> self.map = self.config.get([self.id, "map"], {}) <NEW_LINE> self.metrics = self.config.get...
File output Class
62598f16091ae356687038ad
class ColRowWindow(ListModel): <NEW_LINE> <INDENT> def __init__(self, parent: QObject) -> None: <NEW_LINE> <INDENT> super().__init__(parent) <NEW_LINE> self.modelRC = None <NEW_LINE> self.modelValue = None <NEW_LINE> <DEDENT> def dropMimeData( self, mimeData: QMimeData, action: Qt.DropAction, row: int, column: int, ind...
Model for windows with field lists for rows and columns.
62598f16ad47b63b2c5a64b4
class GroupNorm(nn.Module): <NEW_LINE> <INDENT> def __init__(self, channels, channels_per_group=8, eps=1e-2): <NEW_LINE> <INDENT> self.always_float = True <NEW_LINE> super().__init__() <NEW_LINE> self.weight = nn.Parameter(torch.ones(channels)) <NEW_LINE> self.bias = nn.Parameter(torch.zeros(channels)) <NEW_LINE> if ch...
Implementation of group normalization from https://arxiv.org/abs/1803.08494 Authors find a large drop in performance if normalization is performed across each channels separately (i.e. num_groups = channels), which coincides with instance normalization.
62598f1650812a4eaa62023f
class Transport(object): <NEW_LINE> <INDENT> hdr = None <NEW_LINE> def send(self,): raise NotImplementedError
Base class for WARPNet transports. Attributes: hdr -- Transport header object
62598f16ad47b63b2c5a64b6
class _CachedDocument(object): <NEW_LINE> <INDENT> filename = None <NEW_LINE> document = None <NEW_LINE> variables = None <NEW_LINE> docinfo = None <NEW_LINE> music = None
Contains a document and related items.
62598f160fa83653e46f3b8d
class AttribDict(collections.MutableMapping): <NEW_LINE> <INDENT> defaults = {} <NEW_LINE> readonly = [] <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.__dict__.update(self.defaults) <NEW_LINE> self.update(dict(*args, **kwargs)) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> retur...
A class which behaves like a dictionary
62598f169f288636728174a0
class Master(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.suma_diferencias = 0 <NEW_LINE> self.slaves = [] <NEW_LINE> self.tiempos = [] <NEW_LINE> self.tiempo_sincronizado = time() <NEW_LINE> self.diferencia_media = 0 <NEW_LINE> <DEDENT> def registrar_slave(self, port): <NEW_LINE> <INDENT> self.s...
Clase Master
62598f168a349b6b43684eeb
class IRapidoApplication(Interface): <NEW_LINE> <INDENT> pass
A Rapido app
62598f16283ffb24f3cf254d
class MdeUnfoldSectionContextCommand(MdeFoldSectionCommand): <NEW_LINE> <INDENT> def is_visible(self): <NEW_LINE> <INDENT> if not super().is_visible(): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> view = self.view <NEW_LINE> target_level = folding_target_level(view) <NEW_LINE> hasSection = False <NEW_LINE> for ...
This class describes a `mde_unfold_section_context` command.
62598f16099cdd3c63674a2a
class WindProfileModel(object): <NEW_LINE> <INDENT> def __init__(self, lat, lon, eP, cP, rMax, windSpeedModel): <NEW_LINE> <INDENT> self.rho = 1.15 <NEW_LINE> self.lat = lat <NEW_LINE> self.lon = lon <NEW_LINE> self.eP = eP <NEW_LINE> self.cP = cP <NEW_LINE> self.rMax = rMax <NEW_LINE> self.speed = windSpeedModel(self)...
The base wind profile model. :param float lat: Latitude of TC centre. :param float lon: Longitude of TC centre. :param float eP: environmental pressure (hPa). :param float cP: centrral pressure of the TC (hPa). :param float rMax: Radius to maximum wind (km). :param windSpeedModel: A maximum wind speed model to apply. ...
62598f1650812a4eaa620240
class _SchemasHGenerator(object): <NEW_LINE> <INDENT> def __init__(self, cpp_bundle): <NEW_LINE> <INDENT> self._bundle = cpp_bundle <NEW_LINE> <DEDENT> def Generate(self, namespace): <NEW_LINE> <INDENT> c = code.Code() <NEW_LINE> c.Append('#include <map>') <NEW_LINE> c.Append('#include <string>') <NEW_LINE> c.Append() ...
Generates a code.Code object for the generated schemas .h file
62598f167cff6e4e811b4694
class OntologyFactory(): <NEW_LINE> <INDENT> test = 0 <NEW_LINE> def __init__(self, handle=None): <NEW_LINE> <INDENT> self.handle = handle <NEW_LINE> <DEDENT> def create(self, handle=None, handle_type=None, **args): <NEW_LINE> <INDENT> if handle == None: <NEW_LINE> <INDENT> self.test = self.test+1 <NEW_LINE> logging.in...
Implements a factory for generating :class:`Ontology` objects. You should use a factory object rather than initializing `Ontology` directly. See :ref:`inputs` for more details.
62598f16ad47b63b2c5a64b9
class MeanRegressor(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._mean = 0 <NEW_LINE> <DEDENT> def fit(self, X, y): <NEW_LINE> <INDENT> self._mean = np.mean(y) <NEW_LINE> return self <NEW_LINE> <DEDENT> def predict(self, X): <NEW_LINE> <INDENT> return np.full(l...
Regression Model which predicts the mean train value of target
62598f16656771135c488335
class Member: <NEW_LINE> <INDENT> def __init__(self, initial_phenotype, genotype): <NEW_LINE> <INDENT> self.initial_phenotype = initial_phenotype <NEW_LINE> self.phenotype = self.initial_phenotype.copy() <NEW_LINE> self.rng = np.random.RandomState() <NEW_LINE> self.size = len(self.initial_phenotype) <NEW_LINE> self.rec...
Initialization: initial_phenotype: initial list of parameters initial_genotype: initial seed and initial sigma Internal attributes: genotype: list of seeds phenotype: list of parameters Methods: recreate(new_genotype): update genotype and phenotype from new_genotype mutate(rng_genes): ...
62598f160fa83653e46f3b90
class Arguments: <NEW_LINE> <INDENT> uid = graphene.String(required=True) <NEW_LINE> name = graphene.String(required=True)
Play chromecast uid
62598f1631939e2706ed10b7
class TestInlineResponse200KillsLog(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 testInlineResponse200KillsLog(self): <NEW_LINE> <INDENT> pass
InlineResponse200KillsLog unit test stubs
62598f168a349b6b43684eef
class TwitterSearchResponse(object): <NEW_LINE> <INDENT> def __init__(self, client, user): <NEW_LINE> <INDENT> self.client = client.client <NEW_LINE> self.screen_name = user.screen_name <NEW_LINE> <DEDENT> def save(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> print("[search] [search_term: {}]".format(self.screen...
Talk to Twitter.
62598f16ad47b63b2c5a64bb
class PersonCreateView(CreateView): <NEW_LINE> <INDENT> model = Person <NEW_LINE> template_name = 'django_form.html' <NEW_LINE> form_class = HelloWorldForm <NEW_LINE> context_object_name = 'person' <NEW_LINE> def get_success_url(self): <NEW_LINE> <INDENT> return reverse('django_form') <NEW_LINE> <DEDENT> def get_contex...
View to create aa Person instance every time the form is submitted
62598f1660cbc95b06362fdd
class CommitAllChangeSets(handler_utils.CronJobHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> start_time = datetime.datetime.utcnow() <NEW_LINE> changes = rule_models.RuleChangeSet.query( projection=[rule_models.RuleChangeSet.blockable_key], distinct=True).fetch() <NEW_LINE> blockable_keys = [change.b...
Attempt a deferred commit for each Blockable with pending change sets.
62598f16ab23a570cc2d43c2
class Interpolacion(object): <NEW_LINE> <INDENT> def __init__(self, values, duration, delay): <NEW_LINE> <INDENT> self.values = values <NEW_LINE> self.duration = duration <NEW_LINE> self.delay = delay <NEW_LINE> <DEDENT> def apply(self, target, function, type): <NEW_LINE> <INDENT> import pilas <NEW_LINE> step = self.du...
Representa una interpolacion, que pasa por varios puntos clave. Las interpolacione se utilizan para realizar movimientos de actores en la pantalla. O simplemente para cambiar el estado de un actor de un punto a otro, por ejemplo, de 0 a 360 grados de manera gradual. Todo objeto de interpolaciones se puede asignar dir...
62598f16fbf16365ca792d4b
class CpuPercent: <NEW_LINE> <INDENT> _last_measurement = None <NEW_LINE> _last_cpu_percent = 0.0 <NEW_LINE> @classmethod <NEW_LINE> def get(cls, interval=None): <NEW_LINE> <INDENT> if interval: <NEW_LINE> <INDENT> cls._last_cpu_percent = psutil.cpu_percent(interval=interval) <NEW_LINE> cls._last_measurement = time.mon...
Ensures a minumum interval between two cpu_percent() calls
62598f169f288636728174a6
class CompaniesPostgresPipeline(object): <NEW_LINE> <INDENT> def __init__(self, database_config): <NEW_LINE> <INDENT> self.database_config = database_config <NEW_LINE> <DEDENT> def process_item(self, item, spider): <NEW_LINE> <INDENT> self.db_utils.upsert_company(item) <NEW_LINE> return item <NEW_LINE> <DEDENT> def ope...
保存公司信息至postgres数据库
62598f16283ffb24f3cf2553
class UserListSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> roles = serializers.SerializerMethodField() <NEW_LINE> def get_roles(self, obj): <NEW_LINE> <INDENT> return obj.roles.values() <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> model = UserProfile <NEW_LINE> fields = ['id', 'username', 'name',...
用户列表的序列化
62598f16656771135c488339
class TextTestRunner(object): <NEW_LINE> <INDENT> resultclass = TextTestResult <NEW_LINE> def __init__(self, stream=None, descriptions=True, verbosity=1, failfast=False, buffer=False, resultclass=None, warnings=None): <NEW_LINE> <INDENT> if stream is None: <NEW_LINE> <INDENT> stream = sys.stderr <NEW_LINE> <DEDENT> sel...
A test runner class that displays results in textual form. It prints out the names of tests as they are run, errors as they occur, and a summary of the results at the end of the test run.
62598f16091ae356687038b7
class CompoundQuantity(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> app_label = 'DRP' <NEW_LINE> unique_together = ('reaction', 'role', 'amount') <NEW_LINE> <DEDENT> compound = models.ForeignKey(Compound, on_delete=models.PROTECT) <NEW_LINE> reaction = models.ForeignKey(Reaction) <NEW_LINE> role =...
A class to contain the relationship between a reaction and a compound. Contains the amount of a given compound used in a reaction with the applicable units. At present, no unit convention is enforced.
62598f16ad47b63b2c5a64c0
class LoggingTestsMixin: <NEW_LINE> <INDENT> @contextmanager <NEW_LINE> def assertNotLogs(self, logger=None, level=None, msg=None): <NEW_LINE> <INDENT> if not isinstance(logger, logging.Logger): <NEW_LINE> <INDENT> logger = logging.getLogger(logger) <NEW_LINE> <DEDENT> if level: <NEW_LINE> <INDENT> level = logging._nam...
A mixin that defines additional test methods for logging behavior. This mixin relies on the availability of the `fail` attribute defined by the test classes included in Python's unittest method to signal test failure.
62598f16ec188e330fdf7567
class flujo(models.Model): <NEW_LINE> <INDENT> nombre = models.CharField(max_length=30) <NEW_LINE> actividades = models.ManyToManyField(actividad) <NEW_LINE> user_stories = models.ManyToManyField('US.us',through='kanban',related_name='userstories',null=True,blank=True) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDE...
Model de Flujo ============== Clase que define un B{Flujo} @cvar nombre: Nombre asignado al Flujo. @type nombre: Varchar @cvar actividades: Lista de actividades que tiene el B{Flujo}, mediante la relación ManytoMan(Muchos a muchos) con L{Actividad<IS2_R09.apps.Flujo.models.actividad>} @type actividades: L{Actividad<I...
62598f16099cdd3c63674a2f
class ZoneInfo(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Zone = None <NEW_LINE> self.ZoneName = None <NEW_LINE> self.ZoneId = None <NEW_LINE> self.ZoneState = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Zone = params.get("Zone") <NEW_LINE> sel...
描述可用区的编码和状态信息
62598f16bf627c535bcb0129
class TestIntegrationSystem(object): <NEW_LINE> <INDENT> def create_authenticated_session(self): <NEW_LINE> <INDENT> return kismet_rest.System(username="admin", password="passwordy", debug=True) <NEW_LINE> <DEDENT> def test_system_get_status(self): <NEW_LINE> <INDENT> system = self.create_authenticated_session() <NEW_L...
Test System().
62598f16656771135c48833d
class AbinitYamlError(AbinitError): <NEW_LINE> <INDENT> pass
Raised if the YAML parser cannot parse the document and the doc tag is an Error.
62598f16187af65679d2925e
class IntegerOptional(BasicParam): <NEW_LINE> <INDENT> def __init__(self, label, default=0): <NEW_LINE> <INDENT> super(IntegerOptional, self).__init__(label) <NEW_LINE> self.default = default
an optional integer param
62598f163617ad0b5ee04de1
class TestMenu(object): <NEW_LINE> <INDENT> folder = join(TEST_DIR, 'data') <NEW_LINE> tiffilename = join(folder, 'test.tif') <NEW_LINE> h5filename = join(folder, 'test.h5') <NEW_LINE> def test_clicks(self, menu_test_fixture): <NEW_LINE> <INDENT> widget, dialog, qtbot = menu_test_fixture <NEW_LINE> qtbot.mouseClick(wid...
Tests whether the menu buttons work, e.g. whether clicking "Open Image..." actually opens a QFileDialog and records the correct filename. As stated in the menu_test_fixture docstring, this does not test for file parsing and loading functionality. That's tested in the test_file_info_dialog module.
62598f16c4546d3d9def68c0
class IterativeSolver(BaseSolver): <NEW_LINE> <INDENT> def __init__(self, tol=1e-8, maxiter=5000): <NEW_LINE> <INDENT> self.tol = tol <NEW_LINE> self.maxiter = maxiter <NEW_LINE> <DEDENT> def _get_atol(self, b): <NEW_LINE> <INDENT> return norm(self.b) * self.tol <NEW_LINE> <DEDENT> def _get_rtol(self, x0): <NEW_LINE> <...
Brief description of 'IterativeSolver'
62598f1631939e2706ed10bb
class WhQ(Question): <NEW_LINE> <INDENT> contentclass = Pred1 <NEW_LINE> def __init__(self, pred): <NEW_LINE> <INDENT> assert isinstance(pred, (Pred1, basestring)) <NEW_LINE> if isinstance(pred, basestring): <NEW_LINE> <INDENT> if pred.startswith('?x.') and pred.endswith('(x)'): <NEW_LINE> <INDENT> pred = pred[3:-3] <N...
Wh-question.
62598f1626238365f5fab83e
class sdssStripe82PhotoUnc(empiricalPhotoUnc): <NEW_LINE> <INDENT> def __init__(self,b): <NEW_LINE> <INDENT> stripe82terms = np.array([[0.15127,3.8529,0.00727,-0.1308], [0.15180,4.0233,0.00486,-0.0737], [0.14878,3.8970,0.00664,-0.1077], [0.14780,3.8024,0.00545,-0.0678], [0.14497,3.5437,0.00715,-0.1121]]) <NEW_LINE> sel...
this fails at m<~18 when SDSS detections are no longer sky-dominated, but not really interested in bright objects on the Stripe... also, dominated by calibration uncertainty for bright objects anyway
62598f163617ad0b5ee04de3
class Moviesfunctions(View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> if request.is_ajax(): <NEW_LINE> <INDENT> form=CriteriaForm(request.GET) <NEW_LINE> if form.is_valid(): <NEW_LINE> <INDENT> lan=form.cleaned_data['language'] <NEW_LINE> genre=form.cleaned_data['genre'] <NEW_LINE> sort_by=form.c...
---------View for handeling movies functionalities-------------
62598f1697e22403b3839b97
class OrgHomeView(View): <NEW_LINE> <INDENT> def get(self, request, org_id): <NEW_LINE> <INDENT> current_page = 'home' <NEW_LINE> course_org = CourseOrg.objects.get(id=int(org_id)) <NEW_LINE> course_org.click_nums += 1 <NEW_LINE> course_org.save() <NEW_LINE> has_fav = False <NEW_LINE> if request.user.is_authenticated: ...
机构首页
62598f16d8ef3951e32c74af
class TsvDialect(csv.Dialect): <NEW_LINE> <INDENT> delimiter = "\t" <NEW_LINE> doublequote = False <NEW_LINE> escapechar = "\\" <NEW_LINE> lineterminator = "\n" <NEW_LINE> extrasaction = "ignore" <NEW_LINE> quotechar = '"' <NEW_LINE> quoting = csv.QUOTE_MINIMAL <NEW_LINE> skipinitialspace = False
Standard Unix-style TSV format.
62598f16c4546d3d9def68c1
class CatalogValueSupplier(ValueSupplier): <NEW_LINE> <INDENT> deserialized_types = { 'object_type': 'str', 'value_catalog': 'ask_smapi_model.v1.skill.interaction_model.value_catalog.ValueCatalog' } <NEW_LINE> attribute_map = { 'object_type': 'type', 'value_catalog': 'valueCatalog' } <NEW_LINE> supports_multiple_types ...
Supply slot values from catalog(s). :param value_catalog: :type value_catalog: (optional) ask_smapi_model.v1.skill.interaction_model.value_catalog.ValueCatalog
62598f16bf627c535bcb012d
class TCPClient(asynchat.async_chat): <NEW_LINE> <INDENT> def __init__(self, ip, port, user_input): <NEW_LINE> <INDENT> asynchat.async_chat.__init__(self) <NEW_LINE> self.set_terminator('\a\b\r\n') <NEW_LINE> self.found_terminator = self.handle_reply <NEW_LINE> self.cache = '' <NEW_LINE> self.user_input = user_input <N...
Envia mensagens para o servidor e recebe respostas.
62598f16091ae356687038bf
class Home(TemplateView): <NEW_LINE> <INDENT> template_name = 'home/home.html'
Home page when users login
62598f1697e22403b3839b99
class AntlrRubyLexer(DelegatingLexer): <NEW_LINE> <INDENT> name = 'ANTLR With Ruby Target' <NEW_LINE> aliases = ['antlr-ruby', 'antlr-rb'] <NEW_LINE> filenames = ['*.G', '*.g'] <NEW_LINE> def __init__(self, **options): <NEW_LINE> <INDENT> super(AntlrRubyLexer, self).__init__(RubyLexer, AntlrLexer, **options) <NEW_LINE>...
`ANTLR`_ with Ruby Target .. versionadded:: 1.1
62598f169f288636728174b0
class Reservation(core_models.AbstractTimeStampedModel): <NEW_LINE> <INDENT> STATUS_PENDING = "pending" <NEW_LINE> STATUS_CONFIRMED = "confirmed" <NEW_LINE> STATUS_CANCELED = "canceled" <NEW_LINE> STATUS_CHOICES = ( (STATUS_PENDING, "pending"), (STATUS_CONFIRMED, "confirmed"), (STATUS_CANCELED, "canceled"), ) <NEW_LINE...
Reservation Model Definition
62598f16283ffb24f3cf255d
class JSONOutputSerialization: <NEW_LINE> <INDENT> def __init__(self, record_delimiter=None): <NEW_LINE> <INDENT> self._record_delimiter = record_delimiter <NEW_LINE> <DEDENT> def toxml(self, element): <NEW_LINE> <INDENT> element = SubElement(element, "JSON") <NEW_LINE> if self._record_delimiter is not None: <NEW_LINE>...
JSON output serialization.
62598f16099cdd3c63674a32
class PermanentCache(CacheBase, dict): <NEW_LINE> <INDENT> def __new__(klass, parent=None): <NEW_LINE> <INDENT> return super(PermanentCache,klass).__new__(klass)
Keeps items in cache until explicitly cleared
62598f169f288636728174b2
class API: <NEW_LINE> <INDENT> def __init__(self, project_id: str, url: str): <NEW_LINE> <INDENT> self.project_id = project_id <NEW_LINE> if url.startswith("http://"): <NEW_LINE> <INDENT> self.url = url.lstrip("http://") <NEW_LINE> <DEDENT> elif url.startswith("https://"): <NEW_LINE> <INDENT> self.url = url.lstrip("htt...
The SpaceUp Client API :: from space_api import API api = API("My-Project", "localhost:4124") :param project_id: (str) The project ID :param url: (str) The base URL of space-cloud server
62598f16ec188e330fdf756f
class MutableDict(Mutable, dict): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def coerce(cls, key, value): <NEW_LINE> <INDENT> if not isinstance(value, MutableDict): <NEW_LINE> <INDENT> if isinstance(value, dict): <NEW_LINE> <INDENT> return MutableDict(value) <NEW_LINE> <DEDENT> return Mutable.coerce(key, value) <NEW_L...
SQLAlchemy dict field that tracks changes
62598f16099cdd3c63674a33
class SoundSave(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(SoundSave, self).__init__() <NEW_LINE> res = rospy.get_param("~res") <NEW_LINE> self.filename = rospkg.RosPack().get_path('respeaker')+"/output/"+res <NEW_LINE> self.frame = 0 <NEW_LINE> pozyx_sub = rospy.Subscriber('sound_raw', ...
docstring for SoundSave.
62598f1650812a4eaa620249
class Airport: <NEW_LINE> <INDENT> hanger_capacity = 2 <NEW_LINE> def __init__(self, weather=Weather()): <NEW_LINE> <INDENT> self.hanger = [] <NEW_LINE> self.weather = weather <NEW_LINE> <DEDENT> def land(self, plane): <NEW_LINE> <INDENT> stormy = self.forecast() <NEW_LINE> if stormy: <NEW_LINE> <INDENT> raise TypeErro...
Creates Airport
62598f16bf627c535bcb0131
class IpMapping(messages.Message): <NEW_LINE> <INDENT> ipAddress = messages.StringField(1) <NEW_LINE> timeToRetire = message_types.DateTimeField(2)
Database instance IP Mapping. Fields: ipAddress: The IP address assigned. timeToRetire: The due time for this IP to be retired in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. This field is only available when the IP is scheduled to be retired.
62598f1626238365f5fab844
class StickerSet: <NEW_LINE> <INDENT> def __init__(self, dictionary=None): <NEW_LINE> <INDENT> if dictionary is None: <NEW_LINE> <INDENT> dictionary = {} <NEW_LINE> <DEDENT> self.dict = dictionary <NEW_LINE> self.name = dictionary["name"] if "name" in dictionary else None <NEW_LINE> self.title = dictionary["title"] if ...
This object represents a sticker set.[See on Telegram API](https://core.telegram.org/bots/api#stickerset) - - - - - **Fields**: - `name`: `string` - Sticker set name - `title`: `string` - Sticker set title - `is_animated`: `bool` - True, if the sticker set contains animated stickers - `is_video`: `bool` - True, if th...
62598f16656771135c488345
class Crawl_Error_Type(models.Model): <NEW_LINE> <INDENT> type = models.CharField(max_length=50, unique=True)
Crawl Error Types
62598f1631939e2706ed10bf
class _LinuxProcess(_Process): <NEW_LINE> <INDENT> def spawn_process(self, cmd): <NEW_LINE> <INDENT> return Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, universal_newlines=True)
Concrete class to implement external subprocess on Linux.
62598f1697e22403b3839b9d
class EventHook(Hook): <NEW_LINE> <INDENT> def __init__(self, name=None): <NEW_LINE> <INDENT> self.fired = False <NEW_LINE> super(EventHook,self).__init__(name) <NEW_LINE> <DEDENT> def __iadd__(self, other): <NEW_LINE> <INDENT> if self.fired and callable(other): other() <NEW_LINE> else: return super(EventHook,self).__i...
Like a Hook, but this is a one-off. Ensures that callables added to this hook AFTER it was triggered will fire immediately.
62598f17ad47b63b2c5a64ca
class Messages(BaseInterface): <NEW_LINE> <INDENT> table_name = "messages" <NEW_LINE> bulk_data_field = "" <NEW_LINE> field_defaults = {4: {}, 5: {}, 6: {}, 7: {}, 8: {}} <NEW_LINE> converters_reference = {4: {"lat": Utility.format_int_as_latlon, "lon": Utility.format_int_as_latlon}, 5: {}, 6: {}, 7: {}, 8: {}} <NEW_LI...
This object covers messages stored in the Kismet DB. The ``Keyword Arguments`` section below applies only to methods which support them (as noted below), not to object instantiation. Args: file_location (str): Path to Kismet log file. Keyword args: ts_sec_gt (str, datetime, or (secs, u_secs)): Timestamp for ...
62598f17ab23a570cc2d43ca
class TemHem(models.Model): <NEW_LINE> <INDENT> data_time = models.DateTimeField(auto_now=True) <NEW_LINE> temperature = models.FloatField() <NEW_LINE> humidity = models.FloatField()
A data contains temperature and humidity Contains only original data
62598f17099cdd3c63674a34
class Picture(db.BASE): <NEW_LINE> <INDENT> __tablename__ = 'picture' <NEW_LINE> id = Column(Integer, Sequence('pictures_id_seq'), primary_key=True) <NEW_LINE> pict = Column(String, nullable=False) <NEW_LINE> posted = Column(String) <NEW_LINE> taken = Column(String) <NEW_LINE> ntags = Column(Integer, nullable=False) <N...
A Mapping class for Picture Objects.
62598f17bf627c535bcb0133
class DomesticMelonOrder(AbstractMelonOrder): <NEW_LINE> <INDENT> def __init__(self, species, qty): <NEW_LINE> <INDENT> super().__init__(species, qty, 'USA', 'domestic', 0.08)
A melon order within the USA.
62598f17d8ef3951e32c74b3
class TestData17(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 testData17(self): <NEW_LINE> <INDENT> pass
Data17 unit test stubs
62598f17091ae356687038c7
class RNNCell(BaseRNNCell): <NEW_LINE> <INDENT> def __init__(self, num_hidden, activation='tanh', prefix='rnn_', params=None): <NEW_LINE> <INDENT> super(RNNCell, self).__init__(prefix=prefix, params=params) <NEW_LINE> self._num_hidden = num_hidden <NEW_LINE> self._activation = activation <NEW_LINE> self._iW = self.para...
Simple recurrent neural network cell Parameters ---------- num_hidden : int number of units in output symbol activation : str or Symbol, default 'tanh' type of activation function prefix : str, default 'rnn_' prefix for name of layers (and name of weight if params is None) params : RNNParams or None ...
62598f17ad47b63b2c5a64ce
class LUXCORE_OT_ior_preset_values(bpy.types.Operator, LuxCoreIORPresetBase, LuxCoreIORPresetCommonProperties): <NEW_LINE> <INDENT> bl_idname = "luxcore.ior_preset_values" <NEW_LINE> bl_description = "Index of Refraction presets sorted by value" <NEW_LINE> bl_property = "ior_preset" <NEW_LINE> callback_strings = [] <NE...
A custom operator to return a list of IOR presets sorted by value
62598f1750812a4eaa62024d
class ApplicationGatewayFirewallRuleGroup(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'rule_group_name': {'required': True}, 'rules': {'required': True}, } <NEW_LINE> _attribute_map = { 'rule_group_name': {'key': 'ruleGroupName', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'},...
A web application firewall rule group. All required parameters must be populated in order to send to Azure. :param rule_group_name: Required. The name of the web application firewall rule group. :type rule_group_name: str :param description: The description of the web application firewall rule group. :type descriptio...
62598f17bf627c535bcb0139
class YOURLSClient( YOURLSDeleteMixin, YOURLSEditMixin, YOURLSSearchKeywordsMixin, YOURLSAPIMixin, YOURLSClientBase ): <NEW_LINE> <INDENT> pass
YOURLS client with API delete support.
62598f17adb09d7d5dc09266
class HTTPWSGIResponse(object): <NEW_LINE> <INDENT> def __init__(self, webob_resp): <NEW_LINE> <INDENT> self.resp = webob_resp <NEW_LINE> self._body = StringIO(self.resp.body) <NEW_LINE> self._body.seek(0) <NEW_LINE> self.reason = self.resp.status.split(" ", 1) <NEW_LINE> self.status = self.resp.status_int <NEW_LINE> <...
A fake httplib-like HTTP response. Used by :class:`WSGILikeHTTP` for use by :class:`WSGIXMLRPCAppTransport`. .. versionadded:: 1.1
62598f17283ffb24f3cf2566
class SwitchOp(Op): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> super(SwitchOp, self).__init__(name) <NEW_LINE> <DEDENT> def propagateShapes(self, make_symbolic=False): <NEW_LINE> <INDENT> self.debugAssert(len(self._inputs) == 2) <NEW_LINE> self.debugAssert(self._inputs[1].shape.isScalar()) <NEW_L...
The first input to the SwitchOp is the tensor that should be forwarded to one of the outputs. The second input gates whether the first input gets forwarded to the first or second output. If the second input is true, input goes to the first output, or if the second input is false, input goes to the second output.
62598f17187af65679d29266
class StreamStateBookmark(): <NEW_LINE> <INDENT> def __init__(self, stream): <NEW_LINE> <INDENT> if not stream.seekable(): <NEW_LINE> <INDENT> raise StreamError('Requires a seekable stream') <NEW_LINE> <DEDENT> self._stream = stream <NEW_LINE> self._offset = 0 <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT...
Remember the stream offset in a with statement
62598f17ec188e330fdf7579
class InputState(EventState): <NEW_LINE> <INDENT> def __init__(self, request, message): <NEW_LINE> <INDENT> super(InputState, self).__init__(outcomes=['received', 'aborted', 'no_connection', 'data_error'], output_keys=['data']) <NEW_LINE> self._action_topic = 'flexbe/behavior_input' <NEW_LINE> self._client = ProxyActio...
Implements a state where the state machine needs an input from the operator. Requests of different types, such as requesting a waypoint, a template, or a pose, can be specified. -- request uint8 One of the custom-defined values to specify the type of request. -- message string Message displayed to...
62598f178a349b6b43684f07
@attr.s(frozen=True,slots=True,order=True) <NEW_LINE> class Neighbour(AffineFunc): <NEW_LINE> <INDENT> @property <NEW_LINE> def a(self) -> Real: <NEW_LINE> <INDENT> return self.d <NEW_LINE> <DEDENT> @property <NEW_LINE> def L(self) -> Real: <NEW_LINE> <INDENT> return self.r <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> d...
A neighbour is a special type of normalized affine function, used to represent a neighbour of a net interval. Neighbours have a fixed order which is used when computing transition matrices. This class is an immutable storage class. Methods for creation: * :meth:`from_aff` Convenience attributes: * :attr:`a` * :att...
62598f170fa83653e46f3ba9
class CreateQueues(show.ShowOne): <NEW_LINE> <INDENT> log = logging.getLogger(__name__ + ".CreateQueues") <NEW_LINE> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(CreateQueues, self).get_parser(prog_name) <NEW_LINE> parser.add_argument( "name", metavar="<name>", help="Name of the queue") <NEW_LINE...
List available queues.
62598f173617ad0b5ee04df3
class QuotaClass(BASE): <NEW_LINE> <INDENT> __tablename__ = 'quota_classes' <NEW_LINE> __table_args__ = ( sa.Index('quota_classes_class_name_idx', 'class_name'), ) <NEW_LINE> id = sa.Column(sa.Integer, primary_key=True) <NEW_LINE> class_name = sa.Column(sa.String(255)) <NEW_LINE> resource = sa.Column(sa.String(255)) <N...
Represents a single quota override for a quota class. If there is no row for a given quota class and resource, then the default for the deployment is used. If the row is present but the hard limit is Null, then the resource is unlimited.
62598f177cff6e4e811b46b1
class SimCLRLoss(nn.Module): <NEW_LINE> <INDENT> def __init__(self, opt): <NEW_LINE> <INDENT> super(SimlrDistillv1, self).__init__() <NEW_LINE> self.temperature = 1.0 <NEW_LINE> <DEDENT> def forward(self, features): <NEW_LINE> <INDENT> N = features.size(0) // 2 <NEW_LINE> anchor = features <NEW_LINE> contrast = feature...
SimCLR Loss
62598f17187af65679d29268
class AddressesScopedList(messages.Message): <NEW_LINE> <INDENT> class WarningValue(messages.Message): <NEW_LINE> <INDENT> class CodeValueValuesEnum(messages.Enum): <NEW_LINE> <INDENT> DEPRECATED_RESOURCE_USED = 0 <NEW_LINE> DISK_SIZE_LARGER_THAN_IMAGE_SIZE = 1 <NEW_LINE> INJECTED_KERNELS_DEPRECATED = 2 <NEW_LINE> NEXT...
A AddressesScopedList object. Messages: WarningValue: [Output Only] Informational warning which replaces the list of addresses when the list is empty. Fields: addresses: [Output Only] List of addresses contained in this scope. warning: [Output Only] Informational warning which replaces the list of addre...
62598f17c4546d3d9def68c9
class DrawInfo(object): <NEW_LINE> <INDENT> pass
This object is supplied as a parameter to the draw method of the various segments. It has the following fields: `surface` The surface to draw to. `override_color` If not None, a color that's used for this outline/shadow. `outline` The amount to outline the text by. `displayable_blits` If no...
62598f17ad47b63b2c5a64d6
class DocumentedGreyhound(DocumentedDog): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> super().__init__(name=name, breed="Greyhound") <NEW_LINE> self.chases_rabbits = True <NEW_LINE> self.size = "Medium"
The Greyhound breed is a subclass of dog. Will auto-set the Dog breed argument with "Greyhound" Args: name (str): the name of the dog Attributes: chases_rabbits (bool): If the greyhound likes to chase rabbits size (str): Size of the dog - overwrites parent class
62598f179f288636728174c0
class AioHTTPTestCase(unittest.TestCase): <NEW_LINE> <INDENT> @asyncio.coroutine <NEW_LINE> def get_application(self, loop): <NEW_LINE> <INDENT> return self.get_app(loop) <NEW_LINE> <DEDENT> def get_app(self, loop): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def setUp(self): <NEW_LINE> <INDENT> self.loop = setup_test...
A base class to allow for unittest web applications using aiohttp. Provides the following: * self.client (aiohttp.test_utils.TestClient): an aiohttp test client. * self.loop (asyncio.BaseEventLoop): the event loop in which the application and server are running. * self.app (aiohttp.web.Application): the applicati...
62598f178a349b6b43684f0c
class Error(MeasError): <NEW_LINE> <INDENT> def __init__(self, expression, message): <NEW_LINE> <INDENT> self.expression = expression <NEW_LINE> self.message = message <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return repr([self.expression, self.message])
Exeption raised for wrong input values
62598f17099cdd3c63674a3a
class Hawk(Unit): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.growth_rates = {"hp": 130, "strength": 55, "magic": 10, "skill": 70, "speed": 65, "luck": 40, "defense": 30, "resistance": 25} <NEW_LINE> self.hp = 39 <NEW_LINE> self.strength = 13 <NEW_LINE> self.magic = 5 ...
Janaff, level 8.
62598f17656771135c488355
class SessionsServicer(object): <NEW_LINE> <INDENT> def DetectIntent(self, request, context): <NEW_LINE> <INDENT> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!') <NEW_LINE> <DEDENT> def StreamingDet...
Manages user sessions. #
62598f1731939e2706ed10c7
class StorageManagerEntities(BaseEntitiesView): <NEW_LINE> <INDENT> table = Table(".//div[@id='list_grid' or @class='miq-data-table']/table")
The entities on the main list Storage Manager or Provider page
62598f17ec188e330fdf7581
class FrequentButton(tk.Button): <NEW_LINE> <INDENT> def __init__(self,parent): <NEW_LINE> <INDENT> tk.Button.__init__(self, parent, text = 'Frequent', relief = tk.RIDGE, border = 2, activeforeground = 'black', activebackground = 'purple') <NEW_LINE> self.parent = parent
Button that makes the FoodListingFrame list the most frequently eaten foods.
62598f17ad47b63b2c5a64da
class Tags(Model): <NEW_LINE> <INDENT> _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, } <NEW_LINE> def __init__(self, *, tags=None, **kwargs) -> None: <NEW_LINE> <INDENT> super(Tags, self).__init__(**kwargs) <NEW_LINE> self.tags = tags
Tags field of the resource. :param tags: Tags field of the resource. :type tags: dict[str, str]
62598f17656771135c488357
class InvitationBackend(object): <NEW_LINE> <INDENT> def register(self, request, **kwargs): <NEW_LINE> <INDENT> username, email, password, invitation_code = kwargs['username'], kwargs['email'], kwargs['password1'], kwargs['invitation_code'] <NEW_LINE> if Site._meta.installed: <NEW_LINE> <INDENT> site = Site....
Backend which requires invitation code to register.
62598f1731939e2706ed10c8
class CardDetailView(generic.DetailView): <NEW_LINE> <INDENT> model = CreditCard
Generic class-based detail view for a credit card.
62598f17d8ef3951e32c74bb
class SinopeThermostat(ClimateDevice): <NEW_LINE> <INDENT> def __init__(self, sinope_data, device_id, name): <NEW_LINE> <INDENT> self.client_name = name <NEW_LINE> self.client = sinope_data.client <NEW_LINE> self.device_id = device_id <NEW_LINE> self.sinope_data = sinope_data <NEW_LINE> self._target_temp = None <NEW_L...
Implementation of a Sinope Device.
62598f17956e5f7376df4ce3