code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class ModulatedDeformConvPack(ModulatedDeformConv): <NEW_LINE> <INDENT> _version = 2 <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(ModulatedDeformConvPack, self).__init__(*args, **kwargs) <NEW_LINE> self.conv_offset = nn.Conv2d( self.in_channels, self.deformable_groups * 3 * self.kernel_size... | A ModulatedDeformable Conv Encapsulation that acts as normal Conv layers.
Args:
in_channels (int): Same as nn.Conv2d.
out_channels (int): Same as nn.Conv2d.
kernel_size (int or tuple[int]): Same as nn.Conv2d.
stride (int or tuple[int]): Same as nn.Conv2d.
padding (int or tuple[int]): Same as nn.Con... | 62598f6ad18da76e235b6ce0 |
class ChildProgramDeciderTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_indicated_with_executable_flag(self): <NEW_LINE> <INDENT> analyzable, child = main.decide_child_program(True, False, "foobar.py") <NEW_LINE> self.assertIsNone(analyzable) <NEW_LINE> self.assertEqual(child, "foobar.py") <NEW_LINE> <DEDENT... | Check how the child program is decided. | 62598f6a1d351010ab8f3297 |
class CourseContentVisibilityMixin(models.Model): <NEW_LINE> <INDENT> hide_from_toc = models.BooleanField(null=False, default=False) <NEW_LINE> visible_to_staff_only = models.BooleanField(null=False, default=False) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = True | This mixin stores XBlock information that affects outline level visibility
for a single LearningSequence or Section in a course.
We keep the XBlock field names here, even if they're somewhat misleading.
Please read the comments carefully for each field. | 62598f6a3eb6a72ae0389d97 |
class Station(Producer): <NEW_LINE> <INDENT> key_schema = avro.load(f"{Path(__file__).parents[0]}/schemas/arrival_key.json") <NEW_LINE> value_schema = avro.load(f"{Path(__file__).parents[0]}/schemas/arrival_value.json") <NEW_LINE> def __init__(self, station_id, name, color, direction_a=None, direction_b=None): <NEW_LIN... | Defines a single station | 62598f6a0a366e3fb87dc119 |
class Relation(db.Model): <NEW_LINE> <INDENT> __tablename__ = "relation" <NEW_LINE> relation_id = db.Column(db.Integer, nullable=False, autoincrement=True, primary_key=True) <NEW_LINE> relation_place_id = db.Column(db.Integer, db.ForeignKey('place.place_id')) <NEW_LINE> relation_biblio_id = db.Column(db.Integer, db.For... | Création d'une table d'associations entre table Biblio
et la table Place | 62598f6a925a0f43d25e778f |
class ComposeMixin(NamespaceMixin, object): <NEW_LINE> <INDENT> http_method_names = ['get', 'post'] <NEW_LINE> success_url = None <NEW_LINE> user_filter = None <NEW_LINE> exchange_filter = None <NEW_LINE> max = None <NEW_LINE> auto_moderators = [] <NEW_LINE> def get_form_kwargs(self): <NEW_LINE> <INDENT> kwargs = super... | Code common to the write and reply views.
Optional attributes:
``success_url``: where to redirect to after a successful POST
``user_filter``: a filter for recipients
``exchange_filter``: a filter for exchanges between a sender and a recipient
``max``: an upper limit for the recipients number
``auto... | 62598f6a507cdc57c63a44f1 |
@override_settings(MODULESTORE=TEST_DATA_MIXED_MODULESTORE) <NEW_LINE> class TestInstructorDashboardAnonCSV(ModuleStoreTestCase, LoginEnrollmentTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> clear_existing_modulestores() <NEW_LINE> self.toy = modulestore().get_course("edX/toy/2012_Fall") <NEW_LINE>... | Check for download of csv | 62598f6ac432627299fa272a |
class SprintViewSet(DefaultsMixin, viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Sprint.objects.order_by('end') <NEW_LINE> serializer_class = SprintSerializer <NEW_LINE> filter_class = SprintFilter <NEW_LINE> search_fields = ('name', ) <NEW_LINE> ordering_fields = ('end', 'name', ) | API endpoint for listing and creating sprint. | 62598f6a0383005118f6ce62 |
class Song(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=255) <NEW_LINE> filename = models.CharField(max_length=255) <NEW_LINE> directory = models.CharField(max_length=255, blank=True) <NEW_LINE> duration = models.DurationField(default=timedelta(0)) <NEW_LINE> version = models.CharField(max_len... | Song object. | 62598f6a21bff66bcd7223b4 |
class BasicAuthRequestHandler(CommonRequestHandler): <NEW_LINE> <INDENT> def creds_check(self, user, password): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> def parse_auth(self, header): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> method, data = header.split(None, 1) <NEW_LINE> if method.lower() == 'basic': <N... | HTTP request handler with Basic Authentication. It automatically sends back HTTP response code 401 if no valid Autorization header present in the request. | 62598f6a9b70327d1c57e501 |
class OkButton(QPushButton): <NEW_LINE> <INDENT> def __init__(self, ok_function): <NEW_LINE> <INDENT> super().__init__('OK') <NEW_LINE> self.clicked.connect(ok_function) <NEW_LINE> self.setToolTip('Move to next page') <NEW_LINE> self.show() | calls passed function when clicked by user. | 62598f6a56b00c62f0fb200d |
class Daophot(core.BaseReader): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> core.BaseReader.__init__(self) <NEW_LINE> self.header = DaophotHeader() <NEW_LINE> self.inputter = core.ContinuationLinesInputter() <NEW_LINE> self.inputter.no_continue = r'\s*#' <NEW_LINE> self.data.splitter = fixedwidth.FixedW... | Read a DAOphot file.
Example::
#K MERGERAD = INDEF scaleunit %-23.7g
#K IRAF = NOAO/IRAFV2.10EXPORT version %-23s
#K USER = davis name %-23s
#K HOST = tucana computer %-23s
#
#N ID XCENTER YCENTER MAG MERR MSKY NITER \
#U ## pixels pixels ... | 62598f6a287bf620b6271316 |
class Solution: <NEW_LINE> <INDENT> def candy(self, ratings): <NEW_LINE> <INDENT> candynum = [1 for i in range(len(ratings))] <NEW_LINE> for i in range(1, len(ratings)): <NEW_LINE> <INDENT> if ratings[i] > ratings[i - 1]: <NEW_LINE> <INDENT> candynum[i] = candynum[i - 1] + 1 <NEW_LINE> <DEDENT> <DEDENT> for i in range(... | 老师想给孩子们分发糖果,有 N 个孩子站成了一条直线,老师会根据每个孩子的表现,预先给他们评分。
你需要按照以下要求,帮助老师给这些孩子分发糖果:
每个孩子至少分配到 1 个糖果。
相邻的孩子中,评分高的孩子必须获得更多的糖果。
那么这样下来,老师至少需要准备多少颗糖果呢?
示例 1:
输入: [1,0,2]
输出: 5
解释: 你可以分别给这三个孩子分发 2、1、2 颗糖果。 | 62598f6aac7a0e7691f71c6c |
class MistralScenario(scenario.OpenStackScenario): <NEW_LINE> <INDENT> @atomic.action_timer("mistral.list_workbooks") <NEW_LINE> def _list_workbooks(self): <NEW_LINE> <INDENT> return self.clients("mistral").workbooks.list() <NEW_LINE> <DEDENT> @atomic.action_timer("mistral.create_workbook") <NEW_LINE> def _create_workb... | Base class for Mistral scenarios with basic atomic actions. | 62598f6a76d4e153a661c370 |
class AverageBlockCollection(BlockCollection): <NEW_LINE> <INDENT> def _makeRepresentativeBlock(self): <NEW_LINE> <INDENT> newBlock = self._getNewBlock() <NEW_LINE> lfpCollection = self._getAverageFuelLFP() <NEW_LINE> newBlock.setLumpedFissionProducts(lfpCollection) <NEW_LINE> newBlock.setNumberDensities(self._getAvera... | Block collection that builds a new block based on others in collection
Averages number densities, fission product yields, and fission gas
removal fractions. | 62598f6ad164cc61758206d3 |
class GenericBonusItem(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, start_point, itemType, *groups): <NEW_LINE> <INDENT> super(GenericBonusItem, self).__init__(*groups) <NEW_LINE> if itemType == 'healthBox': <NEW_LINE> <INDENT> self.image = pygame.image.load('graphics/healthBox.png') <NEW_LINE> <DEDENT... | Класс бонусных объектов | 62598f6a38b623060ffa87f4 |
class Lemmas(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._lemmas = {} <NEW_LINE> <DEDENT> def _get_and_create_if_not_exists(self, lemma_name): <NEW_LINE> <INDENT> s_lname = str( lemma_name ) <NEW_LINE> if s_lname not in self._lemmas: <NEW_LINE> <INDENT> self._lemmas[s_lname] = Lemma() <NEW... | This class is a collection of Lemma objects with some utility methods.
Represents the result file of a Euler reasoning in memory. | 62598f6a1f037a2d8b9e3848 |
@skipIf(HAS_MOTO is False, 'The moto module must be installed.') <NEW_LINE> @skipIf(_has_required_moto() is False, 'The moto module must be >= to {0} for ' 'PY2 or {1} for PY3.'.format(required_moto, required_moto_py3)) <NEW_LINE> @skipIf(sys.version_info > (3, 6), 'Disabled for 3.7+ pending https://github.com/spulec/m... | TestCase for salt.modules.boto_route53 module | 62598f6a711fe17d825dfe43 |
class CrawlerProcess(Crawler): <NEW_LINE> <INDENT> def __init__(self, *a, **kw): <NEW_LINE> <INDENT> super(CrawlerProcess, self).__init__(*a, **kw) <NEW_LINE> self.signals.connect(self.stop, signals.engine_stopped) <NEW_LINE> install_shutdown_handlers(self._signal_shutdown) <NEW_LINE> <DEDENT> def start(self): <NEW_LIN... | A class to run a single Scrapy crawler in a process. It provides
automatic control of the Twisted reactor and installs some convenient
signals for shutting down the crawl. | 62598f6a8e05c05ec3f6e9f2 |
class ValidatorsUtilsTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_to_float_array(self): <NEW_LINE> <INDENT> expected = [-90.0, 0.0, 90.0] <NEW_LINE> test_input = '-90, 0, 90' <NEW_LINE> self.assertEqual(expected, to_float_array(test_input)) <NEW_LINE> <DEDENT> def test_to_float_array_no_commas(self): <NEW_... | Test for validator utility functions | 62598f6a6fece00bbaccb0e4 |
class Repeater: <NEW_LINE> <INDENT> def __init__(self, value, n): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> self.n = n <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return self.n <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> if isinstance(key, (int, np.integer)): <NEW_LINE> <I... | Returns a virtual sequence with value repeated n times.
The sequence is never actually created in memory.
Parameters
----------
value : any
Value to repeat.
n : int
Number of times to repeat value.
Notes
-----
This is very similar to itertools.repeat except this version returns a Sequence instead of an iterat... | 62598f6a66673b3332c2fb16 |
class TestResultQueryContainer(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.queries_by_testcase = dict() <NEW_LINE> self.total = 0 <NEW_LINE> <DEDENT> def add(self, test_case_id, queries): <NEW_LINE> <INDENT> existing_query_container = self.queries_by_testcase.get( test_case_id, TestCaseQue... | Stores all the queries from a Test Run, aggregated by Test Case | 62598f6a6aa9bd52df0d462b |
class IpsubMaIntfStateDataEnum(Enum): <NEW_LINE> <INDENT> invalid = 0 <NEW_LINE> initialized = 1 <NEW_LINE> session_creation_started = 2 <NEW_LINE> control_policy_executing = 3 <NEW_LINE> control_policy_executed = 4 <NEW_LINE> session_features_applied = 5 <NEW_LINE> vrf_configured = 6 <NEW_LINE> adding_adjacency = 7 <N... | IpsubMaIntfStateDataEnum
Interface states
.. data:: invalid = 0
Invalid state
.. data:: initialized = 1
Initial state
.. data:: session_creation_started = 2
Interface creation started
.. data:: control_policy_executing = 3
Interface created in IM, AAA session start
called
.. data:: contro... | 62598f6a50485f2cf55da6c8 |
class HuiyiBuildHeaderError(HuiyiBuildError): <NEW_LINE> <INDENT> pass | 构建头部出错 | 62598f6a4d74a7450cd58a85 |
class MonthYearWidget(Widget): <NEW_LINE> <INDENT> none_value = (0, '---') <NEW_LINE> month_field = '%s_month' <NEW_LINE> year_field = '%s_year' <NEW_LINE> def __init__(self, attrs=None, years=None, required=True): <NEW_LINE> <INDENT> self.attrs = attrs or {} <NEW_LINE> self.required = required <NEW_LINE> if years: <NE... | A Widget that splits date input into two <select> boxes for month and year,
with 'day' defaulting to the first of the month.
Based on SelectDateWidget, in
django/trunk/django/forms/extras/widgets.py | 62598f6a76d4e153a661c372 |
class MovieAdd(APIView): <NEW_LINE> <INDENT> @swagger_auto_schema(request_body=openapi.Schema( type=openapi.TYPE_OBJECT, properties={ 'title': openapi.Schema(type=openapi.TYPE_STRING, description='string'), 'genre': openapi.Schema(type=openapi.TYPE_STRING, description='string'), 'year': openapi.Schema(type=openapi.TYPE... | 영화 리스트 생성 | 62598f6a0383005118f6ce66 |
class ANY_OF(Validator): <NEW_LINE> <INDENT> def __init__(self, subs, error_message=None): <NEW_LINE> <INDENT> self.subs = subs <NEW_LINE> self.error_message = error_message <NEW_LINE> <DEDENT> def __call__(self, value): <NEW_LINE> <INDENT> for validator in self.subs: <NEW_LINE> <INDENT> value, error = validator(value)... | Tests if any of the validators in a list returns successfully::
>>> ANY_OF([IS_EMAIL(),IS_ALPHANUMERIC()])('a@b.co')
('a@b.co', None)
>>> ANY_OF([IS_EMAIL(),IS_ALPHANUMERIC()])('abco')
('abco', None)
>>> ANY_OF([IS_EMAIL(),IS_ALPHANUMERIC()])('@ab.co')
('@ab.co', 'enter only letters, numbers, a... | 62598f6a15fb5d323ce7e47f |
class Family(models.Model): <NEW_LINE> <INDENT> name = models.CharField(u"名称", max_length=255) <NEW_LINE> relationship = models.CharField(u"关系", max_length=255) <NEW_LINE> mobile_phone = models.CharField(u'手机号', null=True, blank=True, max_length=100) <NEW_LINE> create_datetime = models.DateTimeField(auto_now_add=True) ... | 家庭信息 | 62598f6a1d351010ab8f329d |
class Video(object): <NEW_LINE> <INDENT> scores = {} <NEW_LINE> def __init__(self, name, format=None, release_group=None, resolution=None, video_codec=None, audio_codec=None, imdb_id=None, hashes=None, size=None, subtitle_languages=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.format = format <NEW_LINE> s... | Base class for videos
Represent a video, existing or not, with various properties that defines it.
Each property has an associated score based on equations that are described in
subclasses.
:param string name: name or path of the video
:param string format: format of the video (HDTV, WEB-DL, ...)
:param string releas... | 62598f6a1f037a2d8b9e384a |
class _DumpOutputProtocol(ProcessProtocol): <NEW_LINE> <INDENT> def __init__(self, f): <NEW_LINE> <INDENT> self.done = Deferred() <NEW_LINE> self._out = f if f is not None else sys.stdout <NEW_LINE> <DEDENT> def processEnded(self, reason): <NEW_LINE> <INDENT> if not self.done.called: <NEW_LINE> <INDENT> self.done.callb... | Internal helper. | 62598f6a6e29344779affdb7 |
class ScrollsSocketClient(object): <NEW_LINE> <INDENT> queue = Queue() <NEW_LINE> subscribers = {} <NEW_LINE> auth_url = 'https://authserver.mojang.com/authenticate' <NEW_LINE> json_header = {'content-type':'application/json'} <NEW_LINE> username = None <NEW_LINE> password = None <NEW_LINE> _socket_recv = 8192 <NEW_LIN... | A Python client for the Scrolls socket server.
Usage:
YOUR_SCROLLS_EMAIL = 'user@example.com'
YOUR_SCROLLS_PASSWORD = 'password'
scrolls = ScrollsSocketClient(YOUR_SCROLLS_EMAIL, YOUR_SCROLLS_PASSWORD) | 62598f6a0a366e3fb87dc11f |
class AccountChangeView(edit_views.FormView): <NEW_LINE> <INDENT> template_name = 'mongo_auth/account.html' <NEW_LINE> form_class = forms.AccountChangeForm <NEW_LINE> success_url = urlresolvers.reverse_lazy('account') <NEW_LINE> def form_valid(self, form): <NEW_LINE> <INDENT> user = self.request.user <NEW_LINE> user.fi... | This view displays form for updating user account. It checks if all fields are valid and updates it. | 62598f6a30c21e258be97f5b |
class ACGReimbursementFormItemEntry(models.Model): <NEW_LINE> <INDENT> entry_id = models.AutoField(primary_key=True) <NEW_LINE> form = models.ForeignKey(ACGReimbursementForm, on_delete=models.SET_DEFAULT, default=None) <NEW_LINE> title = models.CharField(max_length=100) <NEW_LINE> description = models.TextField() <NEW_... | Item entry for reimbursement, included in a submitted ACG form. | 62598f6a5166f23b2e242b36 |
class TokenSerializer(serializers.Serializer): <NEW_LINE> <INDENT> token = serializers.CharField(max_length = 255) | serializer for token data | 62598f6a8e05c05ec3f6e9f3 |
class HttpApi(models.Model): <NEW_LINE> <INDENT> project = models.ForeignKey(Project, on_delete=models.CASCADE, verbose_name='所属项目') <NEW_LINE> name = models.CharField(max_length=50, verbose_name='接口名称') <NEW_LINE> requestType = models.CharField(max_length=50, verbose_name='请求方式', choices=REQUEST_TYPE_CHOICE) <NEW_LINE... | 接口信息 | 62598f6afb3f5b602db47d60 |
class HTTPLoader: <NEW_LINE> <INDENT> url = None <NEW_LINE> def get_data( self): <NEW_LINE> <INDENT> return requests.get( self.url).text | Mixin to load text data from an URL | 62598f6ad53ae8145f917bf2 |
class JTAGCom(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.addr=JTAGAddr() <NEW_LINE> self._handle=None <NEW_LINE> self.prog_id="MIMOSIS0.MIMOSIS0SC" <NEW_LINE> self.conf_path="C:/CCMOS_SCTRL/MIMOSIS0_SC/config_files" <NEW_LINE> self._mcf_file="MIMOSIS0_DEF_TEMPLATE_PIXEL_DATA.mcf" <NEW_LINE> sel... | Class to comunicate to MIMOSISOSC JTAG software and PXI acquisition software through COM
attributes:
- prog_id: ProgID for COM (default "MIMOSIS0.MIMOSIS0SC")
- conf_path: Path of config files for JTAG exe (default "C:/CCMOS_SCTRL/MIMOSIS0_SC/config_files")
- mcf_file: MCF file (default "MIMOSIS0_DEF_TEMPLATE.mc... | 62598f6a26238365f5fac2d2 |
class TestCaseStudent_List(TestCourse): <NEW_LINE> <INDENT> def test_student_list_empty(self): <NEW_LINE> <INDENT> self.assertEqual(self.csc148.student_list(), []) <NEW_LINE> <DEDENT> def test_student_list_simple(self): <NEW_LINE> <INDENT> self.csc148.add_student(self.david) <NEW_LINE> self.csc148.add_student(self.bill... | Test cases for Course.student_list() | 62598f6a711fe17d825dfe46 |
class TestGetter(unittest.TestCase): <NEW_LINE> <INDENT> def test_bioregistry_ids(self): <NEW_LINE> <INDENT> prefixes = set(bioregistry.read_registry()) <NEW_LINE> for getter in get_getters(): <NEW_LINE> <INDENT> if getter.bioregistry_id is None: <NEW_LINE> <INDENT> continue <NEW_LINE> <DEDENT> with self.subTest(name=g... | Tests for the Getter class. | 62598f6a76d4e153a661c374 |
class DummyTracer(Service): <NEW_LINE> <INDENT> name = 'dummy_tracer' <NEW_LINE> @endpoint('echo') <NEW_LINE> def echo(self, ctx, word, count): <NEW_LINE> <INDENT> if count > 0: <NEW_LINE> <INDENT> return ctx.rpc.dummy_tracer.echo(word, count-1) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return word, 0 | Call itself given number of times | 62598f6a0383005118f6ce68 |
class MeetupList(Resource): <NEW_LINE> <INDENT> @jwt_required <NEW_LINE> def post(self): <NEW_LINE> <INDENT> parser = reqparse.RequestParser() <NEW_LINE> parser.add_argument('location', required=True, help="location cannot be blank!") <NEW_LINE> parser.add_argument('topic', required=True, help="location cannot be blank... | Request on a meetup list | 62598f6abf627c535bcb0bdd |
class Metric: <NEW_LINE> <INDENT> valid_units = [] <NEW_LINE> @input_validator <NEW_LINE> def __init__( self, metric: str, value_regex=r"[0-9]+(\.[0-9]+)?", unit_regex=r"[A-Za-z]+" ): <NEW_LINE> <INDENT> if not re.fullmatch(value_regex + unit_regex, metric): <NEW_LINE> <INDENT> raise ValueError( f"{metric} is not a val... | Base type for metrics. Metrics are of the format <value><unit>.
For eg., `Bandwidth` type ("10mbit") derives from this class. Here,
value="10" and unit="mbit" | 62598f6a6e29344779affdb9 |
class RunTests(Command): <NEW_LINE> <INDENT> description = "Run the django test suite from the tests dir." <NEW_LINE> user_options = [] <NEW_LINE> extra_env = {} <NEW_LINE> extra_args = ['packages'] <NEW_LINE> def run(self): <NEW_LINE> <INDENT> for env_name, env_value in self.extra_env.items(): <NEW_LINE> <INDENT> os.e... | From django-celery | 62598f6aa4f1c619b294dd52 |
class TraceDirectoryError(ValueError): <NEW_LINE> <INDENT> pass | Error from trying to load a trace from an incorrectly-structured directory, | 62598f6a0a366e3fb87dc121 |
class CsvContactSerializer(ContactSerializer): <NEW_LINE> <INDENT> email = serializers.EmailField() | We need to override `email` field to remove UniqueValidator from it
and be sure that it should be required. | 62598f6aff9c53063f519db3 |
class Code(models.Model): <NEW_LINE> <INDENT> CHOICES = ((2, 'Annuelle'), (1, 'Semestrielle')) <NEW_LINE> content = models.CharField(max_length=30, unique=True, verbose_name=_("Code")) <NEW_LINE> semesters = models.IntegerField(choices=CHOICES, verbose_name=_("Durée")) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDE... | One-time use code for validating membership on the website | 62598f6a30c21e258be97f5d |
class Number(QArgument): <NEW_LINE> <INDENT> default = 0 <NEW_LINE> def create(self): <NEW_LINE> <INDENT> if isinstance(self, Float): <NEW_LINE> <INDENT> slider = _with_entered_exited(FractionSlider, self)() <NEW_LINE> widget = _with_entered_exited(QtWidgets.QDoubleSpinBox, self)() <NEW_LINE> widget.setMinimum(self._da... | Base class of numeric type user interface | 62598f6a1d351010ab8f32a0 |
class Ratio(object): <NEW_LINE> <INDENT> def __init__(self, numerator=0.0, denominator=0.0): <NEW_LINE> <INDENT> self.numerator = numerator <NEW_LINE> self.denominator = denominator <NEW_LINE> <DEDENT> _attrs = ["numerator", "denominator"] <NEW_LINE> _attr_types = {"numerator": float, "denominator": float} <NEW_LINE> _... | Fraction specified explicitly with a numerator and denominator, which can be used to calculate the quotient.Fraction specified explicitly with a numerator and denominator, which can be used to calculate the quotient.
| 62598f6ad10714528d69d629 |
class MUuid(object): <NEW_LINE> <INDENT> def __eq__(*args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __ge__(*args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __gt__(*args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __init__(*args, **kwargs): <NEW_LINE> <INDENT> pass <... | Manipulate UUID data. | 62598f6ad10714528d69d62a |
class BaseDataProvider(object): <NEW_LINE> <INDENT> channels = 1 <NEW_LINE> n_class = 2 <NEW_LINE> def __init__(self, a_min=None, a_max=None): <NEW_LINE> <INDENT> self.a_min = a_min if a_min is not None else -np.inf <NEW_LINE> self.a_max = a_max if a_min is not None else np.inf <NEW_LINE> <DEDENT> def _load_data_and_la... | Abstract base class for DataProvider implementation. Subclasses have to
overwrite the `_next_data` method that load the next data and label array.
This implementation automatically clips the data with the given min/max and
normalizes the values to (0,1]. To change this behavoir the `_process_data`
method can be overwri... | 62598f6a4d74a7450cd58a87 |
class ItemCotizacionAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> pass | Ciudad admin class | 62598f6a73bcbd0ca4bc99b3 |
class LicenseRule(Type): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> _repr_fields = [ "key", ] <NEW_LINE> _graphql_fields = [ "description", "key", "label", ] <NEW_LINE> @property <NEW_LINE> def description(self): <NEW_LINE> <INDENT> return self._get_field("description") <NEW_LINE> <DEDENT> @property <NEW_LINE> def k... | Represents a license rule. | 62598f6a0383005118f6ce6a |
class GetBookService: <NEW_LINE> <INDENT> query_type = ["intitle", "inauthor", "inpublisher", "subject", "isbn", "lccn", "oclc"] <NEW_LINE> gurl = "https://www.googleapis.com/books/v1/volumes?q=" <NEW_LINE> def put(self, index): <NEW_LINE> <INDENT> for i in range(index): <NEW_LINE> <INDENT> isbn = self.book_info["items... | Input : title / (author / isbn)
Output : isbn | 62598f6a38b623060ffa87fa |
class TypeSelector(Selector): <NEW_LINE> <INDENT> WEIGHT = 0 <NEW_LINE> def __init__(self, typename): <NEW_LINE> <INDENT> self.typename = typename <NEW_LINE> <DEDENT> def _select(self, stylable, ret): <NEW_LINE> <INDENT> if stylable.typename == self.typename: <NEW_LINE> <INDENT> ret.append((stylable, self.WEIGHT)) <NEW... | Select element by element.typename
| 62598f6a9b70327d1c57e509 |
class Service(TimestampedModel): <NEW_LINE> <INDENT> name = models.CharField(max_length=300) <NEW_LINE> keywords = models.ManyToManyField(ServiceKeyword, related_name="services") <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.name | Model to keep track of service. | 62598f6a6fece00bbaccb0ea |
class BadgeApplicationPurchaseConstraintsLimitPerUser(object): <NEW_LINE> <INDENT> openapi_types = { 'max_items': 'int' } <NEW_LINE> attribute_map = { 'max_items': 'maxItems' } <NEW_LINE> def __init__(self, max_items=None, local_vars_configuration=None): <NEW_LINE> <INDENT> if local_vars_configuration is None: <NEW_LIN... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598f6aff9c53063f519db5 |
class BaseBookmarkPlugin(BaseDashboardPlugin): <NEW_LINE> <INDENT> name = _("Bookmark") <NEW_LINE> group = _("URLs") <NEW_LINE> form = BookmarkForm <NEW_LINE> @property <NEW_LINE> def html_class(self): <NEW_LINE> <INDENT> html_class = super(BaseBookmarkPlugin, self).html_class <NEW_LINE> if self.data.image: <NEW_LINE> ... | Base URL plugin. | 62598f6a5166f23b2e242b3a |
class VersionTestCase(_VersionTestCase): <NEW_LINE> <INDENT> unique_entry_name = "build_fingerprint" <NEW_LINE> unique_entries = Dummy.BUILD_FINGERPRINTS <NEW_LINE> endpoint_url = reverse("hiccup_stats_api_v1_versions") <NEW_LINE> def _create_version_entities(self): <NEW_LINE> <INDENT> versions = [ self._create_dummy_v... | Test the Version and REST endpoint. | 62598f6ad10714528d69d62b |
class GeoNames(Geocoder): <NEW_LINE> <INDENT> def __init__(self, country_bias=None, username=None, timeout=DEFAULT_TIMEOUT, proxies=None): <NEW_LINE> <INDENT> super(GeoNames, self).__init__(scheme='http', timeout=timeout, proxies=proxies) <NEW_LINE> if username == None: <NEW_LINE> <INDENT> raise ConfigurationError( 'No... | GeoNames geocoder, documentation at:
http://www.geonames.org/export/geonames-search.html
Reverse geocoding also available, but not yet implemented. Documentation at:
http://www.geonames.org/maps/us-reverse-geocoder.html | 62598f6a76d4e153a661c378 |
class Solution: <NEW_LINE> <INDENT> def maxIncreaseKeepingSkyline(self, grid): <NEW_LINE> <INDENT> res = 0 <NEW_LINE> for i in range(len(grid)): <NEW_LINE> <INDENT> for j in range(len(grid)): <NEW_LINE> <INDENT> max_row = max(grid[i]) <NEW_LINE> max_col = max([ele[j] for ele in grid]) <NEW_LINE> res += min(max_row, max... | Method 2:
Same logic as Method 1, with a single
method - maxIncreaseKeepingSkyline
Your runtime beats 8.27 % of python submissions. | 62598f6ad164cc61758206db |
class PapersListScrollArea(ScrollArea): <NEW_LINE> <INDENT> def __init__(self, db, rightPanel): <NEW_LINE> <INDENT> ScrollArea.__init__(self) <NEW_LINE> self.papers = [] <NEW_LINE> self.rightPanel = rightPanel <NEW_LINE> self.db = db <NEW_LINE> rightPanel.papersList = self <NEW_LINE> <DEDENT> def addPaper(self, bibcode... | The class to be used for the central list of papers.
It's just a ScrollArea that keeps track of the papers that have been added. | 62598f6a63f4b57ef0085920 |
class TestBoxAtOriginIntersectionWithRay(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.minPoint = np.array([-.5, -.5, -.5]) <NEW_LINE> self.maxPoint = -self.minPoint <NEW_LINE> self.center = (self.minPoint + self.maxPoint) / 2. <NEW_LINE> self.box = Box({'min': self.minPoint, 'max': ... | Test basic cases where the ray intersects the box
Note: By eye (in the test_eye_* functions) we refer to the ray origin | 62598f6aa8ecb03325870967 |
class card5(unittest.TestCase): <NEW_LINE> <INDENT> def testPlayable(self): <NEW_LINE> <INDENT> app = Labyrinth(1, 1, testBlankScenarioSetup) <NEW_LINE> self.assertTrue(app.deck["5"].playable("US", app)) <NEW_LINE> <DEDENT> def testEvent(self): <NEW_LINE> <INDENT> app = Labyrinth(1, 1, testBlankScenarioSetup) <NEW_LINE... | NEST | 62598f6a6e29344779affdbd |
class ResourceId(_messages.Message): <NEW_LINE> <INDENT> id = _messages.StringField(1) <NEW_LINE> type = _messages.StringField(2) | A container to reference an id for any resource type. A `resource` in
Google Cloud Platform is a generic term for something you (a developer) may
want to interact with through one of our API's. Some examples are an App
Engine app, a Compute Engine instance, a Cloud SQL database, and so on.
Fields:
id: Required field... | 62598f6a9b70327d1c57e50b |
class sale_order_invoice_analysis(models.Model): <NEW_LINE> <INDENT> _name = 'sale.order.invoice.analysis' <NEW_LINE> _description = 'Sale invoice analysis module ' <NEW_LINE> @api.one <NEW_LINE> @api.depends('date_from', 'date_to') <NEW_LINE> def _compute_sales_amounts(self): <NEW_LINE> <INDENT> payment_amount = 0 <NE... | Invoice analysis for module | 62598f6a6fece00bbaccb0ec |
class DynamoDBBase(Base): <NEW_LINE> <INDENT> dynamodb: DynamoDB | DynamoDB基底class | 62598f6a30c21e258be97f61 |
class ZTEK2525(ZTEDBusDevicePlugin): <NEW_LINE> <INDENT> name = "ZTE K2525" <NEW_LINE> version = "0.1" <NEW_LINE> author = "Andrew Bird" <NEW_LINE> custom = ZTE2525Customizer <NEW_LINE> __remote_name__ = "K2525" <NEW_LINE> __properties__ = { 'usb_device.vendor_id': [0x19d2], 'usb_device.product_id': [0x0022], } | L{vmc.common.plugin.DBusDevicePlugin} for ZTE's version of Vodafone's K2525 | 62598f6a7b25080760ed6bfb |
class TestCybersourceTokenPagedMetadata(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 testCybersourceTokenPagedMetadata(self): <NEW_LINE> <INDENT> model = billforward.models.cybersource_token_pag... | CybersourceTokenPagedMetadata unit test stubs | 62598f6a5166f23b2e242b3c |
class Textarea(HtmlTag): <NEW_LINE> <INDENT> pass | Defines a multiline input control (text area) | 62598f6a8e05c05ec3f6e9f6 |
class PostgresDB: <NEW_LINE> <INDENT> def __init__(self, database, user, password, host, port): <NEW_LINE> <INDENT> self.database = database <NEW_LINE> self.user = user <NEW_LINE> self.password = password <NEW_LINE> self.host = host <NEW_LINE> self.port = port <NEW_LINE> self.execute('create_datebase.sql', commit=True)... | класс отвечает за работу с БД | 62598f6abe8e80087fbbe7be |
class RuntimeSettingsContainer(typedstruct.Struct): <NEW_LINE> <INDENT> __slots__ = runtimeMembers(locals()) | Container for runtime settings
@see: L{runtimeMembers} for the actual member list | 62598f6ad18da76e235b6ce7 |
class TextColumnSerializer(ColumnSerializerCollection): <NEW_LINE> <INDENT> COLUMN_TYPE_INFO = 'TEXT' <NEW_LINE> @classmethod <NEW_LINE> def _convert_bounds_type(cls, value): <NEW_LINE> <INDENT> return int(value) | (De)serializes VarChar column type. | 62598f6a8c3a8732951f5cb1 |
class Section(db.Document): <NEW_LINE> <INDENT> created_at = db.DateTimeField(default=datetime.now()) <NEW_LINE> campus = db.ReferenceField(Campus, required=True) <NEW_LINE> year = db.IntField(required=True) <NEW_LINE> name = db.StringField(required=True) | Section model | 62598f6aa4f1c619b294dd58 |
class TokenMember(_base.BasePremapMember): <NEW_LINE> <INDENT> def init(self): <NEW_LINE> <INDENT> super(TokenMember, self).init() <NEW_LINE> allowed = self.param.get('allowed') <NEW_LINE> if allowed: <NEW_LINE> <INDENT> self._allowed = dict.fromkeys([token.lower() for token in allowed]) <NEW_LINE> <DEDENT> else: <NEW_... | Unicode token storage
:ivar `_allowed`: List of allowed tokens (or ``None``) - saved in a
dict for faster lookup
:type `_allowed`: ``dict`` | 62598f6a66673b3332c2fb20 |
class BatchFactorExperiment(prs.OnlineExperiment): <NEW_LINE> <INDENT> def _config(self, top_k, seed): <NEW_LINE> <INDENT> model = rs.FactorModel(**self.parameter_defaults( begin_min=-0.01, begin_max=0.01, dimension=10, initialize_all=False, )) <NEW_LINE> updater = rs.FactorModelGradientUpdater(**self.parameter_default... | BatchFactorExperiment(dimension=10,begin_min=-0.01,begin_max=0.01,learning_rate=0.05,regularization_rate=0.0,negative_rate=0.0,number_of_iterations=3,period_length=86400,timeframe_length=0,clear_model=False)
Batch version of :py:class:`alpenglow.experiments.FactorExperiment.FactorExperiment`,
meaning it retrains its m... | 62598f6a287bf620b6271321 |
class ReplayMemoryDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, data_file, skeleton): <NEW_LINE> <INDENT> self._data = torch.load(data_file) <NEW_LINE> self._skeleton = skeleton <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self._data['reward']) <NEW_LINE> <DEDENT> def __getitem__(sel... | replay buffer dataset. | 62598f6abe8e80087fbbe7c0 |
class TestCreatePopulation(unittest.TestCase): <NEW_LINE> <INDENT> def test_returns_valid_genomes(self): <NEW_LINE> <INDENT> result = create_population(1, CANTUS_FIRMUS) <NEW_LINE> self.assertEqual(Genome, type(result[0])) <NEW_LINE> <DEDENT> def test_returns_correct_number_of_genomes(self): <NEW_LINE> <INDENT> result ... | Ensures the create_population function works as expected. | 62598f6ad53ae8145f917bfa |
class Probe(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ipaddr = None <NEW_LINE> self.name = None <NEW_LINE> self.rtt = None <NEW_LINE> self.anno = None <NEW_LINE> <DEDENT> def clone(self): <NEW_LINE> <INDENT> copy = Probe() <NEW_LINE> copy.ipaddr = self.ipaddr <NEW_LINE> copy.name = self.... | Abstraction of an individual probe in a traceroute. | 62598f6ac432627299fa2738 |
class NFSPPolicies(policy.Policy): <NEW_LINE> <INDENT> def __init__(self, env, nfsp_policies, mode): <NEW_LINE> <INDENT> game = env.game <NEW_LINE> player_ids = list(range(FLAGS.num_players)) <NEW_LINE> super(NFSPPolicies, self).__init__(game, player_ids) <NEW_LINE> self._policies = nfsp_policies <NEW_LINE> self._mode ... | Joint policy to be evaluated. | 62598f6a711fe17d825dfe4e |
class UserDao(models.BaseDao): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(UserDao, self).__init__(User) <NEW_LINE> <DEDENT> def find_by_email(self, email): <NEW_LINE> <INDENT> return self.get_query_builder().filter_by(email=email).first() | Provides access to database operations related to the User object.
Extends functionality provided by the BaseDao. | 62598f6a15baa723494616eb |
class GetTransformNode(ArmLogicTreeNode): <NEW_LINE> <INDENT> bl_idname = 'LNGetTransformNode' <NEW_LINE> bl_label = 'Get Object Transform' <NEW_LINE> arm_version = 1 <NEW_LINE> def arm_init(self, context): <NEW_LINE> <INDENT> self.add_input('ArmNodeSocketObject', 'Object') <NEW_LINE> self.add_output('ArmDynamicSocket'... | Returns the transformation of the given object. An object's
transform consists of vectors describing its global location,
rotation and scale. | 62598f6a63f4b57ef0085922 |
class VariationForm: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.u_form = [] <NEW_LINE> self.b_form = [] <NEW_LINE> <DEDENT> def add_u_form(self, form): <NEW_LINE> <INDENT> self.u_form.append(form) <NEW_LINE> <DEDENT> def add_b_form(self, form): <NEW_LINE> <INDENT> self.b_form.append(form) | A u = b
u_form 列表存储的是装配到A矩阵的项
b_form列表存储的是装配到b的项 | 62598f6a507cdc57c63a4500 |
class StampBranchSubtree(BranchSubtree): <NEW_LINE> <INDENT> schema.kindInfo(annotates=schema.Item) | A mapping between an Item and the list of top-level blocks ('rootBlocks')
that should appear when an Item inheriting from that Kind is displayed.
Each rootBlock entry should have its 'position' attribute specified, to
enable it to be sorted with other root blocks.) | 62598f6a5166f23b2e242b40 |
class Profile(models.Model): <NEW_LINE> <INDENT> pass | Class that defines profile objects of the objects | 62598f6ad164cc61758206e0 |
class CommentInline(generic.GenericStackedInline): <NEW_LINE> <INDENT> model = Comment <NEW_LINE> ct_fk_field = 'object_pk' <NEW_LINE> extra = 0 | Generic Comment Inline | 62598f6a8e05c05ec3f6e9f8 |
class RLAlgo(Algo, metaclass=ABCMeta): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def event_tick(self, event): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def event_episode_starts(self, event): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def event_episode_ends(self, event): <NEW_LINE> <INDENT... | A reinforcement learning Algo that interacts with an environment to learn how to "predict" actions such that
the sum of received reward signals (coming from the environment) is maximized.
See [1].
[1] Reinforcement Learning - An Introduction, 2nd Edition; A.G. Barto, R.S. Sutton 2018 | 62598f6a66673b3332c2fb22 |
@command_lib.CommandRegexParser(r'%s buy ([0-9]+)' % _STACK_PREFIX) <NEW_LINE> class BuyHypeStackCommand(command_lib.BaseCommand): <NEW_LINE> <INDENT> @command_lib.MainChannelOnly <NEW_LINE> @command_lib.HumansOnly() <NEW_LINE> def _Handle(self, channel: Channel, user: str, stack_amount: str) -> hypecore.MessageType: <... | Rewards consumerism with sellout HypeStacks. | 62598f6afb3f5b602db47d65 |
class Autoencoder(nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_shape, enc_shape): <NEW_LINE> <INDENT> super(Autoencoder, self).__init__() <NEW_LINE> self.encode = nn.Sequential( nn.Linear(in_shape, 128), nn.ReLU(True), nn.Dropout(0.2), nn.Linear(128, 64), nn.ReLU(True), nn.Dropout(0.2), nn.Linear(64, enc_shape... | Makes the main denoising auto
Parameters
----------
in_shape [int] : input shape
enc_shape [int] : desired encoded shape | 62598f6ac432627299fa273a |
class BucketKeyMetadata(NamedTuple): <NEW_LINE> <INDENT> last_modified: str <NEW_LINE> bytes: int | Storing meta-information about a bucket key.
last_modified: ISO 8601 format
bytes: file-size | 62598f6ad10714528d69d632 |
class HasZCoordinateSelector(HasCoordinateSelector): <NEW_LINE> <INDENT> def __init__(self, coords=None, min_points=1, tolerance=0.1): <NEW_LINE> <INDENT> super().__init__(coords=coords, min_points=min_points, tolerance=tolerance) <NEW_LINE> <DEDENT> def filter(self, objectList): <NEW_LINE> <INDENT> r = [] <NEW_LINE> f... | A CQ Selector class which filters edges which have specified values
for their Z coordinate | 62598f6a0383005118f6ce72 |
class UnknownFolderNameError(PIMException): <NEW_LINE> <INDENT> pass | Raised when a given folder name is unknown | 62598f6ad164cc61758206e1 |
class use(_use): <NEW_LINE> <INDENT> __metaclass__ = _register_command <NEW_LINE> def __call__(self, namespace, out, err): <NEW_LINE> <INDENT> self.use = namespace.profile.pkg_use <NEW_LINE> super(use, self).__call__(namespace, out, err) | Inspect package.use flags | 62598f6a8c3a8732951f5cb6 |
class dynamicalForm(QDialog): <NEW_LINE> <INDENT> def __init__(self, taskname,parent=None): <NEW_LINE> <INDENT> super(dynamicalForm,self).__init__(parent) <NEW_LINE> self.setModal(True) <NEW_LINE> self.keys = [] <NEW_LINE> self.log="" <NEW_LINE> cmd='Running '+taskname <NEW_LINE> cmd_inlines=re.sub("(.{64})", "\\1\n", ... | This is a dialog which is showed when a task is launched to HERMES. This dialog allow the user insert
the values for the parameters task. The dialog grows dinamically, adding a new field for each required parameter | 62598f6a9b70327d1c57e511 |
class DeploymentException(Exception): <NEW_LINE> <INDENT> pass | Exception Handling | 62598f6a3eb6a72ae0389da9 |
class SchemaField(object): <NEW_LINE> <INDENT> def __init__(self, name, field_type, mode='NULLABLE', description=None, fields=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.field_type = field_type <NEW_LINE> self.mode = mode <NEW_LINE> self.description = description <NEW_LINE> self.fields = fields <NEW_LIN... | Describe a single field within a table schema.
:type name: str
:param name: the name of the field.
:type field_type: str
:param field_type: the type of the field (one of 'STRING', 'INTEGER',
'FLOAT', 'BOOLEAN', 'TIMESTAMP' or 'RECORD').
:type mode: str
:param mode: the type of the field (one of 'N... | 62598f6a6fece00bbaccb0f3 |
class PluginScriptDirectory(ScriptDirectory): <NEW_LINE> <INDENT> dir = None <NEW_LINE> versions = None <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(PluginScriptDirectory, self).__init__(*args, **kwargs) <NEW_LINE> self.dir = PluginScriptDirectory.dir <NEW_LINE> self.__dict__['_version_loca... | Like `ScriptDirectory` but lets you override the paths from outside.
This is a pretty ugly hack but alembic doesn't give us a nice way to do it... | 62598f6a91af0d3eaad39571 |
class DiceTable(Dice): <NEW_LINE> <INDENT> range_sep_cp = re.compile(r'(?:\.\.)|[:]') <NEW_LINE> def __init__(self, dice_expr, table, default=None, **local_kwargs): <NEW_LINE> <INDENT> super(DiceTable, self).__init__(dice_expr, **local_kwargs) <NEW_LINE> self.table = defaultdict(lambda: default) <NEW_LINE> for key, val... | Same as a Dice field, but the result of evaluating the dice
expression is used to select a value from a table. | 62598f6abe8e80087fbbe7c4 |
class PointerNetLoss(nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(PointerNetLoss, self).__init__() <NEW_LINE> <DEDENT> def forward(self, target, logits, lengths): <NEW_LINE> <INDENT> _, tgt_max_len = target.size() <NEW_LINE> logits_flat = logits.view(-1, logits.size(-1)) <NEW_LINE> log_... | Loss function for pointer network
| 62598f6ad10714528d69d634 |
class VisitRecordMiddleWare(MiddlewareMixin): <NEW_LINE> <INDENT> def __init__(self, get_response=None): <NEW_LINE> <INDENT> self.get_response = get_response <NEW_LINE> <DEDENT> def process_request(self, request): <NEW_LINE> <INDENT> request_path = request.path_info <NEW_LINE> if 'xadmin' not in request_path: <NEW_LINE... | 游客访问记录中间件
将非管理员操作记录到数据库中 | 62598f6ad18da76e235b6cea |
class Pool: <NEW_LINE> <INDENT> def __init__(self, consumer, quantity=None, args=None, kwargs=None): <NEW_LINE> <INDENT> self.consumer = consumer <NEW_LINE> self._args = args or () <NEW_LINE> self._kwargs = kwargs or {} <NEW_LINE> self.quantity = quantity or multiprocessing.cpu_count() <NEW_LINE> self._processes = [] <... | A :py:class:`Pool` is responsible for the lifecycle of separate consumer
processes and the queue upon which they consume from.
When used as a context manager, entering the context returns the pool
object and exiting invokes its :py:meth:`join` method.
:param callable consumer:
A callable which will consume from t... | 62598f6a8c3a8732951f5cb7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.