code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class SpacedSeparator(Gtk.EventBox): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Gtk.EventBox.__init__(self) <NEW_LINE> self.box = Gtk.Box() <NEW_LINE> self.box.set_orientation(Gtk.Orientation.VERTICAL) <NEW_LINE> self.box.add(Gtk.HSeparator()) <NEW_LINE> self.box.set_border_width(6) <NEW_LINE> self.add... | A Separator with vertical spacing
Inherits from EventBox since we want to change background color | 62598ef310dbd63aa1c6f3b0 |
class BgpServiceCommunity(Resource): <NEW_LINE> <INDENT> _validation = { 'name': {'readonly': True}, 'type': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'st... | Service Community Properties.
Variables are only populated by the server, and will be ignored when
sending a request.
:param id: Resource ID.
:type id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
:vartype type: str
:param location: Resource location.
:type location: str
:param tags: R... | 62598ef37b25080760ed5cd3 |
class seq(immutable, matchable): <NEW_LINE> <INDENT> __slots__ = 'matchables', <NEW_LINE> def __new__(cls, *matchables): <NEW_LINE> <INDENT> if not matchables: <NEW_LINE> <INDENT> raise TypeError('cannot create an empty sequence') <NEW_LINE> <DEDENT> if len(matchables) == 1: <NEW_LINE> <INDENT> return coerce_ellipsis(m... | A sequence of matchables to match in order.
Parameters
----------
*matchables : iterable of matchable
The matchables to match against. | 62598ef33317a56b869bd982 |
class LiveM3U8StreamResource(Resource): <NEW_LINE> <INDENT> def get(self, video_id, repr_name): <NEW_LINE> <INDENT> video = session .query(Video) .filter(Video.video_id == video_id) .first() <NEW_LINE> if not video: <NEW_LINE> <INDENT> abort(404, message="Video (%s) doesn't exist" % vid... | Resource to serve the Live M3U8 stream playlist. | 62598ef3aad79263cf42d046 |
class CibObjectSetCli(CibObjectSet): <NEW_LINE> <INDENT> vim_stx_str = "# vim: set filetype=pcmk:\n" <NEW_LINE> def __init__(self, *args): <NEW_LINE> <INDENT> CibObjectSet.__init__(self, *args) <NEW_LINE> <DEDENT> def repr_nopretty(self, format_mode=1): <NEW_LINE> <INDENT> with clidisplay.nopretty(): <NEW_LINE> <INDENT... | Edit or display a set of cib objects (using cli notation). | 62598ef366673b3332c2ebe3 |
@sequence.serializable("IsotopeLabeledState") <NEW_LINE> class IsotopeLabeledState(namedtuple("IsotopeLabeledState", "modifications mass populations crosslinker")): <NEW_LINE> <INDENT> pass | # TODO: Doc | 62598ef37b180e01f3e48462 |
class Carte: <NEW_LINE> <INDENT> def __init__(self, nom, chaine): <NEW_LINE> <INDENT> self.nom = nom <NEW_LINE> self.labyrinthe = self.creer_labyrinthe_depuis_chaine(chaine) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "<Carte {}>".format(self.nom) <NEW_LINE> <DEDENT> def CalculerCoordonees(self, ... | Objet de transition entre un fichier et un labyrinthe. | 62598ef3d58c6744b42db6d2 |
class TaskSpace(object): <NEW_LINE> <INDENT> def __init__(self, **args): <NEW_LINE> <INDENT> self.taskName = args['TaskName'] <NEW_LINE> self.location = os.path.dirname(inspect.getsourcefile(args['Locator'])) <NEW_LINE> self.task = None <NEW_LINE> self.workload = None <NEW_LINE> <DEDENT> def getWMWorkload(self): <NEW_L... | _TaskSpace_
Util container for runtime operations within a Task & its
constituent steps | 62598ef3fff4ab517ebcc011 |
class LearningAgent(Agent): <NEW_LINE> <INDENT> def __init__(self, env, learning=False, epsilon=1.0, alpha=0.5): <NEW_LINE> <INDENT> super(LearningAgent, self).__init__(env) <NEW_LINE> self.planner = RoutePlanner(self.env, self) <NEW_LINE> self.valid_actions = self.env.valid_actions <NEW_LINE> self.learning = learning ... | An agent that learns to drive in the Smartcab world.
This is the object you will be modifying. | 62598ef38da39b475be019e6 |
class TestContextManager(object): <NEW_LINE> <INDENT> def __init__(self, args): <NEW_LINE> <INDENT> self.staging_location = args.staging_location <NEW_LINE> self.temp_location = args.temp_location <NEW_LINE> self.logging_location = args.logging_location <NEW_LINE> self.project = args.project <NEW_LINE> self.credentials... | Manages all resources for a given run of tests.
Responsible for setting up tests (i.e. creating a unique dataset) and
cleaning up all resources after tests have been completed. | 62598ef367a9b606de544807 |
class CtoUV(Matrix): <NEW_LINE> <INDENT> def __init__(self, config={}, **kwds): <NEW_LINE> <INDENT> super(CtoUV, self).__init__(config=config, **kwds) <NEW_LINE> mat = Frame() <NEW_LINE> mat.data = numpy.array( [[2.02 / 0.886], [1.14 / 0.701]], dtype=numpy.float32) <NEW_LINE> mat.type = 'mat' <NEW_LINE> audit = mat.met... | Matrix chroma to modulated Cb,Cr.
This includes level conversions as specified in the "White Book". | 62598ef357b8e32f52507520 |
class MplVisualizer(Visualizer): <NEW_LINE> <INDENT> def __init__(self, q_widget, q_layout): <NEW_LINE> <INDENT> Visualizer.__init__(self) <NEW_LINE> self.qWidget = q_widget <NEW_LINE> self.qLayout = q_layout <NEW_LINE> self.dpi = 100 <NEW_LINE> self.fig = Figure((5.0, 4.0), facecolor='white', dpi=self.dpi) <NEW_LINE> ... | Base Class with some function the help visualizing the system using
matplotlib | 62598ef397e22403b3839729 |
class IHotThreads(IPortletDataProvider): <NEW_LINE> <INDENT> header = schema.TextLine( title=_(u'Header'), description=_(u'The header for the portlet. Leave empty for none.'), required=False, ) <NEW_LINE> forum = schema.TextLine( title=_(u'Forum'), description=_( u'Specify the forum you wish to obtain the hot threads f... | A portlet that lists hot threads. | 62598ef3a8370b77170eec1e |
class VisualEncoder(UnimodalEncoder): <NEW_LINE> <INDENT> pass | Alias for Unimodal Encoder | 62598ef37d847024c075ac08 |
class UserDoesNotExist(Exception): <NEW_LINE> <INDENT> pass | Raised when user does not exist | 62598ef360cbc95b06362b6f |
class ModelDatabaseRouter(object): <NEW_LINE> <INDENT> def db_for_read(self, model, **hints): <NEW_LINE> <INDENT> if hasattr(model._meta, 'in_db'): <NEW_LINE> <INDENT> return model._meta.in_db <NEW_LINE> <DEDENT> return None <NEW_LINE> <DEDENT> def db_for_write(self, model, **hints): <NEW_LINE> <INDENT> if hasattr(mode... | Allows each model to set its own destiny | 62598ef3dc8b845886d51dff |
class Mutation(graphene.ObjectType): <NEW_LINE> <INDENT> create_author = CreateAuthor.Field() <NEW_LINE> update_author = UpdateAuthor.Field() <NEW_LINE> create_book = CreateBook.Field() <NEW_LINE> update_book = UpdateBook.Field() | Our set of mutations allowed | 62598ef3283ffb24f3cf20e4 |
class Follow(models.Model): <NEW_LINE> <INDENT> band=models.ForeignKey(Band, on_delete=models.CASCADE) <NEW_LINE> follower = models.ForeignKey(User, on_delete=models.CASCADE) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> db_table= "followers" <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return f'{self.follow... | Model to represent the follower of one band instance. | 62598ef3379a373c97d97831 |
class DeleteSavedOrderInfo(Object): <NEW_LINE> <INDENT> ID = "deleteSavedOrderInfo" <NEW_LINE> def __init__(self, extra=None, **kwargs): <NEW_LINE> <INDENT> self.extra = extra <NEW_LINE> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def read(q: dict, *args) -> "DeleteSavedOrderInfo": <NEW_LINE> <INDENT> return Dele... | Deletes saved order info
Attributes:
ID (:obj:`str`): ``DeleteSavedOrderInfo``
No parameters required.
Returns:
Ok
Raises:
:class:`telegram.Error` | 62598ef399fddb7c1ca62221 |
class DescribeImagesRequest(JDCloudRequest): <NEW_LINE> <INDENT> def __init__(self, parameters, header=None, version="v1"): <NEW_LINE> <INDENT> super(DescribeImagesRequest, self).__init__( '/regions/{regionId}/images', 'GET', header, version) <NEW_LINE> self.parameters = parameters | 返回指定repository中images的元数据,包括image size, image tags和creation date。 | 62598ef330bbd7224646846f |
class TestBucketCopyrightProtection(TestClient): <NEW_LINE> <INDENT> def test_bucket_copyright_protection(self): <NEW_LINE> <INDENT> resource = [self.BUCKET + "/test/*"] <NEW_LINE> err = None <NEW_LINE> try: <NEW_LINE> <INDENT> self.bos.put_bucket_copyright_protection(self.BUCKET, resource) <NEW_LINE> <DEDENT> except B... | test bucket copyright protection | 62598ef38a43f66fc4bf09ae |
class VideoReceiver(ProcEndpoint): <NEW_LINE> <INDENT> def __init__(self, parent: Node, name: str, receiver_port: int): <NEW_LINE> <INDENT> super().__init__(parent, name, self.init_receiver, self.monitor_stream, TICK_RATE_HZ) <NEW_LINE> self.receiver_port = receiver_port <NEW_LINE> self.window_name = f"Raspberry Pi Str... | Video stream receiving endpoint.
Shows video received over IP in window. | 62598ef33317a56b869bd983 |
class DBSCAN(BaseEstimator, ClusterMixin): <NEW_LINE> <INDENT> def __init__(self, eps=0.5, min_samples=5, timeScale=1, metric='euclidean', indexing=None): <NEW_LINE> <INDENT> self.eps = eps <NEW_LINE> self.min_samples = min_samples <NEW_LINE> self.metric = metric <NEW_LINE> self.indexing = indexing <NEW_LINE> self.time... | Perform DBSCAN clustering from vector array or distance matrix.
DBSCAN - Density-Based Spatial Clustering of Applications with Noise.
Finds core samples of high density and expands clusters from them.
Good for data which contains clusters of similar density.
Parameters
----------
eps : float, optional
The maximum... | 62598ef34c34283577618b21 |
class ReflexAgent(Agent): <NEW_LINE> <INDENT> def getAction(self, gameState): <NEW_LINE> <INDENT> legalMoves = gameState.getLegalActions() <NEW_LINE> scores = [self.evaluationFunction(gameState, action) for action in legalMoves] <NEW_LINE> bestScore = max(scores) <NEW_LINE> bestIndices = [index for index in range(len(s... | A reflex agent chooses an action at each choice point by examining
its alternatives via a state evaluation function.
The code below is provided as a guide. You are welcome to change
it in any way you see fit, so long as you don't touch our method
headers. | 62598ef366673b3332c2ebe5 |
class BaseModule: <NEW_LINE> <INDENT> def __init__(self, bot): <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> <DEDENT> @commands.command(name='ping') <NEW_LINE> async def ping(self, ctx): <NEW_LINE> <INDENT> ping_message = await ctx.send(':ping_pong: in **...** ms') <NEW_LINE> latency_delta = ping_message.created_at - c... | Contains commands that are usual for a Discord bot. | 62598ef3adb09d7d5dc08e03 |
class PyBoardNotFoundError(Exception): <NEW_LINE> <INDENT> pass | Raised if the requested board could not be found | 62598ef3cc0a2c111447983b |
class PrimaryComponent(BuiltForm): <NEW_LINE> <INDENT> objects = GeoInheritanceManager() <NEW_LINE> class Meta(object): <NEW_LINE> <INDENT> app_label = 'footprint' <NEW_LINE> <DEDENT> def get_parent_field(self): <NEW_LINE> <INDENT> return self.placetypecomponent_set | Building represents a template building, such as a Rural Community College | 62598ef3d58c6744b42db6d3 |
class ConditionTwoArgs(Condition): <NEW_LINE> <INDENT> def __init__(self, v1, v2): <NEW_LINE> <INDENT> Condition.__init__(self, v1) <NEW_LINE> self.v2 = v2 <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '%s(%s, %s)' % (self.__class__.__name__, self.v1, self.v2) <NEW_LINE> <DEDENT> def to_dict(self):... | Abstract class for Conditions that require two arguments.
The only example of this currently is BETWEEN. | 62598ef3236d856c2adc8834 |
class Server(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'redis_server' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String(64), unique=True) <NEW_LINE> description = db.Column(db.String(512)) <NEW_LINE> host = db.Column(db.String(15)) <NEW_LINE> port = db.Column(db.Integer,... | Redis服务器模型 | 62598ef39c8ee8231303f578 |
class Controller: <NEW_LINE> <INDENT> POLL_FREQUENCY = 10 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.kill_event = threading.Event() <NEW_LINE> self.input_thread = InputThread(self.kill_event) <NEW_LINE> self.output_thread = OutputThread(self.kill_event) <NEW_LINE> <DEDENT> def start(self): <NEW_LINE> <INDE... | This is a basic controller class. It starts all the threads, handles SIGTERM and SIGINT,
and stops and rejoins the threads cleanly. The __main__ thread will wait in the controllers
wait method. | 62598ef3a219f33f346c506e |
class WebServiceTask(ScanTask): <NEW_LINE> <INDENT> abstract = True <NEW_LINE> @property <NEW_LINE> def inspector(self): <NEW_LINE> <INDENT> from lib.inspection import WebServiceInspector <NEW_LINE> return WebServiceInspector( ip_address=self.web_service.ip_address, port=self.web_service.port, hostname=self.web_service... | This is a base task type for all tasks that are intended to investigate a web service. | 62598ef33346ee7daa336a85 |
class PrivateEpApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.admin_user = get_user_model().objects.create_user( 'test@gmail.com', 'password123', is_staff=True ) <NEW_LINE> self.client = APIClient() <NEW_LINE> self.client.force_authenticate(self.admin_user) <NEW_LINE> <DEDENT> def tes... | Test the authorized user eps API | 62598ef3851cf427c66b6b00 |
class OrmP(P): <NEW_LINE> <INDENT> def eval(self, instance): <NEW_LINE> <INDENT> return orm_eval(self, instance) | Version of P class that asserts the invariants of the orm_eval method. | 62598ef37d43ff2487426819 |
class ContactResponseList(object): <NEW_LINE> <INDENT> openapi_types = { 'contacts': 'list[ContactResponse]' } <NEW_LINE> attribute_map = { 'contacts': 'contacts' } <NEW_LINE> def __init__(self, contacts=None, local_vars_configuration=None): <NEW_LINE> <INDENT> if local_vars_configuration is None: <NEW_LINE> <INDENT> l... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598ef3956e5f7376df4a96 |
class ObjectSearchParams: <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.isSingle = kwargs.get('isSingle', False) <NEW_LINE> self.returnType = kwargs.get('returnType', 'src') <NEW_LINE> self.attribute = kwargs.get('attribute', None) <NEW_LINE> <DEDENT> def __dict__(self): <NEW_LINE> <INDENT>... | Base class for to hold parameters for an item on page, and verifies the items
found are of the correct quantity. | 62598ef35fc7496912d47690 |
class CommitList(Node): <NEW_LINE> <INDENT> def __init__(self, parent, name, repo_dir=None): <NEW_LINE> <INDENT> Node.__init__(self, parent, name, GIT_MODE_TREE, EMPTY_SHA, repo_dir) <NEW_LINE> self.commits = {} <NEW_LINE> <DEDENT> def _mksubs(self): <NEW_LINE> <INDENT> self._subs = {} <NEW_LINE> for (name, (hash, date... | A list of commits with hashes that start with the current node's name. | 62598ef38a349b6b43684a7e |
class RemoteUploaderRunner(UploaderRunner): <NEW_LINE> <INDENT> def __init__(self, uploader: Uploader): <NEW_LINE> <INDENT> super(RemoteUploaderRunner, self).__init__() <NEW_LINE> self.uploader = uploader <NEW_LINE> <DEDENT> def upload(self, basedir_name: str, transaction: Transaction = None, transaction_key_values: ty... | Handle uploading to a remote Pacifica instance. | 62598ef3a17c0f6771d5aa90 |
class meme_list_1(APIView): <NEW_LINE> <INDENT> renderer_classes = [TemplateHTMLRenderer] <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> form = MemeSerializer() <NEW_LINE> return Response({"form": form},template_name="meme_detail.html") <NEW_LINE> <DEDENT> def post(self, request): <NEW_LINE> <INDENT> serializer... | List all meme contents, or create a new meme content | 62598ef3a219f33f346c506f |
class SrtpProjectSignupView(View): <NEW_LINE> <INDENT> def get(self,request): <NEW_LINE> <INDENT> srtp_announce = ProjectCollectIssue.objects.filter(to_student= True) <NEW_LINE> if srtp_announce.exists(): <NEW_LINE> <INDENT> srtp_announce = srtp_announce.latest('id') <NEW_LINE> file_name = re.split('/',str(srtp_announc... | 学生查看报名通知并在这里进行报名 | 62598ef3009cb60464cffd8c |
class TomcatExtractionJob(interface.TurbiniaJob): <NEW_LINE> <INDENT> evidence_input = [ Directory, DockerContainer, RawDisk, GoogleCloudDisk, GoogleCloudDiskRawEmbedded ] <NEW_LINE> evidence_output = [ExportedFileArtifact] <NEW_LINE> NAME = 'TomcatExtractionJob' <NEW_LINE> def create_tasks(self, evidence): <NEW_LINE> ... | Extract Apache Tomcat files for analysis. | 62598ef37b25080760ed5cd7 |
class Uniform(Initializer): <NEW_LINE> <INDENT> def __init__(self, low=0.0, high=1.0, name="uniformInit"): <NEW_LINE> <INDENT> super(Uniform, self).__init__(name=name) <NEW_LINE> self.low, self.high = (low, high) <NEW_LINE> <DEDENT> def fill(self, param): <NEW_LINE> <INDENT> param[:] = self.be.rng.uniform(self.low, sel... | A class for initializing parameter tensors with values drawn from
a uniform distribution.
Args:
low (float, optional): Lower bound of range from which we draw values.
high (float, optional): Upper bound of range from which we draw values. | 62598ef33317a56b869bd984 |
class BaseInput(BasePort): <NEW_LINE> <INDENT> def __init__(self, name='', **kwargs): <NEW_LINE> <INDENT> self.callback = kwargs.get('callback') <NEW_LINE> self._parser = Parser() <NEW_LINE> self._messages = self._parser._parsed_messages <NEW_LINE> BasePort.__init__(self, name, **kwargs) <NEW_LINE> <DEDENT> def pending... | Base class for input port.
Override _pending() to create a new input port type.
(See portmidi.py for an example of how to do this.) | 62598ef34c34283577618b23 |
class SimpleMessageArea(gtk.HBox): <NEW_LINE> <INDENT> def __init__(self, message, buttons=()): <NEW_LINE> <INDENT> gtk.HBox.__init__(self, spacing=6) <NEW_LINE> self.set_border_width(6) <NEW_LINE> self.__in_style_set = False <NEW_LINE> self.connect('style-set', self.__style_set) <NEW_LINE> self.connect('expose-event',... | A simple, yellow message area. Inspired by gedit.
Original C source code:
http://svn.gnome.org/viewvc/gedit/trunk/gedit/gedit-message-area.c | 62598ef371ff763f4b5e5f9c |
class GetUcdnTrafficResponseSchema(schema.ResponseSchema): <NEW_LINE> <INDENT> fields = { "TrafficSet": fields.List( models.TrafficSetSchema(), required=False, load_from="TrafficSet" ) } | GetUcdnTraffic - 获取流量信息
| 62598ef34428ac0f6e656d8a |
class checkoutComplete(View): <NEW_LINE> <INDENT> template_name = 'checkout_complete.html' <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> order_id = request.session['order_id'] <NEW_LINE> order = Order.objects.get(id=order_id) <NEW_LINE> del request.session['order_id'] <NEW_LINE> context = { 'order': order} <NE... | View to be displayed when the checkout has been completed | 62598ef3bf627c535bcafcad |
class OrgName(core.XmlElement): <NEW_LINE> <INDENT> _qname = GDATA_TEMPLATE % 'orgName' <NEW_LINE> yomi = 'yomi' | The gd:orgName element.
The name of the organization. Must appear within a gd:organization
element.
Contains a Yomigana attribute (Japanese reading aid) for the
organization name. | 62598ef3fff4ab517ebcc015 |
class Registry: <NEW_LINE> <INDENT> Format = namedtuple("Format", ('archiver', 'description', 'extensions')) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._formats = {} <NEW_LINE> <DEDENT> def list(self): <NEW_LINE> <INDENT> return self._formats.keys() <NEW_LINE> <DEDENT> def add(self, id, archiver, descripti... | A set of methods for finding and enumerating supported archivers | 62598ef39c8ee8231303f579 |
class ChiSquared(object): <NEW_LINE> <INDENT> def __init__(self, form="poisson_likelihood", penalty_terms=None): <NEW_LINE> <INDENT> self._form = form <NEW_LINE> if penalty_terms: <NEW_LINE> <INDENT> self._penalty_terms = penalty_terms <NEW_LINE> self._penalty_terms_set = True <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDE... | This class calculates the chi squared comparing "data" to
"montecarlo".
The calculation is based on a spectrum containing observed events
and one containing expected events. The paradigm assumed is that the
observed events form the "data" spectrum and the expected events
form the "montecarlo" spectrum. A couple of dif... | 62598ef31b99ca400228e92d |
class Plugin(object): <NEW_LINE> <INDENT> def __init__(self, args): <NEW_LINE> <INDENT> self.args = args <NEW_LINE> self.init() <NEW_LINE> <DEDENT> def init(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def list_hooks(self): <NEW_LINE> <INDENT> for attr in dir(self): <NEW_LINE> <INDENT> if attr.startswith("hook_"... | Base plugin class | 62598ef356ac1b37e6300a29 |
class KBranch(nodes.Branch): <NEW_LINE> <INDENT> def __init__(self, value: str, expr: KExpr): <NEW_LINE> <INDENT> super().__init__(value, expr) | branch statement | 62598ef3be7bc26dc9251281 |
class AuthorizationView(OAuthMixin, LoginRequiredMixin, FormView): <NEW_LINE> <INDENT> template_name = 'oauth/allow.html' <NEW_LINE> form_class = AllowForm <NEW_LINE> def get_initial(self): <NEW_LINE> <INDENT> initial_data = { 'redirect_uri': self.oauth2_data.get('redirect_uri', None), 'client_id': self.oauth2_data.get... | Authorization code /Implicit grant 模式下触发
触发该模块流程如下:
1.用户打开第三方应用
2.第三方应用引导用户跳往该view的页面(get 请求)
(1).如果用户登录了,则选择是否授权
(2).如果没有登录的话,则重定向到登录页面,登录成功之后再重定向回来,让用户选择是否授权
3.选择授权完成后再触发post请求(create_authorization_response) | 62598ef3a8370b77170eec21 |
class MusicHandler(BaseMusicHandler): <NEW_LINE> <INDENT> NAME = 'None' <NEW_LINE> DESCRIPTION = 'Don\'t listen to any player' <NEW_LINE> AUTHOR = 'Mariano Guerra' <NEW_LINE> WEBSITE = 'www.emesene.org' <NEW_LINE> def __init__(self, session): <NEW_LINE> <INDENT> BaseMusicHandler.__init__(self, session) <NEW_LINE> self.... | Base class for all music handlers
that can split artist from song from album, etc... | 62598ef357b8e32f52507522 |
class ApiTestCase(FlaskAppTestCase): <NEW_LINE> <INDENT> def parse_redirect(self, location, parse_fragment=False): <NEW_LINE> <INDENT> from werkzeug.urls import url_parse, url_decode, url_unparse <NEW_LINE> scheme, netloc, script_root, qs, anchor = url_parse(location) <NEW_LINE> return ( url_unparse((scheme, netloc, sc... | Authenticate users using ADS Classic (if necessary) | 62598ef301c39578d7f115e0 |
class CoinbaseApi(ApiConfig): <NEW_LINE> <INDENT> def get_client(self): <NEW_LINE> <INDENT> return CoinbaseClient( self.key, self.secret ) | Api config for Coinbase exchange | 62598ef3dd821e528d6d777b |
class TI64Value(object): <NEW_LINE> <INDENT> def __init__(self, value=None,): <NEW_LINE> <INDENT> self.value = value <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> <I... | Attributes:
- value | 62598ef37d43ff248742681a |
class DateUtils: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def get_current_time(): <NEW_LINE> <INDENT> return datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') | 日期、时间工具类 | 62598ef34f88993c371ef908 |
class IllegalStatusChangeException(ISvcException): <NEW_LINE> <INDENT> def __init__(self, import_id: str, requested_status: ImportStatus, current_terminal_status: ImportStatus): <NEW_LINE> <INDENT> eid = uuid.uuid4() <NEW_LINE> msg = f"Requested illegal status change on import {import_id} from status {current_terminal_... | An external service requested changing the state of an import, but the new state is not legal compared to the current state. | 62598ef37d847024c075ac0d |
class _BootstrappedCachedProperty(misc_tools.OwnNameDiscoveringDescriptor): <NEW_LINE> <INDENT> def __init__(self, getter_or_value, doc=None, name=None, force_value_not_getter=False): <NEW_LINE> <INDENT> misc_tools.OwnNameDiscoveringDescriptor.__init__(self, name=name) <NEW_LINE> if callable(getter_or_value) and not fo... | A property that is calculated only once for an object, and then cached.
This is redefined here in `bagging.py`, in addition to having it defined in
`python_toolbox.caching`, because we can't import the canonical
`CachedProperty` from there because of an import loop.
Usage:
class MyObject:
# ... Regu... | 62598ef3498bea3a75a56371 |
class MGUASelect(object): <NEW_LINE> <INDENT> def __init__(self,max_buf_size,max_corr_coef): <NEW_LINE> <INDENT> self.max_buf_size = max_buf_size <NEW_LINE> self.max_corr_coef = max_corr_coef <NEW_LINE> return <NEW_LINE> <DEDENT> def select(self,buf): <NEW_LINE> <INDENT> new_buf = [] <NEW_LINE> max_buf_size = self.max_... | Note
----
Class implements method select to use with methods like st_aml.alg.GreedySequenceSearch and st_aml.alg.GreedySequenceSearchDownward. | 62598ef3d486a94d0ba2a805 |
class RecipeViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Recipe.objects.all() <NEW_LINE> serializer_class = serializers.RecipeSerializer <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> authentication_classes = (TokenAuthentication, ) <NEW_LINE> def _convert_commaseparated_params_to_integ... | Manage Recipes in the Database | 62598ef3fff4ab517ebcc016 |
class LibrariesQWidget(QWidget, Logger.ClassLogger): <NEW_LINE> <INDENT> def __init__(self, parent, helper=None, testParams=None, testDescrs=None): <NEW_LINE> <INDENT> QWidget.__init__(self, parent) <NEW_LINE> self.helper = helper <NEW_LINE> self.testParams = testParams <NEW_LINE> self.testDescrs = testDescrs <NEW_LINE... | Libraries widget | 62598ef32ae34c7f260a991f |
class AssetAddSoftwareServerForm(forms.Form): <NEW_LINE> <INDENT> asset_type = fields.CharField( max_length=64, error_messages={'required': '不能为空', 'invalid': '格式错误', 'max_length': '最大长度不能大于64位'}, label='资产类型', help_text='必填项', widget=widgets.Select( choices=[('softwareserver', '软件服务器')], attrs={'class': 'form-control'... | 资产添加软件服务器视图表单验证类 | 62598ef35166f23b2e241c18 |
class RangerBlueprint(Blueprint): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__("ranger", 7, 60) <NEW_LINE> self.add_component(Health, 7) <NEW_LINE> self.add_component(Attack, 2, 3) <NEW_LINE> self.add_component(Movable, 3) | Used to create a copy of a ranger (Rebels combat unit) | 62598ef3f548e778e5969dcb |
class V3DLPFileSizeConfig(object): <NEW_LINE> <INDENT> openapi_types = { 'size_limit': 'int' } <NEW_LINE> attribute_map = { 'size_limit': 'sizeLimit' } <NEW_LINE> def __init__(self, size_limit=None, local_vars_configuration=None): <NEW_LINE> <INDENT> if local_vars_configuration is None: <NEW_LINE> <INDENT> local_vars_c... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598ef316aa5153ce3fed40 |
class EditProfileForm(FlaskForm): <NEW_LINE> <INDENT> bio = StringField('Bio', validators=[Length(max=220)]) <NEW_LINE> email = StringField('E-mail', validators=[DataRequired(), Email()]) <NEW_LINE> image_url = StringField('(Optional) Image URL') <NEW_LINE> header_image_url = StringField('(Optional) Header URL') <NEW_L... | Edit User Profile form | 62598ef3d7e4931a7ef3a8da |
class DispatchSkewDatabase(DataSetDatabase): <NEW_LINE> <INDENT> def __init__(self, database_name="queryfinish"): <NEW_LINE> <INDENT> super(DispatchSkewDatabase, self).__init__( database_name=database_name) <NEW_LINE> <DEDENT> def setUp(self): <NEW_LINE> <INDENT> if super(DispatchSkewDatabase, self).setUp(): <NEW_LINE>... | Database with skewed tables based on dataset. | 62598ef3283ffb24f3cf20e7 |
@devicedecorator <NEW_LINE> class find_available_ip(): <NEW_LINE> <INDENT> pass | returns the first IP that is available from a range of IPs | 62598ef34527f215b58e873e |
class SubCmd(Cmd): <NEW_LINE> <INDENT> CMD = '' <NEW_LINE> def __init__(self, bin, options=None, handler=None): <NEW_LINE> <INDENT> options_ = [self.CMD, ] <NEW_LINE> if options: <NEW_LINE> <INDENT> options_ = options_ + options <NEW_LINE> <DEDENT> Cmd.__init__(self, bin=bin, options=options_, handler=handler) | A base class for fcinfo subcommands defining CMD static attribute to hold
the sub-command string and overriding initializer method to add subcommand
to the options list.
All child classes should override CMD attribute with correct value. | 62598ef37c178a314d78bcd6 |
class MismatchingLeona(Exception): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Exception.__init__(self, " The given Leona instance has another configuration.") | The given Leona instance has another configuration | 62598ef356ac1b37e6300a2b |
class TestEventSubscriber(IonTestCase): <NEW_LINE> <INDENT> @defer.inlineCallbacks <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> yield self._start_container() <NEW_LINE> self._proc = Process() <NEW_LINE> yield self._proc.spawn() <NEW_LINE> <DEDENT> @defer.inlineCallbacks <NEW_LINE> def tearDown(self): <NEW_LINE> <IND... | Tests the EventSubscriber and derived classes. | 62598ef397e22403b383972f |
class OAuthVk(web.RequestHandler): <NEW_LINE> <INDENT> _ACCESS_TOKEN_URL = 'https://oauth.vk1.com/access_token' <NEW_LINE> _AUTHORIZE_URL = 'https://oauth.vk.com/authorize' <NEW_LINE> _APP_ID_ = '' <NEW_LINE> _REDIRECT_URL_ = '' <NEW_LINE> _CLIENT_SECRET_ = '' <NEW_LINE> def __init__(self, *args): <NEW_LINE> <INDENT> s... | Авторизация в ВК
on_success(HTTPResponse response) - если не возникло ошибок,
response - ответ сервера vk
on_error(error) - в случае возникновеня ошибок
error - строка с описанием, или exception | 62598ef37d43ff248742681b |
class Solution: <NEW_LINE> <INDENT> def uncommonFromSentences(self, A, B): <NEW_LINE> <INDENT> ret = [] <NEW_LINE> di_a, di_b = {}, {} <NEW_LINE> words_a = A.split(' ') <NEW_LINE> words_b = B.split(' ') <NEW_LINE> self.buildDict(words_a, di_a) <NEW_LINE> self.buildDict(words_b, di_b) <NEW_LINE> self.checkWords(di_a, di... | @param A: Sentence A
@param B: Sentence B
@return: Uncommon Words from Two Sentences | 62598ef310dbd63aa1c6f3b8 |
class EntityOverrideMode(object): <NEW_LINE> <INDENT> ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0 <NEW_LINE> ENTITY_OVERRIDE_MODE_OVERRIDE = 1 <NEW_LINE> ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2 | The types of modifications for a session entity type.
Attributes:
ENTITY_OVERRIDE_MODE_UNSPECIFIED (int): Not specified. This value should be never used.
ENTITY_OVERRIDE_MODE_OVERRIDE (int): The collection of session entities overrides the collection of entities
in the corresponding developer entity type.
ENTI... | 62598ef3d268445f26638faf |
class SqlConnection: <NEW_LINE> <INDENT> _connection = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def get_session(logger): <NEW_LINE> <INDENT> while SqlConnection._connection is None: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> root_pass = getpass("Please ... | Class to allow sql access. Should be used in the top scope and sessions are got using get_session. | 62598ef3f548e778e5969dcc |
class PersonSpecWorkloadView(LaunchpadView): <NEW_LINE> <INDENT> label = 'Blueprint workload' <NEW_LINE> @cachedproperty <NEW_LINE> def members(self): <NEW_LINE> <INDENT> members = self.context.allmembers <NEW_LINE> batch_nav = BatchNavigator(members, self.request, size=20) <NEW_LINE> return batch_nav <NEW_LINE> <DEDEN... | View to render the specification workload for a person or team.
It shows the set of specifications with which this person has a role. If
the person is a team, then all members of the team are presented using
batching with their individual specifications. | 62598ef3adb09d7d5dc08e09 |
class RequestReferenceHdr(Packet): <NEW_LINE> <INDENT> name = "Request Reference" <NEW_LINE> fields_desc = [ BitField("eightBitRR", None, 1), XBitField("ieiRR", None, 7), ByteField("ra", 0x0), BitField("t1", 0x0, 5), BitField("t3Hi", 0x0, 3), BitField("t3Lo", 0x0, 3), BitField("t2", 0x0, 5) ] | Request Reference Section 10.5.2.30 | 62598ef3e1aae11d1e7cdc61 |
class ActuatorWrapper(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._wrapped_actuators = {} <NEW_LINE> <DEDENT> def unpause(self): <NEW_LINE> <INDENT> for act in self._wrapped_actuators.values(): <NEW_LINE> <INDENT> act.unpause() <NEW_LINE> <DEDENT> <DEDENT> def pause(self): <NEW_LINE> <INDE... | A wrapper that bundles the function of one or more actuators
This class is abstract and should not be instantiated in general | 62598ef371ff763f4b5e5fa0 |
class Students(BaseModel): <NEW_LINE> <INDENT> __tablename__ = 'students' <NEW_LINE> name = models.Column(models.String(32)) <NEW_LINE> age = models.Column(models.Integer) <NEW_LINE> gender = models.Column(models.Integer) | 学员表 | 62598ef33d592f4c4edb972e |
class MessageFirendsAddByIDUserPraise(BaseElement): <NEW_LINE> <INDENT> @property <NEW_LINE> def selector(self): <NEW_LINE> <INDENT> return (By.ID,"com.videochat.livu:id/text_link") | The user has number of raise | 62598ef33539df3088ecaaee |
class TM: <NEW_LINE> <INDENT> def __init__(self, states, initial_state, initial_memory_symbol, final_states, transition_functions): <NEW_LINE> <INDENT> self.string = '' <NEW_LINE> self.states = states <NEW_LINE> self.initial_state = initial_state <NEW_LINE> self.initial_memory_symbol = initial_memory_symbol <NEW_LINE> ... | Class to represent TM | 62598ef3442bda511e95aca4 |
class ProgramReader: <NEW_LINE> <INDENT> areas = collections.OrderedDict() <NEW_LINE> def __init__(self, filename, src_reader=ProgramType.IHEX, page_size=None): <NEW_LINE> <INDENT> if src_reader == ProgramType.IHEX: <NEW_LINE> <INDENT> addr_mask = 0xFFFFFFFF <NEW_LINE> if page_size != None: <NEW_LINE> <INDENT> addr_mas... | Wrapper around ihex and binfile readers
Seperates areas seperated by holes surrounding a whole page to be programmed seperately and zero
fills holes that are within a page. Assumes pages are always aligned
Attributes:
areas Dictionary of seperate contiguous pages to program, keyed and sorted by address | 62598ef32c8b7c6e89bd2005 |
class SimpleContentLoss(object): <NEW_LINE> <INDENT> CONTENT_FEATURE = '4_2' <NEW_LINE> def __init__(self, content_features: typing.Dict[str, torch.FloatTensor], gpu: bool): <NEW_LINE> <INDENT> content_feature = content_features[self.CONTENT_FEATURE] <NEW_LINE> self.__f_x_c = Variable(content_feature.data, requires_gra... | Simple L2 distance of the feature maps at each convolution layers.
:param content_features: (dict) The feature maps of content image.
:param gpu: (bool) Whether or not to use GPU. | 62598ef367a9b606de544810 |
class TodoSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Todo <NEW_LINE> fields = ('id', 'name', 'completed', 'date_created', 'date_modified') <NEW_LINE> read_only_fields = ('date_created', 'date_modified') | Serializer to map the Model instance into JSON format. | 62598ef37d847024c075ac11 |
class DescriptionsDelegate(QItemDelegate, Logger.ClassLogger): <NEW_LINE> <INDENT> def __init__(self, parent, col_): <NEW_LINE> <INDENT> QItemDelegate.__init__(self, parent) <NEW_LINE> self.col_ = col_ <NEW_LINE> <DEDENT> def getValue(self, index): <NEW_LINE> <INDENT> if index.isValid(): <NEW_LINE> <INDENT> return inde... | Delegate items descriptions | 62598ef3a8370b77170eec26 |
class StatusCode: <NEW_LINE> <INDENT> SUCCESS = 200 <NEW_LINE> NOT_FOUND = 404 <NEW_LINE> ERROR = 400 | Helper class to hold status codes | 62598ef3283ffb24f3cf20ea |
class GenMulti: <NEW_LINE> <INDENT> def __init__(self, argv): <NEW_LINE> <INDENT> parser = argparse.ArgumentParser( prog='PROG', formatter_class=argparse.ArgumentDefaultsHelpFormatter) <NEW_LINE> parser.add_argument('--game', type=str, default='freecell', help='The Solitaire variant') <NEW_LINE> parser.add_argument('--... | docstring for GenMulti | 62598ef3aad79263cf42d04f |
class Solver: <NEW_LINE> <INDENT> def solve(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def man_version(self) -> str: <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def __str__(self) -> str: <NEW_LINE> <INDENT> raise NotImplementedError | Abstract class for loading and running module solvers
| 62598ef3009cb60464cffd92 |
class TensorflowGraph(object): <NEW_LINE> <INDENT> def __init__(self, graph, session, name_scopes, output, labels, weights, loss): <NEW_LINE> <INDENT> self.graph = graph <NEW_LINE> self.session = session <NEW_LINE> self.name_scopes = name_scopes <NEW_LINE> self.output = output <NEW_LINE> self.labels = labels <NEW_LINE>... | Simple class that holds information needed to run Tensorflow graph. | 62598ef363b5f9789fe839a0 |
class EFailedToManipulate(EUnknown): <NEW_LINE> <INDENT> def __init__(self, manipulator_name, action_name, reason_message): <NEW_LINE> <INDENT> super().__init__("fstools error: " + str(manipulator_name) + "failed to perform " + str(action_name) + " - " + str(reason_message) + ".") | An exception, which is raised when the manipulator is failed to perform
a manipulation. | 62598ef33317a56b869bd987 |
@pytest.mark.windows_whitelisted <NEW_LINE> class TestGrainsCore(ModuleCase): <NEW_LINE> <INDENT> @slowTest <NEW_LINE> def test_grains_passed_to_custom_grain(self): <NEW_LINE> <INDENT> self.assertEqual( self.run_function("grains.get", ["custom_grain_test"]), "itworked" ) | Test the core grains grains | 62598ef3f548e778e5969dce |
class CreateStoragepoolTierResponse(object): <NEW_LINE> <INDENT> swagger_types = { 'id': 'int' } <NEW_LINE> attribute_map = { 'id': 'id' } <NEW_LINE> def __init__(self, id=None): <NEW_LINE> <INDENT> self._id = None <NEW_LINE> self.discriminator = None <NEW_LINE> self.id = id <NEW_LINE> <DEDENT> @property <NEW_LINE> def... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598ef3adb09d7d5dc08e0b |
class WaveletConvolve(LinearParent): <NEW_LINE> <INDENT> def __init__(self, filters, method='scipy'): <NEW_LINE> <INDENT> self._filters = check_float(filters) <NEW_LINE> self.op = lambda x: filter_convolve_stack(x, self._filters, method=method) <NEW_LINE> self.adj_op = lambda x: filter_convolve_stack(x, self._filters, ... | Wavelet Convolution Class
This class defines the wavelet transform operators via convolution with
predefined filters
Parameters
----------
filters: np.ndarray
Array of wavelet filter coefficients | 62598ef3bd1bec0571e144ec |
class build_ext(_build_ext): <NEW_LINE> <INDENT> def check_build_prereq(self): <NEW_LINE> <INDENT> self.make_command = "" <NEW_LINE> if not os.path.exists(os.path.join(driver_src_path, 'CMakeLists.txt')): <NEW_LINE> <INDENT> grumble("error: can't build Sedna C API library -- Sedna source directory doesn't look correct.... | Extends build_ext command by building sedna driver if needed | 62598ef366673b3332c2ebed |
class TxPktPerQueue(base_tests.SimpleDataPlane): <NEW_LINE> <INDENT> def runTest(self): <NEW_LINE> <INDENT> logging.info("Running TxPktPerQueue test") <NEW_LINE> of_ports = config["port_map"].keys() <NEW_LINE> of_ports.sort() <NEW_LINE> self.assertTrue(len(of_ports) > 1, "Not enough ports for test") <NEW_LINE> (queue_s... | Verify that tx_packets in the queue_stats reply increments in accordance with the number of transmitted packets | 62598ef37b180e01f3e48467 |
class TestCce(base.TestCase): <NEW_LINE> <INDENT> def test_vault_list(self): <NEW_LINE> <INDENT> self.openstack( 'cbr vault list -f json ' ) | Functional tests for CBR Vault. | 62598ef3d58c6744b42db6d7 |
class SecurityRulePaged(Paged): <NEW_LINE> <INDENT> _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, 'current_page': {'key': 'value', 'type': '[SecurityRule]'} } <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(SecurityRulePaged, self).__init__(*args, **kwargs) | A paging container for iterating over a list of :class:`SecurityRule <azure.mgmt.network.v2018_08_01.models.SecurityRule>` object | 62598ef332920d7e50bc486f |
class GraphWorker: <NEW_LINE> <INDENT> def __init__(self, authCredential=AUTH_CREDENTIAL, authPassword=AUTH_PASSWORD): <NEW_LINE> <INDENT> self.DB_URI = "bolt://localhost:7687" <NEW_LINE> self.AUTH_CREDENTIAL = authCredential <NEW_LINE> self.AUTH_PASSWORD = authPassword <NEW_LINE> self.driver = GraphDatabase.driver(sel... | Interface to work with the graph database.
See https://neo4j.com/docs/api/python-driver/current/_modules/neo4j/v1/types/graph.html#Path | 62598ef34527f215b58e8742 |
class Config(object): <NEW_LINE> <INDENT> pass | Common Configuration | 62598ef3be7bc26dc9251284 |
class FindOnMultipleKeysError(AttributeError): <NEW_LINE> <INDENT> pass | Used internally | 62598ef33d592f4c4edb9730 |
class OpenWeatherMapWeather(WeatherEntity): <NEW_LINE> <INDENT> def __init__(self, name, owm, temperature_unit): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._owm = owm <NEW_LINE> self._temperature_unit = temperature_unit <NEW_LINE> self.data = None <NEW_LINE> self.forecast_data = None <NEW_LINE> <DEDENT> @pro... | Implementation of an OpenWeatherMap sensor. | 62598ef392d797404e387f9d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.