code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class RequestPayloadError(Exception): <NEW_LINE> <INDENT> pass | Payload parsing error. | 62598fb3a8370b77170f0474 |
class NewBertRegressionModel(NewBertModel): <NEW_LINE> <INDENT> class Config(NewBertModel.Config): <NEW_LINE> <INDENT> class InputConfig(ConfigBase): <NEW_LINE> <INDENT> tokens: BERTTensorizer.Config = BERTTensorizer.Config( columns=["text1", "text2"], max_seq_len=128 ) <NEW_LINE> labels: NumericLabelTensorizer.Config ... | BERT single sentence (or concatenated sentences) regression. | 62598fb37047854f4633f472 |
class HoursAssignmentRequirement(Model): <NEW_LINE> <INDENT> def __init__(self, grade: Grade=None, grade_type: GradeType=None, grade_type_category: GradeTypeCategory=None): <NEW_LINE> <INDENT> self.openapi_types = { 'grade': Grade, 'grade_type': GradeType, 'grade_type_category': GradeTypeCategory } <NEW_LINE> self.attr... | NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Do not edit the class manually. | 62598fb3283ffb24f3cf3924 |
class PycassaCluster(BaseCluster): <NEW_LINE> <INDENT> def __init__(self, hosts=None, keyspace=None, backend=Pycassa, **kwargs): <NEW_LINE> <INDENT> assert isinstance(hosts, collections.Iterable), 'hosts must be an iterable' <NEW_LINE> assert keyspace, 'keyspace must be set' <NEW_LINE> return super(PycassaCluster, self... | A PycassaCluster has a single host as pycassa internally handles routing
and communication within a set of nodes. | 62598fb37047854f4633f473 |
@attr('UNIT') <NEW_LINE> class TestSusbcriberChannel(PyonTestCase): <NEW_LINE> <INDENT> pass | SubscriberChannel is a blank for now | 62598fb356ac1b37e6302283 |
class AllowableList(Stringify): <NEW_LINE> <INDENT> def __init__(self, values): <NEW_LINE> <INDENT> self.values = values <NEW_LINE> <DEDENT> def to_wiki(self): <NEW_LINE> <INDENT> return "Allowed values: {0}".format(", ".join(self.values)) | Model of a allowableValues of type LIST
See https://github.com/wordnik/swagger-core/wiki/datatypes#complex-types | 62598fb3be383301e0253892 |
class RedisDirectTcpReplicationClientFactory(SynapseRedisFactory): <NEW_LINE> <INDENT> maxDelay = 5 <NEW_LINE> protocol = RedisSubscriber <NEW_LINE> def __init__( self, hs: "HomeServer", outbound_redis_connection: txredisapi.RedisProtocol ): <NEW_LINE> <INDENT> super().__init__( hs, uuid="subscriber", dbid=None, poolsi... | This is a reconnecting factory that connects to redis and immediately
subscribes to a stream.
Args:
hs
outbound_redis_connection: A connection to redis that will be used to
send outbound commands (this is separate to the redis connection
used to subscribe). | 62598fb355399d3f056265b2 |
class TestOrderCoupon(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 testOrderCoupon(self): <NEW_LINE> <INDENT> pass | OrderCoupon unit test stubs | 62598fb35166f23b2e243472 |
class DoubleDict(dict): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> if len(args) > 1: <NEW_LINE> <INDENT> raise TypeError('DoubleDict expected at most 1 arguments, got 2') <NEW_LINE> <DEDENT> super(DoubleDict, self).__init__(*args, **kwargs) <NEW_LINE> self._keys = self.keys if _PY3 els... | Dictionary that enables reverse lookup.
>>> dd = DoubleDict([('a', 1), ('b', 2), ('c', 3)])
>>> dd == {'a': 1, 'b':2, 'c': 3}
True
>>> dd.reverse == {1: 'a', 2: 'b', 3: 'c'}
True
For this to work, dict values must be unique and hashable:
>>> dd = DoubleDict([('a', 1), ('b', 2), ('c', 1)])
Traceback (most recent call... | 62598fb3fff4ab517ebcd87e |
class Switch(KlattComponent): <NEW_LINE> <INDENT> def __init__(self, mast): <NEW_LINE> <INDENT> KlattComponent.__init__(self, mast) <NEW_LINE> self.output = [] <NEW_LINE> self.output.append(np.zeros(self.mast.params["N_SAMP"])) <NEW_LINE> self.output.append(np.zeros(self.mast.params["N_SAMP"])) <NEW_LINE> <DEDENT> def ... | Binary switch between two outputs.
Has two output signals (instead of one, as in other KlattComponents). Each
is connected to a different destination, and the operate() function
switches the input between the two possible outputs depending on a control
singal.
Arguments:
mast (KlattSynth): see parent class
Attri... | 62598fb332920d7e50bc60ec |
class Gallery(models.Model): <NEW_LINE> <INDENT> title = models.CharField(u'Название', max_length=256) <NEW_LINE> create_date = models.DateField(u'Дата создания', default=datetime.date.today()) <NEW_LINE> preview_image = ImageRatioField('image', '221x100', verbose_name=u'Превью') <NEW_LINE> image = models.ImageField(ve... | Галерея | 62598fb344b2445a339b69be |
class Config: <NEW_LINE> <INDENT> base_dir: str <NEW_LINE> downloads_dir: str <NEW_LINE> jobs: int <NEW_LINE> platform: Platform <NEW_LINE> architecture: str <NEW_LINE> triple: str <NEW_LINE> native_config: "Config" <NEW_LINE> program_suffix: str <NEW_LINE> def __init__( self, base_dir: str, downloads_dir: str = None, ... | A class to store the configuration for a given platform. | 62598fb301c39578d7f12e12 |
class DbenchTest(DfuseTestBase): <NEW_LINE> <INDENT> def test_dbench(self): <NEW_LINE> <INDENT> self.add_pool(connect=False) <NEW_LINE> self.add_container(self.pool) <NEW_LINE> self.start_dfuse(self.hostlist_clients, self.pool, self.container) <NEW_LINE> dbench_cmd = Dbench(self.hostlist_clients, self.tmp) <NEW_LINE> d... | Base Dbench test class.
:avocado: recursive | 62598fb371ff763f4b5e780c |
class Workflow(AWSObject): <NEW_LINE> <INDENT> resource_type = "AWS::Transfer::Workflow" <NEW_LINE> props: PropsDictType = { "Description": (str, False), "OnExceptionSteps": ([WorkflowStep], False), "Steps": ([WorkflowStep], True), "Tags": (Tags, False), } | `Workflow <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-transfer-workflow.html>`__ | 62598fb35fc7496912d482c8 |
class DivOperatorTerm(Term): <NEW_LINE> <INDENT> name = 'dw_div' <NEW_LINE> arg_types = ('opt_material', 'virtual') <NEW_LINE> @staticmethod <NEW_LINE> def function(out, mat, vg): <NEW_LINE> <INDENT> div_bf = vg.bfg <NEW_LINE> n_el, n_qp, dim, n_ep = div_bf.shape <NEW_LINE> div_bf = div_bf.reshape((n_el, n_qp, dim * n_... | :Description:
Weighted divergence term of a test function.
:Definition:
.. math::
\int_{\Omega} \nabla \cdot \ul{v} \mbox { or } \int_{\Omega} c \nabla \cdot \ul{v}
:Arguments:
material : :math:`c` (optional),
virtual : :math:`\ul{v}` | 62598fb356b00c62f0fb2950 |
class User(db.Model): <NEW_LINE> <INDENT> __tablename__ = "users" <NEW_LINE> id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4) <NEW_LINE> first_name = db.Column(db.String(80), nullable=False) <NEW_LINE> last_name = db.Column(db.String(80), nullable=False) <NEW_LINE> email = db.Column(db.String(12... | Represents a User.
| 62598fb32ae34c7f260ab17b |
class ProductSerializer(CommonSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Product | Product serializer. | 62598fb3097d151d1a2c10c7 |
class Account(CapBaseObject): <NEW_LINE> <INDENT> login = StringField('Login') <NEW_LINE> password = StringField('Password') <NEW_LINE> properties = Field('List of key/value properties', dict) <NEW_LINE> def __init__(self, id=None): <NEW_LINE> <INDENT> CapBaseObject.__init__(self, id) | Describe an account and its properties. | 62598fb355399d3f056265b3 |
class CppTranslator(ApiTranslator): <NEW_LINE> <INDENT> methods = { 'List': { '@equivalent': 'vector', 'push': '#push_back', 'insert': '#insert(%{begin}, %{0})', 'remove_at': '#erase(%{begin}, %{0})', 'length': '#size', 'slice': Slice, 'slice_from': Slice, 'slice_to': Slice, }, 'Dic... | C++ api translator
The DSL is explained in the ApiTranslator docstring
C++ specific:
'%{begin}':
expands to `%{self}.begin()`, useful for vector methods
'%{end}':
expands to `%{self}.end()`, useful for vector methods
'%{new}':
expands to `new %{equivalent}` | 62598fb3a17c0f6771d5c2cf |
class ConnectionTimeout(ConnectionError): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return 'ConnectionTimeout caused by - %s(%s)' % ( self.info.__class__.__name__, self.info) | A network timeout. | 62598fb3e5267d203ee6b99d |
class ToOneField(FieldInUsePathMixin, ApiNameMixin, tastypie_fields.ToOneField): <NEW_LINE> <INDENT> def build_schema(self): <NEW_LINE> <INDENT> return { 'fields': self.to_class(self.get_api_name()).build_schema()['fields'], } | Extended tastypie ToOneField with support for nested schema and field
filtering. | 62598fb3f548e778e596b63d |
class FacetsAdmin(ModelView): <NEW_LINE> <INDENT> _can_create = True <NEW_LINE> _can_edit = True <NEW_LINE> _can_delete = True <NEW_LINE> column_list = ( 'collection', 'order', 'facet_name', ) <NEW_LINE> form_args = { 'collection': { 'validators': [ DataRequired(), ], 'allow_blank': False, 'query_factory': lambda: db.s... | Flask-Admin module to manage facets configuration. | 62598fb31b99ca400228f57d |
class const(Stub): <NEW_LINE> <INDENT> _description_ = '<const>' <NEW_LINE> array_like = macro.Macro('const.array_like', const_array_like, callable=True, argnames=['ary']) | shared namespace
| 62598fb3dc8b845886d53650 |
class AnalyseGacsIgslOutput(AviTask): <NEW_LINE> <INDENT> query = AviParameter() <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(AnalyseGacsIgslOutput, self).__init__(*args, **kwargs) <NEW_LINE> self.output_file_prefix = hashlib.md5(self.query).hexdigest() <NEW_LINE> logger.info('output_file_p... | Some cursory analysis of the the VOTable output by GACS. | 62598fb3e5267d203ee6b99e |
class MnliProcessor(DataProcessor): <NEW_LINE> <INDENT> def get_train_examples(self, data_dir): <NEW_LINE> <INDENT> return self._create_examples( self._read_tsv(os.path.join(data_dir, "train.tsv")), "train") <NEW_LINE> <DEDENT> def get_dev_examples(self, data_dir): <NEW_LINE> <INDENT> return self._create_examples( self... | Processor for the MultiNLI data set (GLUE version). | 62598fb34e4d5625663724c0 |
class MouseLookTests(TestCase, PlayerCreationMixin): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.player = self.makePlayer(Vector(2, 4, -6)) <NEW_LINE> self.controller = PlayerController(self.player) <NEW_LINE> <DEDENT> def test_lookLeft(self): <NEW_LINE> <INDENT> self.controller.mouseMotion((100, 200)... | Tests for mouse motion events which control the direction the player is
facing. | 62598fb3aad79263cf42e86d |
class EngineFacadeFixture(fixtures.Fixture): <NEW_LINE> <INDENT> def __init__(self, ctx_manager, engine, sessionmaker): <NEW_LINE> <INDENT> super(EngineFacadeFixture, self).__init__() <NEW_LINE> self._ctx_manager = ctx_manager <NEW_LINE> self._engine = engine <NEW_LINE> self._sessionmaker = sessionmaker <NEW_LINE> <DED... | Fixture to isolation EngineFacade during tests.
Because many elements of EngineFacade are based on globals, once
an engine facade has been initialized, all future code goes
through it. This means that the initialization of sqlite in
databases in our Database fixture will drive all connections to
sqlite. While that's f... | 62598fb3be383301e0253894 |
class TestAuctionDetails(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return AuctionDetails( ... | AuctionDetails unit test stubs | 62598fb3009cb60464d015bc |
class Proxy(BaseHTTPRequestHandler): <NEW_LINE> <INDENT> server_inst = None <NEW_LINE> @staticmethod <NEW_LINE> def start(): <NEW_LINE> <INDENT> def start_proxy(): <NEW_LINE> <INDENT> Proxy.server_inst = TCPServer(('127.0.0.1', 0), Proxy) <NEW_LINE> port = Proxy.server_inst.socket.getsockname()[1] <NEW_LINE> kodiutils.... | Manifest Proxy to workaround a Inputstream Adaptive bug | 62598fb37c178a314d78d537 |
class Component: <NEW_LINE> <INDENT> SERIES = 0 <NEW_LINE> SHUNT = 1 <NEW_LINE> def __init__(self, connection_type): <NEW_LINE> <INDENT> self._connection_type = connection_type <NEW_LINE> self._input_freq = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def impedance(self): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT>... | A basic electric component, all components have a connection_type
**abstract class** | 62598fb34428ac0f6e6585ba |
class GameObject: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def register_subclass(cls, subcls): <NEW_LINE> <INDENT> if subcls.id_ in cls._subs: <NEW_LINE> <INDENT> raise ValueError('Subclass id repeats twice: {subcls.id_}!') <NEW_LINE> <DEDENT> cls._subs[subcls.id_] = subcls <NEW_LINE> <DEDENT> @classmethod <NEW_LINE... | The abstract parent of all game objects. | 62598fb3d58c6744b42dc326 |
class InformationDropoutLayer(Module): <NEW_LINE> <INDENT> def __init__(self, layer_type: Module, output_size: Tuple[int], max_alpha=1.0, *args, **kw) -> None: <NEW_LINE> <INDENT> super(InformationDropoutLayer, self).__init__() <NEW_LINE> self.max_alpha = max_alpha <NEW_LINE> self.layer, self.noise = lyrs = [layer_type... | Information-dropout layer with softplus activations
Args (to `forward`):
`inp`: 'Activations to be passed through the layer'
Returns:
An `InfoActivations` instance. The `activations` field should be passed
on to the next layer. The `kl` field should be incorporated into the
loss, as in Achille & Soatto... | 62598fb332920d7e50bc60ee |
class UnsupportedFeaturesChecker(gast.NodeTransformer): <NEW_LINE> <INDENT> def visit_Global(self, node): <NEW_LINE> <INDENT> raise errors.AutoGraphError( 'The global keyword is not yet supported.') <NEW_LINE> <DEDENT> def visit_Nonlocal(self, node): <NEW_LINE> <INDENT> raise errors.AutoGraphError( 'The nonlocal keywor... | Quick check for Python features we know we don't support.
Any features detected will cause AutoGraph to not compile a function. | 62598fb35fdd1c0f98e5e028 |
class TestStops(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = Client() <NEW_LINE> self.url = reverse("stop:fetch") <NEW_LINE> <DEDENT> def test_fetching_train_stations_connection(self): <NEW_LINE> <INDENT> data = { "input_unit": "centimetre", "output_unit": "metre", "input_value": ro... | This class contains tests that convert measurements from one
unit of measurement to another. | 62598fb34a966d76dd5eef72 |
class TaskViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Task.objects.all() <NEW_LINE> serializer_class = serializers.TaskSerializer | API endpoint that allows authenticated users to view or edit tasks. | 62598fb360cbc95b063643e1 |
class Task: <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.input = {} <NEW_LINE> self.output = {} <NEW_LINE> <DEDENT> def method(self): <NEW_LINE> <INDENT> return 'method' | A mola optimisation task | 62598fb3627d3e7fe0e06f49 |
class RK4_example_integrator: <NEW_LINE> <INDENT> with_jacobian = False <NEW_LINE> @staticmethod <NEW_LINE> def integrate_adaptive(rhs, jac, y0, x0, xend, dx0, **kwargs): <NEW_LINE> <INDENT> if kwargs: <NEW_LINE> <INDENT> warnings.warn("Ignoring keyword-argumtents: %s" % ', '.join(kwargs.keys())) <NEW_LINE> <DEDENT> xs... | This is an example of how to implement a custom integrator.
It uses fixed step size and is usually not useful for real problems. | 62598fb330bbd722464699c6 |
class LightMapPack(Operator): <NEW_LINE> <INDENT> bl_idname = "uv.lightmap_pack" <NEW_LINE> bl_label = "Lightmap Pack" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> PREF_CONTEXT = bpy.props.EnumProperty( name="Selection", items=(("SEL_FACES", "Selected Faces", "Space all UVs evently"), ("ALL_FACES", "All Face... | Follow UVs from active quads along continuous face loops | 62598fb3e1aae11d1e7ce871 |
class nn_se_rSTWavMSE512(p40): <NEW_LINE> <INDENT> blstm_layers = 1 <NEW_LINE> lstm_layers = 1 <NEW_LINE> use_wav_as_feature = True <NEW_LINE> frame_length = 512 <NEW_LINE> frame_step = 128 <NEW_LINE> fft_dot = 512 <NEW_LINE> loss_weight = [100.0] <NEW_LINE> GPU_PARTION = 0.3 | cnn1blstm1lstm
short time wav as feature | 62598fb3236d856c2adc948c |
class IShoppingLists(Interface): <NEW_LINE> <INDENT> lists = Attribute("list") | Marker interface for Shopping Lists. | 62598fb356b00c62f0fb2952 |
class Model(dict): <NEW_LINE> <INDENT> __metaclass__ = ModelType <NEW_LINE> id = None <NEW_LINE> name = None <NEW_LINE> objects = None <NEW_LINE> def __init__(self, manager=None, id=None, **fields): <NEW_LINE> <INDENT> self.objects = manager <NEW_LINE> self.id = id <NEW_LINE> dict.__init__(self, self.prepare_fields(fie... | A Model.
:param manager: The :class:`Manager` for this model.
:keyword id: Id of the entry, ``None`` if the entry has not been
created yet.
:keyword \*\*fields: Values of the entry.
.. attribute:: name
Name of the model.
**REQUIRED**
All models needs a name, this name is used to keep track of ids
... | 62598fb3e5267d203ee6b99f |
class NamedMasters(iscconf.Clause, _Masters): <NEW_LINE> <INDENT> def __init__(self, masters_name, port=None, comment=None): <NEW_LINE> <INDENT> additional = [masters_name] <NEW_LINE> if port: <NEW_LINE> <INDENT> additional.extend(['port', port]) <NEW_LINE> <DEDENT> iscconf.Clause.__init__(self, 'masters', tuple(additi... | Class for named BIND masters clause.
This is different from a Masters object because it has a name and
is allowed only in the global context (as an element of a BINDConf
object). | 62598fb3ec188e330fdf892b |
class LoggingException(object): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> __swig_destroy__ = _math.delete_LoggingException <NEW_LINE> def getMessage(self): <NEW_LINE> <INDENT> return _math.Loggi... | Proxy of C++ nupic::LoggingException class | 62598fb3442bda511e95c4f3 |
class MolPrintObjInteract(Operator): <NEW_LINE> <INDENT> bl_idname = "mesh.molprint_objinteract" <NEW_LINE> bl_label = "Convert name list to object list" <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> interaction_list = [] <NEW_LINE> for each in bpy.context.scene.molprint_lists.internames["pairs"]: <NEW_LIN... | Make a name list into an object list | 62598fb34e4d5625663724c2 |
class OcclusionRanking(__Base__): <NEW_LINE> <INDENT> __tablename__ = 'occlusionrankings' <NEW_LINE> __table_args__ = {'autoload': True} | A single occlusion ranking. | 62598fb33539df3088ecc34e |
class Options(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.output_path = None <NEW_LINE> self.zip_to_output = None <NEW_LINE> self.toco = None <NEW_LINE> self.known_bugs_are_errors = False <NEW_LINE> self.ignore_converter_errors = False <NEW_LINE> self.save_graphdefs = False <NEW_LINE> self... | All options for example generation. | 62598fb3cc0a2c111447b0af |
class StageModified(Stage): <NEW_LINE> <INDENT> SHORTCUT = 'Ctrl+S' <NEW_LINE> @staticmethod <NEW_LINE> def name(): <NEW_LINE> <INDENT> return N_('Stage Modified') <NEW_LINE> <DEDENT> def __init__(self): <NEW_LINE> <INDENT> Stage.__init__(self, None) <NEW_LINE> self.paths = self.model.modified | Stage all modified files. | 62598fb3460517430c4320ac |
class getApkFiles_args(object): <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRUCT, 'predicate', (LinkPredicate, LinkPredicate.thrift_spec), None, ), (2, TType.I32, 'pendings', None, None, ), ) <NEW_LINE> def __init__(self, predicate=None, pendings=None,): <NEW_LINE> <INDENT> self.predicate = predicate <NEW_LIN... | Attributes:
- predicate
- pendings | 62598fb3d7e4931a7ef3c130 |
class TreeInfoModel: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.tree_store = Gtk.TreeStore( GObject.TYPE_STRING, GObject.TYPE_BOOLEAN, GObject.TYPE_PYOBJECT, GObject.TYPE_STRING) <NEW_LINE> if not self.tree_store: <NEW_LINE> <INDENT> raise Exception("cannot create tree store") <NEW_LINE> <DEDENT> ... | Model holds information to be displayed in the tree view | 62598fb35fdd1c0f98e5e029 |
class Field(object): <NEW_LINE> <INDENT> class arguments: <NEW_LINE> <INDENT> required = True <NEW_LINE> <DEDENT> def __init__(self,**kwds): <NEW_LINE> <INDENT> global _order_counter <NEW_LINE> self._order_counter = _order_counter = _order_counter + 1 <NEW_LINE> args = self.__class__.arguments <NEW_LINE> for argnm in d... | Base class for all dexml Field classes.
Field classes are responsible for parsing and rendering individual
components to the XML. They also act as descriptors on dexml Model
instances, to get/set the corresponding properties.
Each field instance will magically be given the following properties:
* model_class: th... | 62598fb3be7bc26dc9251eaa |
class nn_se_rSpecMSE_joint_SE_D_WDFLbyD_S300(p40): <NEW_LINE> <INDENT> model_name = 'DISCRIMINATOR_AD_MODEL' <NEW_LINE> D_GRL = True <NEW_LINE> D_Grad_DCC = True <NEW_LINE> blstm_layers = 1 <NEW_LINE> lstm_layers = 1 <NEW_LINE> loss_name = ["real_net_spec_mse"] <NEW_LINE> GPU_PARTION = 0.47 <NEW_LINE> se_grad_fromD_coe... | half full vec constrained | 62598fb399cbb53fe6830f70 |
class VGG(nn.Module): <NEW_LINE> <INDENT> def __init__(self, arch: object, num_classes=1000) -> object: <NEW_LINE> <INDENT> super(VGG, self).__init__() <NEW_LINE> self.in_channels = 3 <NEW_LINE> self.conv3_64 = self.__make_layer(64, arch[0]) <NEW_LINE> self.conv3_128 = self.__make_layer(128, arch[1]) <NEW_LINE> self.co... | VGG builder | 62598fb34a966d76dd5eef73 |
class scan(): <NEW_LINE> <INDENT> def __init__(self, scan_type, targets): <NEW_LINE> <INDENT> self.scan_type = scan_type <NEW_LINE> self.targets = targets <NEW_LINE> <DEDENT> def send_icmp_packet(self): <NEW_LINE> <INDENT> for target in self.targets: <NEW_LINE> <INDENT> print("\tSending ICMP packet to %s." % target) <N... | Do the scan | 62598fb344b2445a339b69c0 |
class Cert(ShareableOrgMixin, AbstractCert): <NEW_LINE> <INDENT> ca = models.ForeignKey(Ca, verbose_name=_('CA'), on_delete=models.CASCADE) <NEW_LINE> class Meta(AbstractCert.Meta): <NEW_LINE> <INDENT> abstract = False <NEW_LINE> <DEDENT> def clean(self): <NEW_LINE> <INDENT> self._validate_org_relation('ca') | openwisp-controller cert model | 62598fb363b5f9789fe85206 |
class _Remove(argparse.Action): <NEW_LINE> <INDENT> def __init__(self, option_strings, dest=None, default=None, metavar=None): <NEW_LINE> <INDENT> super().__init__(option_strings=option_strings, dest=dest, metavar=metavar, default=default, help='remove pool') <NEW_LINE> <DEDENT> def __call__(self, parser, namespace, na... | Action for argument parser that removes a pool | 62598fb3dc8b845886d53654 |
class IDocentimsFixcontainerviewLayer(IDefaultBrowserLayer): <NEW_LINE> <INDENT> pass | Marker interface that defines a browser layer. | 62598fb3498bea3a75a57bbd |
class TestSend(TransactionCase): <NEW_LINE> <INDENT> def test_send(self): <NEW_LINE> <INDENT> carrier = self.env.ref("delivery.normal_delivery_carrier") <NEW_LINE> picking_form = Form( self.env["stock.picking"].with_context( default_picking_type_id=self.env.ref("stock.picking_type_out").id, ) ) <NEW_LINE> picking_form.... | Test sending a picking | 62598fb35fcc89381b26619b |
class TaskViewSet(viewsets.ViewSet): <NEW_LINE> <INDENT> permission_classes = (IsAuthenticated,) <NEW_LINE> prefix = r'tasks' <NEW_LINE> base_name = 'tasks' <NEW_LINE> @log() <NEW_LINE> @required_roles(['read']) <NEW_LINE> @load() <NEW_LINE> def list(self): <NEW_LINE> <INDENT> inspector = inspect() <NEW_LINE> data = {'... | Information about celery tasks | 62598fb3283ffb24f3cf392a |
class vb2pyOptions(model.CustomDialog): <NEW_LINE> <INDENT> def __init__(self, logger, *args, **kw): <NEW_LINE> <INDENT> model.CustomDialog.__init__(self, *args, **kw) <NEW_LINE> self.log = logger <NEW_LINE> self.log.info("Opening INI file") <NEW_LINE> fle = open(utils.relativePath("vb2py.ini"), "r") <NEW_LINE> try: <N... | GUI for the vb2Py converter | 62598fb3a8370b77170f047a |
class RequestTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.app = create_app(config_name="testing") <NEW_LINE> self.client = self.app.test_client <NEW_LINE> self.user_data_sign = { 'user_email': 'ngolo@example.com', 'password': 'test_123' } <NEW_LINE> self.user_data_2 = { 'us... | Class for Ride offer request test cases | 62598fb37d43ff2487427451 |
class ReportHandler(Handles): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> def __init__(self, signal, weak=False): <NEW_LINE> <INDENT> self.signal = getsig(signal) <NEW_LINE> self.report_signal = getsig("badfile") <NEW_LINE> def dummy(sender, event): self.handle(sender,event) <NEW_LINE> dispatcher.connect... | A handler that can also report problem files when things go wrong
through the report_problem_file routine | 62598fb31b99ca400228f57f |
class ModelsRegistry(object): <NEW_LINE> <INDENT> def __init__(self, model_name_class_tuples_list=None): <NEW_LINE> <INDENT> hard_coded_model_name_class_tuples = [("Logistic regression", LogisticRegressionModel), ("Linear regression", LinearRegressionModel), ("HTTP REST Model", HTTPRestModel), ("Openscoring REST Model"... | Registers a model name with a model class | 62598fb32c8b7c6e89bd3862 |
class GeometricDistribution(Distribution): <NEW_LINE> <INDENT> def __init__(self, p): <NEW_LINE> <INDENT> self.p = p <NEW_LINE> <DEDENT> def log_density(self, data): <NEW_LINE> <INDENT> assert(len(data.shape) == 1), "Expect 1D data!" <NEW_LINE> return np.log(1 - self.p) * (data - 1) + np.log(self.p) <NEW_LINE> <DEDENT>... | Geometric distribution with parameter (p). | 62598fb3cc0a2c111447b0b0 |
class Person(models.Model): <NEW_LINE> <INDENT> subject = models.TextField(null=True, blank=True) <NEW_LINE> birth_year = models.IntegerField(null=True, blank=True) <NEW_LINE> places = models.ManyToManyField('Location') <NEW_LINE> death_year = models.IntegerField(null=True, blank=True) <NEW_LINE> religion = models.Text... | docstring for ClassName | 62598fb3f548e778e596b641 |
class ChannelRequest(dbus.service.Object): <NEW_LINE> <INDENT> @dbus.service.method('org.freedesktop.Telepathy.ChannelRequest', in_signature='', out_signature='') <NEW_LINE> def Proceed(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> @dbus.service.method('org.freedesktop.Telepathy.ChannelReques... | A channel request is an object in the ChannelDispatcher representing
an ongoing request for some channels to be created or found. There
can be any number of ChannelRequest objects at the same time.
Its well-known bus name is the same as that of the ChannelDispatcher,
"org.freedesktop.Telepathy.ChannelDispatcher"... | 62598fb3fff4ab517ebcd883 |
class PublicationViewSet(RetrieveElasticMixin, ListElasticMixin, viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> serializer_class = PublicationSerializer <NEW_LINE> pagination_class = ElasticLimitOffsetPagination <NEW_LINE> idx = ElasticSettings.idx('PUBLICATION') <NEW_LINE> filter_fields = ('pmid', 'title', 'autho... | Returns a list of publications.
---
list:
response_serializer: PublicationSerializer
parameters:
- name: pmid
description: PubMed ID (e.g. 20937630).
required: false
type: string
paramType: query
- name: title
description: Title.
requir... | 62598fb367a9b606de54606c |
class Advent3Tests(unittest.TestCase): <NEW_LINE> <INDENT> def test_3a(self): <NEW_LINE> <INDENT> known_values = { 1: 0, 12: 3, 23: 2, 1024: 31 } <NEW_LINE> for number, expected in known_values.items(): <NEW_LINE> <INDENT> actual = advent_3a(number) <NEW_LINE> message = ("Testing input '{}', expected '{}' but got '{}'"... | Unit tests for the functions in this module | 62598fb35fdd1c0f98e5e02b |
class Not(Node): <NEW_LINE> <INDENT> def __init__(self, right): <NEW_LINE> <INDENT> self.right = right <NEW_LINE> <DEDENT> def evaluate(self): <NEW_LINE> <INDENT> right = self.right.evaluate() <NEW_LINE> if not isinstance(right, int): <NEW_LINE> <INDENT> raise SemanticError() <NEW_LINE> <DEDENT> if right == 0: <NEW_LIN... | A node representing NOT. | 62598fb37d847024c075c461 |
class Rectangle: <NEW_LINE> <INDENT> def __init__(self, initP, initW, initH): <NEW_LINE> <INDENT> self.location = initP <NEW_LINE> self.width = initW <NEW_LINE> self.height = initH | Rectangle class using Point, width and height | 62598fb3f9cc0f698b1c531a |
class VirtualConnection(Component): <NEW_LINE> <INDENT> def __init__(self, name='VirtualConnection', pos=QPoint(0, 0)): <NEW_LINE> <INDENT> Component.__init__(self, name, pos) <NEW_LINE> self.compType = TYPE_CONN_VIRTUAL <NEW_LINE> self.addTerminal('IN', 1, TERM.CONN, QPointF(0, 0)) | @if English
@endif
@if Slovak
Neviditelny prepojovaci komponent pre spojenie sieti (net-ov).
Zoznam prepojeni sa vytvara dynamicky na zaklade terminalov sieti.
Poskytuje spolocny terminal pre vzajomne prepojenie virtualnych sieti.
Komponent nie je zaradeny do grafickeho kontaineru.
@endif | 62598fb367a9b606de54606d |
class ReplicationStatus(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'aggregated_state': {'readonly': True}, 'summary': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'aggregated_state': {'key': 'aggregatedState', 'type': 'str'}, 'summary': {'key': 'summary', 'type': '[RegionalReplicationStatus... | This is the replication status of the gallery Image Version.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar aggregated_state: This is the aggregated replication status based on all the regional
replication status flags. Possible values include: "Unknown", "InProgress", ... | 62598fb35fdd1c0f98e5e02c |
class City(BaseModel): <NEW_LINE> <INDENT> state_id = "" <NEW_LINE> name = "" | [City]
Args:
BaseModel ([class]): class that inherited by City | 62598fb344b2445a339b69c1 |
class MQTTRPCBaseResponse(JSONSerializable): <NEW_LINE> <INDENT> def __init__(self, result=None, error=None, _id=None): <NEW_LINE> <INDENT> self.data = dict() <NEW_LINE> self.result = result <NEW_LINE> self.error = error <NEW_LINE> self._id = _id <NEW_LINE> if self.result is None and self.error is None: <NEW_LINE> <IND... | Base class for JSON-RPC 1.0 and JSON-RPC 2.0 responses. | 62598fb38a43f66fc4bf2218 |
class DisabledFlavorsWithRealDBTest(test.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(DisabledFlavorsWithRealDBTest, self).setUp() <NEW_LINE> self.controller = flavors.FlavorsController() <NEW_LINE> self.req = fakes.HTTPRequestV3.blank('/flavors') <NEW_LINE> self.context = self.req.environ[... | Tests that disabled flavors should not be shown nor listed. | 62598fb3adb09d7d5dc0a62a |
class FacebookAgentMessageResponseBody(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.recipient_id = '' <NEW_LINE> self.message_id = '' | Request body for facebook agent message. | 62598fb3e1aae11d1e7ce873 |
class DanbooruError(Exception): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> self.message = message | Exception raised for errors with Danbooru.
Attributes:
message -- explanation of the error | 62598fb323849d37ff851152 |
class Item_Type(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'item_types' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> item_type = Column(String, nullable=False) <NEW_LINE> items = relationship('Item') | db model for Treasure Item Types | 62598fb360cbc95b063643e5 |
class DictionaryReaderUtilsTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_load_dummy_dict(self): <NEW_LINE> <INDENT> data_dir = fileutils.get_test_data_directory() <NEW_LINE> dummy_dict_path = os.path.join(data_dir, "dummy_dict.json") <NEW_LINE> self.assertTrue(os.path.exists(dummy_dict_path), "Missing data for ... | The dictionary reader loads json dicts. | 62598fb3a8370b77170f047b |
@nest.check_stack <NEW_LINE> @unittest.skipIf(not HAVE_GSL, 'GSL is not available') <NEW_LINE> class SiegertNeuronTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.rtol = 1.0 <NEW_LINE> self.N = 100 <NEW_LINE> self.rate_ex = 1.5 * 1e4 <NEW_LINE> self.J = 0.1 <NEW_LINE> self.simt... | Test siegert_neuron
Details
-------
Compares the rate of a Poisson-driven iaf_psc_delta neuron
with the prediction from the siegert neuron. | 62598fb356b00c62f0fb2956 |
class WorkflowStatus(str, Enum): <NEW_LINE> <INDENT> created = "created" <NEW_LINE> queued = "queued" <NEW_LINE> pending = "pending" <NEW_LINE> running = "running" <NEW_LINE> failed = "failed" <NEW_LINE> finished = "finished" | Enumeration of workflow statuses.
Example:
WorkflowStatus.failed == "failed" # True | 62598fb3a79ad1619776a108 |
class ServiceManager: <NEW_LINE> <INDENT> _ec2 = None <NEW_LINE> _elb = None <NEW_LINE> _acm = None <NEW_LINE> _iam = None <NEW_LINE> _rds = None <NEW_LINE> _s3 = None <NEW_LINE> _ce = None <NEW_LINE> @property <NEW_LINE> def ec2(self): <NEW_LINE> <INDENT> if self._ec2 is None: self._ec2 = Ec2Service() <NEW_LINE> retur... | Parent class that provides access to services.
For each service (ec2, s3, vpc ...) you are given access through a property of this class.
This property will return an instance of the corresponding class, for example Ec2Service or VpcService.
Each class of service (Ec2Service, S3Service ...) inherits from the AwsBase c... | 62598fb3dc8b845886d53656 |
@tf_export( "queue.PaddingFIFOQueue", v1=["queue.PaddingFIFOQueue", "io.PaddingFIFOQueue", "PaddingFIFOQueue"]) <NEW_LINE> @deprecation.deprecated_endpoints(["io.PaddingFIFOQueue", "PaddingFIFOQueue"]) <NEW_LINE> class PaddingFIFOQueue(QueueBase): <NEW_LINE> <INDENT> def __init__(self, capacity, dtypes, shapes, names=N... | A FIFOQueue that supports batching variable-sized tensors by padding.
A `PaddingFIFOQueue` may contain components with dynamic shape, while also
supporting `dequeue_many`. See the constructor for more details.
See `tf.queue.QueueBase` for a description of the methods on
this class. | 62598fb34f88993c371f055b |
class CoordinateAttribute(Attribute): <NEW_LINE> <INDENT> def __init__(self, frame, default=None, secondary_attribute=''): <NEW_LINE> <INDENT> self._frame = frame <NEW_LINE> super().__init__(default, secondary_attribute) <NEW_LINE> <DEDENT> def convert_input(self, value): <NEW_LINE> <INDENT> from astropy.coordinates im... | A frame attribute which is a coordinate object. It can be given as a
`~astropy.coordinates.SkyCoord` or a low-level frame instance. If a
low-level frame instance is provided, it will always be upgraded to be a
`~astropy.coordinates.SkyCoord` to ensure consistent transformation
behavior. The coordinate object will al... | 62598fb3f548e778e596b643 |
class Messaging: <NEW_LINE> <INDENT> WSCloseCode = WSCloseCode <NEW_LINE> MSG_JOIN = 'join' <NEW_LINE> MSG_NEW_PLAYER = 'new_player' <NEW_LINE> MSG_HANDSHAKE = 'handshake' <NEW_LINE> MSG_WORLD = 'world' <NEW_LINE> MSG_P_JOINED = 'p_joined' <NEW_LINE> MSG_P_GAMEOVER = 'p_gameover' <NEW_LINE> MSG_P_SCORE = 'p_score' <NEW... | WebSocket messaging helper class. | 62598fb37b25080760ed7551 |
class NSNitroNserrCachefwpxyToomany(NSNitroCrErrors): <NEW_LINE> <INDENT> pass | Nitro error code 601
Forward proxy limit reached | 62598fb32ae34c7f260ab17f |
class BaseSVC(BaseLibSVM, ClassifierMixin): <NEW_LINE> <INDENT> def _validate_targets(self, y): <NEW_LINE> <INDENT> y = column_or_1d(y, warn=True) <NEW_LINE> cls, y = unique(y, return_inverse=True) <NEW_LINE> self.class_weight_ = compute_class_weight(self.class_weight, cls, y) <NEW_LINE> if len(cls) < 2: <NEW_LINE> <IN... | ABC for LibSVM-based classifiers. | 62598fb37047854f4633f47a |
class CreateQoSBandwidthLimitRule(qos_rule.QosRuleMixin, neutronv20.CreateCommand): <NEW_LINE> <INDENT> resource = BANDWIDTH_LIMIT_RULE_RESOURCE <NEW_LINE> def add_known_arguments(self, parser): <NEW_LINE> <INDENT> super(CreateQoSBandwidthLimitRule, self).add_known_arguments(parser) <NEW_LINE> add_bandwidth_limit_argum... | Create a qos bandwidth limit rule. | 62598fb355399d3f056265ba |
class Choose(callbacks.Plugin): <NEW_LINE> <INDENT> def __init__(self, irc): <NEW_LINE> <INDENT> callbacks.Plugin.__init__(self, irc) <NEW_LINE> <DEDENT> def choose(self, irc, msg, args, choices): <NEW_LINE> <INDENT> if choices is None: <NEW_LINE> <INDENT> if conf.get(conf.supybot.plugins.Infobot.personality): <NEW_LIN... | Make tough decisions between two or more options, easily. | 62598fb37d847024c075c462 |
class ThreadedTCPRequestHandler(BaseRequestHandler): <NEW_LINE> <INDENT> def handle(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> command = ['./script.sh'] + self.request.recv(1024).decode().split(' ') <NEW_LINE> print(command) <NEW_LINE> process = Popen(command, stdout=PIPE, stderr=PIPE, cwd=join('..', 'Question... | This handler is used to handle each client in separate thread | 62598fb35fdd1c0f98e5e02d |
class PadServerTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.server = PadServer.objects.create(title=TS['title'], url=TS['url'], apikey=TS['apikey']) <NEW_LINE> <DEDENT> def testBasics(self): <NEW_LINE> <INDENT> self.assertTrue(isinstance(self.server, PadServer)) <NEW_LINE> ... | Test cases for the Server model
| 62598fb3d268445f26639bd3 |
class RandomController(Controller): <NEW_LINE> <INDENT> def pick_procs(self, graph: Graph, n_procs: int) -> np.ndarray: <NEW_LINE> <INDENT> return np.random.randint(n_procs, size=len(graph.nodes)) <NEW_LINE> <DEDENT> def register_times(self, t: List[float]) -> None: <NEW_LINE> <INDENT> return None | Controller for random search of processor assignments | 62598fb326068e7796d4c9f6 |
class Objective(OptimizationExpression): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def clone(cls, objective, model=None, **kwargs): <NEW_LINE> <INDENT> return cls(cls._substitute_variables(objective, model=model), name=objective.name, direction=objective.direction, sloppy=True, **kwargs) <NEW_LINE> <DEDENT> def __ini... | Objective function.
Attributes
----------
expression: sympy
The mathematical expression defining the objective.
name: str, optional
The name of the constraint.
direction: 'max' or 'min'
The optimization direction.
value: float, read-only
The current objective value.
problem: solver
The low-level so... | 62598fb3be7bc26dc9251eac |
class TestIoK8sApiCoreV1NodeStatus(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 testIoK8sApiCoreV1NodeStatus(self): <NEW_LINE> <INDENT> pass | IoK8sApiCoreV1NodeStatus unit test stubs | 62598fb37d847024c075c463 |
class SDR_Classifier: <NEW_LINE> <INDENT> def __init__(self, alpha, input_sdr, num_labels): <NEW_LINE> <INDENT> self.alpha = alpha <NEW_LINE> self.input_sdr = input_sdr <NEW_LINE> self.num_labels = num_labels <NEW_LINE> self.stats = np.random.uniform( 0.1 * self.alpha, 0.2 * self.alpha, size=(self.input_sdr... | Maximum Likelyhood classifier for SDRs. | 62598fb367a9b606de54606f |
@ptah.layout( 'workspace', SiteRoot, parent='page', renderer='ptah_ws:templates/layout-workspace.pt') <NEW_LINE> class WorkspaceLayout(ptah.View): <NEW_LINE> <INDENT> def update(self): <NEW_LINE> <INDENT> self.user = ptah.auth_service.get_current_principal() <NEW_LINE> self.ptahManager = manage.check_access( ptah.auth_... | same as PageLayout, it uses 'page' as parent layout | 62598fb391f36d47f2230ef8 |
class RecieveTimingExcced(fsm.Event): <NEW_LINE> <INDENT> description: str = settings.Description.RecieveTimingExcced | 超时系统自动确认收货 | 62598fb33317a56b869be59c |
class SimpleQuantZmqProcessBase(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.context = None <NEW_LINE> self.loop = None <NEW_LINE> <DEDENT> def setup(self, sock_type, addr, bind, subscribe=b''): <NEW_LINE> <INDENT> self.context = zmq.asyncio.Context() <NEW_LINE> loop... | This is the base for all zmq processes and offers utility functions
for setup and creating new streams. | 62598fb3aad79263cf42e874 |
class GameRouter(View): <NEW_LINE> <INDENT> inactive_view = staticmethod(PlayInactiveGame.as_view()) <NEW_LINE> reinforcements_view = staticmethod(PlayReinforcements.as_view()) <NEW_LINE> finance_reinforcements_view = staticmethod(PlayFinanceReinforcements.as_view()) <NEW_LINE> orders_view = staticmethod(PlayOrders.as_... | Return a View that depends on the current status of the game. | 62598fb38e7ae83300ee9145 |
class Controller: <NEW_LINE> <INDENT> def __init__(self, model: Model, view: View): <NEW_LINE> <INDENT> self.model = model <NEW_LINE> self.view = view <NEW_LINE> self.view.on_open_profile.on(self.on_open_profile) <NEW_LINE> self.view.on_new_account.on(self.on_new_account) <NEW_LINE> self.view.on_account_bot_start.on(se... | Контроллер. Отвечает за ввод пользователя | 62598fb330bbd722464699c9 |
class AnythingType(LittleScribeType): <NEW_LINE> <INDENT> def is_super_of(self, other): <NEW_LINE> <INDENT> return True | Takes any type. | 62598fb363b5f9789fe8520a |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.