code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class CheckAllOutputTest(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def _call(cls, *args, **kwargs): <NEW_LINE> <INDENT> from certbot_postfix.util import check_all_output <NEW_LINE> return check_all_output(*args, **kwargs) <NEW_LINE> <DEDENT> @mock.patch('certbot_postfix.util.logger') <NEW_LINE> @m...
Tests for certbot_postfix.util.check_all_output.
62598fa3baa26c4b54d4f139
class RegExpIdBase(Rule): <NEW_LINE> <INDENT> labels = [ _('Text:') ] <NEW_LINE> name = _('Objects with <Id>') <NEW_LINE> description = _("Matches objects whose Gramps ID contains a substring " "or matches a regular expression") <NEW_LINE> category = _('General filters') <NEW_LINE> allow_regex = True <NE...
Rule that checks for an object whose GRAMPS ID matches regular expression.
62598fa3a17c0f6771d5c0c3
class BSFilter: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.keywords = [] <NEW_LINE> self.kwsets = set([]) <NEW_LINE> self.bsdict = defaultdict(set) <NEW_LINE> self.pat_en = re.compile(r'^[0-9a-zA-Z]+$') <NEW_LINE> <DEDENT> def add(self, keyword): <NEW_LINE> <INDENT> if not isinstance(keyword, str)...
Filter Messages from keywords Use Back Sorted Mapping to reduce replacement times >>> f = BSFilter() >>> f.add("sexy") >>> f.filter("hello sexy baby") hello **** baby
62598fa34e4d5625663722ad
class Token(Enum): <NEW_LINE> <INDENT> OR = ("or", 0, Associative.LEFT, TokenType.OPERATOR) <NEW_LINE> AND = ("and", 1, Associative.LEFT, TokenType.OPERATOR) <NEW_LINE> NOT = ("not", 2, Associative.RIGHT, TokenType.OPERATOR) <NEW_LINE> OPEN_PARENTHESIS = ("(", -2) <NEW_LINE> CLOSE_PARENTHESIS = (")", -1) <NEW_LINE...
Describes tokens and their abilities for tag-expression parsing.
62598fa39c8ee823130400b3
class Reader: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def read_file(file_path): <NEW_LINE> <INDENT> text = '' <NEW_LINE> with open(file_path, 'r') as file: <NEW_LINE> <INDENT> for line in file.readlines(): <NEW_LINE> <INDENT> text += line <NEW_LINE> <DEDENT> <DEDENT> return text <NEW_LINE> <DEDENT> @staticmethod <...
Used in handling reading input.
62598fa3097d151d1a2c0eb4
class ProjectVersionsView(generics.ListAPIView): <NEW_LINE> <INDENT> serializer_class = serializers.VerboseVersionSerializer <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> documents = utils.list_versions(self.kwargs['name']) <NEW_LINE> if documents: <NEW_LINE> <INDENT> return documents <NEW_LINE> <DEDENT> raise...
Displays all the versions associated with a specific project.
62598fa3d7e4931a7ef3bf23
class ReaderTester: <NEW_LINE> <INDENT> filename = Undefined <NEW_LINE> start_time = Undefined <NEW_LINE> end_time = Undefined <NEW_LINE> time_zone = Undefined <NEW_LINE> name = Undefined <NEW_LINE> lat_long = Undefined <NEW_LINE> fields = Undefined <NEW_LINE> units = Undefined <NEW_LINE> sample_data = Undefined <NEW_L...
a base class for a set of tests on a file reader
62598fa3ac7a0e7691f72394
class InitProfile(ExtendedApiResource): <NEW_LINE> <INDENT> @deck.apimethod <NEW_LINE> def post(self): <NEW_LINE> <INDENT> j = self.get_input() <NEW_LINE> key = 'userid' <NEW_LINE> if key not in j: <NEW_LINE> <INDENT> return self.response( "No user identifier specified to init the profile", fail=True, code=hcodes.HTTP_...
Token authentication test
62598fa3627d3e7fe0e06d35
class FramerState(Singleton): <NEW_LINE> <INDENT> Initializing = 1 <NEW_LINE> ReadingHeader = 2 <NEW_LINE> ReadingContent = 3 <NEW_LINE> CompleteFrame = 4 <NEW_LINE> ErrorInFrame = 5
Represents the state machine of a modbus framer .. attribute:: Initializing This indicates that the framer is waiting for a new message to process. .. attribute:: ReadingHeader This indicates that the framer is currently reading the fixed size header of the current frame. .. attribute:: ReadingContent ...
62598fa37d847024c075c24f
class lazy_property: <NEW_LINE> <INDENT> def __init__(self, deferred): <NEW_LINE> <INDENT> self._deferred = deferred <NEW_LINE> self.__doc__ = deferred.__doc__ <NEW_LINE> <DEDENT> def __get__(self, obj, cls): <NEW_LINE> <INDENT> if obj is None: <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> value = self._deferred(...
A @property that is only evaluated once.
62598fa3adb09d7d5dc0a414
class BeatTrackExtractor(LibrosaFeatureExtractor): <NEW_LINE> <INDENT> _feature = 'beat_track'
Dynamic programming beat tracker (beat_track) from audio using the Librosa library. For details on argument specification visit: https://librosa.org/doc/latest/generated/librosa.beat.beat_track.html.
62598fa3fff4ab517ebcd66e
class LinksSpider(scrapy.Spider): <NEW_LINE> <INDENT> name = "od_links" <NEW_LINE> black_list = ( "?C=N;O=D", "?C=M;O=A", "?C=S;O=A", "?C=D;O=A", ) <NEW_LINE> saved_links = set() <NEW_LINE> def __index__(self, **kw): <NEW_LINE> <INDENT> super(LinksSpider, self).__init__(**kw) <NEW_LINE> self.base_url = kw.get("base_url...
Scrapy spider for open directories. Will gather all download links recursively
62598fa3442bda511e95c2e5
class hashtag(models.Model): <NEW_LINE> <INDENT> blogId = models.ForeignKey(userpost) <NEW_LINE> hashtags = models.ManyToManyField(hashs) <NEW_LINE> @property <NEW_LINE> def hashlist(self): <NEW_LINE> <INDENT> return list(self.hashtags.all())
docstring for hashtags
62598fa3009cb60464d013af
class RegistrationView(utils.SendEmailViewMixin, generics.CreateAPIView): <NEW_LINE> <INDENT> serializer_class = serializers.UserRegistrationSerializer <NEW_LINE> permission_classes = ( permissions.AllowAny, ) <NEW_LINE> token_generator = default_token_generator <NEW_LINE> subject_template_name = 'activation_email_subj...
Use this endpoint to register new user.
62598fa30c0af96317c5620b
class RoRStatUpgrade(StatUpgrade): <NEW_LINE> <INDENT> def is_unique(self) -> bool: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return f"RoRStatUpgrade<{self.get_id()}>"
Upgrades attributes of units/buildings or other stats in the game.
62598fa3851cf427c66b8152
class ZetaSaver(object): <NEW_LINE> <INDENT> def __init__(self, output_filename): <NEW_LINE> <INDENT> self.output_filename = output_filename <NEW_LINE> <DEDENT> def __call__(self, inverse_solver, count, data): <NEW_LINE> <INDENT> zeta = data.zeta <NEW_LINE> zeta.metadata().set_name('zeta_inv') <NEW_LINE> zeta.metadata(...
Iteration listener used to save a copy of the current value of :math:`\zeta` (i.e. a parameterized design variable such as :math:`\tau_c` or hardness) at each iteration during an inversion. The intent is to use a saved value to restart an inversion if need be.
62598fa301c39578d7f12c09
class OntologyConfigSchema(Schema): <NEW_LINE> <INDENT> id = fields.Str(description="local identifier") <NEW_LINE> handle = fields.Str(description="ontology handle") <NEW_LINE> pre_load = fields.Bool(description="if true, load this ontology at startup") <NEW_LINE> @post_load <NEW_LINE> def make_object(self, data, **kwa...
Set of ontologies
62598fa3e1aae11d1e7ce768
class ASAxesPlotBuilderNoTitle(ASAxesPlotBuilder): <NEW_LINE> <INDENT> def _get_axes_rect(self): <NEW_LINE> <INDENT> return [0.08, 0.15, 0.85, 0.8] <NEW_LINE> <DEDENT> def _get_title_kwargs(self): <NEW_LINE> <INDENT> kw = super()._get_title_kwargs() <NEW_LINE> kw.update({"visible": False}) <NEW_LINE> return kw
AS Axes plot without the tile string, this leaves more space for the plot
62598fa324f1403a926857f8
class MetaToPair(gr.sync_block): <NEW_LINE> <INDENT> def __init__(self, incomingKeyName, outgoingPairName): <NEW_LINE> <INDENT> gr.sync_block.__init__(self, name="MetaToPair", in_sig=None, out_sig=None) <NEW_LINE> self.incomingKeyName = str(incomingKeyName) <NEW_LINE> self.outgoingPairName = str(outgoingPairName) <NEW_...
This block converts a metadata dictionary item to a pmt pair that is compatible with other blocks expecting a pair in. You can specify which item in the incoming metadata to output as a pair and what the pair name is.
62598fa399cbb53fe6830d5e
class CreateObjects(MethodCall): <NEW_LINE> <INDENT> def __init__(self, **kw): <NEW_LINE> <INDENT> objs = [] <NEW_LINE> for path, interfaces in kw.pop('objs').iteritems(): <NEW_LINE> <INDENT> key_o = TrivialArgument( value=path, type='string', decorators=[Literal('string')]) <NEW_LINE> value_i = [] <NEW_LINE> for inter...
Assemble a createObjects functor.
62598fa35166f23b2e243262
class ListPolicy(lister.Lister): <NEW_LINE> <INDENT> log = logging.getLogger(__name__ + '.ListPolicy') <NEW_LINE> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(ListPolicy, self).get_parser(prog_name) <NEW_LINE> parser.add_argument( '--include-blob', action='store_true', default=False, help='Additi...
List policy command
62598fa366673b3332c30252
class CasePuits(Case): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Case.__init__(self, "le puits", "O", "|rg|", "dans", "tombez", "tombe", " !") <NEW_LINE> <DEDENT> def __getnewargs__(self): <NEW_LINE> <INDENT> return () <NEW_LINE> <DEDENT> def arrive(self, jeu, plateau, partie, personnage, coup): <NEW_...
Classe représentant le puits.
62598fa34f6381625f199402
class Point(O): <NEW_LINE> <INDENT> def __init__(self, decisions): <NEW_LINE> <INDENT> O.__init__(self) <NEW_LINE> self.decisions = decisions <NEW_LINE> self.objectives = [] <NEW_LINE> <DEDENT> def __hash__(self): <NEW_LINE> <INDENT> return hash(tuple(self.decisions)) <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_L...
Represents a member of the population
62598fa3dd821e528d6d8dbf
class Agenda(models.Model): <NEW_LINE> <INDENT> patient = models.ForeignKey(Patient, on_delete=models.CASCADE, related_name = 'agenda_patient') <NEW_LINE> clinicien = models.ForeignKey(Clinicien, on_delete=models.CASCADE, related_name = 'agenda_clini') <NEW_LINE> objet = models.CharField(max_length=250) <NEW_LINE> debu...
Utilisation d'un graphe pour créneau agenda
62598fa37047854f4633f262
class BaseView(object): <NEW_LINE> <INDENT> def __call__(self, request, *args, **kwargs): <NEW_LINE> <INDENT> method = request.method.lower() <NEW_LINE> if hasattr(self, method): <NEW_LINE> <INDENT> return getattr(self, method)(request, *args, **kwargs) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise Http404('Not s...
A base class for views that delegates handling to GET, POST methods based on reques method. An instance of this class must be created to be used in the url patterns.
62598fa34f88993c371f044f
class IVImageFilterType(): <NEW_LINE> <INDENT> ImageFilter_Gaussion3 = 0 <NEW_LINE> ImageFilter_Gaussion5 = 1 <NEW_LINE> ImageFilter_Gaussion = 2 <NEW_LINE> ImageFilter_Median = 3 <NEW_LINE> ImageFilter_Sharpen = 4 <NEW_LINE> ImageFilter_SobelX = 5, <NEW_LINE> ImageFilter_SobelY = 6 <NEW_LINE> ImageFilter_SobelA = 7 <N...
Image filter type
62598fa321bff66bcd722af0
class MembershipType(models.Model): <NEW_LINE> <INDENT> name = models.CharField( max_length=200, ) <NEW_LINE> description = models.TextField( blank=True, null=True, ) <NEW_LINE> def publish(self): <NEW_LINE> <INDENT> self.save() <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.name
MembershipType data model.
62598fa330dc7b766599f6d8
class OperatingPoint(object): <NEW_LINE> <INDENT> def __init__(self, omega, rms_motor_power, rms_output_power, rms_input_power, average_motor_power, torque): <NEW_LINE> <INDENT> self._omega = omega <NEW_LINE> self._rms_motor_power = rms_motor_power <NEW_LINE> self._rms_output_power = rms_output_power <NEW_LINE> self._r...
Represents one operating point of a motor. This is intended to include all of the useful output metrics for an operating point (speed, torque, etc) of a motor. Attributes ---------- omega : float The speed of the motor in rad/s. rms_motor_power : float The RMS power dissipated in the motor in W. rms_output_po...
62598fa3a17c0f6771d5c0c4
class SnippetSourceDirective(SphinxDirective): <NEW_LINE> <INDENT> required_arguments = 1 <NEW_LINE> optional_arguments = 1 <NEW_LINE> has_content = True <NEW_LINE> option_spec = { 'emphasize-lines': directives.unchanged_required, 'caption': directives.unchanged_required, 'commercial': directives.flag, } <NEW_LINE> def...
.. snippet-source:: filepath_relative_to_project_root [code]
62598fa3baa26c4b54d4f13b
class Grade(Base): <NEW_LINE> <INDENT> __tablename__ = 'grades' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> name = Column(String(32),nullable=False) <NEW_LINE> student = relationship('Student', secondary=grade_m2m_student, backref='grades') <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return "课程名...
课程表,id,课程名,对grade_m2m_student,grade_record表进行关联,一个课程对应多个学生,一个学生也可以对应多个课程
62598fa33539df3088ecc13f
class ActiveEnrichmentSessionResponse(object): <NEW_LINE> <INDENT> swagger_types = { 'payload': 'ActiveEnrichmentSession' } <NEW_LINE> attribute_map = { 'payload': 'payload' } <NEW_LINE> def __init__(self, payload=None): <NEW_LINE> <INDENT> self._payload = None <NEW_LINE> self.discriminator = None <NEW_LINE> if payload...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598fa3d58c6744b42dc219
class Cert_TrustPointSetInfoIDL_args(object): <NEW_LINE> <INDENT> thrift_spec = (None, (1, TType.STRING, 'TrustPointName', None, None), (2, TType.I32, 'action', None, None), (3, TType.STRUCT, 'SetInfo', (CertTrustpointInfoInIDL, CertTrustpointInfoInIDL.thrift_spec), None)) <NEW_LINE> def __init__(self, TrustPointName =...
Attributes: - TrustPointName - action - SetInfo
62598fa31f5feb6acb162aad
class Handler(handler.handler): <NEW_LINE> <INDENT> def dispatch(self, session): <NEW_LINE> <INDENT> req_body = self.context.request.body <NEW_LINE> resp_body = self.context.response.body <NEW_LINE> user_id = req_body.userid <NEW_LINE> if not user_id: <NEW_LINE> <INDENT> raise Error(-1, '用户id参数缺失') <NEW_LINE> <DEDENT> ...
我的订单数目
62598fa3dd821e528d6d8dc0
class ManagedClusterPoolUpgradeProfile(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'kubernetes_version': {'required': True}, 'os_type': {'required': True}, } <NEW_LINE> _attribute_map = { 'kubernetes_version': {'key': 'kubernetesVersion', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'os_...
The list of available upgrade versions. All required parameters must be populated in order to send to Azure. :ivar kubernetes_version: Required. Kubernetes version (major, minor, patch). :vartype kubernetes_version: str :ivar name: Pool name. :vartype name: str :ivar os_type: Required. OsType to be used to specify os...
62598fa3627d3e7fe0e06d37
class SortedListNode(object): <NEW_LINE> <INDENT> IS_GREATER = True <NEW_LINE> def __init__(self, index, value): <NEW_LINE> <INDENT> super(SortedListNode, self).__init__() <NEW_LINE> self.index = index <NEW_LINE> self.value = value <NEW_LINE> self._is_delete = False <NEW_LINE> return None <NEW_LINE> <DEDENT> def __str_...
Documentation for SortedListNode
62598fa367a9b606de545e56
class RMVDepartureSensor(SensorEntity): <NEW_LINE> <INDENT> def __init__( self, station, destinations, direction, lines, products, time_offset, max_journeys, name, timeout, ): <NEW_LINE> <INDENT> self._station = station <NEW_LINE> self._name = name <NEW_LINE> self._state = None <NEW_LINE> self.data = RMVDepartureData( ...
Implementation of an RMV departure sensor.
62598fa34527f215b58e9d6e
class DateTimeField(Field): <NEW_LINE> <INDENT> def clean_param_value(self, value): <NEW_LINE> <INDENT> value = super(DateTimeField, self).clean_param_value(value) <NEW_LINE> return self._parse_datetime_string(value) <NEW_LINE> <DEDENT> def clean_result_value(self, value): <NEW_LINE> <INDENT> value = super(DateTimeFiel...
For date-and-time (timestamp) values, automatically normalized to UTC.
62598fa363d6d428bbee263d
class AbstractNotifier(threading.Thread): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> def __init__(self, config, logger, msg_queue): <NEW_LINE> <INDENT> super(AbstractNotifier, self).__init__() <NEW_LINE> self._config = config <NEW_LINE> self._msg_queue = msg_queue <NEW_LINE> self._logger = logger <NEW_LINE>...
Serves as a base class for all plugins
62598fa3a8370b77170f0265
class User(db.Model): <NEW_LINE> <INDENT> id = db.Column(db.Integer, nullable=False, autoincrement=True, primary_key=True) <NEW_LINE> email = db.Column(db.String, nullable=False, unique=True) <NEW_LINE> phone = db.Column(db.String, unique=True) <NEW_LINE> name = db.Column(db.String, nullable=False) <NEW_LINE> hashed_pa...
model of user
62598fa3a8ecb0332587109a
class Meta(object): <NEW_LINE> <INDENT> model = DashboardSettings <NEW_LINE> fields = ('user', 'layout_uid', 'title', 'is_public')
Meta.
62598fa38da39b475be0306c
class UserTicketSubscription(TicketSubscription): <NEW_LINE> <INDENT> __mapper_args__ = { 'polymorphic_identity': TicketSubscriptionType.user } <NEW_LINE> def get_addresses(self): <NEW_LINE> <INDENT> if not self.user: <NEW_LINE> <INDENT> raise StopIteration <NEW_LINE> <DEDENT> for addr in self.user.email_addresses: <NE...
Describes one link between a ticket and a user.
62598fa37d847024c075c252
class CNN: <NEW_LINE> <INDENT> def __init__(self, train_x, train_y, test_x, test_y, epochs = 15, batch_size=128, ): <NEW_LINE> <INDENT> self.batch_size = batch_size <NEW_LINE> self.epochs = epochs <NEW_LINE> print (len(train_x)) <NEW_LINE> print (len([elem for elem in train_x])) <NEW_LINE> self.train_y = np.array(train...
CNN classifier
62598fa3009cb60464d013b1
class Controller(object): <NEW_LINE> <INDENT> def __init__(self, display): <NEW_LINE> <INDENT> self.display = display <NEW_LINE> <DEDENT> def control_quit(self): <NEW_LINE> <INDENT> for event in pygame.event.get(): <NEW_LINE> <INDENT> if event.type == pygame.QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE): <N...
This is the event controller - NOT USED AT THE MOMENT
62598fa30c0af96317c5620d
@public <NEW_LINE> class DigestMemberRoster(DeliveryMemberRoster): <NEW_LINE> <INDENT> name = 'digest_members' <NEW_LINE> @property <NEW_LINE> def members(self): <NEW_LINE> <INDENT> yield from self._get_members( DeliveryMode.plaintext_digests, DeliveryMode.mime_digests, DeliveryMode.summary_digests)
Return all the regular delivery members of a list.
62598fa301c39578d7f12c0b
@patch("dakara_player.__main__.exit") <NEW_LINE> @patch.object(ArgumentParser, "parse_args") <NEW_LINE> class MainTestCase(TestCase): <NEW_LINE> <INDENT> def test_normal_exit(self, mocked_parse_args, mocked_exit): <NEW_LINE> <INDENT> function = MagicMock() <NEW_LINE> mocked_parse_args.return_value = Namespace(function=...
Test the main action.
62598fa307f4c71912baf2cf
class Bishop(Piece): <NEW_LINE> <INDENT> def __init__(self, player: object, row: int, column: int): <NEW_LINE> <INDENT> super().__init__(player=player, row=row, column=column, name='bishop', evaluation=3) <NEW_LINE> <DEDENT> def legal_moves(self, board: object, pins: list = ()) -> list[object]: <NEW_LINE> <INDENT> unpr...
A 'Bishop' moves any distance in all diagonal directions. The bishop always remains on squares of the same color during a game. That is why each player has a white-squared bishop and a black-squared bishop at the beginning. Both together (the bishop pair) can be a particularly great power, as they complement each othe...
62598fa33317a56b869be48f
class DirRecTabularRegressionForecaster(_DirRecReducer): <NEW_LINE> <INDENT> _estimator_scitype = "tabular-regressor"
Dir-rec reduction from forecasting to tabular regression. For the hybrid dir-rec strategy, a separate forecaster is fitted for each step ahead of the forecasting horizon and then the previous forecasting horizon is added as an input for training the next forecaster, following the recusrive strategy. Parameters ------...
62598fa32c8b7c6e89bd3652
class CODE_TYPE(object): <NEW_LINE> <INDENT> FLOW = 1 <NEW_LINE> ORDER = 2
编号类型
62598fa391af0d3eaad39c99
class Solution: <NEW_LINE> <INDENT> def uniquePaths(self, m, n): <NEW_LINE> <INDENT> dp = [[0] * n for _ in range(m)] <NEW_LINE> for i in range(m): <NEW_LINE> <INDENT> dp[i][0] = 1 <NEW_LINE> <DEDENT> for j in range(n): <NEW_LINE> <INDENT> dp[0][j] = 1 <NEW_LINE> <DEDENT> for i in range(1, m): <NEW_LINE> <INDENT> for j...
@param m: positive integer (1 <= m <= 100) @param n: positive integer (1 <= n <= 100) @return: An integer
62598fa3e64d504609df92ff
class IDataCubeSettings(Interface): <NEW_LINE> <INDENT> datacube_thumbnail = schema.TextLine( title=_(u"DataCube thumbnail"), description=_(u"Default picture URL when no thumbnail is available"), required=True, default=u"++resource++scoreboard.theme.images/connect_thumbnail.png" ) <NEW_LINE> visualization_thumbnail = s...
Settings for datacube
62598fa367a9b606de545e57
class StorageFileField(forms.MultiValueField): <NEW_LINE> <INDENT> def __init__(self, language=None, *args, **kwargs): <NEW_LINE> <INDENT> attrs = kwargs.pop('attrs', {}) <NEW_LINE> language_initial = getattr(language, 'code', None) <NEW_LINE> if language_initial: <NEW_LINE> <INDENT> language_queryset = Language.object...
Field for handling creation/deletion of StorageFile objects based on file upload. Whenever a file is chosen to be uploaded, the upload happens through AJAX using the storage app API, creating a StorageFile object accordingly. The deletion of the uploaded file happens through AJAX too, as the setting of the related lan...
62598fa33eb6a72ae038a4d0
class WordSet: <NEW_LINE> <INDENT> def __init__(self, words=None): <NEW_LINE> <INDENT> if words == None: <NEW_LINE> <INDENT> self.words = set() <NEW_LINE> self.letterFreq = collections.Counter() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.words = words.copy() <NEW_LINE> self.updated() <NEW_LINE> <DEDENT> <DEDENT...
Simple class to encapsulate a set of possible words and the letter frequency assoicated with it.
62598fa34f6381625f199403
class SetVolume(command.Command): <NEW_LINE> <INDENT> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(SetVolume, self).get_parser(prog_name) <NEW_LINE> parser.add_argument( 'volume', metavar='<volume>', help=_('Volume to modify (name or ID)'), ) <NEW_LINE> parser.add_argument( '--name', metavar='<na...
Set volume properties
62598fa3d6c5a102081e1fd3
class SetOwnershipView(BaseLoggedInPage): <NEW_LINE> <INDENT> @View.nested <NEW_LINE> class form(View): <NEW_LINE> <INDENT> user_name = BootstrapSelect('user_name') <NEW_LINE> group_name = BootstrapSelect('group_name') <NEW_LINE> entities = View.nested(BaseNonInteractiveEntitiesView) <NEW_LINE> save_button = Button('Sa...
Set vms/instance ownership page The title actually as Instance|VM.VM_TYPE string in it, otherwise the same
62598fa3090684286d593621
class AnchorPosWrapper(QObject): <NEW_LINE> <INDENT> _spinbox_changed_signal = pyqtSignal(float) <NEW_LINE> _SPINNER_THRESHOLD = 0.001 <NEW_LINE> def __init__(self, x, y, z): <NEW_LINE> <INDENT> super(AnchorPosWrapper, self).__init__() <NEW_LINE> self._x = x <NEW_LINE> self._y = y <NEW_LINE> self._z = z <NEW_LINE> self...
Wraps the UI elements of one anchor position
62598fa3c432627299fa2e67
class PermalinkHandler(tornado.web.RequestHandler): <NEW_LINE> <INDENT> async def post(self): <NEW_LINE> <INDENT> def encode(s): <NEW_LINE> <INDENT> return base64.urlsafe_b64encode( zlib.compress(s.encode("utf8"))).decode("utf8") <NEW_LINE> <DEDENT> args = self.request.arguments <NEW_LINE> logger.debug("Storing permali...
Permalink generation request handler. This accepts the code and language strings and stores these in the permalink database. A zip and query string are returned. The specified id can be used to generate permalinks with the format ``<root_url>?q=<id>``.
62598fa3fff4ab517ebcd671
class BatchMakerWQ(BatchMakerShell): <NEW_LINE> <INDENT> def _write_scripts(self, tileid): <NEW_LINE> <INDENT> super(BatchMakerWQ,self)._write_scripts() <NEW_LINE> self._write_wq_script(tileid) <NEW_LINE> <DEDENT> def _write_wq_script(self, tileid): <NEW_LINE> <INDENT> pass
write wq submit scripts in addition to shell scripts
62598fa31f037a2d8b9e3f76
class AnnotatedTask: <NEW_LINE> <INDENT> on_changed = aioxmpp.callbacks.Signal() <NEW_LINE> def __init__(self, asyncio_task: asyncio.Task): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.__asyncio_task = asyncio_task <NEW_LINE> self.__text = None <NEW_LINE> self.__progress_ratio = None <NEW_LINE> <DEDENT> def a...
A :class:`asyncio.Task` wrapper with human-readable information. :param asyncio_task: The asyncio Task of this annotated task. :type asyncio_task: :class:`asyncio.Task`
62598fa3e5267d203ee6b799
class Rectangle(): <NEW_LINE> <INDENT> def __init__(self, width=0, height=0): <NEW_LINE> <INDENT> self.width = width <NEW_LINE> self.height = height <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> string = "" <NEW_LINE> if self.width == 0 or self.height == 0: <NEW_LINE> <INDENT> return string <NEW_LINE> <DED...
rectangle class for storing rectangle data
62598fa33539df3088ecc141
class UpdateArticle(UpdateView): <NEW_LINE> <INDENT> model = Article <NEW_LINE> fields = ['title', 'intro', 'content'] <NEW_LINE> template_name = "articles/update_article.html" <NEW_LINE> def dispatch(self, request, *args, **kwargs): <NEW_LINE> <INDENT> if request.user != self.get_object().author and not request.user.i...
Modification d'un article L'utilisateur qui veut modifier l'article doit en être l'auteur
62598fa39c8ee823130400b5
class TwitterRecentMessagesUser(): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self._trmu_initiate_loop(self, **kwargs) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def _trmu_initiate_loop(cls, self, **kwargs): <NEW_LINE> <INDENT> for index, row in self.df_uref.iterrows(): <NEW_LINE> <INDENT> u...
Recent messages per user, get timestamps if necessary.
62598fa3d58c6744b42dc21a
class Chromosome(list): <NEW_LINE> <INDENT> def __add__(self, other): <NEW_LINE> <INDENT> l = [] <NEW_LINE> for i,(pos,allele) in enumerate(self): <NEW_LINE> <INDENT> l.append(allele + other[i][1]) <NEW_LINE> <DEDENT> return l <NEW_LINE> <DEDENT> def __mul__(self, other): <NEW_LINE> <INDENT> swap = 0 <NEW_LINE> recomb ...
list of (pos,allele) tuples, where x is position expressed as a genetic distance in Morgans, e.g. chr1 = Chromosome([(0.01,Wh),(0.3,Wr)])
62598fa3b7558d58954634bb
class Flocci(GenericTumblrV1): <NEW_LINE> <INDENT> name = "flocci" <NEW_LINE> long_name = "floccinaucinihilipilification" <NEW_LINE> url = "https://floccinaucinihilipilificationa.tumblr.com"
Class to retrieve floccinaucinihilipilification comics.
62598fa301c39578d7f12c0c
class Node: <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> self.parent = parent <NEW_LINE> self.left = None <NEW_LINE> self.right = None <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def count_elements(node): <NEW_LINE> <INDENT> if node is None: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> retur...
Single node in Binary Tree
62598fa34527f215b58e9d70
class Param(object): <NEW_LINE> <INDENT> def __init__(self, name, class_name=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.class_name = class_name
This class represents the HTTP parameter.
62598fa3fff4ab517ebcd672
class Block(object): <NEW_LINE> <INDENT> def __init__(self, index, timestamp, current_transactions, proof, previous_hash): <NEW_LINE> <INDENT> self.index = index <NEW_LINE> self.timestamp = timestamp <NEW_LINE> self.transactions = current_transactions <NEW_LINE> self.proof = proof <NEW_LINE> self.previous_hash = previo...
Constructor
62598fa332920d7e50bc5ee4
class A(Element): <NEW_LINE> <INDENT> tag_name = 'a' <NEW_LINE> def __init__(self, link, content): <NEW_LINE> <INDENT> super().__init__(content, href=link)
<a> tag
62598fa34a966d76dd5eed70
class DoubleStaircaseReinforced(AdaptiveBase): <NEW_LINE> <INDENT> def __init__(self, stims, rate_constant=.05, probe_rate=.1, sample_log=False, **kwargs): <NEW_LINE> <INDENT> super(DoubleStaircaseReinforced, self).__init__(**kwargs) <NEW_LINE> self.dblstaircase = DoubleStaircase(stims, rate_constant) <NEW_LINE> self.s...
Generates conditions as with DoubleStaircase, but 1-probe_rate proportion of the trials easier/known trials to reduce frustration. Easier trials are sampled from a log shaped distribution so that more trials are sampled from the edges than near the indices stims: an array of stimuli names ordered from most easily lef...
62598fa3a8370b77170f0268
class LoginForm(Form, NextFormMixin): <NEW_LINE> <INDENT> email = StringField(get_form_field_label('email')) <NEW_LINE> password = PasswordField(get_form_field_label('password')) <NEW_LINE> remember = BooleanField(get_form_field_label('remember_me')) <NEW_LINE> submit = SubmitField(get_form_field_label('login')) <NEW_L...
The default login form
62598fa3cc0a2c111447ae9c
class TestValidDirRePlyPacket(object): <NEW_LINE> <INDENT> def test_get_message(self): <NEW_LINE> <INDENT> state = RET_SUCCESS <NEW_LINE> info = 'test infomation' <NEW_LINE> packet = ValidDirReplyPacket(state, info) <NEW_LINE> msg = packet.get_message() <NEW_LINE> eq_(OP_VALID_DIR_REPLY, msg['method']) <NEW_LINE> eq_(s...
the valid dir reply packet
62598fa391f36d47f2230de9
class Student(): <NEW_LINE> <INDENT> def __init__(self, name, age, sex, id_num): <NEW_LINE> <INDENT> self.__name = name <NEW_LINE> self.__age = age <NEW_LINE> self.__sex = sex <NEW_LINE> self.__id = id_num <NEW_LINE> <DEDENT> def get_name(self): <NEW_LINE> <INDENT> return self.__name <NEW_LINE> <DEDENT> def get_age(sel...
Define a student.
62598fa3097d151d1a2c0eb9
class moduleFormSet(BaseFormSet): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(moduleFormSet, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def clean(self): <NEW_LINE> <INDENT> if any(self.errors): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> l = [] <NEW_LINE> for form in s...
class for multiple forms in a same template
62598fa33eb6a72ae038a4d2
class Cache1(object): <NEW_LINE> <INDENT> def __init__(self, transforms=TRANSFORMS): <NEW_LINE> <INDENT> super(Cache1, self).__init__() <NEW_LINE> self.boards = {} <NEW_LINE> self.transforms = transforms <NEW_LINE> <DEDENT> def set(self, board, value): <NEW_LINE> <INDENT> for transform in self.transforms: <NEW_LINE> <I...
docstring for Cache1
62598fa34f6381625f199404
@attr.s(kw_only=True) <NEW_LINE> class Group: <NEW_LINE> <INDENT> pass
Base class for Group attribute available at ALFAsim.
62598fa3be383301e0253686
class Ip(DataObject): <NEW_LINE> <INDENT> class_token = ['count', 'list'] <NEW_LINE> instance_token = ['info'] <NEW_LINE> all_token = class_token + instance_token <NEW_LINE> @classmethod <NEW_LINE> def count(cls, api): <NEW_LINE> <INDENT> info("Counting IPs") <NEW_LINE> with catch_fault(): <NEW_LINE> <INDENT> res = api...
An IP address.
62598fa37047854f4633f266
class AppRunnerListener(object): <NEW_LINE> <INDENT> def preprocess(self) -> None: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def postprocess(self, pre_launch_timestamp: str) -> None: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def metrics_selector(self, am_start_output: str, pre_launch_timestamp: str) -> None: <NEW...
Interface for lisenter of AppRunner.
62598fa31f037a2d8b9e3f78
class SuiteNotFoundError(Exception): <NEW_LINE> <INDENT> pass
Suite not found or did not parse successfully.
62598fa3e5267d203ee6b79b
class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): <NEW_LINE> <INDENT> VERSION = 1 <NEW_LINE> async def async_step_import(self, data: dict[str, Any]) -> FlowResult: <NEW_LINE> <INDENT> name = data.get(CONF_NAME, DEFAULT_NAME) <NEW_LINE> host = data[CONF_HOST] <NEW_LINE> self._async_abort_entries_match({CONF_HO...
Handle a config flow for the Vallox integration.
62598fa3baa26c4b54d4f13f
class User(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'users' <NEW_LINE> username = db.Column(db.String(20), nullable=False, primary_key=True, unique=True) <NEW_LINE> password = db.Column(db.Text, nullable=False) <NEW_LINE> email = db.Column(db.String(50) , nullable=False , unique=True) <NEW_LINE> first_name = db....
User.
62598fa33539df3088ecc143
class AddSmsSignRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.SignName = None <NEW_LINE> self.SignType = None <NEW_LINE> self.DocumentType = None <NEW_LINE> self.International = None <NEW_LINE> self.UsedMethod = None <NEW_LINE> self.ProofImage = None <NEW_LINE> self.Commission...
AddSmsSign请求参数结构体
62598fa3a17c0f6771d5c0c8
class MovieSearchResult(object): <NEW_LINE> <INDENT> def __init__(self, name, name_alt, year, url): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.name_alt = name_alt <NEW_LINE> self.url = url <NEW_LINE> self.year = year <NEW_LINE> <DEDENT> def get_movie(self): <NEW_LINE> <INDENT> return get_movie(self.url)
Třída reprezentující položku filmu z výsledků hledání na ČSFD. Obsahuje pouze základní informace dostupné ze stránky s výsledky a poskytuje metodu pro získání objektu obsahující kompletní informace ze stránky filmu.
62598fa3aad79263cf42e66e
class AdministradorNoModificaSuperUsuarios(permissions.BasePermission): <NEW_LINE> <INDENT> def has_object_permission(self, request, view, obj): <NEW_LINE> <INDENT> is_grupo_usuario_admin = request.user.grupo.name == "Administrador" <NEW_LINE> is_grupo_obj_superuser = (obj.grupo.name == "SuperUsuario" or obj.grupo.name...
This class implement the following permission: Only the SuperUsuario can modify, see and delete its information Esta clase implementa el siguiente permiso: Solo el SuperUsuario puede modificar, ver y eliminar su propia informacion
62598fa33617ad0b5ee05fe1
class Descriptor: <NEW_LINE> <INDENT> def __init__(self, descriptor: dict, file_name: str = ""): <NEW_LINE> <INDENT> self._descriptor = descriptor <NEW_LINE> self._set_file_name(file_name, self.table_name) <NEW_LINE> <DEDENT> @property <NEW_LINE> def table_name(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return...
Stores all of the procedures for extracting data from descriptors.
62598fa3a79ad16197769eef
class T411Auth(AuthBase): <NEW_LINE> <INDENT> def __init__(self, token): <NEW_LINE> <INDENT> if isinstance(token, six.text_type): <NEW_LINE> <INDENT> self.token = token.encode('utf-8') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.token = token <NEW_LINE> <DEDENT> <DEDENT> def __call__(self, r): <NEW_LINE> <INDENT...
Attaches HTTP Authentication to the given Request object.
62598fa33d592f4c4edbad5c
class Function(node.Node('name', 'signatures')): <NEW_LINE> <INDENT> __slots__ = ()
A function or a method. Attributes: name: The name of this function. signatures: Possible list of parameter type combinations for this function.
62598fa38c0ade5d55dc35d7
class WebhookSaltAPIHandler(SaltAPIHandler): <NEW_LINE> <INDENT> def post(self, tag_suffix=None): <NEW_LINE> <INDENT> disable_auth = self.application.mod_opts.get("webhook_disable_auth") <NEW_LINE> if not disable_auth and not self._verify_auth(): <NEW_LINE> <INDENT> self.redirect("/login") <NEW_LINE> return <NEW_LINE> ...
A generic web hook entry point that fires an event on Salt's event bus External services can POST data to this URL to trigger an event in Salt. For example, Amazon SNS, Jenkins-CI or Travis-CI, or GitHub web hooks. .. note:: Be mindful of security Salt's Reactor can run any code. A Reactor SLS that responds to a...
62598fa3d58c6744b42dc21b
class SMC100Test(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self) -> None: <NEW_LINE> <INDENT> addr = '/dev/ttyUSB0' <NEW_LINE> device_index = 1 <NEW_LINE> self.device = newport.SMC100(addr, device_index) <NEW_LINE> self.device.initialize() <NEW_LINE> <DEDENT> def tearDown(self) -> None: <NEW_LINE> <INDENT> self...
For testing the Newport SMC100 class.
62598fa332920d7e50bc5ee5
class BotCommand: <NEW_LINE> <INDENT> def __init__(self, dictionary=None): <NEW_LINE> <INDENT> if dictionary is None: <NEW_LINE> <INDENT> dictionary = {} <NEW_LINE> <DEDENT> self.dict = dictionary <NEW_LINE> self.command = dictionary["command"] if "command" in dictionary else None <NEW_LINE> self.description = dictiona...
This object represents a bot command.[See on Telegram API](https://core.telegram.org/bots/api#botcommand) - - - - - **Fields**: - `command`: `string` - Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. - `description`: `string` - Description of the command; 1-25...
62598fa3cb5e8a47e493c0be
class Data(RESTApi): <NEW_LINE> <INDENT> def __init__(self, app, config, mount): <NEW_LINE> <INDENT> RESTApi.__init__(self, app, config, mount) <NEW_LINE> for k, v in app.appconfig.debug.iteritems(): <NEW_LINE> <INDENT> debug[k] = v <NEW_LINE> <DEDENT> if not getattr(app, 'contentproxy', None): <NEW_LINE> <INDENT> app....
Server object for REST data access API.
62598fa36aa9bd52df0d4d5a
class SEModule(nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_ch, reduction=16, sigmoid=nn.Sigmoid(), bn=nn.BatchNorm2d, nolinear=nn.ReLU()): <NEW_LINE> <INDENT> super(SEModule, self).__init__() <NEW_LINE> self.avgpool = nn.AdaptiveAvgPool2d(1) <NEW_LINE> self.fc = nn.Sequential( Conv2d(in_ch, in_ch // reduction...
Implementation of semodule in SENet and MobileNetV3, there we use 1x1 conv replace the linear layer. SENet:"Squeeze-and-Excitation Networks"<https://arxiv.org/abs/1709.01507> MobileNetV3: "Searching for MobileNetV3" <https://arxiv.org/abs/1905.02244>
62598fa37b25080760ed733a
class AbsDatabaseSettings(AbsSettingsBase): <NEW_LINE> <INDENT> Year = AbsRange(1900, 2200) <NEW_LINE> Text = AbsRange(0, 1000) <NEW_LINE> Integer = AbsRange(0, 200 )
Class encapsulating all the absolute settings for the database
62598fa357b8e32f52508063
class DaoApplication(): <NEW_LINE> <INDENT> def getAll(): <NEW_LINE> <INDENT> return Application.all() <NEW_LINE> <DEDENT> getAll = staticmethod(getAll) <NEW_LINE> def getByVer(dllVer): <NEW_LINE> <INDENT> query = Application.gql("WHERE dllVer = :dllVer", dllVer=dllVer, parent=getConfig()) <NEW_LINE> appIter = query.ru...
Application accessor.
62598fa307f4c71912baf2d3
class _CachedRelation: <NEW_LINE> <INDENT> def __init__(self, inner): <NEW_LINE> <INDENT> self.referenced_by = {} <NEW_LINE> self.inner = inner <NEW_LINE> <DEDENT> def __str__(self) -> str: <NEW_LINE> <INDENT> return ( '_CachedRelation(database={}, schema={}, identifier={}, inner={})' ).format(self.database, self.schem...
Nothing about _CachedRelation is guaranteed to be thread-safe! :attr str schema: The schema of this relation. :attr str identifier: The identifier of this relation. :attr Dict[_ReferenceKey, _CachedRelation] referenced_by: The relations that refer to this relation. :attr BaseRelation inner: The underlying dbt rela...
62598fa34a966d76dd5eed72
@ddt.ddt <NEW_LINE> @attr('mongo') <NEW_LINE> class CrossStoreXMLRoundtrip(CourseComparisonTest, PartitionTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(CrossStoreXMLRoundtrip, self).setUp() <NEW_LINE> self.export_dir = mkdtemp() <NEW_LINE> self.addCleanup(rmtree, self.export_dir, ignore_erro...
This class exists to test XML import and export between different modulestore classes.
62598fa3cc0a2c111447ae9e
@implementer(IDisplay) <NEW_LINE> class DisplayCurses(Display): <NEW_LINE> <INDENT> def init(self): <NEW_LINE> <INDENT> super(DisplayCurses, self).init() <NEW_LINE> curses.initscr() <NEW_LINE> curses.curs_set(0) <NEW_LINE> self.display = curses.newwin(self.height + 3, self.width + 2, 0, 0) <NEW_LINE> self.initialized =...
Curses frame_buffer.
62598fa33eb6a72ae038a4d4
class TaskQueue(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.run_queue = queue.PriorityQueue() <NEW_LINE> self._shutdown_now = False <NEW_LINE> self._shutdown_when_finished = False <NEW_LINE> self.current_task = None <NEW_LINE> self._thread = threading.Thread(target=self.run, name='task_que...
Task processing thread. Only executes one task at a time, if more are requested they are queued up and run in turn.
62598fa324f1403a926857fb
class MultiInOutClassificationLayer(chainer.Chain): <NEW_LINE> <INDENT> def __init__( self, n_classes: List[int]=[168, 11, 7], classification_layer: str="SimpleLinear", output_num: int=3 ) -> None: <NEW_LINE> <INDENT> super(MultiInOutClassificationLayer, self).__init__() <NEW_LINE> self.n_classes = n_classes <NEW_LINE>...
Wrapper for Classification Layer, which output multiple Variables
62598fa363d6d428bbee2642
class SequentialNonceVerifier(nonce.NonceGenerator): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_name(cls): <NEW_LINE> <INDENT> return "SequentialNonce" <NEW_LINE> <DEDENT> def __init__(self, length): <NEW_LINE> <INDENT> self.__generator = SequentialNonceGenerator(length) <NEW_LINE> self.__initialized = False <...
Verifier for sequential nonces. It will always accept the first value it receives, and then expect it to increment from there.
62598fa3d53ae8145f91831d
class I(CurrentSource): <NEW_LINE> <INDENT> def __init__(self, Ival): <NEW_LINE> <INDENT> self.args = (Ival, ) <NEW_LINE> self._Isc = Isuper(Ival)
Current source. If the expression contains s treat as s-domain current otherwise time domain. A constant I is considered DC with an s-domain current I / s.
62598fa3925a0f43d25e7ece
class IComposition(form.Schema): <NEW_LINE> <INDENT> form.model("models/composition.xml")
Composable page
62598fa37047854f4633f268