code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Url(namedtuple('Url', url_attrs)): <NEW_LINE> <INDENT> slots = () <NEW_LINE> def __new__(cls, scheme=None, auth=None, host=None, port=None, path=None, query=None, fragment=None): <NEW_LINE> <INDENT> if path and not path.startswith('/'): <NEW_LINE> <INDENT> path = '/' + path <NEW_LINE> <DEDENT> if scheme: <NEW_LIN... | Datastructure for representing an HTTP URL. Used as a return value for
:func:`parse_url`. Both the scheme and host are normalized as they are
both case-insensitive according to RFC 3986. | 62598f977b25080760ed71ad |
class Glog(Package): <NEW_LINE> <INDENT> homepage = "https://github.com/google/glog" <NEW_LINE> url = "https://github.com/google/glog/archive/v0.3.5.tar.gz" <NEW_LINE> version('0.4.0', sha256='f28359aeba12f30d73d9e4711ef356dc842886968112162bc73002645139c39c') <NEW_LINE> version('0.3.5', sha256='7580e408a2c0b5a89ca... | C++ implementation of the Google logging module. | 62598f9745492302aabfc1e3 |
class LearningRateSchedulerLinearDecay(LearningRateScheduler): <NEW_LINE> <INDENT> def __init__(self, base_lr: float, total_steps: int, warmup: int = 0, t_scale: float = 1.0) -> None: <NEW_LINE> <INDENT> super().__init__(base_lr, warmup, t_scale) <NEW_LINE> check_condition(total_steps >= 0, "total_steps need to be >= 0... | Learning rate schedule: lr * (1 - t / total_steps)
Step grows until it reaches decay_steps then remains constant.
This is the schedule used by Devlin et al. in the BERT paper
(https://arxiv.org/pdf/1810.04805.pdf).
:param base_lr: Base learning rate.
:param total_steps: Number of total training updates. The learning... | 62598f97a79ad16197769d6d |
class View(Relation): <NEW_LINE> <INDENT> def __init__(self, sql): <NEW_LINE> <INDENT> super(View, self).__init__() <NEW_LINE> if isinstance(sql, SqlScript): <NEW_LINE> <INDENT> sql = sql.statements[0] <NEW_LINE> <DEDENT> parameters = parse_create_view(sql.sql()) <NEW_LINE> self.sql_statement = sql <NEW_LINE> self.para... | Class representing view in the database
| 62598f9732920d7e50bc5d62 |
class LatentVariableCovarianceSquared(mb_properties.MultiblockFunction, mb_properties.MultiblockGradient, mb_properties.MultiblockLipschitzContinuousGradient): <NEW_LINE> <INDENT> def __init__(self, X, unbiased=True): <NEW_LINE> <INDENT> self.X = X <NEW_LINE> if unbiased: <NEW_LINE> <INDENT> self.n = float(X[0].shape[0... | Represents
Cov(X.w, Y.c)² = ((1 / (n - 1)) * w'.X'.Y.c)²,
where X.w and Y.c are latent variables.
Parameters
----------
X : List with two numpy arrays. The two blocks.
unbiased : Boolean. Whether or not to use biased or unbiased sample
covariance. Default is True, the unbiased sample covariance is
... | 62598f97fff4ab517ebcd4f8 |
class TrainingConfiguration(Configuration): <NEW_LINE> <INDENT> def __init__( self, base_url=None): <NEW_LINE> <INDENT> if not base_url: <NEW_LINE> <INDENT> base_url = 'https://customvisionppe.azure-api.net/v1.0/Training' <NEW_LINE> <DEDENT> super(TrainingConfiguration, self).__init__(base_url) <NEW_LINE> self.add_user... | Configuration for Training
Note that all parameters used to create this instance are saved as instance
attributes.
:param str base_url: Service URL | 62598f97a8ecb03325870f15 |
class DevicesAdmin(object): <NEW_LINE> <INDENT> model_icon = 'fa fa-suitcase' <NEW_LINE> list_display = ('name', 'code',) <NEW_LINE> list_display_links = ('code',) <NEW_LINE> list_filter = ('uid', 'name', 'code', 'owner_id', 'modify_time') <NEW_LINE> search_fields = ('name', 'code') <NEW_LINE> list_export = ('xls', 'xm... | 设备管理的控制主类 | 62598f977047854f4633f0ec |
class KNNWithMeans(SymmetricAlgo): <NEW_LINE> <INDENT> def __init__(self, k=40, min_k=1, sim_options={}, **kwargs): <NEW_LINE> <INDENT> SymmetricAlgo.__init__(self, sim_options=sim_options, **kwargs) <NEW_LINE> self.k = k <NEW_LINE> self.min_k = min_k <NEW_LINE> <DEDENT> def train(self, trainset): <NEW_LINE> <INDENT> S... | A basic collaborative filtering algorithm, taking into account the mean
ratings of each user.
The prediction :math:`\hat{r}_{ui}` is set as:
.. math::
\hat{r}_{ui} = \mu_u + \frac{ \sum\limits_{v \in N^k_i(u)}
\text{sim}(u, v) \cdot (r_{vi} - \mu_v)} {\sum\limits_{v \in
N^k_i(u)} \text{sim}(u, v)}
or
..... | 62598f9782261d6c5272fd5d |
class FasterRCNNResnetV1FeatureExtractor( faster_rcnn_meta_arch.FasterRCNNFeatureExtractor): <NEW_LINE> <INDENT> def __init__(self, architecture, resnet_model, is_training, first_stage_features_stride, batch_norm_trainable=False, reuse_weights=None, weight_decay=0.0): <NEW_LINE> <INDENT> if first_stage_features_stride ... | Faster R-CNN Resnet V1 feature extractor implementation. | 62598f974e4d56256637212e |
class CppProtobufGenerator(object): <NEW_LINE> <INDENT> package = None <NEW_LINE> def __init__(self, opera_root, build_module, module_path, package, dependencies=None): <NEW_LINE> <INDENT> self.package = package <NEW_LINE> self.operaRoot = opera_root <NEW_LINE> self.buildModule = build_module <NEW_LINE> self.modulePath... | Main class for generating cpp/h files from protobuf files.
@param opera_root The root of source code tree.
@param module_path The relative path of the module, relative to opera_root.
@param package The protobuf package to create code for.
@param dependencies Optional list of files the all generated files depends on.
... | 62598f9776e4537e8c3ef2bf |
class CointigerRest(RestSdkAbstract): <NEW_LINE> <INDENT> base_url = 'https://api.cointiger.pro/' <NEW_LINE> _ticker_url = '/exchange/trading/api/market/detail' <NEW_LINE> _depth_url = '/exchange/trading/api/market/depth' <NEW_LINE> _trades_url = '/exchange/trading/api/market/history/trade' <NEW_LINE> _kline_url = '/ex... | doc: https://github.com/cointiger/api-docs/wiki | 62598f978e71fb1e983bb7c0 |
class UserBrowseHistoryView(CreateAPIView): <NEW_LINE> <INDENT> serializer_class = UserBrowseHistorySerializer <NEW_LINE> permission_classes = [IsAuthenticated] <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> user_id = request.user.id <NEW_LINE> redis_conn = get_redis_connection("history") <NEW_LINE> history = r... | 保存用户历史记录 | 62598f97b5575c28eb712b52 |
class AttentionWithContext(Layer): <NEW_LINE> <INDENT> def __init__(self, W_regularizer=None, u_regularizer=None, b_regularizer=None, W_constraint=None, u_constraint=None, b_constraint=None, bias=True, **kwargs): <NEW_LINE> <INDENT> self.supports_masking = True <NEW_LINE> self.init = initializers.get('glorot_uniform') ... | Attention operation, with a context/query vector, for temporal data.
Supports Masking.
Follows the work of Yang et al. [https://www.cs.cmu.edu/~diyiy/docs/naacl16.pdf]
"Hierarchical Attention Networks for Document Classification"
by using a context vector to assist the attention
# Input shape
3D tensor with shape: ... | 62598f970fa83653e46f4bf6 |
class LogisticRegressionClassifier(Learner): <NEW_LINE> <INDENT> name = "logreg" <NEW_LINE> def __init__(self, regularizer=100): <NEW_LINE> <INDENT> self.logistic = linear_model.LogisticRegression(C=regularizer) <NEW_LINE> self._fitCalled = False <NEW_LINE> <DEDENT> def setParams(self, paramSet): <NEW_LINE> <INDENT> se... | This class is a wrapper for the scikit-learn logistic regression implementation.
No need to do anything in this class. | 62598f97adb09d7d5dc0a294 |
class Network(nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Net,self).__init__() <NEW_LINE> self.conv1 = nn.Conv2d(3,6,5) <NEW_LINE> self.pool = nn.MaxPool2d(2, 2) <NEW_LINE> self.conv2 = nn.Conv2d(6,16,5) <NEW_LINE> self.fc1 = nn.Linear(16 * 5 * 5, 120) <NEW_LINE> self.fc2 = nn.Linear(1... | Implement the nueral network architechture and methods | 62598f97435de62698e9bb00 |
class WalletFlow(models.Model): <NEW_LINE> <INDENT> wallet = models.ForeignKey('Wallet', on_delete=True, help_text='钱包') <NEW_LINE> amount = models.IntegerField(default=0, help_text='发生金额') <NEW_LINE> direction = models.BooleanField( default=True, help_text='方向,增加为True,减少为False') <NEW_LINE> create_date = models.DateTim... | #钱包流水明细 | 62598f973eb6a72ae038a349 |
class NonNegativeIntegers(UniqueRepresentation, Parent): <NEW_LINE> <INDENT> def __init__(self, category=None): <NEW_LINE> <INDENT> from sage.rings.integer_ring import ZZ <NEW_LINE> Parent.__init__(self, facade = ZZ, category = InfiniteEnumeratedSets().or_subcategory(category) ) <NEW_LINE> <DEDENT> def _repr_(self): <N... | The enumerated set of non negative integers.
This class implements the set of non negative integers, as an
enumerated set (see :class:`InfiniteEnumeratedSets
<sage.categories.infinite_enumerated_sets.InfiniteEnumeratedSets>`).
EXAMPLES::
sage: NN = NonNegativeIntegers()
sage: NN
Non negative integers
... | 62598f97a05bb46b3848a58b |
class ChoiceUpdateView(generics.RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> queryset = Choice.objects.all() <NEW_LINE> serializer_class = ChoiceSerializer | This class defines the create behavior of our rest api. | 62598f9701c39578d7f12a8b |
class OrderViewSet(ModelViewSet): <NEW_LINE> <INDENT> queryset = Order.objects.all() <NEW_LINE> serializer_class = OrderListSerializer <NEW_LINE> filter_backends = (DjangoFilterBackend,) <NEW_LINE> filterset_fields = ('status', 'customer',) <NEW_LINE> authentication_classes = (TokenAuthentication, SessionAuthentication... | OrderViewSet for reading, writing, updating, delete orders. | 62598f97e64d504609df923d |
class Template(messages.Message): <NEW_LINE> <INDENT> action = messages.MessageField('Action', 1) <NEW_LINE> healthChecks = messages.MessageField('HealthCheck', 2, repeated=True) <NEW_LINE> version = messages.StringField(3) <NEW_LINE> vmParams = messages.MessageField('VmParams', 4) | The template used for creating replicas in the pool.
Fields:
action: An action to run during initialization of your replicas. An action
is run as shell commands which are executed one after the other in the
same bash shell, so any state established by one command is inherited by
later commands.
healthC... | 62598f970a50d4780f7050e4 |
class Solution: <NEW_LINE> <INDENT> def oddEvenList(self, head: ListNode) -> ListNode: <NEW_LINE> <INDENT> if head is None: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> node_idx = 1 <NEW_LINE> node = head <NEW_LINE> even_values, odd_values = [], [] <NEW_LINE> while node: <NEW_LINE> <INDENT> if node_idx % 2 == 0: <NEW... | Bruteforce approach with extra memory.
Runtime: 44 ms, faster than 54.21% of Python3
Memory Usage: 16.4 MB, less than 20.95% of Python3
Time complexity: O(n)
Space complexity: O(n) for storing odd and even values in regular list | 62598f9715baa72349461c8e |
class Downloader(object): <NEW_LINE> <INDENT> def send_request(self, request): <NEW_LINE> <INDENT> if request.method.upper() == "GET": <NEW_LINE> <INDENT> response = requests.get( url=request.url, headers=request.headers, params=request.params, proxies=request.proxy ) <NEW_LINE> <DEDENT> elif request.method.upper() == ... | 框架提供的Downloader下载器原型类,由框架提供方法 请求发送和响应返回 | 62598f970c0af96317c56090 |
class Keyword(Cipher): <NEW_LINE> <INDENT> letters_list = [chr(i) for i in range(65, 91)] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def encrypt(self, text): <NEW_LINE> <INDENT> keyword = input('What keyword would you like to use?') <NEW_LINE> keyword = keyword.upper() <NEW_LINE> new_li... | This is our class of Keyword Cipher. A keyword is used as a key,
and it determines the letter matchings of the cipher alphabet to the
plain alphabet. No alphabets are repeated and the keyword plus the
remaining alphabets are stored in new_list. No alphabet is repeated and
the keyword is appended to the list first and t... | 62598f97097d151d1a2c0d2f |
class SingleRangedAttackHandler(SelectIndexHandler): <NEW_LINE> <INDENT> def __init__( self, engine: Engine, callback: Callable[[Tuple[int, int]], Optional[Action]] ): <NEW_LINE> <INDENT> super().__init__(engine) <NEW_LINE> self.callback = callback <NEW_LINE> <DEDENT> def on_index_selected(self, x: int, y: int) -> Opti... | Handles targeting a single enemy. Only the enemy selected will be affected. | 62598f9707f4c71912baf158 |
class CommandParser(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.functions = {} <NEW_LINE> <DEDENT> def on(self, command, callback): <NEW_LINE> <INDENT> self.functions[command] = callback <NEW_LINE> <DEDENT> def take_command(self, unparsed_command): <NEW_LINE> <INDENT> command_parts = unparsed_co... | docstring for CommandParser | 62598f9730dc7b766599f55e |
class RobustSigma(BaseRiskModel): <NEW_LINE> <INDENT> def __init__(self, Sigma, epsilon, **kwargs): <NEW_LINE> <INDENT> self.Sigma = Sigma <NEW_LINE> self.epsilon = epsilon <NEW_LINE> super(RobustSigma, self).__init__(**kwargs) <NEW_LINE> <DEDENT> def _estimate(self, t, wplus, z, value): <NEW_LINE> <INDENT> testing=loc... | Implements covariance forecast error risk. | 62598f973617ad0b5ee05e5a |
class StorySummaryModel(base_models.BaseModel): <NEW_LINE> <INDENT> title = ndb.StringProperty(required=True, indexed=True) <NEW_LINE> language_code = ndb.StringProperty(required=True, indexed=True) <NEW_LINE> story_model_last_updated = ndb.DateTimeProperty(required=True, indexed=True) <NEW_LINE> story_model_created_on... | Summary model for an Oppia Story.
This should be used whenever the content blob of the story is not
needed (e.g. search results, etc).
A StorySummaryModel instance stores the following information:
id, description, language_code, last_updated, created_on, version.
The key of each instance is the story id. | 62598f97379a373c97d98d20 |
class ModuleDocumenter(Documenter): <NEW_LINE> <INDENT> objtype = 'module' <NEW_LINE> content_indent = u'' <NEW_LINE> option_spec = { 'members': members_option, 'undoc-members': bool_option, 'noindex': bool_option, 'inherited-members': bool_option, 'show-inheritance': bool_option, 'synopsis': identity, 'platform': iden... | Specialized Documenter subclass for modules. | 62598f97a79ad16197769d6f |
class BlueViaOutboundSms(BlueVia): <NEW_LINE> <INDENT> def __init__(self, sandbox = "_Sandbox", realm = "BlueVia", version="v1"): <NEW_LINE> <INDENT> self.environment = sandbox <NEW_LINE> self.realm = realm <NEW_LINE> self.version = version <NEW_LINE> self.outbound_sms_url = "https://api.bluevia.com/services/REST/SMS%... | The BlueVia class for sending and tracking SMS. | 62598f9785dfad0860cbf8fa |
@ddt.ddt <NEW_LINE> @skip_unless_lms <NEW_LINE> class UpdateEmailOptInTestCase(UserAPITestCase, SharedModuleStoreTestCase): <NEW_LINE> <INDENT> USERNAME = "steve" <NEW_LINE> EMAIL = "steve@isawesome.com" <NEW_LINE> PASSWORD = "steveopolis" <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> supe... | Tests the UpdateEmailOptInPreference view. | 62598f9776e4537e8c3ef2c1 |
class LocalResponseNorm(layers.Layer): <NEW_LINE> <INDENT> def __init__(self, size, alpha=0.0001, beta=0.75, k=1.0, data_format="NCHW", name=None): <NEW_LINE> <INDENT> super(LocalResponseNorm, self).__init__() <NEW_LINE> self.size = size <NEW_LINE> self.alpha = alpha <NEW_LINE> self.beta = beta <NEW_LINE> self.k = k <N... | Local Response Normalization performs a type of "lateral inhibition" by normalizing over local input regions.
For more information, please refer to `ImageNet Classification with Deep Convolutional Neural Networks <https://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf>`_
... | 62598f9760cbc95b06364056 |
class Boundary(object): <NEW_LINE> <INDENT> def __init__(self, cell_width, cell_length, boundary_pos): <NEW_LINE> <INDENT> self.pos = boundary_pos <NEW_LINE> self.cw = cell_width <NEW_LINE> self.cl = cell_length <NEW_LINE> if self.pos in ('W', 'N'): <NEW_LINE> <INDENT> self.postype = 'upstream' <NEW_LINE> <DEDENT> elif... | A boundary of the computation domain
Privilegied access is through get_boundary_flow() | 62598f9732920d7e50bc5d65 |
class HidApiUSB(Interface): <NEW_LINE> <INDENT> vid = 0 <NEW_LINE> pid = 0 <NEW_LINE> isAvailable = isAvailable <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.device = None <NEW_LINE> <DEDENT> def open(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def getAllConnectedInterface(vid... | This class provides basic functions to access
a USB HID device using cython-hidapi:
- write/read an endpoint | 62598f97b5575c28eb712b53 |
class MetricBase(object): <NEW_LINE> <INDENT> _language = None <NEW_LINE> _metrics = None <NEW_LINE> def __init__(self, *args, **kwds ): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def process_token(self, token): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT>... | Metric template class. | 62598f9755399d3f0562622d |
class BulkOfferHandler(RepoBaseHandler): <NEW_LINE> <INDENT> METHOD_ACCESS = { "POST": RepoBaseHandler.READ_ACCESS, "OPTIONS": RepoBaseHandler.READ_ACCESS } <NEW_LINE> @gen.coroutine <NEW_LINE> def post(self, repository_id): <NEW_LINE> <INDENT> body = _unique_ids(self.get_json_body()) <NEW_LINE> try: <NEW_LINE> <INDENT... | Handler for offers | 62598f970a50d4780f7050e5 |
class OmnisciOnRayFrameManager(RayFrameManager): <NEW_LINE> <INDENT> _partition_class = OmnisciOnRayFramePartition <NEW_LINE> _column_partitions_class = OmnisciOnRayFrameColumnPartition <NEW_LINE> _row_partition_class = OmnisciOnRayFrameRowPartition <NEW_LINE> @classmethod <NEW_LINE> def _compute_num_partitions(cls): <... | This method implements the interface in `BaseFrameManager`. | 62598f97bd1bec0571e14f4b |
@registry.expose(["Order", "WithExpiry"]) <NEW_LINE> class side_WithExpiry_FloatSideIObservableIOrder(IFunctionIObservableIOrderIFunctionSide): <NEW_LINE> <INDENT> def __init__(self, expiry = None, proto = None): <NEW_LINE> <INDENT> from marketsim.gen._out._constant import constant_Float as _constant_Float <NEW_LINE> f... | WithExpiry orders can be viewed as ImmediateOrCancel orders
where cancel order is sent not immediately but after some delay | 62598f978e71fb1e983bb7c3 |
class PWMSteering: <NEW_LINE> <INDENT> LEFT_ANGLE = -1 <NEW_LINE> RIGHT_ANGLE = 1 <NEW_LINE> def __init__(self, controller=None, left_pulse=290, right_pulse=490): <NEW_LINE> <INDENT> self.controller = controller <NEW_LINE> self.left_pulse = left_pulse <NEW_LINE> self.right_pulse = right_pulse <NEW_LINE> <DEDENT> def ru... | Wrapper over a PWM motor cotnroller to convert angles to PWM pulses. | 62598f97e76e3b2f99fd8742 |
class ConfigureDialog(QDialog): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> QDialog.__init__(self, parent) <NEW_LINE> self._ui = Ui_ConfigureDialog() <NEW_LINE> self._ui.setupUi(self) <NEW_LINE> self._makeConnections() <NEW_LINE> <DEDENT> def _makeConnections(self): <NEW_LINE> <INDENT> self... | Configure dialog to present the user with the options to configure this step. | 62598f970a50d4780f7050e6 |
class BaseConfig(object): <NEW_LINE> <INDENT> APP_NAME = "Application name" <NEW_LINE> SECRET_KEY = "Change this SECRET_KEY, because it's not secret anymore." <NEW_LINE> ADMINS = frozenset(['admin@example.com']) <NEW_LINE> DEBUG = False <NEW_LINE> DEBUG_TB_ENABLED = False <NEW_LINE> PROPAGATE_EXCEPTIONS = False <NEW_LI... | Base configuration. | 62598f97cb5e8a47e493bffb |
class ProfileFeedItemSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = models.ProfileFeedItem <NEW_LINE> fields = ('id', 'user_profile', 'status_text', 'created_on') <NEW_LINE> extra_kwargs = {'user_profile': {'read_only': True}} | serializes profile feed | 62598f979c8ee8231303fff6 |
class Change: <NEW_LINE> <INDENT> def __init__(self, old_version, old_revno, new_version, new_revno, date_new, diff, changelogs): <NEW_LINE> <INDENT> self.old_version = old_version <NEW_LINE> self.old_revno = old_revno <NEW_LINE> self.new_version = new_version <NEW_LINE> self.new_revno = new_revno <NEW_LINE> self.build... | Change contains the changes from old_version to new version | 62598f970c0af96317c56092 |
class ErrorHandler(commands.Cog): <NEW_LINE> <INDENT> def __init__(self, bot: Ryan) -> None: <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> <DEDENT> @commands.Cog.listener() <NEW_LINE> async def on_command_error(self, ctx: commands.Context, error: Exception) -> None: <NEW_LINE> <INDENT> original_exception = getattr(erro... | Generic error handler. | 62598f9707f4c71912baf15a |
class Tag(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length = 225) <NEW_LINE> user = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete = models.CASCADE, ) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name | Tag to be used for a recipe | 62598f97be383301e025350a |
class DeleteAclSubCommand(CommonContainerSubCommand): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__("delete-acl") <NEW_LINE> self.principal = FormattedParameter("--principal={}") | Defines an object for the daos container delete-acl command. | 62598f9771ff763f4b5e7487 |
class Meta: <NEW_LINE> <INDENT> abstract = True | The meta option class for BaseProject | 62598f9796565a6dacd2ce01 |
class EncodingPodsViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = EncodingPods.objects.all() <NEW_LINE> serializer_class = EncodingPodsSerializer | API endpoint that allows encoding to be viewed or edited. | 62598f973617ad0b5ee05e5c |
class EditUserForm(FlaskForm): <NEW_LINE> <INDENT> username = StringField('Username', validators=[DataRequired()]) <NEW_LINE> email = StringField('E-mail', validators=[DataRequired(), Email()]) <NEW_LINE> name = StringField("Full Name") <NEW_LINE> weight = IntegerField("Weight (in pounds)") <NEW_LINE> user_image = Stri... | Form for editing user information | 62598f97379a373c97d98d21 |
class Navigation(NavigationToolbar2WxAgg): <NEW_LINE> <INDENT> def __init__(self, canvas, axes): <NEW_LINE> <INDENT> NavigationToolbar2WxAgg.__init__(self, canvas) <NEW_LINE> self.pan() <NEW_LINE> self.canvas = canvas <NEW_LINE> self.axes = axes <NEW_LINE> self.setup_lines() <NEW_LINE> <DEDENT> def setup_lines(self): <... | Subclass of MPL Navigation toolbar.
Created to add custom cursor over pan/zoom | 62598f97507cdc57c63a4aa3 |
class GameEngine: <NEW_LINE> <INDENT> def move(self, direction, world): <NEW_LINE> <INDENT> x, y = world.worker_pos[0] <NEW_LINE> if direction == Dir.UP: <NEW_LINE> <INDENT> next_pos = (x, y - 1) <NEW_LINE> push_pos = (x, y - 2) <NEW_LINE> <DEDENT> elif direction == Dir.DN: <NEW_LINE> <INDENT> next_pos = (x, y + 1) <NE... | Rules engine, decides what is possible with the world.
Rules:
* Worker cannot move into a wall
* Worker can only push 1 box at a time
Also provides method to check if player has won. | 62598f97009cb60464d01233 |
class MSItemList(ItemList): <NEW_LINE> <INDENT> _log_name = 'neolib.item.MSItemList' <NEW_LINE> def buy(self): <NEW_LINE> <INDENT> successful = [] <NEW_LINE> for item in self.data: <NEW_LINE> <INDENT> if item.buy(): <NEW_LINE> <INDENT> successful.append(item) <NEW_LINE> <DEDENT> <DEDENT> return successful <NEW_LINE> <D... | Represents a list of items returned from querying a main shop | 62598f9763d6d428bbee24cc |
class BashOperator(BaseOperator): <NEW_LINE> <INDENT> template_fields = ('bash_command', 'env') <NEW_LINE> template_ext = ('.sh', '.bash',) <NEW_LINE> ui_color = '#f0ede4' <NEW_LINE> @apply_defaults <NEW_LINE> def __init__( self, bash_command, xcom_push=False, env=None, output_encoding='utf-8', *args, **kwargs): <NEW_L... | Execute a Bash script, command or set of commands.
:param bash_command: The command, set of commands or reference to a
bash script (must be '.sh') to be executed.
:type bash_command: string
:param xcom_push: If xcom_push is True, the last line written to stdout
will also be pushed to an XCom when the bash comm... | 62598f97462c4b4f79dbb718 |
class AsyncCallable(QtCore.QRunnable): <NEW_LINE> <INDENT> def __init__(self, fn, *args, **kwargs): <NEW_LINE> <INDENT> super(AsyncCallable, self).__init__() <NEW_LINE> self.signals = AsyncSignals() <NEW_LINE> self.fn = fn <NEW_LINE> self.args = args <NEW_LINE> self.kwargs = kwargs <NEW_LINE> self.running = False <NEW_... | Async function executor | 62598f977b25080760ed71b1 |
class ThreePlusThree(DoseFindingTrial): <NEW_LINE> <INDENT> def __init__(self, num_doses): <NEW_LINE> <INDENT> DoseFindingTrial.__init__(self, first_dose=1, num_doses=num_doses, max_size=6*num_doses) <NEW_LINE> self.num_doses = num_doses <NEW_LINE> self.cohort_size = 3 <NEW_LINE> self._continue = True <NEW_LINE> <DEDEN... | This is an object-oriented attempt at the 3+3 trial design.
e.g. general usage
>>> trial = ThreePlusThree(5)
>>> trial.next_dose()
1
>>> trial.update([(1,0), (1,0), (1,0)])
2
>>> trial.has_more()
True
>>> trial.update([(2,1), (2,0), (2,0)])
2
>>> trial.has_more()
True
>>> trial.update([(2,0), (2,0), (2,0)])
3
>>> tria... | 62598f977cff6e4e811b572d |
class ListToDictSerializer(ListSerializer): <NEW_LINE> <INDENT> default_error_messages = [] <NEW_LINE> @property <NEW_LINE> def data(self): <NEW_LINE> <INDENT> return super(ListSerializer, self).data <NEW_LINE> <DEDENT> def to_representation(self, value): <NEW_LINE> <INDENT> result_list = super( ListToDictSerializer, s... | This is how the DRF 3.x works. For many=True case it automatically
returns a "List" serializer instead of original one
(__new__ method is overriden). Thus, we need to teach it to work with
{<prop_name>: <prop_value>,...} dict instead of standard
[{'name': <prop_name>, 'value': <prop_value>}...]. | 62598f97498bea3a75a5782f |
class AccountSuspendedError(Exception): <NEW_LINE> <INDENT> pass | The account being accessed has been suspended. | 62598f9745492302aabfc1e8 |
class ChangeList(object): <NEW_LINE> <INDENT> def __init__(self, project, project_dir, fetch, commit_sha1, commit, change_list): <NEW_LINE> <INDENT> self.project = project <NEW_LINE> self.project_dir = project_dir <NEW_LINE> self.number = change_list['_number'] <NEW_LINE> self.fetch = fetch <NEW_LINE> self.fetch_url = ... | A ChangeList to be checked out. | 62598f9763b5f9789fe84e85 |
class Version(Entry): <NEW_LINE> <INDENT> PREFIX = 'version' <NEW_LINE> def serialize(self, content): <NEW_LINE> <INDENT> return content.json().encode('utf-8') <NEW_LINE> <DEDENT> def deserialize(self, content): <NEW_LINE> <INDENT> return VersionStruct.from_json(content.decode('utf-8')) <NEW_LINE> <DEDENT> def sub_entr... | Processes Versions, keyed by version | 62598f97f8510a7c17d7dfff |
class Float32(metaclass=Metaclass): <NEW_LINE> <INDENT> __slots__ = [ '_data', ] <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> assert all(['_' + key in self.__slots__ for key in kwargs.keys()]), 'Invalid arguments passed to constructor: %r' % kwargs.keys() <NEW_LINE> self.data = kwargs.get('da... | Message class 'Float32'. | 62598f976e29344779b0036a |
class Svg2ModExportLatest(Svg2ModExportPretty): <NEW_LINE> <INDENT> layer_map = { 'F.Cu' : "F.Cu", 'B.Cu' : "B.Cu", 'F.Adhes' : "F.Adhes", 'B.Adhes' : "B.Adhes", 'F.Paste' : "F.Paste", 'B.Paste' : "B.Paste", 'F.SilkS' : "F.SilkS", 'B.SilkS' : "B.SilkS", 'F.Mask' : "F.Mask", 'B.Mask' : "B.Mask", 'Dwgs.User' : "D... | This provides functionality for the newer kicad
"pretty" footprint file formats introduced in kicad v6.
It is a child of Svg2ModExport. | 62598f977047854f4633f0f0 |
class ItemCalificacionCurso(ItemCalificacion): <NEW_LINE> <INDENT> curso = models.ForeignKey("rubricas.Curso", null=False, on_delete=models.CASCADE) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.nombre + " (" + str(self.peso) + "%) --> " + str(self.rubrica) + " / " + str(self.curso) <NEW_LINE> <DEDENT> ... | Esta clase sirve para representar un ítem de calificación dentro de un curso. | 62598f9799cbb53fe6830be0 |
class LotAuctionPeriod(Period): <NEW_LINE> <INDENT> @serializable(serialize_when_none=False) <NEW_LINE> def shouldStartAfter(self): <NEW_LINE> <INDENT> if self.endDate: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> tender = get_tender(self) <NEW_LINE> lot = self.__parent__ <NEW_LINE> if tender.status not in ['active.t... | The auction period. | 62598f97b5575c28eb712b54 |
class ReadabilityOAuth(BaseOAuth1): <NEW_LINE> <INDENT> name = 'readability' <NEW_LINE> ID_KEY = 'username' <NEW_LINE> AUTHORIZATION_URL = f'{READABILITY_API}/oauth/authorize/' <NEW_LINE> REQUEST_TOKEN_URL = f'{READABILITY_API}/oauth/request_token/' <NEW_LINE> ACCESS_TOKEN_URL = f'{READABILITY_API}/oauth/access_token/'... | Readability OAuth authentication backend | 62598f97adb09d7d5dc0a298 |
class Container(FileSystemEntity): <NEW_LINE> <INDENT> def __init__(self, entity_type, name, path): <NEW_LINE> <INDENT> FileSystemEntity.__init__(self, entity_type, name, path) <NEW_LINE> self._children = {} <NEW_LINE> <DEDENT> def get_child(self, name): <NEW_LINE> <INDENT> return self._children[name] <NEW_LINE> <DEDEN... | Containers may contain zero to many other entities. | 62598f97b57a9660fecd178c |
class Restaurante(): <NEW_LINE> <INDENT> def __init__(self, nome, cozinha): <NEW_LINE> <INDENT> self.nome = nome <NEW_LINE> self.cozinha = cozinha <NEW_LINE> self.num_atendimento = 0 <NEW_LINE> <DEDENT> def descricao(self): <NEW_LINE> <INDENT> print(f'\nNome do restaurante: {self.nome}') <NEW_LINE> print(f'Tipo de cozi... | Uma classe para descrever restauranes. | 62598f9701c39578d7f12a8f |
class _Request(object): <NEW_LINE> <INDENT> def __init__(self, connection): <NEW_LINE> <INDENT> self.connection = connection <NEW_LINE> self.client = requests.Session() <NEW_LINE> self.timeout = connection.timeout <NEW_LINE> if self.connection.auth: <NEW_LINE> <INDENT> self.client.auth = self.connection.auth <NEW_LINE>... | Issues requests to the collections API | 62598f9701c39578d7f12a90 |
class Reader(QThread): <NEW_LINE> <INDENT> debug = False <NEW_LINE> def __init__(self, device, data, parent=None): <NEW_LINE> <INDENT> QThread.__init__(self, parent) <NEW_LINE> self.state = 'Stopped' <NEW_LINE> self.n = 0 <NEW_LINE> self.device = device <NEW_LINE> self.data = data <NEW_LINE> <DEDENT> def set_state(self... | Base class for reading data | 62598f97d58c6744b42dc158 |
class EdgeType(object): <NEW_LINE> <INDENT> LINK = 'link' <NEW_LINE> INTERNAL_LINK = 'internal_link' | Edges Type for Network graph | 62598f9767a9b606de545ce4 |
class LogTimer: <NEW_LINE> <INDENT> def __init__(self, period): <NEW_LINE> <INDENT> self._period = period <NEW_LINE> self._last_emit = time() <NEW_LINE> <DEDENT> def __call__(self): <NEW_LINE> <INDENT> current = time() <NEW_LINE> if current > self._last_emit + self._period: <NEW_LINE> <INDENT> self._last_emit = current... | Utility for periodically emitting logs. Example:
lt = LogTimer(2)
while True:
if lt():
log("This is logged every 2 sec") | 62598f975f7d997b871f9265 |
class CmdWall(COMMAND_DEFAULT_CLASS): <NEW_LINE> <INDENT> key = "@wall" <NEW_LINE> locks = "cmd:perm(wall) or perm(Admin)" <NEW_LINE> help_category = "Admin" <NEW_LINE> def func(self): <NEW_LINE> <INDENT> if not self.args: <NEW_LINE> <INDENT> self.caller.msg("Usage: @wall <message>") <NEW_LINE> return <NEW_LINE> <DEDEN... | make an announcement to all
Usage:
@wall <message>
Announces a message to all connected sessions
including all currently unlogged in. | 62598f972c8b7c6e89bd34df |
class BaseSchemaCollection(BaseSchema, ABC): <NEW_LINE> <INDENT> def __init__(self, fully_qualified_name: str, schema_loader: SchemaLoader, nested_schema_attribute: str) -> None: <NEW_LINE> <INDENT> self._nested_item_attribute = nested_schema_attribute <NEW_LINE> super().__init__(fully_qualified_name, schema_loader) <N... | Base class for schema that contain nested schema | 62598f97097d151d1a2c0d33 |
class SystemModel(models.Model, PyFuzzyMixin): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> app_label = 'fuzzy_modeling' <NEW_LINE> <DEDENT> name = models.CharField(_("Name"), blank=False, null=False, max_length=250) <NEW_LINE> description = models.TextField(_("Description")) <NEW_LINE> user = models.ForeignKey(... | A Fuzzy system model | 62598f978e7ae83300ee8dad |
class MeshReactionRateTallyTestHarness(TestHarness): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(MeshReactionRateTallyTestHarness, self).__init__() <NEW_LINE> self.input_set = SimpleLatticeInput() <NEW_LINE> self.spacing = 0.12 <NEW_LINE> <DEDENT> def _run_openmoc(self): <NEW_LINE> <INDENT> super(... | An eigenvalue calculation with a mesh tally of the fission rates
using the openmoc.process module. | 62598f97d6c5a102081e1e54 |
class ClassifierBestDiverseSelector(Component): <NEW_LINE> <INDENT> @trace <NEW_LINE> def __init__( self, diversity_metric_type=None, learners_selection_proportion=0.5, validation_dataset_proportion=0.3, **params): <NEW_LINE> <INDENT> self.diversity_metric_type = diversity_metric_type <NEW_LINE> self.learners_selection... | **Description**
Combines the models whose predictions are as diverse as possible.
:param diversity_metric_type: The metric type to be used to find the
diversity among base learners.
:param learners_selection_proportion: The proportion of best base learners
to be selected. The range is 0.0-1.0.
:param val... | 62598f9799cbb53fe6830be1 |
class ProjectCommentListResponse(messages.Message): <NEW_LINE> <INDENT> items = messages.MessageField( CommentResponseMessage, 1, repeated=True) <NEW_LINE> video_comments = messages.MessageField( VideoCommentResponseMessage, 2, repeated=True) <NEW_LINE> is_list = messages.BooleanField(3) | Message to represent a list of root-level comments | 62598f97379a373c97d98d24 |
class ParameterDefinitionMapping(ExportMapping): <NEW_LINE> <INDENT> MAP_TYPE = "ParameterDefinition" <NEW_LINE> def add_query_columns(self, db_map, query): <NEW_LINE> <INDENT> return query.add_columns( db_map.parameter_definition_sq.c.id.label("parameter_definition_id"), db_map.parameter_definition_sq.c.name.label("pa... | Maps parameter definitions.
Cannot be used as the topmost mapping; must have an entity class mapping as one of parents. | 62598f97507cdc57c63a4aa5 |
class CategoryPieChart(FigureCanvas): <NEW_LINE> <INDENT> colors = ['b', 'g', 'r', 'c', 'm', 'y', "indigo", "limegreen", "pink"] <NEW_LINE> def __init__(self, categoryStatistics): <NEW_LINE> <INDENT> self.categoryStatistics = categoryStatistics <NEW_LINE> self.addFigure() <NEW_LINE> FigureCanvas.__init__(self, self.fig... | Represents the Pie Chart of the Category Values | 62598f97009cb60464d01235 |
class ConstraintAction(SemanticAction): <NEW_LINE> <INDENT> def __init__(self, built_in = False, is_tag = False): <NEW_LINE> <INDENT> self.built_in = built_in <NEW_LINE> if is_tag: <NEW_LINE> <INDENT> self.constr_type = ConstraintType.Tag <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.constr_type = ConstraintType.V... | Returns evaluated constraint type | 62598f97dd821e528d6d8c45 |
class Json(BaseOutput): <NEW_LINE> <INDENT> name = "JSON" <NEW_LINE> def __init__(self, document): <NEW_LINE> <INDENT> BaseOutput.__init__(self, document) <NEW_LINE> self.renderer = WhitespaceRemovingRenderer(document.source, ReferenceTransformer) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_options(cls): <NEW_L... | dmr output format class to write JSON output. Note that this
output format is lossy; text formatting (e.g., emphasis, etc.) is
discarded. | 62598f9794891a1f408b9579 |
class LiveServer(object): <NEW_LINE> <INDENT> def __init__(self, addr): <NEW_LINE> <INDENT> from django.db import connections <NEW_LINE> from django.test.testcases import LiveServerThread <NEW_LINE> connections_override = {} <NEW_LINE> for conn in connections.all(): <NEW_LINE> <INDENT> if (conn.settings_dict['ENGINE'] ... | The liveserver fixture
This is the object which is returned to the actual user when they
request the ``live_server`` fixture. The fixture handles creation
and stopping however. | 62598f97442bda511e95c176 |
class CleanUpChecks: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> from zope.testing.cleanup import addCleanUp <NEW_LINE> self._testThatCalledCleanUp = {} <NEW_LINE> self._current_test = None <NEW_LINE> addCleanUp(self.doCleanUp) <NEW_LINE> <DEDENT> def doCleanUp(self): <NEW_LINE> <INDENT> assert self._cu... | Try to detect unit tests that perform placeless setup, but not teardown.
The check actually counts the number of times CleanUp().cleanUp() is called
during the setup, test itself, and teardown. Since both placelessSetUp
and placelessTearDown call CleanUp().cleanUp(), we expect to see at least
two cleanups during that... | 62598f9723849d37ff850dd7 |
class InvalidVirtualHostError(Exception): <NEW_LINE> <INDENT> pass | Thrown when a commit is attempted on an invalid virtual host. | 62598f97498bea3a75a57831 |
class Project(models.Model): <NEW_LINE> <INDENT> id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) <NEW_LINE> name = models.CharField(max_length=200) <NEW_LINE> purpose = MarkupField( blank=True, markup_type='markdown', escape_html=True, ) <NEW_LINE> vision = MarkupField( blank=True, markup_ty... | Project is for any multi-step thing that needs to be done. Tasks
will be associated with it. | 62598f976aa9bd52df0d4bde |
class AuthenticationMethod(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> NONE = "None" <NEW_LINE> CASSANDRA = "Cassandra" <NEW_LINE> LDAP = "Ldap" | Which authentication method Cassandra should use to authenticate clients. 'None' turns off
authentication, so should not be used except in emergencies. 'Cassandra' is the default
password based authentication. The default is 'Cassandra'. 'Ldap' is in preview. | 62598f97009cb60464d01236 |
class getPasswordCredential_args(object): <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'tokenId', 'UTF8', None, ), (2, TType.STRING, 'gatewayId', 'UTF8', None, ), ) <NEW_LINE> def __init__(self, tokenId=None, gatewayId=None,): <NEW_LINE> <INDENT> self.tokenId = tokenId <NEW_LINE> self.gatewayId = gateway... | Attributes:
- tokenId
- gatewayId | 62598f97090684286d593561 |
class MapJavaExportedSymbols(Task): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def product_types(cls): <NEW_LINE> <INDENT> return [ 'java_source_to_exported_symbols', ] <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def prepare(cls, options, round_manager): <NEW_LINE> <INDENT> round_manager.require_data('java') <NEW_LINE... | A naive map of java sources to the symbols they export.
We just assume that each java source file represents a single symbol
defined by the directory structure (from the source root) and terminating in the name of the
file with '.java' stripped off. | 62598f97a8ecb03325870f1b |
class StatusTextType(Enum): <NEW_LINE> <INDENT> DEBUG = 0 <NEW_LINE> INFO = 1 <NEW_LINE> NOTICE = 2 <NEW_LINE> WARNING = 3 <NEW_LINE> ERROR = 4 <NEW_LINE> CRITICAL = 5 <NEW_LINE> ALERT = 6 <NEW_LINE> EMERGENCY = 7 <NEW_LINE> def translate_to_rpc(self): <NEW_LINE> <INDENT> if self == StatusTextType.DEBUG: <NEW_LINE> <IN... | Status types.
Values
------
DEBUG
Debug
INFO
Information
NOTICE
Notice
WARNING
Warning
ERROR
Error
CRITICAL
Critical
ALERT
Alert
EMERGENCY
Emergency | 62598f976e29344779b0036c |
@pytest.mark.draft <NEW_LINE> @pytest.mark.components <NEW_LINE> @pytest.allure.story('Configurations') <NEW_LINE> @pytest.allure.feature('GET') <NEW_LINE> class Test_PFE_Components(object): <NEW_LINE> <INDENT> @pytest.allure.link('https://jira.qumu.com/browse/TC-43038') <NEW_LINE> @pytest.mark.Configurations <NEW_LINE... | PFE Configurations test cases. | 62598f97bde94217f37074f2 |
class Admin(Base): <NEW_LINE> <INDENT> __tablename__ = "admin" <NEW_LINE> username = sa.Column(sa.Unicode(120), primary_key=True, nullable=False) <NEW_LINE> password = sa.Column(sa.Unicode(255)) <NEW_LINE> email = sa.Column(sa.Unicode(255)) | The administrators for managing the system.
Certain realms can be defined to be administrative realms in addition | 62598f978c0ade5d55dc3517 |
class SkippedAction(Action): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(TestTimeout.SkippedAction, self).__init__() <NEW_LINE> self.name = "passing-action" <NEW_LINE> self.summary = "fake action without adjuvant" <NEW_LINE> self.description = "fake action runs without calling adjuvant" <NEW_LINE>... | Isolated test action which must not be run | 62598f97004d5f362081ee85 |
class TestAdminApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = swagger_client.api.admin_api.AdminApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_v2_admin_usage_get(self): <NEW_LINE> <INDENT> pass | AdminApi unit test stubs | 62598f97adb09d7d5dc0a29a |
class Factory(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=30) <NEW_LINE> location = models.ForeignKey(Address, null=True, blank=True) <NEW_LINE> company = models.ForeignKey(Company) <NEW_LINE> created_at = models.DateTimeField(auto_now_add=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT... | docstring for Factory | 62598f970a50d4780f7050e9 |
class CommandableServicer(object): <NEW_LINE> <INDENT> def invoke(self, request, context): <NEW_LINE> <INDENT> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!') | The commandable service definition.
| 62598f97a05bb46b3848a591 |
class label(item): <NEW_LINE> <INDENT> def __init__(self, sString): <NEW_LINE> <INDENT> item.__init__(self, sString) | unique_id = parser : label | 62598f97cb5e8a47e493bffd |
class classinstancemethod(object): <NEW_LINE> <INDENT> def __init__(self, func): <NEW_LINE> <INDENT> self.func = func <NEW_LINE> self.__doc__ = func.__doc__ <NEW_LINE> <DEDENT> def __get__(self, obj, type=None): <NEW_LINE> <INDENT> return _methodwrapper(self.func, obj=obj, type=type) | Acts like a class method when called from a class, like an
instance method when called by an instance. The method should
take two arguments, 'self' and 'cls'; one of these will be None
depending on how the method was called. | 62598f9701c39578d7f12a92 |
class StepperPositionChangeEventArgs: <NEW_LINE> <INDENT> def __init__(self, device, index, position): <NEW_LINE> <INDENT> self.device = device <NEW_LINE> self.index = index <NEW_LINE> self.position = position | Stepper Position Change Event data and information will be stored in this class.
Data specific to this event args class are the index of the stepper motor whose position is changing and the position value read.
Properties:
device<object>: Reference to the Phidget object from which this event originated
index<... | 62598f9701c39578d7f12a91 |
class TrickyDefector(Player): <NEW_LINE> <INDENT> name = "Tricky Defector" <NEW_LINE> def strategy(self, opponent): <NEW_LINE> <INDENT> if 'C' in opponent.history and opponent.history[-3:] == ['D']*3: <NEW_LINE> <INDENT> return 'C' <NEW_LINE> <DEDENT> return 'D' | A defector that is trying to be tricky. | 62598f9767a9b606de545ce6 |
class OrderedEnqueuer(SequenceEnqueuer): <NEW_LINE> <INDENT> def __init__(self, sequence, use_multiprocessing=False, shuffle=False): <NEW_LINE> <INDENT> self.sequence = sequence <NEW_LINE> self.use_multiprocessing = use_multiprocessing <NEW_LINE> self.shuffle = shuffle <NEW_LINE> self.workers = 0 <NEW_LINE> self.execut... | Builds a Enqueuer from a Sequence.
Used in `fit_generator`, `evaluate_generator`, `predict_generator`.
# Arguments
sequence: A `keras.utils.data_utils.Sequence` object.
use_multiprocessing: use multiprocessing if True, otherwise threading
shuffle: whether to shuffle the data at the beginning of each epoch | 62598f979c8ee8231303fff8 |
class DevConfig(DefaultConfig): <NEW_LINE> <INDENT> CELERY_RESULT_BACKEND = 'rpc://' <NEW_LINE> CELERY_BROKER_URL = 'amqp://admin:pass@rabbit:5672' | Development Configuration | 62598f970c0af96317c56095 |
class Protocol(object): <NEW_LINE> <INDENT> def request(self, request, callback_url): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def callback(self, request): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def logout(self, request): <NEW_LINE> <INDENT> auth.logout(request) | The interface for an authority that provides authentication hooks. | 62598f973617ad0b5ee05e60 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.