code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class NeutronNsxRouterMapping(model_base.BASEV2): <NEW_LINE> <INDENT> __tablename__ = 'neutron_nsx_router_mappings' <NEW_LINE> neutron_id = Column(String(36), ForeignKey('routers.id', ondelete='CASCADE'), primary_key=True) <NEW_LINE> nsx_id = Column(String(36)) | Maps neutron router identifiers to NSX identifiers. | 62598eeb2c8b7c6e89bd1ef2 |
class CellInfo: <NEW_LINE> <INDENT> def __init__(self, cell : openpyxl.cell.Cell, topleftCell: openpyxl.cell.Cell, rowSize: int, colSize: int): <NEW_LINE> <INDENT> self.mCell = cell <NEW_LINE> self.mTopLeftCell = topleftCell <NEW_LINE> self.mRowSize, self.mColumnSize = rowSize, colSize <NEW_LINE> <DEDENT> def __eq__(se... | Cell info for cell in merged cell area or single cell. | 62598eebbd1bec0571e14462 |
class VumiGoError(Exception): <NEW_LINE> <INDENT> pass | An error raised by Vumi Go. | 62598eeba219f33f346c4f6c |
class TestTraining(unittest.TestCase): <NEW_LINE> <INDENT> @patch('sagemaker_containers.beta.framework.modules.run_module') <NEW_LINE> def test_script_mode(self, mock_run_module): <NEW_LINE> <INDENT> env = mock_training_env() <NEW_LINE> env.user_entry_point = "dummy_entry_point" <NEW_LINE> training.train(env) <NEW_LINE... | Note: The 'train' method has been mocked since this test only checks the training resource setup | 62598eeb2ae34c7f260a9819 |
class SetObjectValueOperation(Operation): <NEW_LINE> <INDENT> label = _('Set value to') <NEW_LINE> def setup(self, other_fields): <NEW_LINE> <INDENT> table = self._field._reference_class <NEW_LINE> data = self._store.find((self._field.get_search_spec(), table)) <NEW_LINE> self.combo = self.add_combo([(_('Erase value'),... | An operation that sets a field to a specifc value.
This works only for object values. | 62598eeb97e22403b3839621 |
class Discard(Animate): <NEW_LINE> <INDENT> TAG_NAME = 'discard' <NEW_LINE> def __init__(self, attributeName, begin=None, **kwargs): <NEW_LINE> <INDENT> kwargs.setdefault('attributeName', None) <NEW_LINE> kwargs.setdefault('to', None) <NEW_LINE> kwargs.setdefault('dur', None) <NEW_LINE> super().__init__(from_or_values=... | Animation configuration specifying when it is safe to discard another
element. E.g. when it will no longer be visible after an animation.
This should be added as a child of the element to animate. Otherwise
the other element and this element must both be added to the drawing. | 62598eeb30bbd72246468365 |
class Relation(models.Model): <NEW_LINE> <INDENT> RELATION_TYPE_FOLLOWING = 'f' <NEW_LINE> RELATION_TYPE_BLOCK = 'b' <NEW_LINE> CHOICES_TYPE = ( (RELATION_TYPE_FOLLOWING, '팔로잉'), (RELATION_TYPE_BLOCK, '차단'), ) <NEW_LINE> from_user = models.ForeignKey( TwitterUser, on_delete=models.CASCADE, related_name='relations_by_fr... | relation b/w users
not only MTM of itself, but also intermediate
additional receiving info is a type of relations | 62598eeb3346ee7daa336a01 |
class AndCondition(ConjunctionCondition): <NEW_LINE> <INDENT> def getOperator(self): <NEW_LINE> <INDENT> return "AND" | AND 连接对象 | 62598eeb7047854f4633db05 |
class UCB1Policy(Policy): <NEW_LINE> <INDENT> def __init__(self, num_arms): <NEW_LINE> <INDENT> self.num_arms = num_arms <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self.step = 0 <NEW_LINE> self.num_selected = np.zeros(self.num_arms) <NEW_LINE> self.sum_of_rewards = np.zeros(self.num_arms) <NEW_LINE> self.... | Upper Confidence Bound Algorithm (UCB1) for non-contextual multi-armed bandit
For contextual bandit, UCB1 will simply ignore the context | 62598eeba8370b77170eeb16 |
class Solution: <NEW_LINE> <INDENT> def setUnion(self, sets): <NEW_LINE> <INDENT> uf = UnionFind() <NEW_LINE> for nums in sets: <NEW_LINE> <INDENT> for num in nums: <NEW_LINE> <INDENT> uf.add(num) <NEW_LINE> <DEDENT> for i in range(1, len(nums)): <NEW_LINE> <INDENT> uf.union(nums[i], nums[i-1]) <NEW_LINE> <DEDENT> <DED... | @param sets: Initial set list
@return: The final number of sets | 62598eeb4428ac0f6e656c85 |
class ShowProcess: <NEW_LINE> <INDENT> i = 0 <NEW_LINE> max_steps = 0 <NEW_LINE> max_arrow = 50 <NEW_LINE> infoDone = 'done' <NEW_LINE> def __init__(self, maxSteps, infoDone='Done'): <NEW_LINE> <INDENT> self.max_steps = maxSteps <NEW_LINE> self.i = 0 <NEW_LINE> self.infoDone = infoDone <NEW_LINE> <DEDENT> def show_proc... | 显示处理进度的类
调用该类相关函数即可实现处理进度的显示 | 62598eebd7e4931a7ef3a7d1 |
class DataProcessor(object): <NEW_LINE> <INDENT> def get_train_examples(self, data_dir): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def get_dev_examples(self, data_dir): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def get_labels(self): <NEW_LINE> <INDENT> raise NotImplem... | Base class for data converters for sequence classification data sets. | 62598eeb7047854f4633db06 |
class CodeExistsViewSet(APIView): <NEW_LINE> <INDENT> permission_classes = () <NEW_LINE> authentication_classes = () <NEW_LINE> def post(self, request): <NEW_LINE> <INDENT> book_id = get_book(request.data["accessCode"]) <NEW_LINE> if book_id == -1: <NEW_LINE> <INDENT> return Response(data={'valid': False}) <NEW_LINE> <... | Takes access code and checks if it corresponds to a book instance. Returns true with an id or false.
Potentially causes a mail to be sent to an unassigned user (see get_book function).
Requires input which potentially impacts the database, and is public.
Write-only and public. | 62598eeb56ac1b37e6300920 |
class RotaryEncoder(object): <NEW_LINE> <INDENT> gpio_a = None <NEW_LINE> gpio_b = None <NEW_LINE> old_a_value = False <NEW_LINE> old_b_value = False <NEW_LINE> when_rotated = lambda *args: None <NEW_LINE> def __init__(self, pin_a, pin_b, pull_up=False): <NEW_LINE> <INDENT> self.gpio_a = DigitalInputDevice(pin=pin_a, p... | Decode mechanical rotary encoder pulses.
The following example will print a Rotary Encoder change direction::
from gpiozero import RotaryEncoder
def change(value):
if value > 0:
print("clockwise")
else:
print("counterclockwise")
rotary = RotaryEncoder(13, 19)
... | 62598eebdc8b845886d51cf6 |
class AdminVideoMixin(object): <NEW_LINE> <INDENT> def formfield_for_dbfield(self, db_field, **kwargs): <NEW_LINE> <INDENT> if isinstance(db_field, EmbedVideoField) or isinstance(db_field, EmbedBackendField): <NEW_LINE> <INDENT> return db_field.formfield(widget=AdminVideoWidget) <NEW_LINE> <DEDENT> return super(AdminVi... | Mixin using :py:class:`AdminVideoWidget` for fields with
:py:class:`~embed_video.fields.EmbedVideoField`.
Usage::
from django.contrib import admin
from embed_video.admin import AdminVideoMixin
from .models import MyModel
class MyModelAdmin(AdminVideoMixin, admin.ModelAdmin):
pass
admin.s... | 62598eeb7d847024c075ab00 |
@attr(skip_travis=1) <NEW_LINE> class TestMachinesPkGraphXdot14View(APITestCase, MachinesPkGraphViewTestCaseMixin): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.url = reverse(transitionsfbv_machines_pk_graph, args=('matter', '.xdot1.4')) <NEW_LINE> self.expected_content_type = 'text/plain' | Tests the transitionsfbv_machines_pk_graph FBV's support for DOT responses. | 62598eeb56b00c62f0fb1003 |
class TwitterStream(LineOnlyReceiver, TimeoutMixin): <NEW_LINE> <INDENT> def __init__(self, delegate, timeoutPeriod=60): <NEW_LINE> <INDENT> self.delegate = delegate <NEW_LINE> self.timeoutPeriod = timeoutPeriod <NEW_LINE> self.deferred = defer.Deferred(self._cancel) <NEW_LINE> self._done = False <NEW_LINE> <DEDENT> de... | Receive a stream of JSON in twitter's weird streaming format. | 62598eeb1f5feb6acb161385 |
@register('pickle.load') <NEW_LINE> class PickleLoader(BaseDataSource): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.load_path = args[0] <NEW_LINE> super(BaseDataSource, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def run(self, caller, data, *args, **kwargs): <NEW_LINE> <IND... | Load chain from a pickle file.
baf.data('pickle.load','file.pkl') | 62598eebeab8aa0e5d30a4ae |
class BrowserPDFExporter(HTMLExporter): <NEW_LINE> <INDENT> def pdf_capture_args(self): <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> def from_notebook_node(self, nb, resources=None, **kw): <NEW_LINE> <INDENT> output, resources = super(BrowserPDFExporter, self).from_notebook_node( nb, resources=resources, **kw ) <N... | An exporter that generates PDF with a headless browser.
Heavily influenced by the nbconvert LaTeX-based PDFExporter. | 62598eeb67a9b606de544702 |
class PageObject(object): <NEW_LINE> <INDENT> def __init__(self, webdriver, root_uri=''): <NEW_LINE> <INDENT> self.w = webdriver <NEW_LINE> self.root_uri = root_uri | Page Object pattern.
Parameters
----------
webdriver: `selenium.webdriver.WebDriver`
Selenium webdriver instance
root_uri: `str`
Root URI, set by the pyramid_server funcarg if available
Examples
--------
With page elements::
from pkglib.testing.page_objects import PageObject, page_element
class Log... | 62598eeb7d43ff2487426795 |
@value.value_equality <NEW_LINE> class YPowGate(eigen_gate.EigenGate, gate_features.SingleQubitGate): <NEW_LINE> <INDENT> def _eigen_components(self): <NEW_LINE> <INDENT> return [ (0, np.array([[0.5, -0.5j], [0.5j, 0.5]])), (1, np.array([[0.5, 0.5j], [-0.5j, 0.5]])), ] <NEW_LINE> <DEDENT> def _circuit_diagram_info_(sel... | A gate that rotates around the Y axis of the Bloch sphere.
The unitary matrix of ``YPowGate(exponent=t)`` is:
[[g·c, g·s],
[-g·s, g·c]]
where:
c = cos(π·t/2)
s = sin(π·t/2)
g = exp(i·π·t/2).
Note in particular that this gate has a global phase factor of
e^{i·π·t/2} vs the traditionally defined... | 62598eeb4e4d562566370b4d |
class Scenario_capsule_sync_2(APITestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.cls_name = 'Scenario_capsule_sync_2' <NEW_LINE> cls.sat_host = settings.server.hostname <NEW_LINE> cls.cap_host = settings.upgrade.rhev_cap_host or settings.upgrade.capsule_hostname <NEW_... | The test class contains pre-upgrade and post-upgrade scenarios to test if
package added postupgrade in satellite is snyced to capsule post upgrade.
Test Steps:
1. Upgrade Satellite and Capsule.
2. Sync a repo/rpm in satellite.
3. Run capsule sync.
4. Check if the repo/rpm is been synced to capsule. | 62598eebdd821e528d6d7677 |
class NoExecutionSQLCompiler(SQLCompiler): <NEW_LINE> <INDENT> def __init__(self, query, connection, using, is_count_qry=False): <NEW_LINE> <INDENT> super().__init__(query, connection, using) <NEW_LINE> self.is_count_qry = is_count_qry <NEW_LINE> <DEDENT> def get_select(self): <NEW_LINE> <INDENT> if self.is_count_qry i... | The NoExecutionSQLCompiler is mostly the same as the basic django SQLCompiler but it has special cases for preparing
a count() query and it cannot execute SQL quries; it is only used to build the sql. | 62598eeb7d847024c075ab01 |
class RandomVerticalFlip(object): <NEW_LINE> <INDENT> def __init__(self, p=0.5): <NEW_LINE> <INDENT> self.p = p <NEW_LINE> <DEDENT> def __call__(self, img, label): <NEW_LINE> <INDENT> if random.random() < self.p: <NEW_LINE> <INDENT> return img.transpose(Image.FLIP_TOP_BOTTOM), label.transpose(Image.FLIP_TOP_BOTTOM) <NE... | Horizontally flip the given PIL Image randomly with a given probability.
Args:
p (float): probability of the image being flipped. Default value is 0.5 | 62598eeb3d592f4c4edb962a |
class DescribeTablesRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ClusterId = None <NEW_LINE> self.TableGroupIds = None <NEW_LINE> self.SelectedTables = None <NEW_LINE> self.Filters = None <NEW_LINE> self.Offset = None <NEW_LINE> self.Limit = None <NEW_LINE> <DEDENT> def _dese... | DescribeTables request structure.
| 62598eeb91f36d47f223023d |
class LogOnlyFormatter(logging.Formatter): <NEW_LINE> <INDENT> DEFAULT_FORMAT = '%(message)s' <NEW_LINE> DEFAULT_DATE_FORMAT = '%Y%m%d %H:%M:%S' <NEW_LINE> DEFAULT_COLORS = { logging.DEBUG: 4, logging.INFO: 2, logging.WARNING: 3, logging.ERROR: 1, } <NEW_LINE> def __init__(self, color=True, fmt=DEFAU... | Log formatter used in Tornado.
Key features of this formatter are:
* Color support when logging to a terminal that supports it.
* Timestamps on every log line.
* Robust against str/bytes encoding problems.
This formatter is enabled automatically by
`tornado.options.parse_command_line` (unless ``--logging=none`` is
u... | 62598eebd486a94d0ba2a701 |
class InverseGammaWithSoftplusAlphaBeta(InverseGamma): <NEW_LINE> <INDENT> def __init__(self, alpha, beta, validate_args=False, allow_nan_stats=True, name="InverseGammaWithSoftplusAlphaBeta"): <NEW_LINE> <INDENT> with ops.name_scope(name, values=[alpha, beta]) as ns: <NEW_LINE> <INDENT> super(InverseGammaWithSoftplusAl... | Inverse Gamma with softplus applied to `alpha` and `beta`. | 62598eeb3346ee7daa336a02 |
class ApiMixin(API): <NEW_LINE> <INDENT> def http_get(self, _http_url, **kwargs): <NEW_LINE> <INDENT> data = super(ApiMixin, self).http_get(_http_url, **kwargs) <NEW_LINE> if data.get('errcode') and data.get('errcode') != 0: <NEW_LINE> <INDENT> logger.error('weixin api (url: %s) return error: %s' % (_http_url, data)) <... | 公共方法 | 62598eebe5267d203ee6a039 |
class UclEntityAutocompleteView(FacultyEntityAutocompleteView): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> qs = super().get_queryset() <NEW_LINE> if self.forwarded['partnership_type'] == PartnershipType.MOBILITY.name: <NEW_LINE> <INDENT> qs = qs.filter( PartnershipMobilityForm.get_partnership_entit... | Autocomplete for entities on Partnership form | 62598eeb090684286d592a7b |
class BaseMessage(Message): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self().__init__() <NEW_LINE> self.returned_message = Message.base_message <NEW_LINE> <DEDENT> def remove_keyboard(self): <NEW_LINE> <INDENT> if "keyboard" in self.returned_message: <NEW_LINE> <INDENT> del self.returned_message["keyb... | 커스텀 메시지를 구현할 수 있는 클래스입니다.
BaseMessage만 활용해도 되고 FailMessage처럼 상속받아 활용할 수도 있습니다. | 62598eebd7e4931a7ef3a7d2 |
class PluckTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_pluck_top_level(self): <NEW_LINE> <INDENT> d = {'a': {'b': 5, 'z': 20}, 'c': {'d': 3}, 'x': 40} <NEW_LINE> self.assertEqual(pluck(d, 'x'), 40) <NEW_LINE> self.assertEqual(pluck(d, 'c'), {'d': 3}) <NEW_LINE> <DEDENT> def test_pluck_one_level_deep(self): <... | Tests for pluck. | 62598eeb2eb69b55b15a0724 |
class JoinTypeKey(Keys): <NEW_LINE> <INDENT> class Fab(Keys.Fab): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def prefix(cls): <NEW_LINE> <INDENT> return '' <NEW_LINE> <DEDENT> <DEDENT> ATTRIBUTE = 'attribute' <NEW_LINE> GEOGRAPHIC = 'geographic' | A key class to describe table joins | 62598eeb5fc7496912d4760c |
class LibvirtAOEVolumeDriver(LibvirtBaseVolumeDriver): <NEW_LINE> <INDENT> def __init__(self, connection): <NEW_LINE> <INDENT> super(LibvirtAOEVolumeDriver, self).__init__(connection, is_block_dev=True) <NEW_LINE> <DEDENT> def _aoe_discover(self): <NEW_LINE> <INDENT> (out, err) = utils.execute('aoe-discover', run_as_ro... | Driver to attach AoE volumes to libvirt. | 62598eeb71ff763f4b5e5e91 |
class TemplateFilter(Filter): <NEW_LINE> <INDENT> name = 'template' <NEW_LINE> def __init__(self, context=None): <NEW_LINE> <INDENT> super(TemplateFilter, self).__init__() <NEW_LINE> self.context = context <NEW_LINE> <DEDENT> def input(self, _in, out, source_path, output_path): <NEW_LINE> <INDENT> t = Template(_in.read... | Will compile all source files as Django templates.
| 62598eeb3cc13d1c6d463ea4 |
@error_status(httplib.BAD_REQUEST) <NEW_LINE> class NominationSeriesObsoleteError(Exception): <NEW_LINE> <INDENT> pass | A bug cannot be nominated for an obsolete series. | 62598eeb4c34283577618a18 |
class Net1(BaseNet): <NEW_LINE> <INDENT> def forward(self, inputs): <NEW_LINE> <INDENT> shape = [ 2, 1, paddle.to_tensor( 2, dtype=self.config['shape_dtype']), 3, 2, 2 ] <NEW_LINE> x = paddle.expand(inputs, shape=shape) <NEW_LINE> x = paddle.reshape( x, shape=paddle.to_tensor(np.array([-1]).astype("int32"))) <NEW_LINE>... | simple Net | 62598eebcb5e8a47e493b513 |
class UserForm(forms.ModelForm): <NEW_LINE> <INDENT> password = forms.CharField(widget=forms.PasswordInput()) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ("username", "email", "password") | Form definition for MODELNAME. | 62598eeb56ac1b37e6300922 |
class HiveOpenIDPlugin(colony.Plugin): <NEW_LINE> <INDENT> id = "pt.hive.cronus.plugins.hive_openid" <NEW_LINE> name = "Hive OpenID" <NEW_LINE> description = "The plugin that offers the Hive OpenID provider" <NEW_LINE> version = "1.0.0" <NEW_LINE> author = "Hive Solutions Lda. <development@hive.pt>" <NEW_LINE> platform... | The main class for the Hive OpenID Main plugin. | 62598eeb7d847024c075ab02 |
class Y2(FieldChannelMixin, core.FieldDef): <NEW_LINE> <INDENT> _class_is_valid_at_instantiation = False <NEW_LINE> def __init__(self, shorthand=Undefined, aggregate=Undefined, bin=Undefined, field=Undefined, timeUnit=Undefined, title=Undefined, type=Undefined, **kwds): <NEW_LINE> <INDENT> super(Y2, self).__init__(shor... | Y2 schema wrapper
Mapping(required=[shorthand])
Definition object for a data field, its type and transformation of an encoding channel.
Attributes
----------
shorthand : string
shorthand for field, aggregate, and type
aggregate : Aggregate
Aggregation function for the field (e.g., ``mean``, ``sum``, ``median`... | 62598eebcc0a2c1114479739 |
class Contourcarpet(PlotlyDict): <NEW_LINE> <INDENT> _name = 'contourcarpet' | Valid attributes for 'contourcarpet' at path [] under parents ():
['a', 'a0', 'asrc', 'atype', 'autocolorscale', 'autocontour', 'b',
'b0', 'bsrc', 'btype', 'carpet', 'colorbar', 'colorscale',
'connectgaps', 'contours', 'da', 'db', 'fillcolor', 'hoverinfo',
'legendgroup', 'line', 'mode', 'name', 'nconto... | 62598eeb4e4d562566370b4e |
class LearningAgent(Agent): <NEW_LINE> <INDENT> def __init__(self, env, learning=True, epsilon=1.0, alpha=0.5): <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 = learning <... | An agent that learns to drive in the Smartcab world.
This is the object you will be modifying. | 62598eebbe8e80087fbbd784 |
class TestGetContext(TestLtiConsumerXBlock): <NEW_LINE> <INDENT> def test_context_keys(self): <NEW_LINE> <INDENT> context_keys = ( 'launch_url', 'element_id', 'element_class', 'launch_target', 'display_name', 'form_url', 'hide_launch', 'has_score', 'weight', 'module_score', 'comment', 'description', 'ask_permission_to_... | Unit tests for LtiConsumerXBlock._get_context_for_template() | 62598eeb3317a56b869bd900 |
class VelocityVerletIntegrator(Integrator): <NEW_LINE> <INDENT> def __init__(self, universe, **options): <NEW_LINE> <INDENT> Integrator.__init__(self, universe, options) <NEW_LINE> self.features = [Features.FixedParticleFeature, Features.NoseThermostatFeature, Features.AndersenBarostatFeature, Features.DistanceConstrai... | Velocity-Verlet molecular dynamics integrator
The integrator can handle fixed atoms, distance constraints,
a thermostat, and a barostat, as well as any combination.
It is fully thread-safe.
The integration is started by calling the integrator object.
All the keyword options (see documnentation of __init__) can be
spe... | 62598eeb0c0af96317c54acb |
class ProcessChannel(object): <NEW_LINE> <INDENT> def __init__(self, executable, *arguments, **kwargs): <NEW_LINE> <INDENT> if kwargs.get('redirect_stderr'): <NEW_LINE> <INDENT> stderr = subprocess.STDOUT <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> stderr = None <NEW_LINE> <DEDENT> self._process = subprocess.Popen( (... | ProcessChannel(executable, argument..., redirect_stderr=False)
This channel type allows controlling processes. It uses python's
``subprocess.Popen`` class to execute a process and allows you to
communicate with it.
Args:
executable(str): The executable to start.
argument...(list of str): The arguments to pass... | 62598eeb8a43f66fc4bf08a8 |
class RecipeListView(generics.ListCreateAPIView): <NEW_LINE> <INDENT> queryset = models.Recipe.objects.all() <NEW_LINE> serializer_class = serializers.RecipeGistSerializer <NEW_LINE> filter_backends = (filters.SearchFilter,) <NEW_LINE> search_fields = ('title', 'description') | Returns a list of recipes | 62598eeb66656f66f7d58b16 |
class Merger(object): <NEW_LINE> <INDENT> def __init__(self, aggregator): <NEW_LINE> <INDENT> self.agg = aggregator <NEW_LINE> <DEDENT> def mergeValues(self, iterator): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def mergeCombiners(self, iterator): <NEW_LINE> <INDENT> raise NotImplementedError <NE... | Merge shuffled data together by aggregator | 62598eeb8e7ae83300ee77c4 |
class LinkPair(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> def __init__(self, *args): <NEW_LINE> <INDENT> this = _engine_internal.new_LinkPair(*args) <NEW_LINE> try: <NEW_LINE> <INDENT> s... | Proxy of C++ std::pair<(std::string,p.nupic::Link)> class | 62598eeb4a966d76dd5ed61a |
class Front(RPCDispatcher, SessionSingleton): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> RPCDispatcher.__init__(self) <NEW_LINE> self.add_service(table_service.TableService('TableSrv')) <NEW_LINE> self.add_service(shared_object_service.SharedObjectService('SharedObjectSrv')) <NEW_LINE> self.add_service... | This class centralizes the access to the provided services | 62598eeb7d43ff2487426796 |
class LoginForm(Form): <NEW_LINE> <INDENT> name = StringField('Name', validators=[Required()]) <NEW_LINE> submit = SubmitField('Enter the game') | Accepts a nickname and a room. | 62598eeba219f33f346c4f70 |
class InviteUserView(LoginRequiredMixin, CreateView): <NEW_LINE> <INDENT> template_name = "account/invite_user.html" <NEW_LINE> form_class = SignupCodeForm <NEW_LINE> redirect_field_name = "next" <NEW_LINE> messages = { "user_invited": { "level": messages.SUCCESS, "text": _("User successfully invited.") } } <NEW_LINE> ... | Invite a user. | 62598eeb8da39b475be018e1 |
class TestArgParsing(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestArgParsing, self).setUp() <NEW_LINE> <DEDENT> def test_no_args(self): <NEW_LINE> <INDENT> if six.PY2: <NEW_LINE> <INDENT> errstring = "Error: too few arguments" <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> errstring = "E... | Tests for parsing arguments for the `create_course` management command | 62598eeb99fddb7c1ca6219f |
class LoginForm(FlaskForm): <NEW_LINE> <INDENT> username = StringField('Username', validators=[required]) <NEW_LINE> password = PasswordField('Password', validators=[required]) | Form to get login information | 62598eebdd821e528d6d767a |
class NostalgiaMachineParser(): <NEW_LINE> <INDENT> NOSTALGIAMACHINE = "http://thenostalgiamachine.com/years/{0}.html" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def create_soup(self, year): <NEW_LINE> <INDENT> r = requests.get(self.NOSTALGIAMACHINE.format(year)) <NEW_LINE> soup = Beaut... | Nostalgia Machine HTML Parser | 62598eeb090684286d592a7c |
class State(enum.IntEnum): <NEW_LINE> <INDENT> STATE_UNSPECIFIED = 0 <NEW_LINE> RUNNING = 1 <NEW_LINE> SUCCEEDED = 2 <NEW_LINE> FAILED = 3 <NEW_LINE> CANCELLING = 4 <NEW_LINE> CANCELLED = 5 | Enumerates the possible states that the creation request can be in.
Attributes:
STATE_UNSPECIFIED (int): Invalid.
RUNNING (int): Request is being processed.
SUCCEEDED (int): The glossary was successfully created.
FAILED (int): Failed to create the glossary.
CANCELLING (int): Request is in the process of bein... | 62598eebd7e4931a7ef3a7d4 |
class _Context: <NEW_LINE> <INDENT> def __init__(self, payload, meta, session_id, compression=COMPRESSION_NONE): <NEW_LINE> <INDENT> self.payload = payload <NEW_LINE> self.meta = meta <NEW_LINE> self.session_id = session_id <NEW_LINE> self.compression = compression <NEW_LINE> <DEDENT> def apply(self, filters): <NEW_LIN... | Manage RPC send and receive state. | 62598eeb442bda511e95ab98 |
class LogParabola: <NEW_LINE> <INDENT> param_names = ["amplitude", "e_0", "alpha", "beta"] <NEW_LINE> _memoize = False <NEW_LINE> _cache = {} <NEW_LINE> _queue = [] <NEW_LINE> def __init__(self, amplitude, e_0, alpha, beta): <NEW_LINE> <INDENT> self.amplitude = amplitude <NEW_LINE> self.e_0 = validate_scalar( "e_0", e_... | One dimensional log parabola model (sometimes called curved power law).
Parameters
----------
amplitude : float
Model amplitude
e_0 : `~astropy.units.Quantity` float
Reference point
alpha : float
Power law index
beta : float
Power law curvature
See Also
--------
PowerLaw, BrokenPowerLaw, ExponentialCu... | 62598eeb7cff6e4e811b4124 |
class FMC(*args, **kwargs): <NEW_LINE> <INDENT> from warnings import warn <NEW_LINE> warnings.warn("FMC is deprecated, use Cluster instead", DeprecationWarning) <NEW_LINE> return Cluster(*args, **kwargs) | Placeholder class during deprecation warning period. Naming things is hard :) | 62598eeb009cb60464cffc84 |
class AuthorEntryRank(models.Model): <NEW_LINE> <INDENT> author = models.ForeignKey(Author, on_delete=models.CASCADE) <NEW_LINE> entry = models.ForeignKey(Entry, on_delete=models.CASCADE) <NEW_LINE> rank = models.IntegerField( _("Rank"), help_text=_("Author rank in entry authors sequence") ) <NEW_LINE> class Meta: <NEW... | Give the author rank for an entry author sequence | 62598eeb7d847024c075ab04 |
class PlayerManager(TypedObjectManager): <NEW_LINE> <INDENT> def num_total_players(self): <NEW_LINE> <INDENT> return self.count() <NEW_LINE> <DEDENT> @returns_typeclass_list <NEW_LINE> def get_connected_players(self): <NEW_LINE> <INDENT> return self.filter(db_is_connected=True) <NEW_LINE> <DEDENT> @returns_typeclass_li... | This PlayerManager implements methods for searching
and manipulating Players directly from the database.
Evennia-specific search methods (will return Characters if
possible or a Typeclass/list of Typeclassed objects, whereas
Django-general methods will return Querysets or database objects):
dbref (converter)
dbref_se... | 62598eebbe383301e0251f0f |
class DownloadMultimediaZip(DownloadZip, ApplicationViewMixin): <NEW_LINE> <INDENT> name = "download_multimedia_zip" <NEW_LINE> compress_zip = False <NEW_LINE> zip_name = 'commcare.zip' <NEW_LINE> def iter_files(self): <NEW_LINE> <INDENT> self.app.remove_unused_mappings() <NEW_LINE> return _iter_media_files(self.app.ge... | This is where the Multimedia for an application gets generated.
Expects domain and app_id to be in its args | 62598eeb01c39578d7f114e0 |
class Player: <NEW_LINE> <INDENT> def __init__(self, location): <NEW_LINE> <INDENT> self.name = 'Billy Boy' <NEW_LINE> self.spirit = 'Boar' <NEW_LINE> self.inventory = [] <NEW_LINE> self.location = location <NEW_LINE> self.actions = {'1': self.search, '2': self.grab, '3': self.gurgle} <NEW_LINE> <DEDENT> def forward(se... | The Player object, with associated variables and methods. This is you!
| 62598eebd486a94d0ba2a704 |
class TextTabWidget(QWidget, MainWindowTabWidgetBase): <NEW_LINE> <INDENT> sigEscapePressed = pyqtSignal() <NEW_LINE> def __init__(self, parent=None): <NEW_LINE> <INDENT> QWidget.__init__(self, parent) <NEW_LINE> MainWindowTabWidgetBase.__init__(self) <NEW_LINE> layout = QHBoxLayout(self) <NEW_LINE> layout.setContentsM... | The widget which displays a RO HTML page | 62598eeb66673b3332c2eade |
class GL_Marker_Texture(object): <NEW_LINE> <INDENT> def __init__(self, filename, colour=(1.,1.,1.)): <NEW_LINE> <INDENT> self.colour = colour <NEW_LINE> self.img = Image.open(filename) <NEW_LINE> self.xsize = self.img.size[0] <NEW_LINE> self.ysize = self.img.size[1] <NEW_LINE> self.raw = self.img.convert('RGBA').tostr... | wrapper for the marker texture | 62598eeb16aa5153ce3fec36 |
class ObserveLastActionWrapper(Wrapper): <NEW_LINE> <INDENT> def __init__(self, env, default_action=None): <NEW_LINE> <INDENT> super(ObserveLastActionWrapper, self).__init__(env) <NEW_LINE> if default_action is None and isinstance(env.action_space, gym.spaces.Box): <NEW_LINE> <INDENT> default_action = np.zeros_like(env... | This wrapper changes an environment with observation space S and
action space A into one with observation space Tuple(S, A), by including
the most recent action in the state space. | 62598eebbe8e80087fbbd786 |
class Vertex: <NEW_LINE> <INDENT> __slots__ = '_element', '_label' <NEW_LINE> def __init__(self, x, label="UNEXPLORED"): <NEW_LINE> <INDENT> self._element = x <NEW_LINE> self._label = label <NEW_LINE> <DEDENT> def element(self): <NEW_LINE> <INDENT> return self._element <NEW_LINE> <DEDENT> def getLabel(self, label): <NE... | Lightweight vertex structure for a graph. | 62598eebd268445f26638f29 |
class BearerTokenAuth(ResourceAuth): <NEW_LINE> <INDENT> NAME = 'Bearer Token' <NEW_LINE> DESCRIPTION = 'Bearer token auth' <NEW_LINE> PARAM_DEFS = { 'token': { 'type': 'password', 'description': 'Token string', 'default': None, 'required': True, 'range': None } } <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> Reso... | Bearer token auth | 62598eeb57b8e32f525074a0 |
class DiffractionRangeConstraint(ReactionCrdRangeConstraint): <NEW_LINE> <INDENT> def __init__(self, atoms=None, k_vector=[], active_symbols=[], all_symbols=[]): <NEW_LINE> <INDENT> ReactionCrdRangeConstraint.__init__(self) <NEW_LINE> self.updater = DiffractionUpdater( atoms=atoms, k_vector=k_vector, active_symbols=act... | Constraints based on diffraction intensity
See docstring of :py:class:`cemc.mcmc.diffraction_observer.DiffractionUpdater`
for explination of the arguments. | 62598eeb32920d7e50bc4763 |
class Block(object): <NEW_LINE> <INDENT> def __init__(self, start, end, level, symbol): <NEW_LINE> <INDENT> self.start = start <NEW_LINE> self.end = end <NEW_LINE> self.level = level <NEW_LINE> self.symbol = symbol <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> fmt = "Block: %d:%d:%d %s" <NEW_LINE> return f... | ADL file block structure | 62598eeb92d797404e387f16 |
class Report(Executor): <NEW_LINE> <INDENT> def __call__(self, args): <NEW_LINE> <INDENT> report_builder = HTMLReportBuilder(self.prj) <NEW_LINE> table = Table(self.prj)() <NEW_LINE> report_path = report_builder(table.objs, table.stats, uniqify(table.columns)) <NEW_LINE> _LOGGER.info("HTML Report (n=" + str(len(table.s... | Combine project outputs into a browsable HTML report | 62598eebeab8aa0e5d30a4b2 |
class EnvironmentDown(Exception): <NEW_LINE> <INDENT> def __init__(self, msg): <NEW_LINE> <INDENT> super(EnvironmentDown, self).__init__("environment went down: %s" % msg) | Indicates an environment has gone down. | 62598eeb66656f66f7d58b18 |
class WikibaseKnownTypesTests(KnownTypesTestBase, DefaultWikibaseClientTestCase): <NEW_LINE> <INDENT> def test_entities(self): <NEW_LINE> <INDENT> known = ['item', 'property'] <NEW_LINE> self._check_param_values(self.repo, 'wbsearchentities', 'type', known) <NEW_LINE> <DEDENT> def test_datatypes(self): <NEW_LINE> <INDE... | Verify Wikibase types using paraminfo. | 62598eeb8e7ae83300ee77c6 |
class strip_debug_symbols_base(Task): <NEW_LINE> <INDENT> color = 'CYAN' <NEW_LINE> vars = [ 'STRIP' ] <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> task_description = super(strip_debug_symbols_base, self).__str__() <NEW_LINE> return task_description.replace(self.__class__.__name__, 'strip_debug_symbols') <NEW_LINE... | Strips the debug symbols from a shared library | 62598eeb1f037a2d8b9e283f |
class Loop(Chanlist): <NEW_LINE> <INDENT> meter_list = [] <NEW_LINE> station_dic = OrderedDict() <NEW_LINE> def __init__(self, meter, starttime): <NEW_LINE> <INDENT> super(Loop,self).__init__() <NEW_LINE> self.meter = meter <NEW_LINE> self.starttime =starttime <NEW_LINE> self.tide_grav = [] <NEW_LINE> self.airpress_gra... | Loop mean the whole close route.
In general, one day job can be seen a Loop. | 62598eeb4e4d562566370b51 |
class MEPCurve(HostObject,IDisposable): <NEW_LINE> <INDENT> def Dispose(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def getBoundingBox(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def ReleaseUnmanagedResources(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def setElementType(self,*args):... | A curve object for duct or pipe blend elements. | 62598eeb99cbb53fe682f5e9 |
class StashedGenerator(object): <NEW_LINE> <INDENT> def __init__(self, generator_function, *args, **kwargs): <NEW_LINE> <INDENT> self._generator_function = generator_function <NEW_LINE> self._args = args <NEW_LINE> self._kwargs = kwargs <NEW_LINE> self._generator = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def __cl... | A :term:`generator iterator` which can be copied/pickled before any other operations
:param generator_function: the source :term:`generator` function
:type generator_function: function
:param args: positional arguments to pass to ``generator_function``
:param kwargs: keyword arguments to pass to ``generator_function``... | 62598eeb460517430c430bbf |
class AnalogEntity(Entity): <NEW_LINE> <INDENT> def __init__(self, nsfile, eid, info): <NEW_LINE> <INDENT> super(AnalogEntity,self).__init__(eid, nsfile, info) <NEW_LINE> <DEDENT> @property <NEW_LINE> def sample_rate(self): <NEW_LINE> <INDENT> return self._info['SampleRate'] <NEW_LINE> <DEDENT> @property <NEW_LINE> def... | :class:`Entity` that represents continuously sampled, i.e. digitized, analog data.
Examples are waveforms recorded via an electrode (microelectrodes, EKG, EEG).
Actual data can be accessed via the :func:`get_data` function.
.. note:: data may contain gaps (e.g. when no data is recorded between trails) | 62598eeba8370b77170eeb1b |
class UnhandledResponse(Exception): <NEW_LINE> <INDENT> pass | Received unknown response. | 62598eebfff4ab517ebcbf0f |
class ClockOutForm(forms.Form): <NEW_LINE> <INDENT> def __init__(self, employee, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.employee = employee <NEW_LINE> <DEDENT> def clean(self): <NEW_LINE> <INDENT> if not self.employee.is_clocked_in: <NEW_LINE> <INDENT> raise forms.Valida... | Form to clock out an employee. | 62598eeb3539df3088eca9e9 |
class FtsDictionaryPutTestCase(BaseTestGenerator): <NEW_LINE> <INDENT> scenarios = [ ('Fetch FTS dictionary Node URL', dict( url='/browser/fts_dictionary/obj/')) ] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.schema_data = parent_node_dict['schema'][-1] <NEW_LINE> self.schema_name = self.schema_data['schema_nam... | This class will update added FTS dictionary under schema node. | 62598eeb99fddb7c1ca621a0 |
class CloseQuestionView(LoginRequired, View): <NEW_LINE> <INDENT> model = Question <NEW_LINE> def post(self, request, question_id): <NEW_LINE> <INDENT> question = get_object_or_404(self.model, pk=question_id) <NEW_LINE> if question.user != request.user: <NEW_LINE> <INDENT> raise ValidationError( "对不起,你不能结束这个问题。") <NEW_... | 视图
将问题标记为closed,验证创建que问题的用户是唯一允许进行这些更改的用户. | 62598eeb4f6381625f198857 |
class ProductViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Product.objects.all() <NEW_LINE> serializer_class = ProductSerializer <NEW_LINE> permission_classes = (permissions.IsAuthenticatedOrReadOnly, IsOwnerOrReadOnly,) <NEW_LINE> filter_backends = (filters.DjangoFilterBackend, SearchFilter, OrderingF... | This viewset automatically provides `list`, `create`, `retrieve`,
`update` and `destroy` actions.
Additionally we also provide an extra `highlight` action. | 62598eeb8da39b475be018e4 |
class AbstractTaskTypeSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> user = serializers.SlugRelatedField(slug_field="username", read_only=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = AbstractTaskType <NEW_LINE> fields = "__all__" <NEW_LINE> <DEDENT> def to_internal_value(self, data): <NEW_LINE... | A serializer for a task type. | 62598eeba79ad16197768755 |
class IRecordEvent(zope.interface.interfaces.IObjectEvent): <NEW_LINE> <INDENT> pass | Marker interface of a general record event. | 62598eeb442bda511e95ab9a |
class SupplyKitBinding (PartNumberType): <NEW_LINE> <INDENT> _TypeDefinition = None <NEW_LINE> _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY <NEW_LINE> _Abstract = False <NEW_LINE> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'SupplyKitBinding') <NEW_LINE> _XSDLocation = pyxb.uti... | A more specific binding kit representation (includes SupplyKit fields). | 62598eeb9c8ee8231303f4f5 |
class TestSetup(unittest.TestCase): <NEW_LINE> <INDENT> layer = STUDIOCILS_THEME_INTEGRATION_TESTING <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.portal = self.layer['portal'] <NEW_LINE> self.installer = api.portal.get_tool('portal_quickinstaller') <NEW_LINE> <DEDENT> def test_product_installed(self): <NEW_LINE... | Test that studiocils.theme is properly installed. | 62598eeb7047854f4633db0c |
class IPDLCodeGen(CodePrinter, Visitor): <NEW_LINE> <INDENT> def __init__(self, outf=sys.stdout, indentCols=4, printed=set()): <NEW_LINE> <INDENT> CodePrinter.__init__(self, outf, indentCols) <NEW_LINE> self.printed = printed <NEW_LINE> <DEDENT> def visitTranslationUnit(self, tu): <NEW_LINE> <INDENT> self.printed.add(t... | Spits back out equivalent IPDL to the code that generated this.
Also known as pretty-printing. | 62598eeb167d2b6e312b56d1 |
class listAllCommunitiesObjects(grok.View): <NEW_LINE> <INDENT> grok.name('listallcommunitiesobjects') <NEW_LINE> grok.context(IPloneSiteRoot) <NEW_LINE> grok.require('cmf.ManagePortal') <NEW_LINE> def render(self): <NEW_LINE> <INDENT> pc = api.portal.get_tool(name='portal_catalog') <NEW_LINE> communities = pc.unrestri... | returns a json with all the comunities and the number of objects of each one | 62598eeb56b00c62f0fb1009 |
class YamlDoc(object): <NEW_LINE> <INDENT> def __init__(self, yamlDoc): <NEW_LINE> <INDENT> self.yamlDoc = yamlDoc <NEW_LINE> <DEDENT> def getYamlDoc(self): <NEW_LINE> <INDENT> return self.yamlDoc <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return ("---\n" + yaml.dump(self.yamlDoc)) | Representation of a Yaml Document | 62598eeb60cbc95b06362a76 |
class BadBlock: <NEW_LINE> <INDENT> def __init__(self, util_tools, tool: BBTool = None): <NEW_LINE> <INDENT> if tool: <NEW_LINE> <INDENT> if not isinstance(tool, BBTool): <NEW_LINE> <INDENT> raise futils.Fail('{} should be a subclass of BBTool' .format(tool)) <NEW_LINE> <DEDENT> self.tool = tool <NEW_LINE> <DEDENT> els... | Utility class specifying high-level workflow for handling bad block. | 62598eeb56ac1b37e6300926 |
class _PosixOpener(_Opener): <NEW_LINE> <INDENT> def open_and_lock(self, timeout, delay): <NEW_LINE> <INDENT> if self._locked: <NEW_LINE> <INDENT> raise AlreadyLockedException('File %s is already locked' % self._filename) <NEW_LINE> <DEDENT> self._locked = False <NEW_LINE> validate_file(self._filename) <NEW_LINE> try: ... | Lock files using Posix advisory lock files. | 62598eebadb09d7d5dc08d01 |
class JoinGameForm(forms.Form): <NEW_LINE> <INDENT> game = forms.ModelChoiceField(Game.objects.all(), widget=forms.HiddenInput, required=False) <NEW_LINE> player_username = forms.CharField(max_length=254) <NEW_LINE> def save(self, player_id): <NEW_LINE> <INDENT> game = self.cleaned_data.get('game') <NEW_LINE> if game i... | Process information about second player | 62598eebcc40096d61619574 |
class ParameterPlugin(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def initialize(self, adserver): <NEW_LINE> <INDENT> raise NotImplementedError('initialize must be implemeted') <NEW_LINE> <DEDENT> def get_request(self): <NEW_LINE> <INDENT> raise NotImplementedError('do_... | Describes the parameter plugin interface | 62598eebe5267d203ee6a03f |
class _AudioSourceProperty(object): <NEW_LINE> <INDENT> def __init__(self, index, prop_type, doc = None): <NEW_LINE> <INDENT> self.index = index <NEW_LINE> self.prop_type = prop_type <NEW_LINE> self.__doc__ = doc <NEW_LINE> <DEDENT> def __get__(self, inst, context): <NEW_LINE> <INDENT> getter_func, getter_type = _Audio... | internal descriptor used for all of our properties | 62598eebdd821e528d6d767d |
class TimeSeries(MySeries): <NEW_LINE> <INDENT> pass | Represents a mapping from times to values. | 62598eebdd821e528d6d767e |
class DistributionSourcePackageReleaseBreadcrumb(Breadcrumb): <NEW_LINE> <INDENT> @property <NEW_LINE> def text(self): <NEW_LINE> <INDENT> return self.context.version | A breadcrumb for `IDistributionSourcePackageRelease`. | 62598eeb26068e7796d4b095 |
class V1ClusterRoleList(object): <NEW_LINE> <INDENT> openapi_types = { 'api_version': 'str', 'items': 'list[V1ClusterRole]', 'kind': 'str', 'metadata': 'V1ListMeta' } <NEW_LINE> attribute_map = { 'api_version': 'apiVersion', 'items': 'items', 'kind': 'kind', 'metadata': 'metadata' } <NEW_LINE> def __init__(self, api_ve... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598eeb30bbd7224646836d |
class ConstType(Const): <NEW_LINE> <INDENT> pass | -------------------------------------------------------------------------*
Affine transform order flags *
-------------------------------------------------------------------------*/
enum {
L_TR_SC_RO = 1, /* translate, scale, rotate */
... | 62598eeb4f6381625f198858 |
class Flight: <NEW_LINE> <INDENT> def __init__(self, number, aircraft): <NEW_LINE> <INDENT> self._number = number <NEW_LINE> self._aircraft = aircraft <NEW_LINE> rows, seats = self._aircraft.seating_plan() <NEW_LINE> self._seating = [None] + [{letter : None for letter in seats} for _ in rows] <NEW_LINE> <DEDENT> def nu... | A flight with a particular passenger aricraft. | 62598eebbaa26c4b54d4da06 |
class DeletePostView(LoginRequiredMixin, DeleteView): <NEW_LINE> <INDENT> template_name = 'posts/delete.html' <NEW_LINE> success_url = reverse_lazy('posts:feed') <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> id_ = self.kwargs.get("id") <NEW_LINE> return get_object_or_404(Post, id=id_) <NEW_LINE> <DEDENT> def pos... | Delete post view. | 62598eebac7a0e7691f70c52 |
class AuthForm(Form): <NEW_LINE> <INDENT> email = TextField('email', validators=[Required()]) <NEW_LINE> password = PasswordField('password', validators=[Required()]) <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> Form.__init__(self, *args, **kwargs) <NEW_LINE> self.user = None <NEW_LINE> <DEDENT> ... | A simple Email and Password authentication form.
Will do user lookups and provide a User object, if found, to the View. | 62598eeb21bff66bcd72138d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.