code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class MetaWinnerFiniteMemory(MetaWinner): <NEW_LINE> <INDENT> name = "Meta Winner Finite Memory" <NEW_LINE> @init_args <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> team = [s for s in ordinary_strategies if s().classifier['memory_depth'] < float('inf')] <NEW_LINE> super(MetaWinnerFiniteMemory, self).__init__(team=... | MetaWinner with the team of Finite Memory Players | 62599036507cdc57c63a5eef |
class Sender(object): <NEW_LINE> <INDENT> def __init__(self, FD_, FDD_, FC_, N_, SPEED_, A_NOISE_, A_SIGNAL_): <NEW_LINE> <INDENT> self.source_sequence = [] <NEW_LINE> self.source_signal = [] <NEW_LINE> self.encoded_signal = [] <NEW_LINE> self.noise = [] <NEW_LINE> self.ASK = [] <NEW_LINE> self.noise_ASK = [] <NEW_LINE... | Класс имитирует передатчик и реализует атрибуты-методы,
которые существуют в реальной системе | 6259903666673b3332c31549 |
class RecursiveTestFlow(flow.GRRFlow): <NEW_LINE> <INDENT> args_type = RecursiveTestFlowArgs <NEW_LINE> @flow.StateHandler(next_state="End") <NEW_LINE> def Start(self): <NEW_LINE> <INDENT> if self.args.depth < 2: <NEW_LINE> <INDENT> for _ in range(2): <NEW_LINE> <INDENT> self.CallFlow("RecursiveTestFlow", depth=self.ar... | A test flow which starts some subflows. | 625990366fece00bbacccb00 |
class Geometry(object): <NEW_LINE> <INDENT> def __init__(self, geom_type, coords): <NEW_LINE> <INDENT> self.geom_type = geom_type <NEW_LINE> coords = coords | A basic geometry class for ``GeoFeedMixin``.
Instances have two public attributes:
.. attribute:: geom_type
"point", "linestring", "linearring", "polygon"
.. attribute:: coords
For **point**, a tuple or list of two floats: ``(X, Y)``.
For **linestring** or **linearring**, a string: ``"X0 Y0 X1 Y1 ..."``... | 625990363eb6a72ae038b7bd |
class RegistrationChart(BaseChart): <NEW_LINE> <INDENT> queryset = get_user_model().objects.all() <NEW_LINE> date_field = 'date_joined' | Dashboard module with user registration charts.
With default values it is suited best for 2-column dashboard layouts. | 625990361d351010ab8f4c70 |
class Comment(db.Model): <NEW_LINE> <INDENT> __tablename__ = "comment" <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> user_id = db.Column(db.Integer, db.ForeignKey("user.id"), nullable=False) <NEW_LINE> news_id = db.Column(db.Integer, db.ForeignKey("news.id"), nullable=False) <NEW_LINE> content = db... | 评论 | 62599036ac7a0e7691f7363e |
class AlgorithmProvider(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.activate = True <NEW_LINE> self.actions = [] <NEW_LINE> self.contextMenuActions = [] <NEW_LINE> <DEDENT> def loadAlgorithms(self): <NEW_LINE> <INDENT> self.algs = [] <NEW_LINE> self._loadAlgorithms() <NEW_LINE> for alg in ... | This is the base class for algorithms providers.
An algorithm provider is a set of related algorithms, typically
from the same external application or related to a common area
of analysis. | 6259903615baa723494630f0 |
class CheckinRuleCmd(Command): <NEW_LINE> <INDENT> def execute(self): <NEW_LINE> <INDENT> sandbox_dir = "/home/apache/inhance_asset_library" <NEW_LINE> rule_code = "6SIMULATION" <NEW_LINE> rule_code = self.kwargs.get("rule_code") <NEW_LINE> rule = Search.get_by_code("config/ingest_rule", rule_code) <NEW_LINE> cmd = Ing... | Command to checkin a rule | 6259903673bcbd0ca4bcb3dd |
class ConvoLayer(nn.Module): <NEW_LINE> <INDENT> def __init__(self, channel_in, channel_out, kernel_size, stride = 1, neg_slope = 0.1): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> padding = (kernel_size-1)//2 <NEW_LINE> self.conv = nn.Conv2d(channel_in, channel_out, kernel_size, stride, padding, bias=False) <NEW_... | Basic Conv2D layer with few parameters: channels, kernel size
Then batch norm - layer and Leaky ReLu layer as follow
Leaky ReLu has negative slope 0.1 as default | 6259903630dc7b76659a0989 |
class HttpResolver(object): <NEW_LINE> <INDENT> def __init__(self, url_download, dependency, source, cwd): <NEW_LINE> <INDENT> self.url_download = url_download <NEW_LINE> self.dependency = dependency <NEW_LINE> self.source = source <NEW_LINE> self.cwd = cwd <NEW_LINE> <DEDENT> def resolve(self): <NEW_LINE> <INDENT> sel... | Http Resolver functionality. Downloads a file. | 625990368c3a8732951f76af |
class ComputeMachineTypesListRequest(_messages.Message): <NEW_LINE> <INDENT> filter = _messages.StringField(1) <NEW_LINE> maxResults = _messages.IntegerField(2, variant=_messages.Variant.UINT32, default=500) <NEW_LINE> pageToken = _messages.StringField(3) <NEW_LINE> project = _messages.StringField(4, required=True) <NE... | A ComputeMachineTypesListRequest object.
Fields:
filter: Sets a filter expression for filtering listed resources, in the
form filter={expression}. Your {expression} must be in the format:
field_name comparison_string literal_string. The field_name is the name
of the field you want to compare. Only atomi... | 6259903626238365f5fadcab |
class LinearInterpolationLanguageModel(TrigramLanguageModel): <NEW_LINE> <INDENT> def __init__(self, sentences, lambda1, lambda2, lambda3, lambda4, lambda5, k_smoothing=0): <NEW_LINE> <INDENT> TrigramLanguageModel.__init__(self, sentences, k_smoothing) <NEW_LINE> self.lambda1 = lambda1 <NEW_LINE> self.lambda2 = lambda2... | @Param: Sentences with each sentence is a list of words
@Param smoothing: Function that do smoothing | 62599036507cdc57c63a5ef1 |
class MessageLayer(object): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> self._parent = parent <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def reliability_response(request, response): <NEW_LINE> <INDENT> if not (response.type == defines.inv_types['ACK'] or response.type == defines.inv_types['RST... | Handles message functionality: Acknowledgment, Reset. | 625990366e29344779b017a9 |
class RandomFlatten(Flatten): <NEW_LINE> <INDENT> def _propose(self, user, categories): <NEW_LINE> <INDENT> while True: <NEW_LINE> <INDENT> friend = self._resolve_friend(random.randint(0, self.user2cat.dictionary.index.shape[0]-1)) <NEW_LINE> if friend not in user.friends: <NEW_LINE> <INDENT> user.friends.add(friend) <... | Proposes the updated list of followees by randomly adding new ones until old top categories a phased out | 625990368da39b475be04347 |
class Sampler(object): <NEW_LINE> <INDENT> def __init__(self, data_source): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> raise NotImplementedError | Base class for all Samplers.
Every Sampler subclass has to provide an :meth:`__iter__` method, providing a
way to iterate over indices of dataset elements, and a :meth:`__len__` method
that returns the length of the returned iterators.
.. note:: The :meth:`__len__` method isn't strictly required by
:class:`... | 62599036d18da76e235b79fb |
class OpenedLoanManager(models.Manager): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> return super().get_queryset().filter(loanreturn__isnull=True) | Loan records that has not yet been returned | 62599036c432627299fa4150 |
class ModelTypeOutputOnly(object): <NEW_LINE> <INDENT> swagger_types = { 'external_station_id': 'int' } <NEW_LINE> attribute_map = { 'external_station_id': '_external_station_id' } <NEW_LINE> def __init__(self, external_station_id=None): <NEW_LINE> <INDENT> self._external_station_id = None <NEW_LINE> self.discriminator... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62599036b57a9660fecd2bd4 |
class AttentionalWeights(nn.Module): <NEW_LINE> <INDENT> def __init__(self, feature_dim, num_classes=70): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.num_classes = num_classes <NEW_LINE> self.feat_dim = feature_dim <NEW_LINE> self.att_fc = nn.Sequential( nn.Linear(128, 64), nn.ReLU(), nn.Linear(64, feature_d... | Compute weights based on spatio-linguistic attention. | 6259903626238365f5fadcad |
class SessionOutResult : <NEW_LINE> <INDENT> pass | Class provides functionality for session's result by means of properties | 62599036796e427e5384f8d4 |
class KeyboardPlayer(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.name = "Keyboard Player" <NEW_LINE> self.uzh_shortname = "kplayer" <NEW_LINE> <DEDENT> def get_input(self, text): <NEW_LINE> <INDENT> reply = input(text + "( u - up, h - left, k - down, l - right)") <NEW_LINE> if reply[0] == 'u': <... | Keyboard Kingsheep player (doesn't move) | 625990369b70327d1c57fede |
class gamification_goal_type_data(osv.Model): <NEW_LINE> <INDENT> _inherit = 'gamification.goal.type' <NEW_LINE> def number_following(self, cr, uid, xml_id="mail.thread", context=None): <NEW_LINE> <INDENT> ref_obj = self.pool.get(xml_id) <NEW_LINE> user = self.pool.get('res.users').browse(cr, uid, uid, context=context)... | Goal type data
Methods for more complex goals not possible with the 'sum' and 'count' mode.
Each method should return the value that will be set in the 'current' field
of a user's goal. The return type must be a float or integer. | 625990368a349b6b4368739a |
class CallMethodNode(Node): <NEW_LINE> <INDENT> def __init__(self, object_name, method_name, args=None, kwargs=None, asvar=False): <NEW_LINE> <INDENT> self.object_name_resolver = object_name <NEW_LINE> self.method_name_resolver = method_name <NEW_LINE> self.args_resolvers = args or [] <NEW_LINE> self.kwargs_resolvers =... | Renders the relevant value of a {% callmethod %} template tag | 625990360a366e3fb87ddb3f |
class CommaList(StrList): <NEW_LINE> <INDENT> SEPARATOR = ',' | Comma-separated list | 6259903616aa5153ce401646 |
class BboxDeviceScanner(DeviceScanner): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self.host = config[CONF_HOST] <NEW_LINE> """Initialize the scanner.""" <NEW_LINE> self.last_results: List[Device] = [] <NEW_LINE> self.success_init = self._update_info() <NEW_LINE> _LOGGER.info("Scanner initializ... | This class scans for devices connected to the bbox. | 625990368da39b475be04349 |
class Predictor_KNN(Predictor): <NEW_LINE> <INDENT> def predict(self, fromPoint,toPoint): <NEW_LINE> <INDENT> return self.predict_KNN(fromPoint, toPoint) | A utility class which inherits a complete KNN predictor from Predictor
Overrides the predict function with the Predictor.predict_knn function | 625990364e696a045264e6cf |
class MudMeta(MudObject): <NEW_LINE> <INDENT> pass | Objects that are about/describe other object(s). | 6259903673bcbd0ca4bcb3e2 |
class What(object): <NEW_LINE> <INDENT> Out = 0 <NEW_LINE> In = 1 <NEW_LINE> Both = 2 <NEW_LINE> OutE = 3 <NEW_LINE> InE = 4 <NEW_LINE> BothE = 5 <NEW_LINE> OutV = 6 <NEW_LINE> InV = 7 <NEW_LINE> Eval = 8 <NEW_LINE> Coalesce = 9 <NEW_LINE> If = 10 <NEW_LINE> IfNull = 11 <NEW_LINE> Expand = 12 <NEW_LINE> First = 13 <NEW... | Specify 'what' a Query retrieves. | 625990365e10d32532ce41b0 |
class CORSResource(ModelResource): <NEW_LINE> <INDENT> def create_response(self, *args, **kwargs): <NEW_LINE> <INDENT> response = super(CORSResource, self).create_response(*args, **kwargs) <NEW_LINE> response['Access-Control-Allow-Origin'] = '*' <NEW_LINE> response['Access-Control-Allow-Headers'] = 'Content-Type' <NEW_... | Adds CORS headers to resources that subclass this. | 62599036c432627299fa4152 |
class GetMemberInDepartmentSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> userId = serializers.IntegerField(source='department_member.user.id', read_only=True) <NEW_LINE> fullName = serializers.CharField(source='department_member') <NEW_LINE> sex = serializers.SerializerMethodField() <NEW_LINE> birthDay =... | Get profile member in department | 625990361f5feb6acb163d4d |
class SqlSensor(BaseSensorOperator): <NEW_LINE> <INDENT> template_fields = ('sql',) <NEW_LINE> template_ext = ('.hql', '.sql',) <NEW_LINE> __mapper_args__ = { 'polymorphic_identity': 'SqlSensor' } <NEW_LINE> @apply_defaults <NEW_LINE> def __init__(self, conn_id, sql, *args, **kwargs): <NEW_LINE> <INDENT> super(SqlSenso... | Runs a sql statement until a criteria is met. It will keep trying until
sql returns no row, or if the first cell in (0, '0', ''). | 6259903607d97122c4217df7 |
class DesignAttributes: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.annotations = [] <NEW_LINE> self.attributes = dict() <NEW_LINE> self.metadata = Metadata() <NEW_LINE> <DEDENT> def add_annotation(self, annotation): <NEW_LINE> <INDENT> self.annotations.append(annotation) <NEW_LINE> <DEDENT> def ad... | The DesignAttributes class corresponds to the design_attributes
object in the Open JSON format | 6259903630c21e258be99968 |
class Library(models.Model): <NEW_LINE> <INDENT> uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) <NEW_LINE> name = models.CharField(_("The name of the library/institute"), max_length=128) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name_plural = "libraries" <NEW_LINE> <DEDENT> def _... | Library or institute that may hold one or more catalogues | 62599036d53ae8145f9195c0 |
class Feed(object): <NEW_LINE> <INDENT> def __init__(self, name, label, description, display_priority): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.label = label <NEW_LINE> self.description = description <NEW_LINE> self.display_priority = display_priority <NEW_LINE> <DEDENT> def fetch(self): <NEW_LINE> <INDENT... | Base class for Feeds. Do not instantiate directly. | 6259903616aa5153ce401648 |
class Server(BaseModel): <NEW_LINE> <INDENT> __tablename__ = 'redis_server' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String(64), unique=True) <NEW_LINE> description = db.Column(db.String(512)) <NEW_LINE> host = db.Column(db.String(15)) <NEW_LINE> port = db.Column(db.Integer... | Redis服务器模型
| 6259903615baa723494630f6 |
class Station(Producer): <NEW_LINE> <INDENT> key_schema = avro.load(f"{Path(__file__).parents[0]}/schemas/arrival_key.json") <NEW_LINE> value_schema = avro.load(f"{Path(__file__).parents[0]}/schemas/arrival_value.json") <NEW_LINE> def __init__(self, station_id, name, color, direction_a=None, direction_b=None): <NEW_LIN... | Defines a single station | 6259903673bcbd0ca4bcb3e4 |
class Properties(object): <NEW_LINE> <INDENT> properties = {} <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.application_id = os.environ['APPLICATION_ID'] <NEW_LINE> shard_index = self.application_id.find('~') <NEW_LINE> if shard_index != -1: <NEW_LINE> <INDENT> self.application_id = self.application_id[shard_... | Class object of creating and getting list of
property of each appengine project
To use:
PROPERTIES = Properties().get_or_create() | 625990365e10d32532ce41b1 |
class AssetList(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Total = None <NEW_LINE> self.List = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Total = params.get("Total") <NEW_LINE> if params.get("List") is not None: <NEW_LINE> <INDENT> self.List =... | 资产列表
| 6259903694891a1f408b9fa7 |
class RoundController(ConsoleController): <NEW_LINE> <INDENT> def __init__(self, round): <NEW_LINE> <INDENT> self.round = round <NEW_LINE> screen = RoundScreen(self.round) <NEW_LINE> ConsoleController.__init__(self, screen, commands={ENDL:self.performATurn}) <NEW_LINE> self.performPlayerTurn = self.performPlayerTurn() ... | Represents the Round Controller | 6259903607d97122c4217df8 |
class TestBackupFoglampProcess(FoglampProcess): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> pass | # FIXME: | 625990361d351010ab8f4c77 |
class IMCache(MutableMapping): <NEW_LINE> <INDENT> MAXLEN = 1000 <NEW_LINE> def __init__(self, maxlen=MAXLEN, *a, **k): <NEW_LINE> <INDENT> self.filepath = 'IN MEMORY' <NEW_LINE> self.maxlen = maxlen <NEW_LINE> self.d = dict(*a, **k) <NEW_LINE> while len(self) > maxlen: <NEW_LINE> <INDENT> self.popitem() <NEW_LINE> <DE... | Read and write to a dict-like cache. | 6259903607d97122c4217df9 |
class Vertex(object): <NEW_LINE> <INDENT> __slots__ = ('index', 'vert', 'norm') <NEW_LINE> def __init__(self, vertex, normal=None, index=None): <NEW_LINE> <INDENT> self.index = index <NEW_LINE> self.vert = Vector3(vertex) <NEW_LINE> self.norm = None <NEW_LINE> if normal != None: self.norm = Vector3 (normal) | A csúcspontok koordinátáját és a hozzá tartozó normálvektort tartalmazza | 62599036cad5886f8bdc592a |
class TestGevent(OpenTracingTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.tracer = MockTracer(GeventScopeManager()) <NEW_LINE> self.client = Client(RequestHandler(self.tracer)) <NEW_LINE> <DEDENT> def test_two_callbacks(self): <NEW_LINE> <INDENT> response_greenlet1 = gevent.spawn(self.client.... | There is only one instance of 'RequestHandler' per 'Client'. Methods of
'RequestHandler' are executed in different greenlets, and no Span
propagation among them is done automatically.
Therefore we cannot use current active span and activate span.
So one issue here is setting correct parent span. | 6259903626068e7796d4daa6 |
class CrossCatClient(object): <NEW_LINE> <INDENT> def __init__(self, engine): <NEW_LINE> <INDENT> self.engine = engine <NEW_LINE> <DEDENT> def __getattribute__(self, name): <NEW_LINE> <INDENT> engine = object.__getattribute__(self, 'engine') <NEW_LINE> attr = None <NEW_LINE> if hasattr(engine, name): <NEW_LINE> <INDENT... | A client interface that gives a singue interface to the various engines.
Depending on the client_type, dispatch to appropriate engine constructor. | 6259903663f4b57ef0086622 |
class HtmlBuilder(object): <NEW_LINE> <INDENT> def categories(self, services): <NEW_LINE> <INDENT> div = Tag('div') <NEW_LINE> for annotation_types in sorted(services.categories): <NEW_LINE> <INDENT> p = Tag('p') <NEW_LINE> if not annotation_types: <NEW_LINE> <INDENT> p.add(Text('None')) <NEW_LINE> <DEDENT> else: <NEW_... | Utility class to help create HTML code for the LAPPS-Flask site. | 6259903615baa723494630f8 |
class TestWayTwoVersionCheck(unittest.TestCase): <NEW_LINE> <INDENT> def test_version(self): <NEW_LINE> <INDENT> self.assertIsNotNone(waytwo.__version__) | WayTwo Package | 6259903607d97122c4217dfa |
class Contact: <NEW_LINE> <INDENT> contact_list = [] <NEW_LINE> def __init__(self,first_name,last_name,number,email): <NEW_LINE> <INDENT> self.first_name = first_name <NEW_LINE> self.last_name = last_name <NEW_LINE> self.phone_number = number <NEW_LINE> self.email = email | Class that generates new instances of contacts. | 625990361d351010ab8f4c79 |
class LLAB_ReferenceSpecification( namedtuple('LLAB_ReferenceSpecification', ('L_L', 'Ch_L', 'h_L', 's_L', 'C_L', 'HC', 'A_L', 'B_L'))): <NEW_LINE> <INDENT> pass | Defines the *LLAB(l:c)* colour appearance model reference specification.
This specification has field names consistent with **Mark D. Fairchild**
reference.
Parameters
----------
L_L : numeric
Correlate of *Lightness* :math:`L_L`.
Ch_L : numeric
Correlate of *chroma* :math:`Ch_L`.
h_L : numeric
*Hue* angl... | 62599036596a897236128dfc |
class WebPageElementSchema(SchemaObject): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.schema = 'WebPageElement' | Schema Mixin for WebPageElement
Usage: place after django model in class definition, schema will return the schema.org url for the object
A web page element, like a table or an image. | 625990361f5feb6acb163d51 |
class ImageReference(SubResource): <NEW_LINE> <INDENT> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'publisher': {'key': 'publisher', 'type': 'str'}, 'offer': {'key': 'offer', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'}, } <NEW_LINE> def __init__(self, id... | The image reference.
:param id: Resource Id
:type id: str
:param publisher: The image publisher.
:type publisher: str
:param offer: The image offer.
:type offer: str
:param sku: The image SKU.
:type sku: str
:param version: The image version. The allowed formats are
Major.Minor.Build or 'latest'. Major, Minor and Bui... | 62599036ec188e330fdf99f6 |
class MSSQLDriver(object): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self.config = config <NEW_LINE> <DEDENT> def get_db(self): <NEW_LINE> <INDENT> conn = self.config <NEW_LINE> db_charset = "CHARSET={};".format(conn["charset"]) if "charset" in conn else "" <NEW_LINE> host_address = conn.get("... | Driver for MS SQL connections via ODBC | 625990378c3a8732951f76b6 |
class Ambito(models.Model): <NEW_LINE> <INDENT> nombre = models.CharField(verbose_name='Nombre de Ámbito', max_length=100) <NEW_LINE> funcionario = models.ForeignKey( Funcionario, verbose_name="Encargado", on_delete=models.CASCADE, blank=True, null=True, related_name='ambito_funcionario' ) <NEW_LINE> subrogante = model... | Clase para crear Ambitos.
Contiene los siguientes atributos.
nombre = Nombre del ámbito.
funcionario = Funcionario encargado del ámbito.
subrogante = Funcionario subrogante del ámbito.
descripcion = Descripción del ámbito según manual.
sigla = Sigla con la que se identifica el ámbito.
numero = Número en orden del ámbit... | 62599037596a897236128dfe |
class BookListView(generic.ListView): <NEW_LINE> <INDENT> model = Book <NEW_LINE> paginate_by = 3 | Generic class-based view for a list of books. | 62599037baa26c4b54d50408 |
class ScoreExport: <NEW_LINE> <INDENT> def __init__(self,scores_df,model_id,data_id,ranked=False): <NEW_LINE> <INDENT> self.scores_df = scores_df <NEW_LINE> self.export_dir = ("model/%s/%s/") % (model_id, data_id) <NEW_LINE> self.id_file = 'ids' + ('.desc' if ranked else '') <NEW_LINE> if not os.path.exists(self.export... | Persists model results for given model and data ids. | 6259903715baa723494630fa |
class Column(ExpressionOperatorMixin): <NEW_LINE> <INDENT> table = None <NEW_LINE> def __init__(self, name, type_=Unknown, primary_key=False, nullable=True, auto_increment=False, default=_marker): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.type_ = type_ if isinstance(type_, Type) else type_() <NEW_LINE> self.... | Defines a column in a table. | 6259903721bff66bcd723dc8 |
class LOOP(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> depth = _swig_property(_x64dbgapi64.LOOP_depth_get, _x64dbgapi64.LOOP_depth_set) <NEW_LINE> start = _swig_property(_x64dbgapi64.LOOP... | Proxy of C++ LOOP class | 6259903716aa5153ce40164c |
class ServiceEndpointPolicyListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'next_link': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'value': {'key': 'value', 'type': '[ServiceEndpointPolicy]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, value... | Response for ListServiceEndpointPolicies API service call.
Variables are only populated by the server, and will be ignored when sending a request.
:param value: A list of ServiceEndpointPolicy resources.
:type value: list[~azure.mgmt.network.v2018_07_01.models.ServiceEndpointPolicy]
:ivar next_link: The URL to get th... | 62599037d164cc61758220d4 |
class Solution: <NEW_LINE> <INDENT> def wordBreak(self, s, dic): <NEW_LINE> <INDENT> k = len(s) <NEW_LINE> if k == 0: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> if len(dic) == 0: <NEW_LINE> <INDENT> return len(s) == 0 <NEW_LINE> <DEDENT> maxLength = max(len(word) for word in dic) <NEW_LINE> if s in dic: <NEW_L... | @param: s: A string
@param: dict: A dictionary of words dict
@return: A boolean | 6259903750485f2cf55dc0e0 |
class CurrencyCode (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin): <NEW_LINE> <INDENT> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'CurrencyCode') <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('http://ddex.net/xml/20100121/iso4217a.xsd', 3, 4) <NEW_LINE> _Documentation = 'An IS... | An ISO4217 three-letter code representing a Currency. | 625990371d351010ab8f4c7d |
class ThreeLayerConvNet(object): <NEW_LINE> <INDENT> def __init__(self, input_dim=(3, 32, 32), num_filters=32, filter_size=7, hidden_dim=100, num_classes=10, weight_scale=1e-3, reg=0.0, dtype=np.float32): <NEW_LINE> <INDENT> self.params = {} <NEW_LINE> self.reg = reg <NEW_LINE> self.dtype = dtype <NEW_LINE> C, H, W = i... | A three-layer convolutional network with the following architecture:
conv - relu - 2x2 max pool - affine - relu - affine - softmax
The network operates on minibatches of data that have shape (N, C, H, W)
consisting of N images, each with height H and width W and with C input
channels. | 62599037596a897236128e00 |
class ListRerunUpdateCartJS(DetailUpdateCartJS): <NEW_LINE> <INDENT> def return_url(self): <NEW_LINE> <INDENT> return self.live_server_url + reverse('menu:menu') | Rerun in List view. | 6259903730c21e258be9996f |
class TestObjectlinkApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = swagger_client.apis.objectlink_api.ObjectlinkApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_find(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def te... | ObjectlinkApi unit test stubs | 6259903730c21e258be99970 |
class CompanyListView(UserListView): <NEW_LINE> <INDENT> template_name = 'company_list.html' <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> queryset = User.objects.order_by('username').select_related('profile').filter(profile__is_company=True) <NEW_LINE> return queryset | Представление для получения списка компаний | 62599037711fe17d825e154d |
class StemmerNotFoundError(Exception): <NEW_LINE> <INDENT> pass | Raised if stemmer is not found. | 6259903776d4e153a661db23 |
class ISession(form.Schema, IImageScaleTraversable): <NEW_LINE> <INDENT> title = schema.TextLine(title=_(u'Session Name')) <NEW_LINE> description = schema.Text( title=_(u'Session summary'), description=_(u'Short description of session topics'), ) <NEW_LINE> start = schema.Datetime( title=_(u'Session starts'), defaultFa... | Conference Session | 62599037be383301e0254979 |
class LoginFailedError(Exception): <NEW_LINE> <INDENT> pass | Raised when login to Snoonotes API fails. | 625990370a366e3fb87ddb48 |
class Command(BaseCommand): <NEW_LINE> <INDENT> def handle(self, *args, **options): <NEW_LINE> <INDENT> from oldproject.models import TypePolygon as Oldtypepolygon, TypePolygonTranslation as oldtrans <NEW_LINE> from forestry.models import TypePolygon <NEW_LINE> logger.info("Start transfering.....") <NEW_LINE> logger.in... | перенос лесничеств со старой базы в новую
| 6259903723e79379d538d66f |
class LearningAgent(Agent): <NEW_LINE> <INDENT> def __init__(self, env, learning=False, epsilon=1.0, alpha=0.5, a = 0.9): <NEW_LINE> <INDENT> super(LearningAgent, self).__init__(env) <NEW_LINE> self.planner = RoutePlanner(self.env, self) <NEW_LINE> self.valid_actions = self.env.valid_actions <NEW_LINE> self.learning = ... | An agent that learns to drive in the Smartcab world.
This is the object you will be modifying. | 62599037287bf620b6272d4c |
class Mapviewer(ndb.Model): <NEW_LINE> <INDENT> loginuser = ndb.StringProperty(indexed=True) <NEW_LINE> realname = ndb.StringProperty(indexed=False) <NEW_LINE> added = ndb.DateTimeProperty(auto_now=True) | Models an user in a non-chfd domain that can access this application | 62599037d10714528d69ef3c |
class OnlineClustering(): <NEW_LINE> <INDENT> def __init__(self, uri, distance_matrix, threshold=0.5, generator_method='string'): <NEW_LINE> <INDENT> self.uri = uri <NEW_LINE> self.threshold = threshold <NEW_LINE> self.distance_matrix = distance_matrix <NEW_LINE> self.clusters = [] <NEW_LINE> self.generator_method = ge... | online clustering class
compare new comming segment with clusters, then decide
create a new cluster, or add it to a existing cluster.
When the distance between the new coming segment and
clusters is larger than a predetermined threshold
then it will be added to the closest cluster. Otherwise,
add a new cluster
Para... | 6259903782261d6c52730776 |
class CaliperCaliQueryTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_caliquery_args(self): <NEW_LINE> <INDENT> target_cmd = [ './ci_test_aggregate' ] <NEW_LINE> query_cmd = [ '../../src/tools/cali-query/cali-query', '--aggregate', 'count(),sum(time.inclusive.duration)', '--aggregate-key=loop.id', '-s', 'loop.id... | cali-query test cases | 62599037d99f1b3c44d06808 |
class PartClassPin(object): <NEW_LINE> <INDENT> well_name = None <NEW_LINE> def __init__(self, names, numbers, type=PinType.UNKNOWN, well=None): <NEW_LINE> <INDENT> self.names = names <NEW_LINE> self.numbers = numbers <NEW_LINE> self.type = type <NEW_LINE> self.well_name = well <NEW_LINE> Plugin.init(self) <NEW_LINE> <... | Pin of a Part, but no particular Part instance.
Contains general information about the pin (but it could be for any
part of that type), nothing related to a specific part instance. | 625990378da39b475be04353 |
class Site(ABC): <NEW_LINE> <INDENT> web: Web <NEW_LINE> def find_table(self, loc: int = 0) -> str: <NEW_LINE> <INDENT> return self.web.soup.select('table')[loc] <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def parse_rows(self, table: Soup) -> List[Any]: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <N... | Site Abstract Base Class.
Defines the structure for the objects based on this class and defines the interfaces
that should implemented in order to work properly.
Variables:
web: Web -- The web object stores the information needed to process
the data.
Methods:
find_table: -> str -- Parses the Web obje... | 6259903773bcbd0ca4bcb3ec |
class App(Cmd): <NEW_LINE> <INDENT> def __init__(self, ddp_endpoint, print_raw): <NEW_LINE> <INDENT> Cmd.__init__(self) <NEW_LINE> self.print_raw = print_raw <NEW_LINE> self.ddpclient = DDPClient( 'ws://' + ddp_endpoint + '/websocket', self.print_raw) <NEW_LINE> self.ddpclient.connect() <NEW_LINE> if sys.stdin.isatty()... | Main input loop. | 62599037cad5886f8bdc592e |
class Concat_Multiword(object): <NEW_LINE> <INDENT> def __init__(self, object): <NEW_LINE> <INDENT> self.arr = object <NEW_LINE> self.has_multiword = any(np.intersect1d(self.arr, ref_lists().multiword_signifiers)) <NEW_LINE> self.signifiers = set(self.arr).intersection(ref_lists().multiword_signifiers) <NEW_LINE> self.... | Method finding and concatenating tokenized multi-word measure words.
attributes:
__init__
__run__ | 62599037d164cc61758220d8 |
class RoleDetailView(RoleDescriptionMixin, TemplateView): <NEW_LINE> <INDENT> template_name = 'saas/profile/roles/role.html' <NEW_LINE> def get_template_names(self): <NEW_LINE> <INDENT> candidates = [] <NEW_LINE> role = self.kwargs.get('role', None) <NEW_LINE> if role: <NEW_LINE> <INDENT> candidates = ['saas/profile/ro... | List of users with a specific role for an organization.
Template:
To edit the layout of this page, create a local ``saas/profile/roles/role.html`` (`example <https://github.com/djaodjin/djaodjin-saas/tree/master/saas/templates/saas/profile/roles.html>`__).
You should insure the page will call back the
:ref:`/api/... | 6259903750485f2cf55dc0e4 |
class AbstractPaymentEventType(models.Model): <NEW_LINE> <INDENT> name = models.CharField(_("Name"), max_length=128, unique=True) <NEW_LINE> code = AutoSlugField(_("Code"), max_length=128, unique=True, populate_from='name') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> app_label = 'order' <NEW_L... | Payment event types are things like 'Paid', 'Failed', 'Refunded'.
These are effectively the transaction types. | 625990379b70327d1c57feea |
class MainViewModel(QtCore.QObject): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> QtCore.QObject.__init__(self) <NEW_LINE> self.__air_on = False <NEW_LINE> self.__chiller_on = False <NEW_LINE> self.__exhaust_on = False <NEW_LINE> self.__is_working = False <NEW_LINE> self.__flow_rate = -255 <NEW_LINE> <DE... | View model for the main window | 625990376fece00bbacccb10 |
class Unicorn: <NEW_LINE> <INDENT> def __init__(self, name, color="White"): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.color = color <NEW_LINE> <DEDENT> def say(self, whatever): <NEW_LINE> <INDENT> return "**;* {} *;**".format(whatever) | This is a unicorn object and it has properties. | 62599037287bf620b6272d4d |
class ImageOsList(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Windows = None <NEW_LINE> self.Linux = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Windows = params.get("Windows") <NEW_LINE> self.Linux = params.get("Linux") | Supported operating systems are divided into two categories, Windows and Linux.
| 625990370a366e3fb87ddb4a |
class Output(object): <NEW_LINE> <INDENT> def write(self, s): <NEW_LINE> <INDENT> open(cfg.DEBUG._FILE, 'a+').write(s) <NEW_LINE> sys.__stdout__.write(s) | if you set the debug mode is enable, then the program's all actions that using sys.stdout is logged to file | 6259903726068e7796d4daad |
class InstanceActionViewSet(AuthReadOnlyViewSet): <NEW_LINE> <INDENT> queryset = InstanceAction.valid_actions.all() <NEW_LINE> serializer_class = InstanceActionSerializer | API endpoint that allows instance actions to be viewed | 62599037a8ecb03325872384 |
class CsvHandler(FileHandler): <NEW_LINE> <INDENT> delimiter = Option(str, default=csv.excel.delimiter, required=False) <NEW_LINE> quotechar = Option(str, default=csv.excel.quotechar, required=False) <NEW_LINE> escapechar = Option(str, default=csv.excel.escapechar, required=False) <NEW_LINE> doublequote = Option(str, d... | .. attribute:: delimiter
The CSV delimiter.
.. attribute:: quotechar
The CSV quote character.
.. attribute:: fields
The list of column names, if the CSV does not contain it as its first line. | 625990378e05c05ec3f6f70d |
class StationViewSet(mixins.CreateModelMixin, mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> queryset = Station.objects.all() <NEW_LINE> serializer_class = StationSerializer <NEW_LINE> filter_backends = (OrderingFilter, DjangoFilterBackend,) <NEW... | The viewset class for stations
retrieve:
Return the given station.
list:
Return a list of all the stations.
update:
Update the station.
create:
Create a new station.
Attributes
----------
station_id : int
the unique identified of the station
short_name : str
the short name of the station
name : str
... | 62599037ec188e330fdf99fc |
class Trainer(cntk_py.Trainer): <NEW_LINE> <INDENT> def __init__(self, model, loss_function, eval_function, parameter_learners): <NEW_LINE> <INDENT> model = sanitize_function(model) <NEW_LINE> loss_function = sanitize_function(loss_function) <NEW_LINE> eval_function = sanitize_function(eval_function) <NEW_LINE> super(T... | Trainer to train the specified `model` with the specified `training_loss`
as the training criterion, the specified `evaluation_function` as the
criterion for evaluating the trained model's quality, and using the
specified set of `parameter_learners` for updating the model's parameters
using computed gradients.
Args:
... | 625990371d351010ab8f4c81 |
class Share: <NEW_LINE> <INDENT> def __init__(self, name, value, yield_): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.value = float(value) <NEW_LINE> self.yield_ = float(yield_) <NEW_LINE> self.profit = self.value * self.yield_ / 100 | This class is used to store the informations of a share | 62599037baa26c4b54d5040e |
class PastesSerializer(serializers.HyperlinkedModelSerializer): <NEW_LINE> <INDENT> author = UserProfileSerializer(read_only=True) <NEW_LINE> shared_user = UserProfileSerializer(source='allowed_user', read_only=True, many=True) <NEW_LINE> expired = serializers.ReadOnlyField(source='is_expired') <NEW_LINE> class Meta: <... | serializer class related to snippet.Pastes model | 62599037ac7a0e7691f7364e |
class TemplateExportByNameResources(object): <NEW_LINE> <INDENT> openapi_types = { 'kind': 'TemplateKind', 'name': 'str' } <NEW_LINE> attribute_map = { 'kind': 'kind', 'name': 'name' } <NEW_LINE> def __init__(self, kind=None, name=None): <NEW_LINE> <INDENT> self._kind = None <NEW_LINE> self._name = None <NEW_LINE> self... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 6259903730c21e258be99974 |
class Cache(): <NEW_LINE> <INDENT> pass | An abstract Cache class for use in the repartition function
Derived classes must implement the following methods:
def insert(self, read_block, dry_run):
raise Exception('Implement in sub-class')
def mem_usage(self):
raise Exception('Implement in sub-class') | 62599037287bf620b6272d4f |
class TestSeeker(unittest.TestCase): <NEW_LINE> <INDENT> def test_parsePom(self): <NEW_LINE> <INDENT> props = IzProperties(pom) <NEW_LINE> self.assertEquals(props['izpack.version'], '5.0.0-rc2') <NEW_LINE> self.assertEquals(props['project.build.sourceEncoding'], 'UTF-8') <NEW_LINE> <DEDENT> def test_parseIzProperties(s... | Basic testing of izproperties class. | 62599037e76e3b2f99fd9b73 |
class PersistenceDataFrameIO(abc.ABC): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def read_dataframe(self) -> pd.DataFrame: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def save_dataframe(self, dataframe: pd.DataFrame): <NEW_LINE> <INDENT> pass | Interface that is able to read tabular data from a persistent source as a dataframe, and then save it back. | 625990370a366e3fb87ddb4c |
class Request: <NEW_LINE> <INDENT> def __init__(self, *, headers, querystring, body): <NEW_LINE> <INDENT> self.headers=Headers(headers) <NEW_LINE> self.querystring=QueryString(querystring) <NEW_LINE> self.body=Body(body) | An HTTP Request, part of a step | 62599037a8ecb03325872386 |
class NLUPipeline(Pipeline): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_yml(cls): <NEW_LINE> <INDENT> return cls | NLU管道 | 6259903773bcbd0ca4bcb3ef |
class Riff: <NEW_LINE> <INDENT> def __init__(self, measures=None, filename=None): <NEW_LINE> <INDENT> if measures is None: <NEW_LINE> <INDENT> if filename is None: <NEW_LINE> <INDENT> raise RiffError("Filename not defined!") <NEW_LINE> <DEDENT> self.measures = self.load_riff(filename) <NEW_LINE> <DEDENT> else: <NEW_LIN... | A riff is a collection of one or more measures.
It only cares about instances of Hz * Seconds.
It is readable from and writable to a .riff file.
This means it can be instantiated via either a list of
Measure objects or a filename.
riff_dict is the key data structure. It is composed of
time : (frequency, duration) pa... | 62599037b5575c28eb71357d |
class Layer2(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> if "layer1" in kwargs: <NEW_LINE> <INDENT> self.layer1 = kwargs["layer1"] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.layer1 = Layer1(*args, **kwargs) <NEW_LINE> <DEDENT> <DEDENT> def create_vault(self, name): <NEW... | Provides a more pythonic and friendly interface to Glacier based on Layer1 | 62599037711fe17d825e154f |
class TGetCatalogsResp(object): <NEW_LINE> <INDENT> def __init__(self, status=None, operationHandle=None,): <NEW_LINE> <INDENT> self.status = status <NEW_LINE> self.operationHandle = operationHandle <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.tra... | Attributes:
- status
- operationHandle | 62599037596a897236128e06 |
class Only(Directive): <NEW_LINE> <INDENT> has_content = True <NEW_LINE> required_arguments = 1 <NEW_LINE> optional_arguments = 0 <NEW_LINE> final_argument_whitespace = True <NEW_LINE> option_spec = {} <NEW_LINE> def run(self): <NEW_LINE> <INDENT> node = addnodes.only() <NEW_LINE> node.document = self.state.document <N... | Directive to only include text if the given tag(s) are enabled. | 62599037d4950a0f3b1116f3 |
class WikiPageAttachment(BasePolarion): <NEW_LINE> <INDENT> _cls_suds_map = {"author": {"field_name": "author", "cls": User}, "file_name": "fileName", "wiki_page_attachment_id": "id", "length": "length", "title": "title", "updated": "updated", "url": "url", "uri": "_uri", "_unresolved": "_unresolved"} <NEW_LINE> _obj_c... | Object to handle the Polarion WSDL tns3:WikiPageAttachment class
Attributes:
author (User)
file_name (string)
wiki_page_attachment_id (string)
length (long)
title (string)
updated (dateTime)
url (string) | 62599037e76e3b2f99fd9b75 |
class FilenameDescriptor(BasePremapDescriptor): <NEW_LINE> <INDENT> def doTransform(self, value, arg): <NEW_LINE> <INDENT> if hasattr(value, '_already_recoded_filename'): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> elif isinstance(value, str) or isinstance(value, unicode): <NEW_LINE> <INDENT> value = util.filename.toL... | Filename storage | 6259903715baa72349463103 |
class ProcedureList: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._map = {} <NEW_LINE> self.dummy = ProcedureMetaData(None) <NEW_LINE> <DEDENT> def ref(self, key): <NEW_LINE> <INDENT> if not key in self._map: <NEW_LINE> <INDENT> self._map[key] = ProcedureMetaData(key) <NEW_LINE> <DEDENT> return self... | Store known metadata about procedures in a format accessible
by analysis tools. | 62599037507cdc57c63a5f02 |
class ImportVisitor(ast.NodeVisitor): <NEW_LINE> <INDENT> def __init__(self, filename, options): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> self.options = options or {} <NEW_LINE> self.imports = [] <NEW_LINE> self.application_import_names = set( self.options.get("application_import_names", []) ) <NEW_LINE>... | This class visits all the import nodes at the root of tree and generates
sort keys for each import node.
In practice this means that they are sorted according to something like
this tuple.
(stdlib, site_packages, names) | 62599037c432627299fa4161 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.