code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class DynamicOutputArgumentsHelper(interface.ArgumentsHelper): <NEW_LINE> <INDENT> NAME = 'dynamic' <NEW_LINE> CATEGORY = 'output' <NEW_LINE> DESCRIPTION = 'Argument helper for the dynamic output module.' <NEW_LINE> _DEFAULT_FIELDS = [ 'datetime', 'timestamp_desc', 'source', 'source_long', 'message', 'parser', 'display... | Dynamic output module CLI arguments helper. | 6259907192d797404e3897bc |
class format_choice(wizard.interface): <NEW_LINE> <INDENT> def _select_format(self, cr, uid, data, context=None): <NEW_LINE> <INDENT> if context is None: <NEW_LINE> <INDENT> context = {} <NEW_LINE> <DEDENT> wiz_name = self.wiz_name.replace('jasper.', '') <NEW_LINE> pool = pooler.get_pool(cr.dbname) <NEW_LINE> document_... | If format = multi, compose a wizard to ask the extension of document
if format = mono, juste launch teh report and return the format previously defined | 62599071435de62698e9d6c8 |
class CNN100(nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(CNN100, self).__init__() <NEW_LINE> self.conv1 = nn.Conv2d(in_channels=1, out_channels=32, kernel_size=5, padding=(2, 2)) <NEW_LINE> self.conv2 = nn.Conv2d(in_channels=32, out_channels=64, kernel_size=3, padding=(1, 1)) <NEW_LINE... | A larger CNN model | 625990718a43f66fc4bf3a57 |
class IsAdminOrOwnerReadOnly(BasePermission): <NEW_LINE> <INDENT> def has_object_permission(self, request, view, obj): <NEW_LINE> <INDENT> return bool( (request.method in SAFE_METHODS and request.user == obj.user) or request.user and request.user.is_authenticated and request.user.is_staff ) | Кастомные права доступа (Любые методы для админа, для владельца только чтение) | 625990714c3428357761bb77 |
class ValuesPointer(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.values = Values() <NEW_LINE> <DEDENT> def swap(self, new_values): <NEW_LINE> <INDENT> assert isinstance(new_values, Values) <NEW_LINE> old = self.values <NEW_LINE> self.values = new_values <NEW_LINE> return old | A ValuesPointer points to a Values instance.
This indirection is needed so several Settings instances (with potentially
different resolvers / scopes) share the same ValuesPointer, such that one
instance's values are updated, all of the other instances share that update. | 62599071cc0a2c111447c732 |
class BaseExecutionEngine(BaseEngine): <NEW_LINE> <INDENT> def evaluate(self, data): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def get_expression_engine(self, name): <NEW_LINE> <INDENT> return self.manager.get_expression_engine(name) <NEW_LINE> <DEDENT> def get_output_schema(self, process): <NEW... | A workflow execution engine. | 625990713d592f4c4edbc7a4 |
class BinaryHierarchicalSoftmax(link.Link): <NEW_LINE> <INDENT> def __init__(self, in_size, tree): <NEW_LINE> <INDENT> self._func = BinaryHierarchicalSoftmaxFunction(tree) <NEW_LINE> super(BinaryHierarchicalSoftmax, self).__init__( W=(self._func.parser_size, in_size)) <NEW_LINE> self.W.data[...] = numpy.random.uniform(... | Hierarchical softmax layer over binary tree.
In natural language applications, vocabulary size is too large to use
softmax loss.
Instead, the hierarchical softmax uses product of sigmoid functions.
It costs only :math:`O(\log(n))` time where :math:`n` is the vocabulary
size in average.
At first a user need to prepare... | 625990712ae34c7f260ac9ad |
class Serializable(object): <NEW_LINE> <INDENT> REQUIRED = dict() <NEW_LINE> OPTIONAL = dict() <NEW_LINE> def __init__(self, **fields): <NEW_LINE> <INDENT> self._fields = {} <NEW_LINE> for field, value in fields.items(): <NEW_LINE> <INDENT> self._validate(field, value) <NEW_LINE> self._fields[field] = value <NEW_LINE> ... | An abstract class for serializable objects. | 62599071f548e778e596ce50 |
class Card(object): <NEW_LINE> <INDENT> RANKS = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K'] <NEW_LINE> SUITS = ['c', 'd', 'h', 's'] <NEW_LINE> def __init__(self, rank, suit): <NEW_LINE> <INDENT> self.rank = rank <NEW_LINE> self.suit = suit <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT... | Karty do gry | 6259907156ac1b37e6303944 |
class Pants: <NEW_LINE> <INDENT> def __init__(self, color, waist_size, length, price): <NEW_LINE> <INDENT> self.color = color <NEW_LINE> self.waist_size = waist_size <NEW_LINE> self.length = length <NEW_LINE> self.price = price <NEW_LINE> <DEDENT> def change_price(self, new_price): <NEW_LINE> <INDENT> self.price = new_... | The Pants class represents an article of clothing sold in a store
| 6259907191f36d47f2231af0 |
class Solution: <NEW_LINE> <INDENT> def maxValue(self, grid: List[List[int]]) -> int: <NEW_LINE> <INDENT> dp = [[0 for _ in range(len(grid[0]))] for _ in range(len(grid))] <NEW_LINE> temp = 0 <NEW_LINE> for i in range(len(grid)): <NEW_LINE> <INDENT> temp += grid[i][0] <NEW_LINE> dp[i][0] = temp <NEW_LINE> <DEDENT> temp... | 在一个 m*n 的棋盘的每一格都放有一个礼物,每个礼物都有一定的价值(价值大于 0)。
你可以从棋盘的左上角开始拿格子里的礼物,并每次向右或者向下移动一格、直到到达棋盘的右下角。
给定一个棋盘及其上面的礼物的价值,请计算你最多能拿到多少价值的礼物? | 6259907197e22403b383c7c7 |
class StartDateTransformer(FilteringTransformerMixin, BlockStructureTransformer): <NEW_LINE> <INDENT> VERSION = 1 <NEW_LINE> MERGED_START_DATE = 'merged_start_date' <NEW_LINE> @classmethod <NEW_LINE> def name(cls): <NEW_LINE> <INDENT> return "start_date" <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def _get_merged_start... | A transformer that enforces the 'start' and 'days_early_for_beta'
fields on blocks by removing blocks from the block structure for
which the user does not have access. The 'start' field on a
block is percolated down to its descendants, so that all blocks
enforce the 'start' field from their ancestors. The assumed
'sta... | 6259907167a9b606de547705 |
class PlantaList(CoreMixinLoginRequired, TemplateView): <NEW_LINE> <INDENT> template_name = 'planta_list.html' | View para renderização da lista | 625990714a966d76dd5f07ae |
class IBANFormField(CharValidator): <NEW_LINE> <INDENT> def __init__(self, use_nordea_extensions=False, include_countries=None, *args, **kwargs): <NEW_LINE> <INDENT> kwargs.setdefault('min_length', IBAN_MIN_LENGTH) <NEW_LINE> kwargs.setdefault('max_length', 34) <NEW_LINE> self.default_validators = [IBANValidator(use_no... | An IBAN consists of up to 34 alphanumeric characters.
To limit validation to specific countries, set the 'include_countries' argument with a tuple or list of ISO 3166-1
alpha-2 codes. For example, `include_countries=('NL', 'BE, 'LU')`.
A list of countries that use IBANs as part of SEPA is included for convenience. To... | 6259907163b5f9789fe86a27 |
class terminateSession_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'key', None, None, ), ) <NEW_LINE> def __init__(self, key=None,): <NEW_LINE> <INDENT> self.key = key <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated an... | Attributes:
- key | 6259907138b623060ffaa4b6 |
class Delivery(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=200, verbose_name='Заголовок') <NEW_LINE> text = models.TextField(verbose_name='Описание') <NEW_LINE> is_active = models.BooleanField(default=True, verbose_name='Модерация') <NEW_LINE> created = models.DateTimeField(auto_now_add=True,... | Информация о доставке товаров | 62599071e1aae11d1e7cf46f |
class GenreViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Genre.objects.all() <NEW_LINE> serializer_class = GenreSerializer | The Genre View provides the `list`, `create`, and `retrieve` actions.
Please click on a specific Order's url for the `update` and `destroy` actions. | 6259907123849d37ff85297b |
class SrMiseLogError(SrMiseError): <NEW_LINE> <INDENT> def __init__(self, info): <NEW_LINE> <INDENT> SrMiseError.__init__(self, info) | diffpy.srmise exception class. Error while handling logging capabilities. | 6259907121bff66bcd72452c |
class HiddenMultiField(wtforms.fields.TextField): <NEW_LINE> <INDENT> widget = HiddenMultiInput() <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.separator = kwargs.pop('separator', ',') <NEW_LINE> super(HiddenMultiField, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def _value(self): <NE... | A hidden field that stores multiple comma-separated values, meant to be
used as an Ajax widget target. The optional ``separator`` parameter
can be used to specify an alternate separator character (default ``','``). | 62599071be8e80087fbc0954 |
class WipViolationViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> permission_classes = (permissions.IsAuthenticated,) <NEW_LINE> serializer_class = WipViolationSerializer <NEW_LINE> queryset = WipViolation.objects.all() <NEW_LINE> def list(self, request): <NEW_LINE> <INDENT> if request.QUERY_PARAMS.get('cardId'): <... | API endpoint that allows WIP violations to be viewed or edited. | 625990714f6381625f19a10b |
class MountEntry(object): <NEW_LINE> <INDENT> __slots__ = ( 'source', 'target', 'fs_type', 'mnt_opts', 'mount_id', 'parent_id' ) <NEW_LINE> def __init__(self, source, target, fs_type, mnt_opts, mount_id, parent_id): <NEW_LINE> <INDENT> self.source = source <NEW_LINE> self.target = target <NEW_LINE> self.fs_type = fs_ty... | Mount table entry data.
| 62599071a219f33f346c80cf |
class NewFolder(NewItem): <NEW_LINE> <INDENT> name = eg.text.MainFrame.Menu.AddFolder.replace("&", "") <NEW_LINE> @eg.AssertInMainThread <NEW_LINE> @eg.LogIt <NEW_LINE> def Do(self, selection): <NEW_LINE> <INDENT> document = self.document <NEW_LINE> def ProcessInActionThread(): <NEW_LINE> <INDENT> if isinstance( select... | Create a new FolderItem if the user has choosen to do so from the menu
or toolbar. | 6259907155399d3f05627ddd |
class ChatSessionMessage(TrackableDateModel): <NEW_LINE> <INDENT> user = models.ForeignKey(User, on_delete=models.PROTECT) <NEW_LINE> chat_session = models.ForeignKey( ChatSession, related_name='messages', on_delete=models.PROTECT ) <NEW_LINE> message = models.TextField(max_length=2000) <NEW_LINE> objects = models.Mana... | Store messages for a session. | 625990714428ac0f6e659df9 |
class VoiceFilterInfo(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.BizId = None <NEW_LINE> self.FileId = None <NEW_LINE> self.FileName = None <NEW_LINE> self.OpenId = None <NEW_LINE> self.Timestamp = None <NEW_LINE> self.Data = None <NEW_LINE> <DEDENT> def _deserialize(self, params):... | 语音文件过滤详情
| 625990711f037a2d8b9e54cd |
class ColumnAggregator(experimenter.Experimenter): <NEW_LINE> <INDENT> def __init__(self, index, settings=None): <NEW_LINE> <INDENT> super(ColumnAggregator, self).__init__(index, None) <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> if isinstance(self._index, list): <NEW_LINE> <INDENT> if isinstance(self._index[... | Experiment that aggregates data from all columns of a :class:`DataFrame`, a list of :class:`DataFrame` objects, or a list of :class:`Series`, into a single :class:`Series`. Aggregation is done through addition. If a :class:`DataFrame` has a column with the name :obj:`u'all'`, it will *not* be included in th... | 625990717b25080760ed8946 |
class TerraformLexer(RegexLexer): <NEW_LINE> <INDENT> name = 'Terraform' <NEW_LINE> aliases = ['terraform', 'tf'] <NEW_LINE> filenames = ['*.tf'] <NEW_LINE> mimetypes = ['application/x-tf', 'application/x-terraform'] <NEW_LINE> embedded_keywords = ('ingress', 'egress', 'listener', 'default', 'connection', 'alias', 'ter... | Lexer for `terraformi .tf files <https://www.terraform.io/>`_.
.. versionadded:: 2.1 | 625990712ae34c7f260ac9b0 |
class DischargeError(Exception): <NEW_LINE> <INDENT> def __init__(self, msg): <NEW_LINE> <INDENT> super(DischargeError, self).__init__( 'third party refused dischargex: {}'.format(msg)) | This is thrown by Client when a third party has refused a discharge | 6259907126068e7796d4e201 |
class Critic(nn.Module): <NEW_LINE> <INDENT> def __init__(self, state_size, action_size, seed, fcs1_units=400, fc2_units=300): <NEW_LINE> <INDENT> super(Critic, self).__init__() <NEW_LINE> self.seed = torch.manual_seed(seed) <NEW_LINE> self.fcs1 = nn.Linear(state_size, fcs1_units) <NEW_LINE> self.bn1 = nn.BatchNorm1d(f... | Critic (Value) Model. | 62599071ec188e330fdfa169 |
class WebsocketServer(ThreadingMixIn, TCPServer, API): <NEW_LINE> <INDENT> allow_reuse_address = True <NEW_LINE> daemon_threads = True <NEW_LINE> clients = [] <NEW_LINE> id_counter = 0 <NEW_LINE> def __init__(self, port, host='127.0.0.1', loglevel=logging.WARNING): <NEW_LINE> <INDENT> logger.setLevel(loglevel) <NEW_LIN... | A websocket server waiting for clients to connect.
Args:
port(int): Port to bind to
host(str): Hostname or IP to listen for connections. By default 127.0.0.1
is being used. To accept connections from any client, you should use
0.0.0.0.
loglevel: Logging level from logging module to use f... | 625990718e7ae83300eea957 |
class PictureDownload(ImagesPipeline): <NEW_LINE> <INDENT> def __init__(self, pool, table_name, download_func=None, settings=None): <NEW_LINE> <INDENT> self.pool = pool <NEW_LINE> self.table_name = table_name <NEW_LINE> if isinstance(settings, dict) or settings is None: <NEW_LINE> <INDENT> settings = Settings(settings)... | 继承于图片下载管道ImagesPipeline | 62599071cc0a2c111447c734 |
class UserAnswer(models.Model): <NEW_LINE> <INDENT> reply = models.ForeignKey(Reply, on_delete=models.CASCADE) <NEW_LINE> answer = models.ForeignKey(Answer, on_delete=models.CASCADE, default=1) | класс Вариант пользователя
вариант ответа на вопрос теста
- reply - пользовательский ответ
- answer - Выбранный ответ из теста | 62599071796e427e5385003f |
class GameState: <NEW_LINE> <INDENT> WIN = "Win!" <NEW_LINE> LOSS = "Loss!" <NEW_LINE> DRAW = "Draw!" <NEW_LINE> IN_PROGRESS = "Still playing..." <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return "< Tic Tac Toe Game States >" | Game End States
| 62599071e1aae11d1e7cf470 |
@attr.s(auto_attribs=True, init=False) <NEW_LINE> class DashboardAggregateTableLookml(model.Model): <NEW_LINE> <INDENT> dashboard_id: Optional[str] = None <NEW_LINE> aggregate_table_lookml: Optional[str] = None <NEW_LINE> def __init__( self, *, dashboard_id: Optional[str] = None, aggregate_table_lookml: Optional[str] =... | Attributes:
dashboard_id: Dashboard Id
aggregate_table_lookml: Aggregate Table LookML | 6259907123849d37ff85297d |
class _GzipMessageDelegate(httputil.HTTPMessageDelegate): <NEW_LINE> <INDENT> def __init__(self, delegate, chunk_size): <NEW_LINE> <INDENT> self._delegate = delegate <NEW_LINE> self._chunk_size = chunk_size <NEW_LINE> self._decompressor = None <NEW_LINE> <DEDENT> def headers_received(self, start_line, headers): <NEW_LI... | Wraps an `HTTPMessageDelegate` to decode ``Content-Encoding: gzip``.
| 6259907156b00c62f0fb4196 |
class Debitor(JSONMixin, object): <NEW_LINE> <INDENT> def __init__(self, typ=None, name=None, description=None, integration_data=None, aggregation_key=None): <NEW_LINE> <INDENT> self.type = typ <NEW_LINE> self.name = name <NEW_LINE> self.description = description <NEW_LINE> self.integration_data = integration_data <NEW... | Information about a 3rd party that will take payment from your customer.
This information is primarily used for bypassing callouts an integrating
directly with payment providers on the front end.
When your account is set up to sell on credit (i.e. you are always taking
payment from the customer in your application di... | 62599071fff4ab517ebcf0e1 |
class neoHookean(MaterialModel): <NEW_LINE> <INDENT> def model_info(self): <NEW_LINE> <INDENT> self.num_parameters = 2 <NEW_LINE> self.kinematic_measure = "RightCauchyGreen" <NEW_LINE> <DEDENT> def strain_energy(self, parameters): <NEW_LINE> <INDENT> J = fenics.sqrt(fenics.det(self.C)) <NEW_LINE> Cbar = J ** (-2.0 / 3.... | Defines the strain energy function for a neo-Hookean
material | 62599071442bda511e95d9bb |
class PixelPrediction(object): <NEW_LINE> <INDENT> def __init__(self, id_val, pixel_number, k): <NEW_LINE> <INDENT> self.id = id_val <NEW_LINE> self.pixel_number = pixel_number <NEW_LINE> self.k = k <NEW_LINE> self._predicted_arr = None <NEW_LINE> self._neighbors = None <NEW_LINE> self._distances = None <NEW_LINE> <DED... | Class to hold a given pixel's prediction including neighbor IDs, distances
and predicted values for each continuous attribute. | 625990714e4d562566373ccd |
class AfterEvent(BaseEvent): <NEW_LINE> <INDENT> def __init__(self, interval, callback, args=None, kwargs=None, userid=0, obj=None): <NEW_LINE> <INDENT> super().__init__(callback, args, kwargs, userid, obj) <NEW_LINE> self._interval = interval <NEW_LINE> self.eventid = self._obj.SetEventAfter(interval, userid) <NEW_LIN... | 指定時間後に実行するATENXA式イベント
interval秒後に引数args,キーワード引数kwargsでcallbackを実行します。
args*がNoneなら空のリストが使用されます。
Args:
interval: 時間(秒)
callback: 実行する関数名
args (optional): 関数実行時に与える引数
kwargs (optional): 関数実行時に与えるキーワード引数
userid (optional): ユーザID
obj (optional): イベント発生対象のオブジェクト。 (default=LAYOUT)
Example:
1.5秒... | 62599071ac7a0e7691f73db0 |
class VideoBlackFailoverSettings(AWSProperty): <NEW_LINE> <INDENT> props: PropsDictType = { "BlackDetectThreshold": (double, False), "VideoBlackThresholdMsec": (integer, False), } | `VideoBlackFailoverSettings <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-medialive-channel-videoblackfailoversettings.html>`__ | 6259907121bff66bcd72452e |
class Validator: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def validate(self, value, context=''): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> is_numeric = False | base class for all value validators
each should have its own constructor, and override:
validate: function of two args: value, context
value is what you're testing
context is a string identifying the caller better
raises an error (TypeError or ValueError) if the value fails
is_numeric: is this a numeric ... | 62599071a05bb46b3848bd8f |
class PartyTestsDatabaseNotLoggedIn(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = app.test_client() <NEW_LINE> app.config['TESTING'] = True <NEW_LINE> connect_to_db(app, "postgresql:///testdb") <NEW_LINE> db.create_all() <NEW_LINE> example_data() <NEW_LINE> <DEDENT> def tear... | Flask tests that use the database. | 6259907176e4537e8c3f0e46 |
class Log: <NEW_LINE> <INDENT> stdlog = logging.getLogger('stdlog') <NEW_LINE> def getlog(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> numeric_level = getattr(logging, cfg['LOGLEVEL'].upper(), None) <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> print('Invalid log level, using default INFO') <NEW_LINE> <DEDENT>... | Initialize the opendmp logging system.
Actually print both to stdout and in a LOGFILE defined in opendmp.conf | 62599071009cb60464d02dff |
class ShrewTopo(Topo): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Topo.__init__(self) <NEW_LINE> attacker = self.addHost('attacker') <NEW_LINE> server = self.addHost('server') <NEW_LINE> client = self.addHost('client') <NEW_LINE> attacker_friend = self.addHost('friend') <NEW_LINE> server_switch = self.... | Simple topology for bufferbloat experiment. | 625990714e4d562566373cce |
class DetectionLayer(KE.Layer): <NEW_LINE> <INDENT> def __init__(self, config=None, **kwargs): <NEW_LINE> <INDENT> super(DetectionLayer, self).__init__(**kwargs) <NEW_LINE> self.config = config <NEW_LINE> <DEDENT> def call(self, inputs): <NEW_LINE> <INDENT> def wrapper(rois, mrcnn_class, mrcnn_bbox, image_meta): <NEW_L... | Takes classified proposal boxes and their bounding box deltas and
returns the final detection boxes.
# TODO: Add support for batch_size > 1
Returns:
[batch, num_detections, (y1, x1, y2, x2, class_score)] in pixels | 6259907166673b3332c31cc5 |
class Log(object): <NEW_LINE> <INDENT> def __init__(self, filename='', log_dir='', console_output=False): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> self.baseDir = 'C:\\temp' if is_windows() else '/tmp' <NEW_LINE> if not log_dir: <NEW_LINE> <INDENT> user = os.environ.get('USER') or os.environ.get('USERNAME... | Log class for the top-level runUpgrade process and all of its scrtips. | 625990711f037a2d8b9e54ce |
class ListOrCreateAssignmentRest(BaseNodeListOrCreateView): <NEW_LINE> <INDENT> permissions = (IsAuthenticated,) <NEW_LINE> resource = AssignmentResource <NEW_LINE> def authenticate_postrequest(self, user, parentnode_id): <NEW_LINE> <INDENT> periodadmin_required(user, parentnode_id) <NEW_LINE> <DEDENT> def get_queryset... | List the subjects where the authenticated user is admin. | 6259907171ff763f4b5e9070 |
class UnrecognizableSourceLanguageError(MerlinError): <NEW_LINE> <INDENT> description = "{0.node.uri}: could not determine the source language" <NEW_LINE> def __init__(self, node, **kwds): <NEW_LINE> <INDENT> super().__init__(**kwds) <NEW_LINE> self.node = node <NEW_LINE> return | Exception raised when the source language of an asset could not be recognized | 62599071bf627c535bcb2d93 |
class Stack(object, ICollection, IEnumerable, ICloneable): <NEW_LINE> <INDENT> def Clear(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Clone(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Contains(self, obj): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def CopyTo(self, array, index): <NEW_LINE> <IND... | Represents a simple last-in-first-out (LIFO) non-generic collection of objects.
Stack()
Stack(initialCapacity: int)
Stack(col: ICollection) | 625990714428ac0f6e659dfc |
class Direction1Enum(object): <NEW_LINE> <INDENT> ENUM_IN = 'in' <NEW_LINE> OUT = 'out' <NEW_LINE> BOTH = 'both' | Implementation of the 'Direction1' enum.
The leg of the call audio will be played to
Attributes:
IN: TODO: type description here.
OUT: TODO: type description here.
BOTH: TODO: type description here. | 62599071baa26c4b54d50b73 |
class TestApiResponse(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 testApiResponse(self): <NEW_LINE> <INDENT> model = mparticle.models.api_response.ApiResponse() | ApiResponse unit test stubs | 62599071d268445f2663a7c1 |
class ATMPort(Port): <NEW_LINE> <INDENT> def __init__(self, name, nio=None): <NEW_LINE> <INDENT> super().__init__(name, nio) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def longNameType(): <NEW_LINE> <INDENT> return "ATM" <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def shortNameType(): <NEW_LINE> <INDENT> return "a" ... | ATM port.
:param name: port name (string)
:param nio: NIO instance to attach to this port | 6259907138b623060ffaa4b8 |
class CF(object): <NEW_LINE> <INDENT> def __init__(self, justify='>', width=0): <NEW_LINE> <INDENT> self.justify = justify <NEW_LINE> self.width = width <NEW_LINE> <DEDENT> def format(self, s): <NEW_LINE> <INDENT> fmtstr = '{:' + self.justify + str(self.width) + "s}" <NEW_LINE> return fmtstr.format(s) <NEW_LINE> <DEDEN... | CF instances represent preferred column width and justification. | 625990717b180e01f3e49cc8 |
class Energy(EcobeeObject): <NEW_LINE> <INDENT> __slots__ = [ '_tou', '_energy_feature_state', '_feels_like_mode', '_comfort_preferences', ] <NEW_LINE> attribute_name_map = { 'tou': 'tou', 'energy_feature_state': 'energyFeatureState', 'energyFeatureState': 'energy_feature_state', 'feels_like_mode': 'feelsLikeMode', 'fe... | This class has been manually generated by reverse engineering
Attribute names have been generated by converting ecobee property
names from camelCase to snake_case.
A getter property has been generated for each attribute.
A setter property has been generated for each attribute whose value
of READONLY is "no".
An __in... | 625990712c8b7c6e89bd50af |
class DublinPublicTransportSensor(Entity): <NEW_LINE> <INDENT> def __init__(self, data, stop, route, name): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self._name = name <NEW_LINE> self._stop = stop <NEW_LINE> self._route = route <NEW_LINE> self._times = self._state = None <NEW_LINE> <DEDENT> @property <NEW_LINE> d... | Implementation of an Dublin public transport sensor. | 6259907123849d37ff85297f |
class PayeeWrapper(object): <NEW_LINE> <INDENT> swagger_types = { 'payee': 'Payee' } <NEW_LINE> attribute_map = { 'payee': 'payee' } <NEW_LINE> def __init__(self, payee=None): <NEW_LINE> <INDENT> self._payee = None <NEW_LINE> self.discriminator = None <NEW_LINE> self.payee = payee <NEW_LINE> <DEDENT> @property <NEW_LIN... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 6259907121bff66bcd724530 |
class ResourceType(ModelBase): <NEW_LINE> <INDENT> def __new__(cls, name, bases, attrs): <NEW_LINE> <INDENT> new = super(ResourceType, cls).__new__ <NEW_LINE> if attrs.pop("abstract", None) or not attrs.get("autoregister", True): <NEW_LINE> <INDENT> return new(cls, name, bases, attrs) <NEW_LINE> <DEDENT> for fname, vna... | Metaclass for archival resources. Don't fear the magic.
All this does is instantiate models.TextField attributes
on subclasses based on their translatable_fields tuple. | 625990714527f215b58eb604 |
class OptProblem(ArchitectureAssembly): <NEW_LINE> <INDENT> solution = Dict({},iotype="in",desc="dictionary of expected values for " "all des_vars and coupling_vars") <NEW_LINE> def check_solution(self,strict=False): <NEW_LINE> <INDENT> error = {} <NEW_LINE> try: <NEW_LINE> <INDENT> for k,v in self.get_parameters().ite... | Class for specifying test problems for optimization
algorithms and architectures. | 62599071283ffb24f3cf5172 |
class AzureStackManagementClient(object): <NEW_LINE> <INDENT> def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any ) -> None: <NEW_LINE> <INDENT> if not base_url: <NEW_LINE> <INDENT> base_url = 'https://management.azure.com' <NEW_LINE> <DEDENT> self... | Azure Stack.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.azurestack.aio.operations.Operations
:ivar cloud_manifest_file: CloudManifestFileOperations operations
:vartype cloud_manifest_file: azure.mgmt.azurestack.aio.operations.CloudManifestFileOperations
:ivar customer_subscriptions: Custom... | 625990711b99ca400229019a |
class DualLayout(BaseLayout, FundamentalTool): <NEW_LINE> <INDENT> _name = "Dual" <NEW_LINE> _args = [Arg("helper_vertices",Arg.bool,"add helper vertices if there are many-to-many vertices", default=True)] <NEW_LINE> def get_subgraph(self, particle): <NEW_LINE> <INDENT> if particle.initial_state: <NEW_LINE> <INDENT> re... | The Dual layout, so named because it is the "Dual" in the graph sense of
Feynman diagrams, shows particles as nodes. | 625990714e4d562566373cd0 |
class ValidateResponse(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, 'error': {'key': 'error', 'type': 'ValidateResponseError'}, } <NEW_LINE> def __init__( self, *, status: Optional[str] = None, error: Optional["ValidateResponseError"] = None, **kwargs )... | Describes the result of resource validation.
:ivar status: Result of validation.
:vartype status: str
:ivar error: Error details for the case when validation fails.
:vartype error: ~azure.mgmt.web.v2020_09_01.models.ValidateResponseError | 62599071627d3e7fe0e08751 |
class SelectorDIC(ModelSelector): <NEW_LINE> <INDENT> def calculate_score(self, model): <NEW_LINE> <INDENT> scores = [] <NEW_LINE> for word, (X, lengths) in self.hwords.items(): <NEW_LINE> <INDENT> if word != self.this_word: <NEW_LINE> <INDENT> scores.append(model.score(X, lengths)) <NEW_LINE> <DEDENT> <DEDENT> score =... | Select best model based on Discriminative Information Criterion
Biem, Alain. "A model selection criterion for classification: Application to hmm topology optimization."
Document Analysis and Recognition, 2003. Proceedings. Seventh International Conference on. IEEE, 2003.
http://citeseerx.ist.psu.edu/viewdoc/download?do... | 625990712c8b7c6e89bd50b0 |
class StateManager(object): <NEW_LINE> <INDENT> def __init__(self, logger=None): <NEW_LINE> <INDENT> import logging <NEW_LINE> self.handles = [ self._clr_states, None, None, None, None, None, self._del_state, self._del_state, None, None, None, None, None, self._add_state, None, None, ] <NEW_LINE> if logger: <NEW_LINE> ... | This class is used to manage PF states.
It handle all pfsync actions (when parsed into the correct action
classes) and log the needed things.
This is the class that you should extends or replace if you need
more of pfstatelogger.py | 6259907167a9b606de547708 |
class index(app.page): <NEW_LINE> <INDENT> path = '/' <NEW_LINE> def GET(self): <NEW_LINE> <INDENT> return render.index(None) | Main page. | 6259907199cbb53fe68327b3 |
class RunCommandInputSet(InputSet): <NEW_LINE> <INDENT> def set_DatabaseName(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'DatabaseName', value) <NEW_LINE> <DEDENT> def set_Password(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'Password', value) <NEW_LINE> <DEDENT> def set_Port(self, value... | An InputSet with methods appropriate for specifying the inputs to the RunCommand
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 62599071baa26c4b54d50b75 |
class Config(object): <NEW_LINE> <INDENT> api_version = 1 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.project = "project" <NEW_LINE> self.project_url = "#" <NEW_LINE> self.repo = None <NEW_LINE> self.pythons = ["{0[0]}.{0[1]}".format(sys.version_info)] <NEW_LINE> self.matrix = {} <NEW_LINE> self.env_dir = "... | Manages the configuration for a benchmark project. | 625990715fcc89381b266dbc |
class Direction(Vector, Enum): <NEW_LINE> <INDENT> N = (0, -1) <NEW_LINE> NE = (1, -1) <NEW_LINE> E = (1, 0) <NEW_LINE> SE = (1, 1) <NEW_LINE> S = (0, 1) <NEW_LINE> SW = (-1, 1) <NEW_LINE> W = (-1, 0) <NEW_LINE> NW = (-1, -1) <NEW_LINE> @property <NEW_LINE> def is_diagonal(self): <NEW_LINE> <INDENT> return all(self.val... | Direction on 2D plane. | 6259907192d797404e3897c0 |
class RSAKeyPair(object): <NEW_LINE> <INDENT> _crypt_padding = padding.OAEP( mgf=padding.MGF1(algorithm=hashes.SHA1()), algorithm=hashes.SHA1(), label=None) <NEW_LINE> def __init__(self, rsa_key=None): <NEW_LINE> <INDENT> if rsa_key is None: <NEW_LINE> <INDENT> rsa_key = generate_private_key() <NEW_LINE> <DEDENT> try: ... | Experimental! Take your own risk. | 6259907163b5f9789fe86a2d |
class FloatEntry(ValidatedEntry): <NEW_LINE> <INDENT> VALIDATOR = FloatValidator | Validated floating-point numbers. | 625990718e7ae83300eea95a |
class OperatingSystemTypes(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> WINDOWS = "Windows" <NEW_LINE> LINUX = "Linux" | The operating system type required by the containers in the container group.
| 62599071ec188e330fdfa16d |
class C1700(Router): <NEW_LINE> <INDENT> def __init__(self, module, server, project, chassis="1720"): <NEW_LINE> <INDENT> super().__init__(module, server, project, platform="c1700") <NEW_LINE> c1700_settings = {"ram": 128, "nvram": 32, "disk0": 0, "disk1": 0, "chassis": "1720", "iomem": 15, "clock_divisor": 8, "slot0":... | Dynamips c1700 router.
:param module: parent module for this node
:param server: GNS3 server instance
:param project: Project instance | 625990712c8b7c6e89bd50b1 |
class GridPlot(object): <NEW_LINE> <INDENT> def __init__(self, sel, x=['comp(a)', 'formation_energy'], y=['comp(a)', 'formation_energy'], type=None, axis=0, kwargs=None): <NEW_LINE> <INDENT> self.sel = sel <NEW_LINE> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.axis = axis <NEW_LINE> if type is None: <NEW_LINE> <IN... | Attributes:
p: a bokeh Figure containing formation energies and the convex hull
layout: a bokeh layout element holding p
sel: a CASM Selection used to make the figure
x: the value of the x-axis, 'comp(a)' by default | 62599071167d2b6e312b81f4 |
class AttachDebuggerCommand(Command): <NEW_LINE> <INDENT> def run(self, context, args, kwargs, opargs): <NEW_LINE> <INDENT> import sys <NEW_LINE> sys.path.append(args[0]) <NEW_LINE> import pydevd <NEW_LINE> pydevd.settrace(args[1], port=args[2]) | Usage: attach_debugger <path to pydevd egg> <host> <port> | 6259907199fddb7c1ca63a38 |
class PadLayer(Layer): <NEW_LINE> <INDENT> def __init__( self, layer = None, paddings = None, mode = 'CONSTANT', name = 'pad_layer', ): <NEW_LINE> <INDENT> Layer.__init__(self, name=name) <NEW_LINE> assert paddings is not None, "paddings should be a Tensor of type int32. see https://www.tensorflow.org/api_docs/python/t... | The :class:`PadLayer` class is a Padding layer for any modes and dimensions.
Please see `tf.pad <https://www.tensorflow.org/api_docs/python/tf/pad>`_ for usage.
Parameters
----------
layer : a :class:`Layer` instance
The `Layer` class feeding into this layer.
padding : a Tensor of type int32.
mode : one of "CONSTA... | 6259907176e4537e8c3f0e4a |
class Portaudio(object): <NEW_LINE> <INDENT> def initialize(self) -> int: <NEW_LINE> <INDENT> return _portaudio.Pa_Initialize() <NEW_LINE> <DEDENT> def terminate(self) -> int: <NEW_LINE> <INDENT> return _portaudio.Pa_Terminate() <NEW_LINE> <DEDENT> @property <NEW_LINE> def device_count(self) -> int: <NEW_LINE> <INDENT>... | Portaudio class.
A portaudio object that can be used with the 'with' statement
to initialize and terminate portaudio. Portaudio has to be initialized
before any portaudio functions are called. | 625990714e4d562566373cd2 |
class DoubleConv(nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_channels, out_channels, mid_channels=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> if not mid_channels: <NEW_LINE> <INDENT> mid_channels = out_channels <NEW_LINE> <DEDENT> self.double_conv = nn.Sequential( nn.Conv3d(in_channels, mid_chann... | (convolution => [BN] => ReLU) * 2 | 625990713317a56b869bf1aa |
class TestCase3(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.__regex__ = yare.compile('a*(b|c\))d') <NEW_LINE> <DEDENT> def test_match(self): <NEW_LINE> <INDENT> positive = [ 'bd', 'abd', 'ac)d', 'c)d' ] <NEW_LINE> negative = [ '', ' ', '\\', '\\e', 'acd', 'ac\)d', 'c\)d', 'a*(b|c\)... | complex test case 3 | 62599071627d3e7fe0e08753 |
class LoadBalancerPaged(Paged): <NEW_LINE> <INDENT> _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, 'current_page': {'key': 'value', 'type': '[LoadBalancer]'} } <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(LoadBalancerPaged, self).__init__(*args, **kwargs) | A paging container for iterating over a list of :class:`LoadBalancer <azure.mgmt.network.v2017_10_01.models.LoadBalancer>` object | 62599071b7558d5895464b99 |
class Task(object): <NEW_LINE> <INDENT> default_cmd = "" <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self._container = None <NEW_LINE> self._config = dict(kwargs) <NEW_LINE> cmd = self._config.get("cmd", self.default_cmd) <NEW_LINE> container_name = self._config.get("docker_container_name", None) <NEW_... | Parent Task class,
if you create a Task, your class must be a child of this class. | 625990718a43f66fc4bf3a60 |
class Token: <NEW_LINE> <INDENT> counter = 0 <NEW_LINE> def __init__(self, token): <NEW_LINE> <INDENT> self.symbol = token <NEW_LINE> self.index = Token.counter <NEW_LINE> Token.counter += 1 | Describes a token which is a representation of an indexed string (words or symbols in the grammar).
It is the format in which these words and symbols are stored on the stack and in the buffer. | 62599071435de62698e9d6d2 |
class Instruction: <NEW_LINE> <INDENT> def __init__( self, name, values ): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.values = values <NEW_LINE> <DEDENT> def to_html( self, **kwArgs ): <NEW_LINE> <INDENT> return "" | A configuration item for the output | 6259907138b623060ffaa4ba |
@implementer(INetwork) <NEW_LINE> class HostNetwork(object): <NEW_LINE> <INDENT> logger = Logger() <NEW_LINE> def create_proxy_to(self, ip, port): <NEW_LINE> <INDENT> return create_proxy_to(self.logger, ip, port) <NEW_LINE> <DEDENT> def delete_proxy(self, proxy): <NEW_LINE> <INDENT> return delete_proxy(self.logger, pro... | An ``INetwork`` implementation based on ``iptables``. | 62599071e5267d203ee6d023 |
class ThreadPool(object): <NEW_LINE> <INDENT> def __init__(self, size, name): <NEW_LINE> <INDENT> self.stopping = False <NEW_LINE> self.active_workers = 0 <NEW_LINE> self.name = name <NEW_LINE> self.unfinished_tasks = 0 <NEW_LINE> self.mutex = threading.Lock() <NEW_LINE> self.all_tasks_done = threading.Condition(self.m... | A thread pool object, the real workhorse of this module.
Methods:
__init__(size, name):
Arguments:
size - the number of threads in the pool
name - a name to give to the pool
task_add(func, args, kwargs, callback):
Arguments:
func - callable object to execu... | 6259907132920d7e50bc7913 |
class ThreadSafeBus(ObjectProxy): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> if import_exc is not None: <NEW_LINE> <INDENT> raise import_exc <NEW_LINE> <DEDENT> super(ThreadSafeBus, self).__init__(Bus(*args, **kwargs)) <NEW_LINE> self.__wrapped__._lock_send_periodic = nullcontext() <NE... | Contains a thread safe :class:`can.BusABC` implementation that
wraps around an existing interface instance. All public methods
of that base class are now safe to be called from multiple threads.
The send and receive methods are synchronized separately.
Use this as a drop-in replacement for :class:`~can.BusABC`.
.. no... | 62599071cc0a2c111447c737 |
class RSAKeyValueType_(SamlBase): <NEW_LINE> <INDENT> c_tag = 'RSAKeyValueType' <NEW_LINE> c_namespace = NAMESPACE <NEW_LINE> c_children = SamlBase.c_children.copy() <NEW_LINE> c_attributes = SamlBase.c_attributes.copy() <NEW_LINE> c_child_order = SamlBase.c_child_order[:] <NEW_LINE> c_cardinality = SamlBase.c_cardinal... | The http://www.w3.org/2000/09/xmldsig#:RSAKeyValueType element | 62599071e1aae11d1e7cf473 |
class SerialClientMsgSender: <NEW_LINE> <INDENT> def __init__(self, pendant=None): <NEW_LINE> <INDENT> self.pendant = pendant <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def pendant_client_name(): <NEW_LINE> <INDENT> return "serial" <NEW_LINE> <DEDENT> def pendant_client_msg(self, msg): <NEW_LINE> <INDENT> self.pendan... | Class used to pass client messages generated by the Pendant application to the serial
device. | 62599071ac7a0e7691f73db6 |
@swagger.model() <NEW_LINE> class ScenarioProject(models.ModelBase): <NEW_LINE> <INDENT> def __init__(self, project='', customs=None, scores=None, trust_indicators=None): <NEW_LINE> <INDENT> self.project = project <NEW_LINE> self.customs = list_default(customs) <NEW_LINE> self.scores = list_default(scores) <NEW_LINE> s... | @property customs:
@ptype customs: C{list} of L{string}
@property scores:
@ptype scores: C{list} of L{ScenarioScore}
@property trust_indicators:
@ptype trust_indicators: C{list} of L{ScenarioTI} | 62599071442bda511e95d9be |
class Url2Netloc(ConverterBase): <NEW_LINE> <INDENT> @ConverterBase.data_to_convert.setter <NEW_LINE> def data_to_convert(self, value: Any) -> None: <NEW_LINE> <INDENT> if not isinstance(value, str): <NEW_LINE> <INDENT> raise TypeError(f"<value> should be {str}, {type(value)} given.") <NEW_LINE> <DEDENT> if not value: ... | Provides the interface for the conversion/extration of the network location
of a given URL. | 62599071a8370b77170f1c97 |
class SMPacketServerNSCGSU(SMPacket): <NEW_LINE> <INDENT> command = smcommand.SMServerCommand.NSCGSU <NEW_LINE> _payload = [ (smencoder.SMPayloadType.INT, "section", 1), (smencoder.SMPayloadType.INT, "nb_players", 1), (smencoder.SMPayloadType.MAP, "options", ("section", { 0: (smencoder.SMPayloadType.INTLIST, None, (1, ... | Server command 133 (Scoreboard update)
This will update the client's scoreboard.
:param int section: Which section to update (0: names, 1:combos, 2: grades)
:param int nb_players: Nb of plyaers in this packet
:param list options: Int list contining names, combos or grades
:Example:
>>> from smserver.smutils.smpacke... | 6259907101c39578d7f1439b |
class ImageWatermarkInput(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ImageContent = None <NEW_LINE> self.Width = None <NEW_LINE> self.Height = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.ImageContent = params.get("ImageContent") <NEW_LINE> self... | 图片水印模板输入参数
| 62599071aad79263cf430083 |
class Features(dict): <NEW_LINE> <INDENT> def __init__(self, template_dir, initial_content=None, name=None): <NEW_LINE> <INDENT> super(Features, self).__init__(initial_content or {}) <NEW_LINE> self.name = name <NEW_LINE> self.template_dir = template_dir <NEW_LINE> if 'path' not in self: <NEW_LINE> <INDENT> self['path'... | A dictionary describing the features of a particular API variation. | 625990717047854f46340c84 |
class AsyncMsgError(NetException): <NEW_LINE> <INDENT> def __init__(self, msg=''): <NEW_LINE> <INDENT> super(self.__class__, self).__init__(msg) | cup.net.async异步消息相关的异常Exception类 | 62599071f548e778e596ce5a |
class OCSPError(Exception): <NEW_LINE> <INDENT> pass | Base OCSP Error class | 625990711f037a2d8b9e54d1 |
class Alg(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.required=[] <NEW_LINE> self.b_key = "alg" <NEW_LINE> self.a10_url="/axapi/v3/cgnv6/lsn/alg" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> self.ftp = {} <NEW_LINE> self.sip = {} <NEW_LINE> sel... | Class Description::
Change LSN ALG Settings.
Class alg supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param DeviceProxy: The device proxy for REST operations and session handling. Refer to `common/device_proxy.py`
URL for this object::
`https... | 625990714e4d562566373cd4 |
class MyFavCourseView(LoginRequiredMixin, View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> course_list = [] <NEW_LINE> fav_courses = UserFavorite.objects.filter(user=request.user, fav_type=1) <NEW_LINE> for fav_course in fav_courses: <NEW_LINE> <INDENT> course_id = fav_course.fav_id <NEW_LINE> cou... | 个人中心,我收藏的课程 | 625990717d847024c075dca6 |
class PollForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Poll <NEW_LINE> exclude = ['author', 'created', 'stream'] <NEW_LINE> widgets = { 'due_date': DateWidget(), 'categories': SelectMultipleAndAddWidget(add_url='/categories/add', with_perms=['taxonomy.add_category']), 'tags': Selec... | Form for poll data.
| 62599071097d151d1a2c2940 |
class TagError(Exception): <NEW_LINE> <INDENT> def __init__(self, error_msg=None, status_code=None): <NEW_LINE> <INDENT> super(TagError, self).__init__() <NEW_LINE> self.error_msg = error_msg or self.__class__.__name__ <NEW_LINE> self.status_code = status_code or 400 <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <I... | Generic error for Tags. | 62599071283ffb24f3cf5176 |
class Movie(): <NEW_LINE> <INDENT> def __init__(self, movie_title, movie_storyline, poster_image, trailer_youtube): <NEW_LINE> <INDENT> self.title = movie_title <NEW_LINE> self.storyline = movie_storyline <NEW_LINE> self.poster_image_url = poster_image <NEW_LINE> self.trailer_youtube_url = trailer_youtube <NEW_LINE> <D... | Represents a movie | 6259907144b2445a339b75c5 |
class Weapon(Item): <NEW_LINE> <INDENT> def __init__(self, name, description, weight, attack, cost): <NEW_LINE> <INDENT> Item.__init__(self, name, description, weight) <NEW_LINE> self._attack = attack <NEW_LINE> self._cost = cost <NEW_LINE> <DEDENT> def getAttack(self): <NEW_LINE> <INDENT> return self._attack <NEW_LINE... | A class of weapons. Weapon inherits from Item and has the defining parameter, attack. | 62599071cc0a2c111447c738 |
class SnliData(object): <NEW_LINE> <INDENT> def __init__(self, data_file, word2index, sentence_len_limit=-1): <NEW_LINE> <INDENT> self._labels = [] <NEW_LINE> self._premises = [] <NEW_LINE> self._premise_transitions = [] <NEW_LINE> self._hypotheses = [] <NEW_LINE> self._hypothesis_transitions = [] <NEW_LINE> with open(... | A split of SNLI data. | 6259907160cbc95b063659d5 |
class Connection(models.Model): <NEW_LINE> <INDENT> from_friend = models.ForeignKey(User, related_name = 'friend_set') <NEW_LINE> to_friend = models.ForeignKey(User, related_name = 'friends') | Note: Create two of these objects for each connection | 6259907199fddb7c1ca63a3a |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.