code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class PackageTree: <NEW_LINE> <INDENT> from bisect import bisect_left <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.root = Package('') <NEW_LINE> self.packages = {'': self.root} <NEW_LINE> self.modules = [] <NEW_LINE> self.mod_dict = {} <NEW_LINE> self.cat_dict = {} <NEW_LINE> <DEDENT> def addModule(self, mod...
Represents a tree of all packages and modules in a project.
625990a0c4546d3d9def820a
class AuthorDetailView(LoginRequiredMixin, generic.DetailView): <NEW_LINE> <INDENT> model = Author
Generic class-based detail view for an author.
625990a050812a4eaa621b36
class String(Unit): <NEW_LINE> <INDENT> cls = MEASURE <NEW_LINE> def __init__(self, fixlen=None, encoding=None): <NEW_LINE> <INDENT> if fixlen is None and encoding is None: <NEW_LINE> <INDENT> self.fixlen = None <NEW_LINE> self.encoding = u'U8' <NEW_LINE> <DEDENT> elif isinstance(fixlen, _inttypes + (IntegerConstant,))...
String container
625990a0091ae35668706b0f
class CoCoContextPolicy(Policy): <NEW_LINE> <INDENT> def __init__( self, priority: int = FORM_POLICY_PRIORITY, ) -> None: <NEW_LINE> <INDENT> super().__init__( priority=priority ) <NEW_LINE> <DEDENT> def train( self, training_trackers: List[DialogueStateTracker], domain: Domain, **kwargs: Any, ) -> None: <NEW_LINE> <IN...
Maintains CoCo multi-turn session by keeping active action mapped to custom CoCo action while the Form set by CoCo to maintain the session is active.
625990a0d8ef3951e32c8dcb
class Waypoint(nmeaSentence): <NEW_LINE> <INDENT> def __init__ (self, payload): <NEW_LINE> <INDENT> nmeaSentence.__init__ (self, payload) <NEW_LINE> p = payload.split (',') <NEW_LINE> self.id = p[0] <NEW_LINE> self.name = p[1] <NEW_LINE> self._mutable = False <NEW_LINE> return <NEW_LINE> <DEDENT> def defineName (self, ...
Define a waypoint maker. The waypoint marker in the GPS data stream. It is defined to be: PDIYWP,{name} where the {name} is user defined.
625990a0187af65679d2ab5a
class CommandList(command.BaseCommand): <NEW_LINE> <INDENT> NAME = "list" <NEW_LINE> HELP = "List metrics." <NEW_LINE> def add_arguments(self, parser): <NEW_LINE> <INDENT> parser.add_argument( "glob", help="One metric name or globbing on metrics names" ) <NEW_LINE> <DEDENT> def run(self, accessor, opts): <NEW_LINE> <IN...
List for metrics.
625990a050812a4eaa621b39
class SplashScreen(QSplashScreen): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> ericPic = QPixmap(os.path.join(getConfig('ericPixDir'), 'ericSplash.png')) <NEW_LINE> self.labelAlignment = Qt.Alignment(Qt.AlignBottom | Qt.AlignRight | Qt.AlignAbsolute) <NEW_LINE> QSplashScreen.__init__(self, er...
Class implementing a splashscreen for eric4.
625990a1adb09d7d5dc0c440
class Start_State(StateBase): <NEW_LINE> <INDENT> def __init__(self, obj_func): <NEW_LINE> <INDENT> StateBase.__init__(self, STATE_NAME_L[VD_READY], obj_func)
VD Task start state
625990a150812a4eaa621b3a
class ExpressRoutePortListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[ExpressRoutePort]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, value: Optional[List["ExpressRoutePort"]] = None, next_link: Optional[str] = ...
Response for ListExpressRoutePorts API service call. :param value: A list of ExpressRoutePort resources. :type value: list[~azure.mgmt.network.v2019_04_01.models.ExpressRoutePort] :param next_link: The URL to get the next set of results. :type next_link: str
625990a1187af65679d2ab5d
class UrlTestCases(LiveServerTestCase): <NEW_LINE> <INDENT> def validate_url(self, url, status_code=200, find_str=None): <NEW_LINE> <INDENT> resp = Client().get(url) <NEW_LINE> self.assertEquals(resp.status_code, status_code, "%s (check status code)" % url) <NEW_LINE> if find_str is not None: <NEW_LINE> <INDENT> self.a...
Walk through a set of URLs, and validate very basic properties (status code, some text) A good test to weed out untested view/template errors
625990a1099cdd3c6367636f
class TestSubClass(object): <NEW_LINE> <INDENT> name = 'testsub' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.value = 1
test for mkdoc
625990a1d8ef3951e32c8dd2
class logged_in(object): <NEW_LINE> <INDENT> def __call__(self, method): <NEW_LINE> <INDENT> @functools.wraps(method) <NEW_LINE> def wrapper(self, *args, **kwargs): <NEW_LINE> <INDENT> if self.user is None: <NEW_LINE> <INDENT> redirect_url = self.url_for("userbase.login", force_external=True) <NEW_LINE> came_from = url...
check if a valid user is present
625990a150812a4eaa621b3f
class Wall(Shape): <NEW_LINE> <INDENT> def __init__(self, shape, particle_type, color, material, quality, box_l, rasterize_resolution, rasterize_pointsize): <NEW_LINE> <INDENT> super().__init__(shape, particle_type, color, material, quality, box_l, rasterize_resolution, rasterize_pointsize) <NEW_LINE> self.distance = s...
Drawable Shape Wall.
625990a150812a4eaa621b40
class DescribeDDoSNetEvListResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Business = None <NEW_LINE> self.Id = None <NEW_LINE> self.StartTime = None <NEW_LINE> self.EndTime = None <NEW_LINE> self.Data = None <NEW_LINE> self.Total = None <NEW_LINE> self.RequestId = None <NEW_LI...
DescribeDDoSNetEvList response structure.
625990a1adb09d7d5dc0c44e
class QueryMultiCheckboxField(QuerySelectMultipleField): <NEW_LINE> <INDENT> widget = PassthroughListWidget(prefix_label=False) <NEW_LINE> option_widget = widgets.CheckboxInput()
`MultiCheckboxField` for SQLAlchemy queries.
625990a150812a4eaa621b42
@register_resource <NEW_LINE> class v1_Scale(Resource): <NEW_LINE> <INDENT> __kind__ = 'v1.Scale' <NEW_LINE> __fields__ = { 'api_version': 'apiVersion', 'kind': 'kind', 'metadata': 'metadata', 'spec': 'spec', 'status': 'status', } <NEW_LINE> __types__ = { 'metadata': 'v1.ObjectMeta', 'spec': 'v1.ScaleSpec', 'status': '...
Scale represents a scaling request for a resource.
625990a1091ae35668706b27
class Operator_ToggleConsole(Operator): <NEW_LINE> <INDENT> bl_idname = "object.toggle_console" <NEW_LINE> bl_label = "Toggle console" <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> bpy.ops.wm.console_toggle() <NEW_LINE> return {'FINISHED'}
Show or hide the console
625990a1091ae35668706b29
class OfficeParser(Parser): <NEW_LINE> <INDENT> def parse(self, document_page, descriptor=None): <NEW_LINE> <INDENT> logger.debug('executing') <NEW_LINE> try: <NEW_LINE> <INDENT> office_converter = OfficeConverter() <NEW_LINE> document_file = document_page.document.document_save_to_temp_dir(document_page.document.check...
Parser for office document formats
625990a150812a4eaa621b44
class GCMTimeoutError(GCMServerError): <NEW_LINE> <INDENT> code = 'Unavailable' <NEW_LINE> description = 'Timeout'
Exception for server timeout.
625990a150812a4eaa621b45
@gin.register <NEW_LINE> class F0LdEvaluator(BaseEvaluator): <NEW_LINE> <INDENT> def __init__(self, sample_rate, frame_rate, run_f0_crepe=True): <NEW_LINE> <INDENT> super().__init__(sample_rate, frame_rate) <NEW_LINE> self._loudness_metrics = metrics.LoudnessMetrics( sample_rate=sample_rate, frame_rate=frame_rate) <NEW...
Computes F0 and loudness metrics.
625990a1c4546d3d9def821b
class TransitLineProxy(): <NEW_LINE> <INDENT> DEFAULT_ATTS = set(['description', 'layover_time', 'speed', 'headway', 'data1', 'data2', 'data3']) <NEW_LINE> __MAP = {'layover_time': 'layover'} <NEW_LINE> def __init__(self, line): <NEW_LINE> <INDENT> self.id = line.id <NEW_LINE> self.vehicle = line.vehicle.number <NEW_LI...
Data container for copying transit line data. For easy line itinerary modification, the line's segments are stored in a simple list made up of TransitSegmentProxy objects. This class's copyToNetwork method can then be used to 'save' the changes to the network. If errors are encountered, this class will safely roll back...
625990a150812a4eaa621b46
class UserProfileSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = models.UserProfile <NEW_LINE> fields = ('id', 'email', 'name', 'password') <NEW_LINE> extra_kwargs = { 'password': { 'write_only': True, 'style': {'input_type': 'password'} } } <NEW_LINE> def create(sel...
Serialiser a user profile object
625990a1099cdd3c63676379
class MockHub(JupyterHub): <NEW_LINE> <INDENT> db_file = None <NEW_LINE> def _ip_default(self): <NEW_LINE> <INDENT> return 'localhost' <NEW_LINE> <DEDENT> def _authenticator_class_default(self): <NEW_LINE> <INDENT> return MockPAMAuthenticator <NEW_LINE> <DEDENT> def _spawner_class_default(self): <NEW_LINE> <INDENT> ret...
Hub with various mock bits
625990a1099cdd3c6367637a
class Rectangle: <NEW_LINE> <INDENT> def __init__(self, width=0, height=0): <NEW_LINE> <INDENT> self.height = height <NEW_LINE> self.width = width <NEW_LINE> <DEDENT> @property <NEW_LINE> def height(self): <NEW_LINE> <INDENT> return self.__height <NEW_LINE> <DEDENT> @height.setter <NEW_LINE> def height(self, value): <N...
defines class Rectangle **Instance attributes** width: private must be a non negative int height: private must be a non negative int **Instance methods** width(self) width(self, value) height(self) height(self, value) __init__(self, width=0, height=0) __check_arg(self, value)
625990a150812a4eaa621b48
class AuthLoginViewTests(ManifestTestCase): <NEW_LINE> <INDENT> user_data = ["john", "pass"] <NEW_LINE> form_data = data_dicts.LOGIN_FORM["valid"][0] <NEW_LINE> def test_auth_login_view(self): <NEW_LINE> <INDENT> response = self.client.get(reverse("auth_login")) <NEW_LINE> self.assertEqual(response.status_code, 200) <N...
Tests for :class:`AuthLoginView <manifest.views.AuthLoginView>`.
625990a1099cdd3c6367637b
class Usage: <NEW_LINE> <INDENT> def __init__(self, *, talkUsed, smsUsed, dataUsed): <NEW_LINE> <INDENT> self.talkUsed = talkUsed <NEW_LINE> self.smsUsed = smsUsed <NEW_LINE> self.dataUsed = dataUsed
Represents the total usage of an individual phone line or total phone bill for a month.
625990a150812a4eaa621b49
class MailboxView(HomeAssistantView): <NEW_LINE> <INDENT> def __init__(self, mailboxes: list[Mailbox]) -> None: <NEW_LINE> <INDENT> self.mailboxes = mailboxes <NEW_LINE> <DEDENT> def get_mailbox(self, platform): <NEW_LINE> <INDENT> for mailbox in self.mailboxes: <NEW_LINE> <INDENT> if mailbox.name == platform: <NEW_LIN...
Base mailbox view.
625990a1099cdd3c6367637c
class UserFavViewset(viewsets.GenericViewSet, mixins.ListModelMixin, mixins.CreateModelMixin, mixins.RetrieveModelMixin, mixins.DestroyModelMixin): <NEW_LINE> <INDENT> permission_classes = (IsAuthenticated, IsOwnerOrReadOnly) <NEW_LINE> lookup_field = 'goods_id' <NEW_LINE> authentication_classes = (JSONWebTokenAuthenti...
list: 获取用户收藏列表 retrieve: 判断某个商品是否已经收藏 create: 收藏商品
625990a250812a4eaa621b4a
class NovaIdeoApplicationSchema(VisualisableElementSchema): <NEW_LINE> <INDENT> name = NameSchemaNode( editing=context_is_a_root, ) <NEW_LINE> titles = colander.SchemaNode( colander.Sequence(), colander.SchemaNode( colander.String(), name=_("Title") ), widget=SequenceWidget(), default=DEFAULT_TITLES, title=_('List of t...
Schema for Nova-Ideo configuration
625990a2d8ef3951e32c8de1
class QPyDesignerCustomWidgetCollectionPlugin(__PyQt4_QtCore.QObject, QDesignerCustomWidgetCollectionInterface): <NEW_LINE> <INDENT> def childEvent(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def connectNotify(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def customEvent(...
QPyDesignerCustomWidgetCollectionPlugin(QObject parent=None)
625990a2091ae35668706b3d
class CreditCheckHistorySearch(SearchEditor): <NEW_LINE> <INDENT> title = _("Client Credit Check History Search") <NEW_LINE> editor_class = CreditCheckHistoryEditor <NEW_LINE> search_spec = CreditCheckHistoryView <NEW_LINE> size = (700, 450) <NEW_LINE> def __init__(self, store, client=None, reuse_store=False): <NEW_LIN...
A search dialog for querying the credit history for a |client|
625990a2099cdd3c63676380
class Event: <NEW_LINE> <INDENT> def __init__(self, code, name, description, sample): <NEW_LINE> <INDENT> self.code = code <NEW_LINE> self.name = name <NEW_LINE> self.description = description <NEW_LINE> self.sample = sample <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '{} - {}'.format(self.code, s...
HL-API event wrapper. Example: # Import module. from prpl.apis.hl.com import Event as HLAPIEvent # Create new instance. api_event = HLAPIEvent( '0', 'USER_ACCOUNTS_ADDED', 'Raised when a new account is added.', '{"Header":{"Code":1,"Name":"USER_ACCOUNTS_ADDED"},"Body":{...
625990a2187af65679d2ab6f
class User(UserMixin, db.Model): <NEW_LINE> <INDENT> __tablename__ = 'users' <NEW_LINE> __table_args__ = {'schema': 'ref'} <NEW_LINE> id = db.Column(db.Integer, primary_key=True, name='users_id') <NEW_LINE> email = db.Column(db.String(64), unique=True, nullable=False, index=True) <NEW_LINE> password_hash = db.Column(db...
SQL Alchemy Class that maps to ref.users
625990a2adb09d7d5dc0c46c
class ModelEmbeddings(nn.Module): <NEW_LINE> <INDENT> def __init__(self, embed_size, vocab): <NEW_LINE> <INDENT> super(ModelEmbeddings, self).__init__() <NEW_LINE> self.embed_size = embed_size <NEW_LINE> src_pad_token_idx = vocab.src["<pad>"] <NEW_LINE> tgt_pad_token_idx = vocab.tgt["<pad>"] <NEW_LINE> self.source = nn...
Class that converts input words to their embeddings.
625990a2adb09d7d5dc0c46e
class RandomEventGenerator: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.spraypaint_success_chance = SPRAYPAINT_SUCCESS_CHANCE <NEW_LINE> self.steal_success_chance = STEAL_SUCCESS_CHANCE <NEW_LINE> self.hack_success_chance = HACK_SUCCESS_CHANCE <NEW_LINE> self.skate_success_chance = SKATE_SUCCES_CHA...
Used to generate / determine random event results within the game. Anything that is randomized in the game should be seeded/randomized and returned from here
625990a2187af65679d2ab75
class CondenseInitBlock(nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_channels, out_channels): <NEW_LINE> <INDENT> super(CondenseInitBlock, self).__init__() <NEW_LINE> self.conv = nn.Conv2d( in_channels=in_channels, out_channels=out_channels, kernel_size=3, stride=2, padding=1, bias=False) <NEW_LINE> <DEDENT> d...
CondenseNet specific initial block. Parameters: ---------- in_channels : int Number of input channels. out_channels : int Number of output channels.
625990a250812a4eaa621b54
class RequestParser(object): <NEW_LINE> <INDENT> def __init__( self, argument_class=Argument, result_class=ParseResult, trim=False, bundle_errors=False, ): <NEW_LINE> <INDENT> self.args = [] <NEW_LINE> self.argument_class = argument_class <NEW_LINE> self.result_class = result_class <NEW_LINE> self.trim = trim <NEW_LINE...
Enables adding and parsing of multiple arguments in the context of a single request. Ex:: from flask_restplus import RequestParser parser = RequestParser() parser.add_argument('foo') parser.add_argument('int_bar', type=int) args = parser.parse_args() :param bool trim: If enabled, trims whitespace...
625990a2c4546d3d9def822a
class UserProfile(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField(User) <NEW_LINE> code = models.CharField(max_length=200, blank=True, null=True) <NEW_LINE> access_token = models.CharField(max_length=200, blank=True, null=True) <NEW_LINE> token_expiration = models.DateTimeField(blank=True, null=True) <NE...
Keeps track of extra information about the user, specifically credentials for logging into other cloud services.
625990a2187af65679d2ab77
class ROMS_Grid(object): <NEW_LINE> <INDENT> def __init__(self, name, hgrid=CGrid, vgrid=s_coordinate): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.hgrid = hgrid <NEW_LINE> self.vgrid = vgrid
grd = ROMS_Grid(hgrid, vgrid) ROMS Grid object combining horizontal and vertical grid
625990a2187af65679d2ab78
class PullRequestCommentEvent(PullRequestEvent): <NEW_LINE> <INDENT> name = 'pullrequest-comment' <NEW_LINE> display_name = lazy_ugettext('pullrequest commented') <NEW_LINE> def __init__(self, pullrequest, comment): <NEW_LINE> <INDENT> super(PullRequestCommentEvent, self).__init__(pullrequest) <NEW_LINE> self.comment =...
An instance of this class is emitted as an :term:`event` after a pull request comment is created.
625990a2adb09d7d5dc0c47c
class InvalidPacketError(CorruptEvohomeError): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.message = args[0] if args else None <NEW_LINE> <DEDENT> def __str__(self) -> str: <NEW_LINE> <INDENT> err_msg = "Corrupt packet" <NEW_LINE> err_ti...
Raised when the packet is inconsistent.
625990a2c4546d3d9def822d
class NodeResolveFingerprintStrategy(DefaultFingerprintHashingMixin, FingerprintStrategy): <NEW_LINE> <INDENT> _package_manager_lockfiles = { 'yarn': ['package.json', 'yarn.lock'], 'npm': ['package.json', 'package-lock.json', 'npm-shrinkwrap.json'] } <NEW_LINE> def _get_files_to_watch(self, target): <NEW_LINE> <INDENT>...
Fingerprint package lockfiles (e.g. package.json, yarn.lock...), so that we don't automatically run this if none of those have changed. We read every file and add its contents to the hash.
625990a3d8ef3951e32c8def
class _RegisterBase(object): <NEW_LINE> <INDENT> def __init__(self, assign_defaults=(), method_name=None, overwrite=False): <NEW_LINE> <INDENT> if isinstance(assign_defaults, str): <NEW_LINE> <INDENT> self._assign_defaults = [assign_defaults] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._assign_defaults = assign_...
Base class for the Register* decorators.
625990a3c4546d3d9def8231
class GetFaceInfo(QQAIClass): <NEW_LINE> <INDENT> api = 'https://api.ai.qq.com/fcgi-bin/face/face_getfaceinfo' <NEW_LINE> def make_params(self, face_id): <NEW_LINE> <INDENT> params = {'app_id': self.app_id, 'time_stamp': int(time.time()), 'nonce_str': int(time.time()), 'person_id': face_id } <NEW_LINE> params['sign'] =...
获取人脸信息
625990a350812a4eaa621b5d
class EmissionBudgetLevelNode(DjangoNode): <NEW_LINE> <INDENT> date = graphene.Date() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = EmissionBudgetLevel <NEW_LINE> fields = [ 'identifier', 'name', 'carbon_footprint', 'year' ]
Mobility emission budget to reach different prize levels
625990a350812a4eaa621b5f
class JoinPath(BaseInterface): <NEW_LINE> <INDENT> input_spec = JoinPathInputSpec <NEW_LINE> output_spec = JoinPathOutputSpec <NEW_LINE> def _list_outputs(self): <NEW_LINE> <INDENT> outputs = self._outputs().get() <NEW_LINE> outputs['path'] = op.join(self.inputs.dirname, self.inputs.filename) <NEW_LINE> return outputs ...
Joins a filename to a directory name
625990a3adb09d7d5dc0c48c
class Service(BaseService): <NEW_LINE> <INDENT> def __init__(self, executable_path, port=0, service_args=None, log_path=None, env=None): <NEW_LINE> <INDENT> super(Service, self).__init__(executable_path, port=port) <NEW_LINE> self.service_args = service_args or [] <NEW_LINE> if log_path: <NEW_LINE> <INDENT> self.servic...
Object that manages the starting and stopping of the ChromeDriver
625990a3d8ef3951e32c8df5
class DBConnectionProducer: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def get_connection(engine): <NEW_LINE> <INDENT> if (engine.lower() == 'mongo'): <NEW_LINE> <INDENT> return MongoConnection(engine) <NEW_LINE> <DEDENT> elif (engine.lower() == 'postgre'): <NEW_LINE> <INDENT> return PostgreConnection(engine)
Returns a new db connection according to the setting.py information Uses the factory method to create instances of connection
625990a3187af65679d2ab83
class PriorBox(object): <NEW_LINE> <INDENT> def __init__(self, cfg): <NEW_LINE> <INDENT> super(PriorBox, self).__init__() <NEW_LINE> self.size = cfg.MODEL.SIZE <NEW_LINE> if self.size == '300': <NEW_LINE> <INDENT> size_cfg = cfg.SMALL <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> size_cfg = cfg.BIG <NEW_LINE> <DEDENT> ...
Compute priorbox coordinates in center-offset form for each source feature map. Note: This 'layer' has changed between versions of the original SSD paper, so we include both versions, but note v2 is the most tested and most recent version of the paper.
625990a3c4546d3d9def8238
class LabelFrame(Frame): <NEW_LINE> <INDENT> def __init__(self, master, controller): <NEW_LINE> <INDENT> self._controller = controller <NEW_LINE> Frame.__init__(self, master) <NEW_LINE> self.printed = None <NEW_LINE> self._prettyPrint = Label(self, text=self.printed) <NEW_LINE> self._prettyPrint.pack(side=LEFT, pady=5)
This class is the Frame at the top which holds the label for displaying time, tem, date, sunlight etc.
625990a350812a4eaa621b64
class VolumeManageController(wsgi.Controller): <NEW_LINE> <INDENT> _view_builder_class = volume_views.ViewBuilder <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(VolumeManageController, self).__init__(*args, **kwargs) <NEW_LINE> self.volume_api = cinder_volume.API() <NEW_LINE> self._list_manag...
The /os-volume-manage controller for the OpenStack API.
625990a3d8ef3951e32c8df8
class ErrorDetail(str): <NEW_LINE> <INDENT> code = None <NEW_LINE> def __new__(cls, string, code=None): <NEW_LINE> <INDENT> self = super(ErrorDetail, cls).__new__(cls, string) <NEW_LINE> self.code = code <NEW_LINE> return self
A string-like object that can additionally
625990a350812a4eaa621b65
class SE_kernel(Kernel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Kernel.__init__(self) <NEW_LINE> <DEDENT> def set_params(self, params): <NEW_LINE> <INDENT> self.weight = params[0] <NEW_LINE> self.l = params[1] <NEW_LINE> <DEDENT> def squared_distance(self, x1, x2): <NEW_LINE> <INDENT> return np.sum...
Squared exponential kernel without derivatives
625990a3c4546d3d9def823a
class Thread (app.web.pastes.PasteListRequestHandler): <NEW_LINE> <INDENT> def get (self, paste_slug): <NEW_LINE> <INDENT> self.set_module(__name__ + ".__init__") <NEW_LINE> self.paste_slug = paste_slug <NEW_LINE> self.pastes = self.get_pastes(paste_slug) <NEW_LINE> self.path.add("Pastes", app.url("pastes/")) <NEW_LINE...
Show a table of all the pastes in the thread.
625990a3091ae35668706b6e
class Analyzer(): <NEW_LINE> <INDENT> def __init__(self, positives, negatives): <NEW_LINE> <INDENT> self.pwords=set() <NEW_LINE> self.nwords=set() <NEW_LINE> pfile=open(positives,"r") <NEW_LINE> for line in pfile: <NEW_LINE> <INDENT> if not line.startswith(";" or " "): <NEW_LINE> <INDENT> self.pwords.add(line.strip()) ...
Implements sentiment analysis.
625990a350812a4eaa621b67
class IngredientSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Ingredient <NEW_LINE> fields = ('id', 'name') <NEW_LINE> read_only_fields = ('id',)
Serializer for ingredient object
625990a3091ae35668706b70
class _RectangularProjection(Projection, metaclass=ABCMeta): <NEW_LINE> <INDENT> def __init__(self, proj4_params, half_width, half_height, globe=None): <NEW_LINE> <INDENT> self._half_width = half_width <NEW_LINE> self._half_height = half_height <NEW_LINE> super().__init__(proj4_params, globe=globe) <NEW_LINE> <DEDENT> ...
The abstract superclass of projections with a rectangular domain which is symmetric about the origin.
625990a3c4546d3d9def823d
class PV_MagAbove(PV_ChainUGen): <NEW_LINE> <INDENT> _ordered_input_names = collections.OrderedDict( [("pv_chain", None), ("threshold", 0)] )
Passes magnitudes above threshold. :: >>> pv_chain = supriya.ugens.FFT( ... source=supriya.ugens.WhiteNoise.ar(), ... ) >>> pv_mag_above = supriya.ugens.PV_MagAbove.new( ... pv_chain=pv_chain, ... threshold=0, ... ) >>> pv_mag_above PV_MagAbove.kr()
625990a3187af65679d2ab89
class GetRecentMediaForLocationResultSet(ResultSet): <NEW_LINE> <INDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None)
Retrieve the value for the "Response" output from this choreography execution. ((json) The response from Instagram.)
625990a3adb09d7d5dc0c49e
class GetUplinkStatusCommand(CommandWithErrors): <NEW_LINE> <INDENT> name = "Retrieve fabric Uplink status" <NEW_LINE> result_type = str <NEW_LINE> def parse_response(self, out, err): <NEW_LINE> <INDENT> if err: <NEW_LINE> <INDENT> raise IpmiError(err) <NEW_LINE> <DEDENT> return str(out) <NEW_LINE> <DEDENT> ipmitool_ar...
Describes the cxoem fabric get uplink_status IPMI command
625990a350812a4eaa621b6a
class Result(IntEnum): <NEW_LINE> <INDENT> SUCCESS = auto() <NEW_LINE> FAIL = auto() <NEW_LINE> UNDETERMINED = auto()
Packet parsing results. We start at undetermined and move to either success or fail.
625990a3187af65679d2ab8b
class Emoji(RedditBase): <NEW_LINE> <INDENT> STR_FIELD = 'name' <NEW_LINE> def __eq__(self, other): <NEW_LINE> <INDENT> if isinstance(other, str): <NEW_LINE> <INDENT> return other == str(self) <NEW_LINE> <DEDENT> return (isinstance(other, self.__class__) and str(self) == str(other) and other.subreddit == self.subreddit...
An individual Emoji object. **Typical Attributes** This table describes attributes that typically belong to objects of this class. Since attributes are dynamically provided (see :ref:`determine-available-attributes-of-an-object`), there is not a guarantee that these attributes will always be present, nor is this list...
625990a3adb09d7d5dc0c4a2
class RackspaceOnMetalDebianImage(OnMetalImage): <NEW_LINE> <INDENT> images = {"OnMetal - Debian Testing (Stretch)": {"minRam": 512, "minDisk": 20, "id": Image.image_id(), "OS-EXT-IMG-SIZE:size": Image.image_size()}, "OnMetal - Debian Unstable (Sid)": {"minRam": 512, "minDisk": 20, "id": Image.image_id(), "OS-EXT-IMG-S...
A Rackspace OnMetal image object representation
625990a4c4546d3d9def8240
class csr(ArrayConvertible, sp.csr_matrix): <NEW_LINE> <INDENT> pass
Wrapper for CSR matrices to be array-convertible.
625990a4adb09d7d5dc0c4a4
class AccessSequence: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._accesses = OrderedDict() <NEW_LINE> <DEDENT> def add(self, timestamp, access): <NEW_LINE> <INDENT> self._accesses[timestamp] = access <NEW_LINE> <DEDENT> def get(self): <NEW_LINE> <INDENT> for t, a in self._accesses.items(): <NEW_LI...
Stores a sequence of Access's by timestamp.
625990a4c4546d3d9def8241
class Moment(MutableDate): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> if args: <NEW_LINE> <INDENT> date, formula = parse_date_and_formula(*args) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> date, formula = (None, None) <NEW_LINE> <DEDENT> self._date = date <NEW_LINE> self._formula = formula <NE...
A class to abstract date difficulties.
625990a4adb09d7d5dc0c4a6
class ErrorResponse(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'error': {'required': True}, } <NEW_LINE> _attribute_map = { 'error': {'key': 'error', 'type': 'TextAnalyticsError'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(ErrorResponse, self).__init__(**kwargs) <NEW_L...
ErrorResponse. All required parameters must be populated in order to send to Azure. :ivar error: Required. Document Error. :vartype error: ~azure.ai.textanalytics.v3_2_preview_2.models.TextAnalyticsError
625990a4d8ef3951e32c8e00
class CoralDocFile(): <NEW_LINE> <INDENT> def __init__(self, local_host, doc_dir, language, relative_path): <NEW_LINE> <INDENT> self.cdf_local_host = local_host <NEW_LINE> self.cdf_doc_dir = doc_dir <NEW_LINE> self.cdf_language = language <NEW_LINE> self.cdf_relative_path = relative_path <NEW_LINE> self._cdf_line_numbe...
Each doc file has an object of this type
625990a450812a4eaa621b6d
class TestFaIr(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.fake = Faker('fa_IR') <NEW_LINE> Faker.seed(0) <NEW_LINE> <DEDENT> def test_color_name(self): <NEW_LINE> <INDENT> color_name = self.fake.color_name() <NEW_LINE> assert isinstance(color_name, str) <NEW_LINE> assert color_nam...
Tests colors in the fa_IR locale
625990a4c4546d3d9def8243
class StateCounter(object): <NEW_LINE> <INDENT> def __init__(self, fec, sec, rac, aac): <NEW_LINE> <INDENT> self.first_entry_count = fec <NEW_LINE> self.subsequent_entries_count = sec <NEW_LINE> self.resolved_answer_count = rac <NEW_LINE> self.active_answer_count = aac <NEW_LINE> <DEDENT> @property <NEW_LINE> def total...
Domain object that keeps counts associated with states. All methods and properties in this file should be independent of the specific storage model used.
625990a4adb09d7d5dc0c4ac
class FireAnt(Ant): <NEW_LINE> <INDENT> name = 'Fire' <NEW_LINE> damage = 3 <NEW_LINE> food_cost = 5 <NEW_LINE> armor = 1 <NEW_LINE> implemented = True <NEW_LINE> def reduce_armor(self, amount): <NEW_LINE> <INDENT> self.armor -= amount <NEW_LINE> if self.armor <= 0: <NEW_LINE> <INDENT> copy = self.place.bees[:] <NEW_LI...
FireAnt cooks any Bee in its Place when it expires.
625990a4091ae35668706b80
@tf_export("data.experimental.service.DispatcherConfig") <NEW_LINE> class DispatcherConfig( collections.namedtuple("DispatcherConfig", [ "port", "protocol", "work_dir", "fault_tolerant_mode", "job_gc_check_interval_ms", "job_gc_timeout_ms" ])): <NEW_LINE> <INDENT> def __new__(cls, port=0, protocol=None, work_dir=None, ...
Configuration class for tf.data service dispatchers. Fields: port: Specifies the port to bind to. A value of 0 indicates that the server may bind to any available port. protocol: The protocol to use for communicating with the tf.data service, e.g. "grpc". work_dir: A directory to store dispatcher state i...
625990a4187af65679d2ab91
class NumAudioBuses(InfoUGenBase): <NEW_LINE> <INDENT> __documentation_section__ = 'Info UGens' <NEW_LINE> __slots__ = () <NEW_LINE> def __init__( self, calculation_rate=None, ): <NEW_LINE> <INDENT> InfoUGenBase.__init__( self, calculation_rate=calculation_rate, )
A number of audio buses info unit generator. :: >>> ugentools.NumAudioBuses.ir() NumAudioBuses.ir()
625990a4adb09d7d5dc0c4b2
class GuiParameters(object): <NEW_LINE> <INDENT> def __init__(self, prefix, template, width, height, accent, boring, light, language, replace_images, replace_code, update_code, name=None): <NEW_LINE> <INDENT> self.prefix = prefix <NEW_LINE> self.template = template <NEW_LINE> self.width = width <NEW_LINE> self.height =...
This represents the parameters to the gui. This is used to initialize the ImageGenerator and CodeGenerator objects to a consistent set of parameters.
625990a450812a4eaa621b73
class ConfigWriter(object): <NEW_LINE> <INDENT> def filenames(self, controllers): <NEW_LINE> <INDENT> filenames = ['clouds.yaml', 'credentials.yaml'] <NEW_LINE> for controller in controllers: <NEW_LINE> <INDENT> filename = "bootstrap-{}.yaml".format(controller.name) <NEW_LINE> filenames.append(filename) <NEW_LINE> <DED...
The JujuConfig writer specific to Juju 2.x.
625990a4c4546d3d9def824c
class AppReleaseViewSet(BaseAppViewSet): <NEW_LINE> <INDENT> model = models.Release <NEW_LINE> serializer_class = serializers.ReleaseSerializer <NEW_LINE> def get_object(self, *args, **kwargs): <NEW_LINE> <INDENT> return self.get_queryset(**kwargs).get(version=self.kwargs['version']) <NEW_LINE> <DEDENT> def rollback(se...
RESTful views for :class:`~api.models.Release`.
625990a4187af65679d2ab9a
class RedisKeySchemaTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.test_db = redis.StrictRedis() <NEW_LINE> if test_db.dbsize() > 0: <NEW_LINE> <INDENT> raise ValueError("Redis Test Instance must be empty") <NEW_LINE> <DEDENT> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self...
This class is an example of testing a Redis Key Schema in Python
625990a4c4546d3d9def824f
class DataParallelWithCallback(DataParallel): <NEW_LINE> <INDENT> def __init__(self, module, device_ids=None, output_device=None, dim=0, chunk_size=None): <NEW_LINE> <INDENT> super(DataParallelWithCallback, self).__init__(module) <NEW_LINE> if not torch.cuda.is_available(): <NEW_LINE> <INDENT> self.module = module <NEW...
Data Parallel with a replication callback. An replication callback `__data_parallel_replicate__` of each module will be invoked after being created by original `replicate` function. The callback will be invoked with arguments `__data_parallel_replicate__(ctx, copy_id)` Examples: > sync_bn = SynchronizedBatchNorm1...
625990a4adb09d7d5dc0c4c2
class BaseBackend: <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> @abstractproperty <NEW_LINE> def is_persistent(self): <NEW_LINE> <INDENT> return NotImplemented <NEW_LINE> <DEDENT> @abstractproperty <NEW_LINE> def is_existing(self): <NEW_LINE> <INDENT> return NotImplemented <NEW_LINE> <DEDENT> @abstractmethod ...
abstract class that should be implemented by all cache storage backends
625990a5187af65679d2ab9f
class NetD(nn.Module): <NEW_LINE> <INDENT> def __init__(self, opt): <NEW_LINE> <INDENT> super(NetD, self).__init__() <NEW_LINE> ndf = opt.ndf <NEW_LINE> self.main = nn.Sequential( nn.Conv2d(3, ndf, 5, 3, 1, bias=False), nn.LeakyReLU(0.2, inplace=True), nn.Conv2d(ndf, ndf * 2, 4, 2, 1, bias=False), nn.BatchNorm2d(ndf * ...
判别器定义
625990a550812a4eaa621b7f
class AlphaBetaAgent(MultiAgentSearchAgent): <NEW_LINE> <INDENT> def getAction(self, gameState): <NEW_LINE> <INDENT> res = self.value(gameState, 0, 0, None, None) <NEW_LINE> return res[1] <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def max_int_action(*args): <NEW_LINE> <INDENT> valid_args = [x for x in args if x is no...
Your minimax agent with alpha-beta pruning (question 3)
625990a5c4546d3d9def8256
class AiAnalysisTaskClassificationInput(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Definition = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Definition = params.get("Definition")
智能分类任务输入类型
625990a5c4546d3d9def8257
class Pomkl(Pompi, IntelMKL, IntelFFTW): <NEW_LINE> <INDENT> NAME = 'pomkl' <NEW_LINE> SUBTOOLCHAIN = [Pompi.NAME, Pmkl.NAME]
Compiler toolchain with PGI compilers, OpenMPI, Intel Math Kernel Library (MKL) and Intel FFTW wrappers.
625990a5c4546d3d9def8259
class PeerList(object): <NEW_LINE> <INDENT> __slots__ = [ "peers", "pids" ] <NEW_LINE> def __init__(self, *args): <NEW_LINE> <INDENT> self.peers = [] <NEW_LINE> for row in args: <NEW_LINE> <INDENT> self.append(row) <NEW_LINE> <DEDENT> <DEDENT> def append(self, peer, status='DONE', score=None): <NEW_LINE> <INDENT> self....
A PeerList is a ranked list of Snippet objects.
625990a5adb09d7d5dc0c4d6
class NvencAdvancedSettingsSignal: <NEW_LINE> <INDENT> def __init__(self, nvenc_handlers, inputs_page_handlers): <NEW_LINE> <INDENT> self.nvenc_handlers = nvenc_handlers <NEW_LINE> self.inputs_page_handlers = inputs_page_handlers <NEW_LINE> <DEDENT> def on_nvenc_advanced_settings_switch_state_set(self, nvenc_advanced_s...
Handles the signal emitted when NVENC advanced settings are toggled.
625990a5187af65679d2aba5
class Config(MutableMapping): <NEW_LINE> <INDENT> def __init__(self, filename, makedirs=True): <NEW_LINE> <INDENT> self._filename = filename <NEW_LINE> if makedirs: <NEW_LINE> <INDENT> os.makedirs(os.path.dirname(self._filename), exist_ok=True) <NEW_LINE> <DEDENT> if os.path.exists(self._filename): <NEW_LINE> <INDENT> ...
A configuration dictionary-like object. Args: filename (str): Initial values for this dictionary are loaded from this file using `yaml.safe_load`. Changes to this dictionary are immediately written to disk in the same file. makedirs (bool, default True): If true, any intermediate ...
625990a5c4546d3d9def825a
class Universe(object): <NEW_LINE> <INDENT> LTP = Ola_pb2.LTP <NEW_LINE> HTP = Ola_pb2.HTP <NEW_LINE> def __init__(self, universe_id, name, merge_mode, input_ports, output_ports): <NEW_LINE> <INDENT> self._id = universe_id <NEW_LINE> self._name = name <NEW_LINE> self._merge_mode = merge_mode <NEW_LINE> self._input_port...
Represents a universe. Attributes: id: the integer universe id name: the name of this universe merge_mode: the merge mode this universe is using
625990a550812a4eaa621b8a
class BaseHTTPResponse: <NEW_LINE> <INDENT> __slots__ = ( "asgi", "body", "content_type", "stream", "status", "headers", "_cookies", ) <NEW_LINE> _dumps = json_dumps <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.asgi: bool = False <NEW_LINE> self.body: Optional[bytes] = None <NEW_LINE> self.content_type: Opti...
The base class for all HTTP Responses
625990a5187af65679d2abab
class Detail(View): <NEW_LINE> <INDENT> def get(self, request, pk): <NEW_LINE> <INDENT> common_return_dict = utils.refresh(request) <NEW_LINE> article = get_object_or_404(Blog, id=pk) <NEW_LINE> if article.password != utils.PARAS().BLOG_DEFAULT_PASSWORD: <NEW_LINE> <INDENT> if not request.GET.get('psd') or request.GET....
博客详情页
625990a550812a4eaa621b8b
class SugarConfigurationException(SugarException): <NEW_LINE> <INDENT> __prefix__ = "Configuration error"
Used when configuration exception occurs (wrong or not found).
625990a5187af65679d2abac
class TournamentWebsocketMixin(TournamentFromUrlMixin): <NEW_LINE> <INDENT> group_prefix = None <NEW_LINE> def get_url_kwargs(self): <NEW_LINE> <INDENT> return self.scope["url_route"]["kwargs"] <NEW_LINE> <DEDENT> def group_name(self): <NEW_LINE> <INDENT> if self.group_prefix is None: <NEW_LINE> <INDENT> raise Improper...
Mixin for websocket consumers that listen for changes relating to a particular tournament, as specified in the URL. Subclasses must provide a `group_prefix` that serves as a name for the stream; the name of the group is a concatenation of this and the tournament slug.
625990a6c4546d3d9def8262
class UserUrl(MainHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> if not self.user: <NEW_LINE> <INDENT> self.write_json({'error':'not logged in'}) <NEW_LINE> return <NEW_LINE> <DEDENT> s = self.request.get('s') <NEW_LINE> if s.isdigit():s=int(s) <NEW_LINE> else:s=0 <NEW_LINE> n = self.request.get('n') ...
get user stored URLs
625990a6adb09d7d5dc0c4ec
class Map(DaeObject): <NEW_LINE> <INDENT> def __init__(self, sampler, texcoord, xmlnode=None): <NEW_LINE> <INDENT> self.sampler = sampler <NEW_LINE> self.texcoord = texcoord <NEW_LINE> if xmlnode != None: <NEW_LINE> <INDENT> self.xmlnode = xmlnode <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.xmlnode = E.texture(t...
Class containing data coming from <texture> tag inside material. When a material defines its properties like `diffuse`, it can give you a color or a texture. In the latter, the texture is mapped with a sampler and a texture coordinate channel. If a material defined a texture for one of its properties, you'll find an o...
625990a6091ae35668706bc0
class XNATCopyInputSpec(CommandLineInputSpec): <NEW_LINE> <INDENT> project = traits.Str(mandatory=True, desc='The XNAT project id') <NEW_LINE> subject = traits.Str(mandatory=True, desc='The XNAT subject name') <NEW_LINE> session = traits.Str(mandatory=True, argstr='%s', position=-2, desc='The XNAT session name') <NEW_L...
The input spec with arguments in the following order: * options * the input files, for an upload * the XNAT object path * the destination directory, for a download
625990a6187af65679d2abb0
class RealeseCommand(Command): <NEW_LINE> <INDENT> description = 'Release the package.' <NEW_LINE> user_options = [] <NEW_LINE> @staticmethod <NEW_LINE> def status(s): <NEW_LINE> <INDENT> print('\033[1m{0}\033[0m'.format(s)) <NEW_LINE> <DEDENT> def initialize_options(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> ...
Support setup.py upload.
625990a650812a4eaa621b90
class HybridServicesAdminNegativeTestJSON(ServicesAdminNegativeTest.ServicesAdminNegativeTestJSON): <NEW_LINE> <INDENT> pass
Tests Services API. List and Enable/Disable require admin privileges.
625990a6adb09d7d5dc0c4f2
class StsUtil: <NEW_LINE> <INDENT> def __init__(self, device_serial_or_address, logger, device_access_timeout_secs=60): <NEW_LINE> <INDENT> self.device_serial_or_address = device_serial_or_address <NEW_LINE> self.logger = logger <NEW_LINE> self.device_access_timeout_secs = device_access_timeout_secs <NEW_LINE> try: <NE...
Interface for STS related workarounds when automating TradeFed. For applying StsUtil, use one instance per TradeFed STS invocation. Ideally, construct it before running any tests, so when the passed device is in a good known state. Call fix_result_file_fingerprints() after each completed run, before rerunning. Applyi...
625990a6091ae35668706bc6
class HumanPlayer(Player): <NEW_LINE> <INDENT> def __init__(self,name): <NEW_LINE> <INDENT> super().__init__(name) <NEW_LINE> <DEDENT> def is_playable(self): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def pick_card(self, putdown_pile): <NEW_LINE> <INDENT> return None
Subclass of Player Player that selects cards to play using the GUI
625990a650812a4eaa621b93
class BaseDyadic(Dyadic, AtomicExpr): <NEW_LINE> <INDENT> def __new__(cls, vector1, vector2): <NEW_LINE> <INDENT> from sympy.vector.vector import Vector, BaseVector, VectorZero <NEW_LINE> if not isinstance(vector1, (BaseVector, VectorZero)) or not isinstance(vector2, (BaseVector, VectorZero)): <NEW_LINE> ...
Class to denote a base dyadic tensor component.
625990a6adb09d7d5dc0c4f6
class AddComentsView(View): <NEW_LINE> <INDENT> def post(self, request): <NEW_LINE> <INDENT> if not request.user.is_authenticated(): <NEW_LINE> <INDENT> return HttpResponse('{"status":"fail", "msg":"用户未登录"}', content_type='application/json') <NEW_LINE> <DEDENT> course_id = request.POST.get("course_id", 0) <NEW_LINE> co...
用户添加课程评论
625990a6091ae35668706bcc