code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Problem(object): <NEW_LINE> <INDENT> def __init__(self, initial, goal=None): <NEW_LINE> <INDENT> self.initial = initial <NEW_LINE> self.goal = goal <NEW_LINE> <DEDENT> def actions(self, state): <NEW_LINE> <INDENT> raise NotImplementedError('Subclasses must implement abstract methods') <NEW_LINE> <DEDENT> def resu...
Abstract class representing a formal problem.
62598fe1091ae35668705287
class Len(Processor): <NEW_LINE> <INDENT> def __call__( self, values: Union[List[str], str], response: Response = None, default: str = "" ) -> Tuple[Union[List[str], str], Dict]: <NEW_LINE> <INDENT> return str(len(values)), {}
Return length
62598fe1adb09d7d5dc0abe3
class PlaceCrop(object): <NEW_LINE> <INDENT> def __init__(self, size, start_x, start_y): <NEW_LINE> <INDENT> if isinstance(size, int): <NEW_LINE> <INDENT> self.size = (int(size), int(size)) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.size = size <NEW_LINE> <DEDENT> self.start_x = start_x <NEW_LINE> self.start_y ...
Crops the given PIL.Image at the particular index. Args: size (sequence or int): Desired output size of the crop. If size is an int instead of sequence like (w, h), a square crop (size, size) is made.
62598fe14c3428357761a91a
class CompanyUrl(models.Model): <NEW_LINE> <INDENT> company_info = models.ForeignKey('CompanyInfo', related_name='company_url', db_constraint=False, null=True) <NEW_LINE> company_url = models.CharField(max_length=50, null=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.company_url
公司网址
62598fe1d8ef3951e32c8192
class Action(BrowserSearchParams): <NEW_LINE> <INDENT> def __init__(self, position, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.kwargs = kwargs <NEW_LINE> self.position = position <NEW_LINE> <DEDENT> def getActionHash(self): <NEW_LINE> <INDENT> return hashlib.md5(f'{type(self).__name__}:{s...
Base action class
62598fe1adb09d7d5dc0abe5
class Encryption(Packaging): <NEW_LINE> <INDENT> def __init__(self, encryption_mechanism=None, encryption_key=None): <NEW_LINE> <INDENT> super(Encryption, self).__init__() <NEW_LINE> self.encryption_mechanism = encryption_mechanism <NEW_LINE> self.encryption_key = encryption_key <NEW_LINE> <DEDENT> def to_obj(self): <N...
An encryption packaging layer.
62598fe1ab23a570cc2d50a6
class AssignmentGroupTag(models.Model): <NEW_LINE> <INDENT> assignment_group = models.ForeignKey(AssignmentGroup, related_name='tags', on_delete=models.CASCADE) <NEW_LINE> tag = models.SlugField(max_length=20, help_text='A tag can contain a-z, A-Z, 0-9 and "_".') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> app_label = '...
An AssignmentGroup can be tagged with zero or more tags using this class. .. attribute:: assignment_group The `AssignmentGroup`_ where this groups belongs. .. attribute:: tag The tag. Max 20 characters. Can only contain a-z, A-Z, 0-9 and "_".
62598fe14c3428357761a91e
class SiteSettingListAPIView(generics.ListAPIView): <NEW_LINE> <INDENT> serializer_class = SiteSettingSerializer <NEW_LINE> pagination_class = None <NEW_LINE> permission_classes = (IsAuthenticatedOrReadOnly,) <NEW_LINE> queryset = Table.objects.all()
list site settings details GET /api/setting/
62598fe1d8ef3951e32c8195
class User(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'users' <NEW_LINE> id = db.Column( db.Integer, primary_key=True, ) <NEW_LINE> email = db.Column( db.Text, nullable=False, unique=True, ) <NEW_LINE> username = db.Column( db.Text, nullable=False, unique=True, ) <NEW_LINE> image_url = db.Column( db.Text, default="...
User in the system.
62598fe1fbf16365ca794736
class ViewletManagerTile(Tile): <NEW_LINE> <INDENT> implements(IViewletManagerTile) <NEW_LINE> def __call__(self): <NEW_LINE> <INDENT> manager = self.data.get('manager') <NEW_LINE> viewName = self.data.get('view', None) <NEW_LINE> section = self.data.get('section', 'body') <NEW_LINE> view = findView(self, viewName) <NE...
A tile that renders a viewlet manager.
62598fe1ad47b63b2c5a7ec3
class KiwiDescriptionConflict(KiwiError): <NEW_LINE> <INDENT> pass
Exception raised if both, a description file and xml_content is provided
62598fe126238365f5fad1d7
class Four_Bar (pga.PGA, autosuper) : <NEW_LINE> <INDENT> def __init__ (self, args) : <NEW_LINE> <INDENT> self.args = args <NEW_LINE> self.F = 10. <NEW_LINE> self.E = 2e5 <NEW_LINE> self.L = 200. <NEW_LINE> self.sigma = 10. <NEW_LINE> q2 = self.q2 = sqrt (2) <NEW_LINE> b = self.F / self.sigma <NEW_...
Example from [1] [1] Tapabrata Ray, Kang Tai, and Kin Chye Seow. Multiobjective design optimization by an evolutionary algorithm. Engineering Optimization, 33(4):399–424, 2001.
62598fe1ab23a570cc2d50a8
class Vimeo(Directive): <NEW_LINE> <INDENT> required_arguments = 1 <NEW_LINE> optional_arguments = 0 <NEW_LINE> option_spec = { 'height': directives.length_or_unitless, 'width': directives.length_or_percentage_or_unitless, 'border': directives.length_or_unitless, 'align': align, 'allowfullscreen': boolean, } <NEW_LINE>...
reStructuredText directive that creates an embed object to display a video from Vimeo Usage example:: .. vimeo:: QFwQIRwuAM0 :align: center :height: 344 :width: 425
62598fe1187af65679d29f30
class Split(BaseEntity): <NEW_LINE> <INDENT> distance = Attribute(float, units=uh.meters) <NEW_LINE> elapsed_time = TimeIntervalAttribute() <NEW_LINE> elevation_difference = Attribute(float, units=uh.meters) <NEW_LINE> moving_time = TimeIntervalAttribute() <NEW_LINE> average_heartrate = Attribute(float) <NEW_LINE> spli...
A split -- may be metric or standard units (which has no bearing on the units used in this object, just the binning of values).
62598fe1091ae35668705291
class RandomManipulation(object): <NEW_LINE> <INDENT> num_hinge_atoms = None <NEW_LINE> def __init__(self, affected_atoms, max_amplitude, hinge_atoms): <NEW_LINE> <INDENT> if len(hinge_atoms) != self.num_hinge_atoms: <NEW_LINE> <INDENT> raise ValueError("The number of hinge atoms must be %i, got %i." % ( self.num_hinge...
Base class for a random manipulation
62598fe1fbf16365ca794738
class CmdGoto(MuxCommand): <NEW_LINE> <INDENT> key = "goto" <NEW_LINE> aliases = ["go"] <NEW_LINE> locks = "cmd:all()" <NEW_LINE> help_cateogory = "General" <NEW_LINE> arg_regex = r"\s.*?|$" <NEW_LINE> def func(self): <NEW_LINE> <INDENT> caller = self.caller <NEW_LINE> if not self.args: <NEW_LINE> <INDENT> caller.msg("...
goto exit Usage: goto exit
62598fe150812a4eaa620f1c
class PM_TreeView(QTreeView): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> QTreeView.__init__(self, parent) <NEW_LINE> self.parent = parent <NEW_LINE> self.setEnabled(True) <NEW_LINE> self.model = QDirModel( ['*.mmp', '*.MMP'], QDir.AllEntries|QDir.AllDirs|QDir.NoDotAndDotDot, QDir.Name ) <NEW_LI...
The PM_TreeView class provides a partlib object (as a 'treeview' of any user specified directory) to the client code. The parts from the partlib can be pasted in the 3D Workspace.
62598fe14c3428357761a928
class GetSubscription(webapp2.RequestHandler): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> request = json.loads(self.request.body) <NEW_LINE> subscription = Subscription.getInstance(request['project']) <NEW_LINE> self.response.write(json.dumps(subscription.to_dict()))
Remove a list of emails from the subscribe list.
62598fe1091ae35668705297
class VideoPlayer(Container): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> tag = "video"
The HTML Video element (`<video>`) embeds a media player which supports video playback into the document. You can use `<video>` for audio content as well, but the `<audio>` element may provide a more appropriate user experience.
62598fe1d8ef3951e32c8199
class User(commands.MemberConverter): <NEW_LINE> <INDENT> async def convert(self, ctx, argument): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return await commands.MemberConverter().convert(ctx, argument) <NEW_LINE> <DEDENT> except commands.BadArgument: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> try: <NEW_LINE> <IND...
A custom discord.py `Converter` that supports `Member`, `User`, and string ID's.
62598fe1fbf16365ca79473e
class Observer: <NEW_LINE> <INDENT> r = JProperty() <NEW_LINE> def __init__(self, r, sources, observable='uvw', transform=None): <NEW_LINE> <INDENT> if not isinstance(sources, SourceCollection): <NEW_LINE> <INDENT> if isinstance(sources, Source): <NEW_LINE> <INDENT> sources = {'source': sources} <NEW_LINE> <DEDENT> sou...
" A set of registered measurement locations that observes a collection of sources. A convenient way to use jefpy. Yields E and B as functions of t. These functions can be used directly or used as call-backs in visualizations.
62598fe1d8ef3951e32c819a
class RealDisk(Disk): <NEW_LINE> <INDENT> def __init__(self, size=DISKSIZE): <NEW_LINE> <INDENT> Disk.__init__(self, size=size, fits=7800, nre=1.0e-14, desc="real-world disk")
Specs from Schroeders 2007 FAST paper
62598fe1ad47b63b2c5a7ecc
class VigraRfPixelwiseClassifierFactory(LazyflowPixelwiseClassifierFactoryABC): <NEW_LINE> <INDENT> VERSION = 1 <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self._args = args <NEW_LINE> self._kwargs = kwargs <NEW_LINE> <DEDENT> def create_and_train_pixelwise(self, feature_images, label_images, ax...
An implementation of LazyflowPixelwiseClassifierFactoryABC using a vigra RandomForest. This exists for testing purposes only. (it is normally better to use the vector-wise classifier so lazyflow can cache the feature matrices). This implementation is simple and un-optimized.
62598fe1c4546d3d9def75c4
class DeleteStatement(Query): <NEW_LINE> <INDENT> def __init__(self, queryInput): <NEW_LINE> <INDENT> self.database = None <NEW_LINE> self.tableName, self.conditions = self.__parseDelete(queryInput) <NEW_LINE> <DEDENT> def execute(self): <NEW_LINE> <INDENT> if self.database is None: <NEW_LINE> <INDENT> print("!Failed t...
Models a DELETE statement in a SQL database
62598fe1ab23a570cc2d50af
@NoiseGenerator.register_class <NEW_LINE> class WhiteNoiseGenerator(NoiseGenerator): <NEW_LINE> <INDENT> NAME = 'white' <NEW_LINE> _SNR_VALUE_PAIRS = [ [0, -10], [-5, -15], [-10, -20], [-20, -30], ] <NEW_LINE> _NOISY_SIGNAL_FILENAME_TEMPLATE = 'noise_{0:d}_SNR.wav' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> Noi...
Additive white noise generator.
62598fe1ad47b63b2c5a7ed2
class IGTVDataAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = [ "date", "igtv", "likes", "comments", "reach", "impressions", "saved", "video_views", ] <NEW_LINE> list_display_links = ["date", "igtv"] <NEW_LINE> list_filter = ["igtv__insta"] <NEW_LINE> date_hierarchy = "date" <NEW_LINE> search_fields = ["igt...
List for choosing existing IGTV data to edit.
62598fe1c4546d3d9def75c7
class GlancesInstance(): <NEW_LINE> <INDENT> def __init__(self, refresh_time=1): <NEW_LINE> <INDENT> self.timer = Timer(0) <NEW_LINE> self.refresh_time = refresh_time <NEW_LINE> <DEDENT> def __update__(self): <NEW_LINE> <INDENT> if self.timer.finished(): <NEW_LINE> <INDENT> stats.update() <NEW_LINE> <DEDENT> self.timer...
All the methods of this class are published as XML RPC methods
62598fe14c3428357761a932
class Program(DeclarativeBase): <NEW_LINE> <INDENT> __tablename__ = 'programs' <NEW_LINE> name = Column(Unicode(200), primary_key=True) <NEW_LINE> seasons = relationship('Season', backref='program', order_by=[Season.number]) <NEW_LINE> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> <DEDENT> d...
Represents a program (i.e. a TV series)
62598fe1d8ef3951e32c819e
class PowerWallEnergySensor(PowerWallEntity, SensorEntity): <NEW_LINE> <INDENT> _attr_state_class = STATE_CLASS_MEASUREMENT <NEW_LINE> _attr_native_unit_of_measurement = POWER_KILO_WATT <NEW_LINE> _attr_device_class = DEVICE_CLASS_POWER <NEW_LINE> def __init__( self, meter: MeterType, coordinator, site_info, status, de...
Representation of an Powerwall Energy sensor.
62598fe14c3428357761a934
@register_exception <NEW_LINE> class InvalidAuthTokenError(errors.Unauthorized): <NEW_LINE> <INDENT> wire_descrition = "invalid auth token" <NEW_LINE> status = 401
Exception raised when failing to get authorization for some action because the provided token either does not exist in the tokens database, has a distinct structure from the expected one, or is associated with a user with a distinct uuid than the one provided by the client.
62598fe2ad47b63b2c5a7ed8
class FileIOCalculator(Calculator): <NEW_LINE> <INDENT> command: Optional[str] = None <NEW_LINE> def __init__(self, restart=None, ignore_bad_restart_file=Calculator._deprecated, label=None, atoms=None, command=None, **kwargs): <NEW_LINE> <INDENT> Calculator.__init__(self, restart, ignore_bad_restart_file, label, atoms,...
Base class for calculators that write/read input/output files.
62598fe2ab23a570cc2d50b3
class NotificationData(object): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.__dict__.update(kwargs) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '%s(%s)' % (self.__class__.__name__, ', '.join('%s=%r' % (name, value) for name, value in self.__dict__.iteritems())) <NEW...
Object containing the notification data
62598fe2d8ef3951e32c81a1
class StackBlock(MultBreakBlock): <NEW_LINE> <INDENT> def __init__(self, elements: Iterable[LayoutBlock], break_mult: float = 1): <NEW_LINE> <INDENT> super().__init__(elements, break_mult) <NEW_LINE> <DEDENT> def extended(self, new_elements: Iterable[LayoutBlock]) -> "StackBlock": <NEW_LINE> <INDENT> return self.__clas...
A block that arranges its elements vertically, separated by line breaks.
62598fe2ad47b63b2c5a7edc
class AdminUserViewSet(IDInFilterMixin, BulkModelViewSet): <NEW_LINE> <INDENT> queryset = AdminUser.objects.all() <NEW_LINE> serializer_class = serializers.AdminUserSerializer <NEW_LINE> permission_classes = (IsSuperUser,)
Admin user api set, for add,delete,update,list,retrieve resource
62598fe250812a4eaa620f28
class NlmXmlTable(Entity): <NEW_LINE> <INDENT> label = StringField('./label', xpath=True) <NEW_LINE> caption = StringField('./caption', xpath=True) <NEW_LINE> reference = StringField('@id', xpath=True) <NEW_LINE> src = StringField('.', xpath=True, strip=True, raw=True) <NEW_LINE> clean_caption = Chain(tidy_nlm_referenc...
Table information from NLM XML file.
62598fe250812a4eaa620f29
class BaseSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> pass
Base V1 Serializer
62598fe250812a4eaa620f2a
class SubscribeNewGet(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.resp = self.client.get(r('subscriptions:new')) <NEW_LINE> <DEDENT> def test_get(self): <NEW_LINE> <INDENT> self.assertEqual(200, self.resp.status_code) <NEW_LINE> <DEDENT> def test_template(self): <NEW_LINE> <INDENT> self.ass...
docstring for SubscribeTest.
62598fe2c4546d3d9def75cf
class NotebookAppError(Exception): <NEW_LINE> <INDENT> pass
General Notebook App error
62598fe24c3428357761a944
class HiddenMarkovLM(BaseLanguageModel): <NEW_LINE> <INDENT> def __init__(self, corpus): <NEW_LINE> <INDENT> self._l = 0 <NEW_LINE> self._emissions = Counter() <NEW_LINE> self._transitions = Counter() <NEW_LINE> self.update(corpus) <NEW_LINE> <DEDENT> def update(self, text): <NEW_LINE> <INDENT> while n < 4: <NEW_LINE> ...
Markov Chain based language model Attributes Methods
62598fe2d8ef3951e32c81a7
class Solution: <NEW_LINE> <INDENT> def searchRange(self, root, k1, k2): <NEW_LINE> <INDENT> result = [] <NEW_LINE> self.travel(root, k1, k2, result) <NEW_LINE> return result <NEW_LINE> <DEDENT> def travel(self, root, k1, k2, result): <NEW_LINE> <INDENT> if root is None: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> i...
@param root: param root: The root of the binary search tree @param k1: An integer @param k2: An integer @return: return: Return all keys that k1<=key<=k2 in ascending order
62598fe2d8ef3951e32c81a8
class TestingConfig(BaseConfig): <NEW_LINE> <INDENT> DEBUG = True <NEW_LINE> TESTING = True <NEW_LINE> SQLALCHEMY_DATABASE_URI = postgres_local_base + database_name + "_test" <NEW_LINE> BCRYPT_HASH_PREFIX = 4 <NEW_LINE> AUTH_TOKEN_EXPIRY_DAYS = 0 <NEW_LINE> AUTH_TOKEN_EXPIRY_SECONDS = 1
Testing application configuration
62598fe2091ae356687052b6
class Packet_head(): <NEW_LINE> <INDENT> def __init__(self, magicno, packet_type, seqno, dataLen): <NEW_LINE> <INDENT> self.magicno = int(magicno) <NEW_LINE> self.packet_type = int(packet_type) <NEW_LINE> self.seqno = int(seqno) <NEW_LINE> self.dataLen = int(dataLen) <NEW_LINE> self.packet_format = "iiii" <NEW_LINE> <D...
Class Builds a Packet with the Magicno, packet type, seqno and Data len as the head and the data is added as the payload
62598fe2ab23a570cc2d50bc
class _NoopRPCStub(apiproxy_stub.APIProxyStub): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def CreateRPC(self): <NEW_LINE> <INDENT> return _NoopRPC()
An RPC stub which always creates a NoopRPC.
62598fe2fbf16365ca794760
class Config: <NEW_LINE> <INDENT> allow_mutation = False <NEW_LINE> extra = "ignore" <NEW_LINE> arbitrary_types_allowed = True
Pydantic config
62598fe2c4546d3d9def75d5
class ParticipantRole(db.Document): <NEW_LINE> <INDENT> name = db.StringField() <NEW_LINE> deployment = db.ReferenceField(Deployment) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.name
Stores the role for a participant. (e.g. Supervisor, Co-ordinator)
62598fe2ab23a570cc2d50be
class optStruct: <NEW_LINE> <INDENT> def __init__(self, dataMatIn, classLabels, C, toler, kTup): <NEW_LINE> <INDENT> self.X = dataMatIn <NEW_LINE> self.labelMat = classLabels <NEW_LINE> self.C = C <NEW_LINE> self.tol = toler <NEW_LINE> self.m = np.shape(dataMatIn)[0] <NEW_LINE> self.alphas = np.mat(np.zeros((self.m,1))...
数据结构,维护所有需要操作的值 Parameters: dataMatIn - 数据矩阵 classLabels - 数据标签 C - 松弛变量 toler - 容错率 kTup - 包含核函数信息的元组,第一个参数存放核函数类别,第二个参数存放必要的核函数需要用到的参数
62598fe2ad47b63b2c5a7ef0
class ParserCollisionsExceptions(Exception): <NEW_LINE> <INDENT> pass
Cant be lower than 0
62598fe2d8ef3951e32c81ac
class _RemoteUploader(FileSystemEventHandler): <NEW_LINE> <INDENT> def __init__(self, credentials, local_upload_path, file_translator): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self._credentials = credentials <NEW_LINE> self._local_upload_path = local_upload_path <NEW_LINE> self._remote_upload_folder = os.path.base...
Private class to upload watched folder files to Google drive. Child class of FileSystemEventHandle that creates its own watchdog observer and sets itself as the file handler. Its on_created method is overridden to upload any files created to a specific folder on Google drive. Attributes: _credentials: ...
62598fe250812a4eaa620f31
class ComicError(Exception): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> Exception.__init__(self, message)
Standard cbzdl error
62598fe2fbf16365ca794766
class Concern(InvalidData): <NEW_LINE> <INDENT> pass
E.g. if a password is not secure enough FIXME very ... unspecific
62598fe2ab23a570cc2d50c0
class Reading(MeasurementValue): <NEW_LINE> <INDENT> def __init__(self, value=0.0, ReadingType=None, MeterReadings=None, ReadingQualities=None, *args, **kw_args): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> self._ReadingType = None <NEW_LINE> self.ReadingType = ReadingType <NEW_LINE> self._MeterReadings = [] <NEW...
Specific value measured by a meter or other asset. Each Reading is associated with a specific ReadingType.Specific value measured by a meter or other asset. Each Reading is associated with a specific ReadingType.
62598fe24c3428357761a952
class MovePageDownAction (BaseAction): <NEW_LINE> <INDENT> stringId = u"MovePageDown" <NEW_LINE> def __init__ (self, application): <NEW_LINE> <INDENT> self._application = application <NEW_LINE> <DEDENT> @property <NEW_LINE> def title (self): <NEW_LINE> <INDENT> return _(u"Move Page Down") <NEW_LINE> <DEDENT> @property ...
Переместить страницу на одну позицию вниз
62598fe250812a4eaa620f33
class CategoryItem(NameItem): <NEW_LINE> <INDENT> DEFAULT_NAME = CONFIG["DATABASE"]["default_category"] <NEW_LINE> def __init__(self, data, entry=None): <NEW_LINE> <INDENT> super(CategoryItem, self).__init__(data, entry) <NEW_LINE> self.setEditable(False) <NEW_LINE> font = self.font() <NEW_LINE> font.setBold(True) <NEW...
Item representing the name of a category. Cannot be edited. Text is printed in bold letters.
62598fe2c4546d3d9def75d9
class bidEvaluatorSMU8(bidEvaluatorBase): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def type(): <NEW_LINE> <INDENT> return "bidEvaluatorSMU8" <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def SS(**kwargs): <NEW_LINE> <INDENT> bidEvaluatorBase.checkArgs(**kwargs) <NEW_LINE> pricePrediction = margDistPredictionAgent.SS...
BidEvaluator that generates 8 candidates via straightMU8 strategy and chooses the best that performs best (highest average surplus) w.r.t to 32 samples from the price prediction distribution.
62598fe3ab23a570cc2d50c3
class HelpfulSubparserAction(argparse._SubParsersAction): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs) -> None: <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.choices = None <NEW_LINE> <DEDENT> def __call__(self, parser: 'HelpfulArgParser', namespace: argparse.Namespace, values: List[s...
Class to either select a unique plugin based on a substring, or identify the alternatives.
62598fe3ab23a570cc2d50c4
class ParserBase(HTMLParser): <NEW_LINE> <INDENT> def __init__(self, outer, inner): <NEW_LINE> <INDENT> HTMLParser.__init__(self) <NEW_LINE> (outerTag, outerAttrib, outerValue) = outer <NEW_LINE> (innerTag, innerAttrib) = inner <NEW_LINE> self.__outerTag = outerTag <NEW_LINE> self.__outerAttrib = outerAttrib <NEW_LINE>...
Parses a given HTML site and seaches for a specified attribute of a given tag inside another specified tag. The outer tag is defined by tag name and attribute with its value. TODO: Extend to a list of (tags, attrib, value) tupel, to find a specific value? [("div", "id", "imgholder"), ("img", "src", xxx)]
62598fe3fbf16365ca794772
class Keys(object): <NEW_LINE> <INDENT> BITRATE = 'bitrate' <NEW_LINE> CHANNEL = 'channel' <NEW_LINE> CHANNELS = 'channels' <NEW_LINE> CONNECT = 'connect' <NEW_LINE> BACKGROUND = 'background' <NEW_LINE> DISPLAY_NAME = 'display_name' <NEW_LINE> FEATURED = 'featured' <NEW_LINE> FOLLOWS = 'follows' <NEW_LINE> GAME = 'game...
Should not be instantiated, just used to categorize string-constants
62598fe3ab23a570cc2d50c7
class notify_args(object): <NEW_LINE> <INDENT> def __init__(self, n=None,): <NEW_LINE> <INDENT> self.n = n <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: <NEW_LINE> <INDENT> ipr...
Attributes: - n
62598fe3ad47b63b2c5a7f04
@base.Hidden <NEW_LINE> @base.ReleaseTracks(base.ReleaseTrack.GA) <NEW_LINE> class DockerHelper(base.Command): <NEW_LINE> <INDENT> GET = 'get' <NEW_LINE> LIST = 'list' <NEW_LINE> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> parser.add_argument('method', help='The docker credential helper method.') <NE...
A Docker credential helper to provide access to GCR repositories.
62598fe3ab23a570cc2d50c8
class ExtractorBase: <NEW_LINE> <INDENT> def __init__(self, features): <NEW_LINE> <INDENT> self.features = features <NEW_LINE> <DEDENT> def initialize(self): <NEW_LINE> <INDENT> for f in self.features: <NEW_LINE> <INDENT> f.initialize() <NEW_LINE> <DEDENT> <DEDENT> def free_memory(self): <NEW_LINE> <INDENT> for f in se...
Base feature extractor class. args: features: List of features.
62598fe3ab23a570cc2d50ca
@autoinitsingleton('windows', 'uri') <NEW_LINE> class WindowsToUriPathConverter(Singleton, PathConverter): <NEW_LINE> <INDENT> def convert(self, source_path): <NEW_LINE> <INDENT> return get_path_converter( 'windows_alt', 'uri').convert( get_path_converter( 'windows', 'windows_alt').convert(source_path))
Windows to uri path converter.
62598fe3187af65679d29f53
class BlockStructureCache(object): <NEW_LINE> <INDENT> def __init__(self, cache): <NEW_LINE> <INDENT> self._cache = cache <NEW_LINE> <DEDENT> def add(self, block_structure): <NEW_LINE> <INDENT> data_to_cache = ( block_structure._block_relations, block_structure._transformer_data, block_structure._block_data_map ) <NEW_...
Cache for BlockStructure objects.
62598fe3091ae356687052d6
class BaseAliPayAPI(object): <NEW_LINE> <INDENT> def __init__(self, client=None): <NEW_LINE> <INDENT> self._client = client <NEW_LINE> <DEDENT> def _get(self, url, **kwargs): <NEW_LINE> <INDENT> if hasattr(self, "API_BASE_URL"): <NEW_LINE> <INDENT> kwargs['api_base_url'] = getattr(self, "API_BASE_URL") <NEW_LINE> <DEDE...
支付宝支付API基类
62598fe3187af65679d29f55
class USER(BASE, mixin.BasicMixin, mixin.UserMixin, mixin.ExtraDataMixin, mixin.TimestampMixin): <NEW_LINE> <INDENT> authorization = relationship('AUTHORIZATION', primaryjoin='foreign(USER.authorization_name) == remote(AUTHORIZATION.name)', backref=backref('users', order_by='USER.name', lazy='dynamic')) <NEW_LINE> @pro...
用户存放用户信息的table
62598fe3c4546d3d9def75e4
class School(models.Model): <NEW_LINE> <INDENT> SchoolID = models.AutoField(primary_key=True) <NEW_LINE> SchoolName = models.CharField(max_length=50, null=False, unique=True) <NEW_LINE> Address = models.CharField(max_length=255) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.SchoolName
This model stores the schools. Each school with multiple campuses will be stored separately.
62598fe3c4546d3d9def75e5
class DescribeVpcQuotaRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TypeIds = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.TypeIds = params.get("TypeIds")
DescribeVpcQuota请求参数结构体
62598fe3fbf16365ca794784
class SocialAPIError(SocialOAuthException): <NEW_LINE> <INDENT> def __init__(self, site_name, url, code, error_msg, *args, **kwargs): <NEW_LINE> <INDENT> self.site_name = site_name <NEW_LINE> self.url = url <NEW_LINE> self.code = code <NEW_LINE> self.error_msg = error_msg <NEW_LINE> SocialOAuthException.__init__(self, ...
Occurred when doing API call
62598fe3fbf16365ca794788
class Pfx2asn(SQLObject): <NEW_LINE> <INDENT> class sqlmeta: <NEW_LINE> <INDENT> fromDatabase = True <NEW_LINE> defaultOrder = 'asn'
the pfx2asn table
62598fe3d8ef3951e32c81bf
class OutputMappingConfig(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Scene = None <NEW_LINE> self.WorkerNum = None <NEW_LINE> self.WorkerPartSize = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Scene = params.get("Scene") <NEW_LINE> self.WorkerNu...
输出映射配置
62598fe4187af65679d29f5c
class UserInterface(object): <NEW_LINE> <INDENT> def __init__(self, storage, payload, instclass): <NEW_LINE> <INDENT> if self.__class__ is UserInterface: <NEW_LINE> <INDENT> raise TypeError("UserInterface is an abstract class.") <NEW_LINE> <DEDENT> self.storage = storage <NEW_LINE> self.payload = payload <NEW_LINE> sel...
This is the base class for all kinds of install UIs. It primarily defines what kinds of dialogs and entry widgets every interface must provide that the rest of anaconda may rely upon.
62598fe4ab23a570cc2d50d5
class Line: <NEW_LINE> <INDENT> def __init__(self, line): <NEW_LINE> <INDENT> from re import match, sub <NEW_LINE> self.no = 1 + line[0] <NEW_LINE> self.text = line[1] <NEW_LINE> if self.text and self.text[-1] == '\\n': <NEW_LINE> <INDENT> self.text = self.text[:-1] <NEW_LINE> <DEDENT> self.py = False <NEW_LINE> self.t...
Abstraction for a line of text input, used by PyCPP.parse
62598fe4d8ef3951e32c81c3
class LogCapturer(object): <NEW_LINE> <INDENT> def __init__(self, level="debug"): <NEW_LINE> <INDENT> self.logs = [] <NEW_LINE> self._old_log_level = _loglevel <NEW_LINE> self.desired_level = level <NEW_LINE> <DEDENT> def get_category(self, identifier): <NEW_LINE> <INDENT> return [x for x in self.logs if x.get("log_cat...
A context manager that captures logs inside of it, and makes it available through the logs attribute, or the get_category method.
62598fe44c3428357761a97d
class _PubSubPayloadSource(dataflow_io.NativeSource): <NEW_LINE> <INDENT> def __init__(self, topic=None, subscription=None, id_label=None): <NEW_LINE> <INDENT> self.coder = coders.BytesCoder() <NEW_LINE> self.full_topic = topic <NEW_LINE> self.full_subscription = subscription <NEW_LINE> self.topic_name = None <NEW_LINE...
Source for the payload of a message as bytes from a Cloud Pub/Sub topic. Attributes: topic: Cloud Pub/Sub topic in the form "projects/<project>/topics/<topic>". If provided, subscription must be None. subscription: Existing Cloud Pub/Sub subscription to use in the form "projects/<project>/subscriptions/<su...
62598fe4ad47b63b2c5a7f20
class NetworkTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> from letsencrypt.network import Network <NEW_LINE> self.net = Network( new_reg_uri=None, key=None, alg=None, verify_ssl=None) <NEW_LINE> self.config = mock.Mock(accounts_dir=tempfile.mkdtemp()) <NEW_LINE> self.contact = ('mai...
Tests for letsencrypt.network.Network.
62598fe4fbf16365ca794794
class Positions(object): <NEW_LINE> <INDENT> def __init__(self, scaled_positions, cop, symbols, distance, origin): <NEW_LINE> <INDENT> self.scaled_positions = scaled_positions <NEW_LINE> self.cop = cop <NEW_LINE> self.symbols = symbols <NEW_LINE> self.distance = distance <NEW_LINE> self.origin = origin <NEW_LINE> <DEDE...
Helper object to simplify the pairing process. Parameters: scaled_positions: (Nx3) array Positions in scaled coordinates cop: (1x3) array Center-of-positions (also in scaled coordinates) symbols: str String with the atomic symbols distance: float Signed distance to the cutting plane origin: int (0 or ...
62598fe4d8ef3951e32c81c4
class WeatherForSinglePointSummarizedResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None)
A ResultSet with methods tailored to the values returned by the WeatherForSinglePointSummarized Choreo. The ResultSet object is used to retrieve the results of a Choreo execution.
62598fe4187af65679d29f61
class QMDMetadataElement(core.QTIElement): <NEW_LINE> <INDENT> def content_changed(self): <NEW_LINE> <INDENT> self.DeclareMetadata(self.get_xmlname(), self.get_value(), self)
Abstract class to represent old-style qmd_ tags
62598fe4d8ef3951e32c81c7
class ProductDetailIntId(BaseModel): <NEW_LINE> <INDENT> brand_name: str = Field(..., alias="BrandName") <NEW_LINE> product_name: str = Field(..., alias="ProductName") <NEW_LINE> sub_header: str = Field(..., alias="SubHeader") <NEW_LINE> organic_code: str = Field(..., alias="OrganicCode") <NEW_LINE> units_in_full_case:...
BaseModel for product details from the UNFIApi product detail by intid
62598fe426238365f5fad23c
class City(Base): <NEW_LINE> <INDENT> __tablename__ = "cities" <NEW_LINE> id = Column(Integer, primary_key=True, autoincrement=True, nullable=False, unique=True) <NEW_LINE> name = Column(String(128), nullable=False) <NEW_LINE> state_id = Column(Integer, ForeignKey('states.id'), nullable=False)
Create a City object that inherits from Base
62598fe4091ae356687052f6
class AutoModelForSequenceClassification: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> raise EnvironmentError( "AutoModelForSequenceClassification is designed to be instantiated " "using the `AutoModelForSequenceClassification.from_pretrained(pretrained_model_name_or_path)` or " "`AutoModelForSequenceCla...
This is a generic model class that will be instantiated as one of the model classes of the library---with a sequence classification head---when created with the when created with the :meth:`~transformers.AutoModelForSequenceClassification.from_pretrained` class method or the :meth:`~transformers.AutoModelForSequenceCla...
62598fe4fbf16365ca79479e
class ExplorationContentValidationJobForCKEditor( jobs.BaseMapReduceOneOffJobManager): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def entity_classes_to_map_over(cls): <NEW_LINE> <INDENT> return [exp_models.ExplorationModel] <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def map(item): <NEW_LINE> <INDENT> if item.deleted...
Job that checks the html content of an exploration and validates it for CKEditor.
62598fe4ab23a570cc2d50dc
class Queue: <NEW_LINE> <INDENT> class ArrayQueue: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.def_cap = 10 <NEW_LINE> self._data=[None]*(self.def_cap) <NEW_LINE> self._size=0 <NEW_LINE> self._front=0 <NEW_LINE> self._pos=0 <NEW_LINE> <DEDENT> def is_empty(self): <NEW_LINE> <INDENT> return (self._s...
Class for Queue Implementations
62598fe4ab23a570cc2d50dd
class ConditionalInstanceNormalisation(nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_channel, n_speakers): <NEW_LINE> <INDENT> super(ConditionalInstanceNormalisation, self).__init__() <NEW_LINE> self.device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") <NEW_LINE> self.dim_in = in_channel <NEW...
CIN Block.
62598fe4d8ef3951e32c81cb
@parsleyfy <NEW_LINE> class CreditCardEntryForm(forms.ModelForm): <NEW_LINE> <INDENT> receipts = MultiFileField( min_num=0, max_num=99, max_file_size=1024 * 1024 * 100, required=False) <NEW_LINE> class Meta(object): <NEW_LINE> <INDENT> model = CreditCardEntry <NEW_LINE> widgets = { 'date': forms.DateInput(attrs={'class...
A Form for CreditCardEntries along with multiple CreditCardReceipts.
62598fe44c3428357761a98f
class VertexDataset(dsl.Artifact): <NEW_LINE> <INDENT> TYPE_NAME = 'google.VertexDataset' <NEW_LINE> def __init__(self, name: Optional[str] = None, uri: Optional[str] = None, metadata: Optional[Dict] = None): <NEW_LINE> <INDENT> super().__init__(uri=uri, name=name, metadata=metadata)
An artifact representing a Vertex Dataset.
62598fe4187af65679d29f69
class TestXBlockWrapper(object): <NEW_LINE> <INDENT> @property <NEW_LINE> def leaf_module_runtime(self): <NEW_LINE> <INDENT> return get_test_system() <NEW_LINE> <DEDENT> def leaf_descriptor(self, descriptor_cls): <NEW_LINE> <INDENT> location = 'i4x://org/course/category/name' <NEW_LINE> runtime = get_test_descriptor_sy...
Helper methods used in test case classes below.
62598fe4fbf16365ca7947ac
class AIBoardHistory(models.Model): <NEW_LINE> <INDENT> created_at = models.DateTimeField(auto_now_add=True) <NEW_LINE> updated_at = models.DateTimeField(auto_now=True) <NEW_LINE> trade_start_at = models.DateTimeField(default=None, null=True) <NEW_LINE> trade_end_at = models.DateTimeField(default=None, null=True) <NEW_...
成績
62598fe44c3428357761a997
class PolyshaperEngraving(inkex.Effect): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> inkex.Effect.__init__(self) <NEW_LINE> self.doc_height = 0 <NEW_LINE> self.gcode_file_path = os.path.expanduser("~/") <NEW_LINE> self.define_command_line_options() <NEW_LINE> <DEDENT> def define_command_line_options(sel...
The main class of the plugin
62598fe526238365f5fad250
class Newmark(): <NEW_LINE> <INDENT> def __init__(self, M, C, K, nls=None, gtype=None): <NEW_LINE> <INDENT> self.M = M <NEW_LINE> self.C = C <NEW_LINE> self.K = K <NEW_LINE> if isinstance(nls, NLS): <NEW_LINE> <INDENT> nls = nls.nls <NEW_LINE> <DEDENT> self.nls = NLS(nls) <NEW_LINE> if gtype is None: <NEW_LINE> <INDENT...
Nonlinear Newmark solver class. Input M,C,K and nonlin. See :func:`newmark_beta_nl` and :class:`.nolinear_elements.NLS`.
62598fe54c3428357761a999
class LinearSearchOptimizer(BaseOptimizer): <NEW_LINE> <INDENT> def optimize(self, net_string, device_graph): <NEW_LINE> <INDENT> net = json.loads(net_string) <NEW_LINE> groups = self.create_colocation_groups(get_flattened_layer_names(net_string)) <NEW_LINE> best_score = -1 <NEW_LINE> best_net = None <NEW_LINE> for com...
A naive optimizer that carries out a brute-force search for the best placement. Will take significant time to run if the search space is too large.
62598fe5091ae3566870530a
class Shape(): <NEW_LINE> <INDENT> def __init__(self, name, area=None, perimeter=None, units=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.area = area <NEW_LINE> self.perimeter = perimeter <NEW_LINE> self.units = units <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return('name:{}\narea:{}\np...
A shape has the following attributes: area: a float representing the area of the shape in units perimeter: a float representing the perimeter of the shape in units units: a string representing the units of measurement e.g. 'mm' or in'
62598fe5187af65679d29f6d
class HTTPSRedirectHandler(BaseHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> port = self.settings['port'] <NEW_LINE> url_prefix = self.settings['url_prefix'] <NEW_LINE> host = self.request.headers.get('Host', 'localhost') <NEW_LINE> self.redirect( 'https://%s:%s%s' % (host, port, url_prefix))
A handler to redirect clients from HTTP to HTTPS. Only used if `https_redirect` is True in Gate One's settings.
62598fe5ad47b63b2c5a7f3e
class OrcIdGenerator(metaclass=SingletonType): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._index = 0 <NEW_LINE> self._now = 0 <NEW_LINE> self._max_pid = 131072 <NEW_LINE> self._pid = None <NEW_LINE> <DEDENT> def set_pid(self, p_pid: int): <NEW_LINE> <INDENT> self._pid = p_pid <NEW_LINE> return sel...
id generator 41 + 17 + 5 time_distance(9) +
62598fe5fbf16365ca7947b2
class VPCRegionInfo(RegionInfo): <NEW_LINE> <INDENT> def __init__(self, connection=None, name=None, id=None, connection_cls=None): <NEW_LINE> <INDENT> from footmark.vpc.connection import VPCConnection <NEW_LINE> super(VPCRegionInfo, self).__init__(connection, name, id, VPCConnection)
Represents an ECS Region
62598fe54c3428357761a99f
class Logger(logging.Logger): <NEW_LINE> <INDENT> formatter = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> logging.Logger.__init__(self, "Logger") <NEW_LINE> fh = Handler() <NEW_LINE> fh.setFormatter(Formatter()) <NEW_LINE> self.addHandler(fh) <NEW_LINE> fh = logging.FileHandler('results/log.txt', mode='w') ...
Main logger class
62598fe5ab23a570cc2d50e7
class FactTestCase(CLITestCase): <NEW_LINE> <INDENT> @run_only_on('sat') <NEW_LINE> @tier1 <NEW_LINE> @upgrade <NEW_LINE> def test_positive_list_by_name(self): <NEW_LINE> <INDENT> for fact in ( u'uptime', u'uptime_days', u'uptime_seconds', u'memoryfree', u'ipaddress'): <NEW_LINE> <INDENT> with self.subTest(fact): <NEW_...
Fact related tests.
62598fe5fbf16365ca7947bc
class AllowOnlyEnabledServiceAccountMixin: <NEW_LINE> <INDENT> def dispatch(self, request, *args, **kwargs): <NEW_LINE> <INDENT> mo = re.search('Token (\S+)', request.META.get('HTTP_AUTHORIZATION', '')) <NEW_LINE> if mo: <NEW_LINE> <INDENT> srv_acct = ServiceAccount.objects.get_object_or_none(user__auth_token__key=mo.g...
A mixin for Django Rest Framework viewsets that checks if the request is made from a ServiceAccount and only allows access to the endpoint if an enabled ServiceAccount made the request. If the ServiceAccount is disabled by the owner or an admin, a 403 error will be received instead of the API response. This currently w...
62598fe5187af65679d29f73
class MsgM25FlashWriteStatus(SBP): <NEW_LINE> <INDENT> def __init__(self, sbp): <NEW_LINE> <INDENT> self.__dict__.update(sbp.__dict__) <NEW_LINE> self.payload = sbp.payload <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return to_repr(self)
SBP class for message MSG_M25_FLASH_WRITE_STATUS (0x00F3)
62598fe5187af65679d29f74
class PeriodShortEnumEnum(Enum): <NEW_LINE> <INDENT> true = 1 <NEW_LINE> @staticmethod <NEW_LINE> def _meta_info(): <NEW_LINE> <INDENT> from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_bundlemgr_cfg as meta <NEW_LINE> return meta._meta_table['PeriodShortEnumEnum']
PeriodShortEnumEnum Period short enum .. data:: true = 1 Use the standard LACP short period (1s)
62598fe5fbf16365ca7947c0
class RandomizedRectifierLayer(Layer): <NEW_LINE> <INDENT> def __init__(self, incoming, lower=0.3, upper=0.8, shared_axes='auto', **kwargs): <NEW_LINE> <INDENT> super(RandomizedRectifierLayer, self).__init__(incoming, **kwargs) <NEW_LINE> self._srng = RandomStreams(get_rng().randint(1, 2147462579)) <NEW_LINE> self.lowe...
A layer that applies a randomized leaky rectify nonlinearity to its input. The randomized leaky rectifier was first proposed and used in the Kaggle NDSB Competition, and later evaluated in [1]_. Compared to the standard leaky rectifier :func:`leaky_rectify`, it has a randomly sampled slope for negative input during tr...
62598fe5187af65679d29f75