code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class BootstrapYoutubePlugin(BootstrapPluginBase): <NEW_LINE> <INDENT> name = _("You Tube") <NEW_LINE> require_parent = False <NEW_LINE> parent_classes = ['BootstrapColumnPlugin'] <NEW_LINE> child_classes = None <NEW_LINE> render_template = 'cascade/bootstrap4/youtube.html' <NEW_LINE> form = YoutubeFormMixin <NEW_LINE>...
Use this plugin to display a YouTube video.
62598eea2c8b7c6e89bd1ed6
class DescribeInvocationMetricDataDimensionResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Result = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("Result") is not None: <NEW_LINE> <INDENT> self.Result...
DescribeInvocationMetricDataDimension返回参数结构体
62598eeaeab8aa0e5d30a490
class UserSetting(object): <NEW_LINE> <INDENT> openapi_types = { 'key': 'str', 'value': 'str', 'description': 'str' } <NEW_LINE> attribute_map = { 'key': 'key', 'value': 'value', 'description': 'description' } <NEW_LINE> def __init__(self, key=None, value=None, description=None, local_vars_configuration=None): <NEW_LIN...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62598eeacc0a2c1114479719
@attr.s(auto_attribs=True) <NEW_LINE> class CrawlRequested(Event): <NEW_LINE> <INDENT> crawl_request: CrawlRequest
A specific request for a url to be crawled that is not connected to a user action.
62598eea38b623060ffa77b0
class ThrowAtGuardEncoder(json.JSONEncoder): <NEW_LINE> <INDENT> def default(self, obj): <NEW_LINE> <INDENT> return { 'type': 'throw_at_guard', 'direction': obj.direction }
Encodes a ThrowAtGuard action.
62598eea7047854f4633dae9
class ViewAPIFacebookLogin(ConvertTokenView): <NEW_LINE> <INDENT> def post(self, request, *args, **kwargs): <NEW_LINE> <INDENT> response = super(ViewAPIFacebookLogin, self).post(request, *args, **kwargs) <NEW_LINE> data = response.data <NEW_LINE> if response.status_code == 400: <NEW_LINE> <INDENT> return Response({"er...
This class is used for login the user through facebook.
62598eea92d797404e387f05
class PrimePoint(): <NEW_LINE> <INDENT> def __init__(self, curve, x, y, order=None): <NEW_LINE> <INDENT> self.curve = curve <NEW_LINE> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.order = order <NEW_LINE> if self.curve: <NEW_LINE> <INDENT> if not self.curve.contains(self): <NEW_LINE> <INDENT> raise ValueError('Inva...
A point on a prime-field elliptic curve
62598eea60cbc95b06362a52
@base.ReleaseTracks(base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA) <NEW_LINE> class Users(base.Group): <NEW_LINE> <INDENT> pass
Read and manipulate Google Compute Engine users.
62598eea5166f23b2e241aed
class skipDays(xsc.Element): <NEW_LINE> <INDENT> xmlns = xmlns
A list of :class:`day`\s of the week, in English, indicating the days of the week when your channel will not be updated. As with :class:`activeHours`, if you know your channel will never be updated on Saturday or Sunday, for example.
62598eea16aa5153ce3fec14
class ThreadReportGenerator(object): <NEW_LINE> <INDENT> def __call__(self): <NEW_LINE> <INDENT> threadModels = [ tm.ThreadModel(thread_id, stack) for thread_id, stack in sys._current_frames().items() ] <NEW_LINE> thread_pairs = dict(zip(range(len(threadModels)), threadModels)) <NEW_LINE> return mwdv.ModelWithDefaultVi...
A Thread Data Generator This generator returns a collection of :class:`essential.report.models.threading.ThreadModel` objects by introspecting the current python state using :func:`sys._current_frames()` .
62598eea4e4d562566370b2f
class IOThread(object): <NEW_LINE> <INDENT> def __init__(self, input, output): <NEW_LINE> <INDENT> self.input = input <NEW_LINE> self.output = output <NEW_LINE> self._running = False <NEW_LINE> self.got_exception = False <NEW_LINE> <DEDENT> def start(self): <NEW_LINE> <INDENT> self.done = event.Event() <NEW_LINE> def _...
Class that reads chunks from the input file and writes them to the output file till the transfer is completely done.
62598eea435de62698e9a4eb
class Node(): <NEW_LINE> <INDENT> def __init__(self, data=None, lchild=None, rchild=None): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.lchild = lchild <NEW_LINE> self.rchild = rchild
节点类
62598eeaf548e778e5969ca1
class TierStatus(object): <NEW_LINE> <INDENT> def __init__(self, resources): <NEW_LINE> <INDENT> self.tiers = OrderedDict() <NEW_LINE> self.tier_status = OrderedDict() <NEW_LINE> self.resources = resources <NEW_LINE> <DEDENT> def set_tiers(self, tiers): <NEW_LINE> <INDENT> for tier in tiers: <NEW_LINE> <INDENT> self.ti...
Represents the state and progress of tier traversal. The build system is organized into linear phases called tiers. Each tier executes in the order it was defined, 1 at a time.
62598eea63b5f9789fe83873
class Query(Choreography): <NEW_LINE> <INDENT> def __init__(self, temboo_session): <NEW_LINE> <INDENT> Choreography.__init__(self, temboo_session, '/Library/Parse/Users/Query') <NEW_LINE> <DEDENT> def new_input_set(self): <NEW_LINE> <INDENT> return QueryInputSet() <NEW_LINE> <DEDENT> def _make_result_set(self, result, ...
Create a new instance of the Query Choreography. A TembooSession object, containing a valid set of Temboo credentials, must be supplied.
62598eeafff4ab517ebcbeed
class BoughtItem(models.Model): <NEW_LINE> <INDENT> RESERVED = 'reserved' <NEW_LINE> UNPAID = 'unpaid' <NEW_LINE> BOUGHT = 'bought' <NEW_LINE> REFUNDED = 'refunded' <NEW_LINE> STATUS_CHOICES = ( (RESERVED, _('Reserved')), (UNPAID, _('Unpaid')), (BOUGHT, _('Bought')), (REFUNDED, _('Refunded')), ) <NEW_LINE> item_option ...
Represents an item bought (or reserved) by a person.
62598eeadd821e528d6d765a
class PermissionsRequiredSignoffsHistoryAPIView(RequiredSignoffsHistoryAPIView): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(PermissionsRequiredSignoffsHistoryAPIView, self).__init__(dbo.permissionsRequiredSignoffs, ["product", "role"]) <NEW_LINE> <DEDENT> def get(self): <NEW_LINE> <INDENT> input_...
/required_signoffs/permissions/revisions
62598eea5fdd1c0f98e5c6b7
class GetNodeBySegment(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> param = pyx12.params.params() <NEW_LINE> self.map = pyx12.map_if.load_map_file('834.5010.X220.A1.xml', param) <NEW_LINE> self.errh = pyx12.error_handler.errh_null() <NEW_LINE> <DEDENT> def test_get_seg_node(self): <NEW_L...
Find matching child nodes matching a segment
62598eea3539df3088eca9c8
class PrivateEndpointConnection(Resource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, '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'}, 'private_en...
PrivateEndpointConnection. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified identifier of the resource. :vartype id: str :ivar name: Name of the resource. :vartype name: str :ivar type: Type of the resource. :vartype type: str :ivar private_endpoint: Th...
62598eeaaad79263cf42cf21
class DeviceInfoContextTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.factory = RequestFactory() <NEW_LINE> self.request = self.factory.get('/') <NEW_LINE> <DEDENT> def test_return_device_info(self): <NEW_LINE> <INDENT> info = {'width': 320, 'height': 480} <NEW_LINE> self.req...
Pull device info off the request.
62598eea6aa9bd52df0d35c8
class Output(object): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> def __init__(self, cfg): <NEW_LINE> <INDENT> self.cfg = cfg <NEW_LINE> self.sessions = {} <NEW_LINE> self.ips = {} <NEW_LINE> self.sshRegex = re.compile( '.*SSHTransport,([0-9]+),[0-9a-f:.]+$') <NEW_LINE> self.telnetRegex = re.compile( '.*...
This is the abstract base class intended to be inherited by cowrie output plugins Plugins require the mandatory methods: stop, start and write
62598eeabe8e80087fbbd765
class FeatureExtractor(object): <NEW_LINE> <INDENT> def __init__(self, sent, ppindex, *ARGS): <NEW_LINE> <INDENT> self.sent = sent <NEW_LINE> self.PREPS = ["in", "for", "at", "on", "of", "about", "with", "from", "by", "as", "into"] <NEW_LINE> self.PPTAG = ["IN"] <NEW_LINE> self.ppindex = ppindex <NEW_LINE> self.ARGS = ...
素性抽出関数 nltk.pos_tagをngram pos featureで使用 TODO implement more sophisticated features
62598eea4c342835776189fa
class Model(BaseModel): <NEW_LINE> <INDENT> def new(self): <NEW_LINE> <INDENT> from qiskit.aqua.parser._inputparser import InputParser <NEW_LINE> uipreferences = UIPreferences() <NEW_LINE> return super().new_model(InputParser, os.path.join(os.path.dirname(__file__), 'input_template.json'), uipreferences.get_populate_de...
Aqua Model
62598eea4428ac0f6e656c6a
class Account(rlp.Serializable): <NEW_LINE> <INDENT> fields = [ ('nonce', big_endian_int), ('balance', big_endian_int), ('storage', trie_root), ('code_hash', hash32) ] <NEW_LINE> def __init__(self, nonce, balance, storage, code_hash, db): <NEW_LINE> <INDENT> self.db = db <NEW_LINE> super(Account, self).__init__(nonce, ...
An Ethereum account. :ivar nonce: the account's nonce (the number of transactions sent by the account) :ivar balance: the account's balance in wei :ivar storage: the root of the account's storage trie :ivar code_hash: the SHA3 hash of the code associated with the account :ivar db: the database in which th...
62598eea3cc13d1c6d463e87
class DelayedEvent: <NEW_LINE> <INDENT> def __init__(self, delay: Union[int, float], callback: Callable, *args) -> None: <NEW_LINE> <INDENT> self.callback: Callable = callback <NEW_LINE> self.args: Tuple[Any, ...] = args <NEW_LINE> self.delay: Union[int, float] = delay <NEW_LINE> self.handler: Optional[Handle] = None
A TimedEvent, but with the date calculated from now + a delay in seconds. Use it if you want an event to happen in, e.g. 6 seconds.
62598eea7047854f4633daeb
class GetExerciseLogResultSet(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 Khan Academy.)
62598eea7d847024c075aae5
class AddSubcloud(base.DCManagerShowOne): <NEW_LINE> <INDENT> def _get_format_function(self): <NEW_LINE> <INDENT> return detail_format <NEW_LINE> <DEDENT> def get_parser(self, parsed_args): <NEW_LINE> <INDENT> parser = super(AddSubcloud, self).get_parser(parsed_args) <NEW_LINE> parser.add_argument( '--name', required=T...
Add a new subcloud.
62598eea92d797404e387f06
class Client(TendersClient): <NEW_LINE> <INDENT> pass
client for tenders for backward compatibility
62598eeae64d504609df874a
class RelationAttention(nn.Module): <NEW_LINE> <INDENT> def __init__(self, r_dim, q_dim, h_dim, gamma=0.3, dropout=0.5, wn=True): <NEW_LINE> <INDENT> super(RelationAttention, self).__init__() <NEW_LINE> self.r_proj = FCNet([r_dim, h_dim], wn=wn) <NEW_LINE> self.q_proj = FCNet([q_dim, h_dim], wn=wn) <NEW_LINE> self.P_ma...
Bilinear relation attention guided by question
62598eea99cbb53fe682f5c9
class NoRequiredFieldsApp(models.Model): <NEW_LINE> <INDENT> pass
Used to test model validation.
62598eead7e4931a7ef3a7b6
class MetasyntacticVariables(Names): <NEW_LINE> <INDENT> Foo = NamedConstant()
Metasyntactic variable names.
62598eea796e427e5384ceaf
class AintGotNoFit: <NEW_LINE> <INDENT> def predict(self): <NEW_LINE> <INDENT> print("I don't have no fit !")
Fake class that doesn't have a fit method.
62598eea8da39b475be018c3
class Downloader: <NEW_LINE> <INDENT> def __init__(self, settings): <NEW_LINE> <INDENT> self.settings = settings <NEW_LINE> <DEDENT> def download(self, video_id, path): <NEW_LINE> <INDENT> logger.info('%s starts downloading %s to %s', self.__class__.__name__, video_id, path) <NEW_LINE> self._download(video_id, path) <N...
abstract class for downloading video/audio.
62598eea63b5f9789fe83874
class UkTransportSensor(SensorEntity): <NEW_LINE> <INDENT> TRANSPORT_API_URL_BASE = "https://transportapi.com/v3/uk/" <NEW_LINE> _attr_icon = "mdi:train" <NEW_LINE> _attr_unit_of_measurement = TIME_MINUTES <NEW_LINE> def __init__(self, name, api_app_id, api_app_key, url): <NEW_LINE> <INDENT> self._data = {} <NEW_LINE> ...
Sensor that reads the UK transport web API. transportapi.com provides comprehensive transport data for UK train, tube and bus travel across the UK via simple JSON API. Subclasses of this base class can be used to access specific types of information.
62598eea97e22403b3839607
class CreateEntity(ModelCommand): <NEW_LINE> <INDENT> ARGS_NO = 2 <NEW_LINE> FULLID = 0 <NEW_LINE> CLASSNAME = 1 <NEW_LINE> def checkArgs( self ): <NEW_LINE> <INDENT> if not ModelCommand.checkArgs(self): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> self.__theID = self.theArgs[ self.FULLID ] <NEW_LINE> self.__th...
arg1: ID arg2: ClassName eg. CompartmentSystem
62598eead7e4931a7ef3a7b7
class ActivityOpenMixin(object): <NEW_LINE> <INDENT> def get_activity(self): <NEW_LINE> <INDENT> activity_id = self.kwargs['activity'] if 'activity' in self.kwargs else self.kwargs['pk'] <NEW_LINE> activity = get_object_or_404(ProjectActivity, id=activity_id) <NEW_LINE> return activity <NEW_LINE> <DEDENT> de...
Checks if the activity is open by its starting & ending date, and the current server date. If the activity is not open, it will redirect to the activity page. Expects 1. <activity> or 2. <pk> => activity
62598eea7cff6e4e811b4106
class IRedirectionPolicy(Interface): <NEW_LINE> <INDENT> ignore_ids = Attribute("A list of ids to ignore when examining a URL " "for a potential redirection")
An adapters that provides some policy about how redirects are performed
62598eeaf9cc0f698b1c465a
class CustomImagePropertiesCustom(Model): <NEW_LINE> <INDENT> _validation = { 'os_type': {'required': True}, } <NEW_LINE> _attribute_map = { 'image_name': {'key': 'imageName', 'type': 'str'}, 'sys_prep': {'key': 'sysPrep', 'type': 'bool'}, 'os_type': {'key': 'osType', 'type': 'str'}, } <NEW_LINE> def __init__(self, os_...
Properties for creating a custom image from a VHD. :param image_name: The image name. :type image_name: str :param sys_prep: Indicates whether sysprep has been run on the VHD. :type sys_prep: bool :param os_type: The OS type of the custom image (i.e. Windows, Linux). Possible values include: 'Windows', 'Linux', 'None...
62598eea7d847024c075aae6
class AvailableProvidersList(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'countries': {'required': True}, } <NEW_LINE> _attribute_map = { 'countries': {'key': 'countries', 'type': '[AvailableProvidersListCountry]'}, } <NEW_LINE> def __init__( self, *, countries: List["AvailableProvidersListCountry"...
List of available countries with details. All required parameters must be populated in order to send to Azure. :param countries: Required. List of available countries. :type countries: list[~azure.mgmt.network.v2018_12_01.models.AvailableProvidersListCountry]
62598eea56ac1b37e6300905
class Resource(Model): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, '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'}, } <NEW_LINE> def __init__(self,...
Resource. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar ...
62598eea56ac1b37e6300906
class MegaIncorrectPasswordExcetion(MegaException): <NEW_LINE> <INDENT> pass
A incorrect password or email was given.
62598eea57b8e32f52507491
class UserSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = get_user_model() <NEW_LINE> fields = ('email', 'password', 'name') <NEW_LINE> extra_kwargs = {'password': {'write_only': True, 'min_length': 5}} <NEW_LINE> <DEDENT> def create(self, validated_data): <NEW_LINE>...
Serializers for the user model object
62598eea8a43f66fc4bf088c
class TestSoufflePlaylist: <NEW_LINE> <INDENT> def test_two_tracks_simple(self, art_tatum_tracks, the_xx_tracks): <NEW_LINE> <INDENT> playlist_uri = 'playlist uri' <NEW_LINE> user_id = 'zhammer' <NEW_LINE> playlist_name = '~coding~' <NEW_LINE> art_tatum_track = art_tatum_tracks[0] <NEW_LINE> the_xx_track = the_xx_track...
Tests for souffle_playlist function.
62598eea1b99ca400228e89a
class MockRtClient(object): <NEW_LINE> <INDENT> def __init__(self, raw, verbose=None): <NEW_LINE> <INDENT> self.raw = raw <NEW_LINE> self.info = copy.deepcopy(self.raw.info) <NEW_LINE> self.verbose = verbose <NEW_LINE> self._current = dict() <NEW_LINE> self._last = dict() <NEW_LINE> <DEDENT> def get_measurement_info(se...
Mock Realtime Client Attributes ---------- raw : instance of Raw object The raw object which simulates the RtClient info : dict Measurement info. verbose : bool, str, int, or None If not None, override default verbose level (see mne.verbose).
62598eea32920d7e50bc4745
class OrgView(View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> all_orgs = CourseOrg.objects.all() <NEW_LINE> hot_orgs = all_orgs.order_by('-click_nums')[:3] <NEW_LINE> all_citys = CityDict.objects.all() <NEW_LINE> city_id = request.GET.get('city', '') <NEW_LINE> if city_id: <NEW_LINE> <INDENT> all...
课程机构列表
62598eea01c39578d7f114c3
class InputStickerSetDice(TLObject): <NEW_LINE> <INDENT> __slots__ = ["emoticon"] <NEW_LINE> ID = 0xe67f520e <NEW_LINE> QUALNAME = "types.InputStickerSetDice" <NEW_LINE> def __init__(self, *, emoticon: str): <NEW_LINE> <INDENT> self.emoticon = emoticon <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def read(b: BytesIO, *...
Attributes: LAYER: ``112`` Attributes: ID: ``0xe67f520e`` Parameters: emoticon: ``str``
62598eeacad5886f8bdc3a1b
class FlaskWithJobResolvers(Flask): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(FlaskWithJobResolvers, self).__init__(*args, **kwargs) <NEW_LINE> self._job_resolvers = [] <NEW_LINE> <DEDENT> def job_resolvers(self): <NEW_LINE> <INDENT> return self._job_resolvers <NEW_LINE> <DEDENT...
A Flask app that manages the resolution of task names in to job names. A task name is that received by the Jobs API from the client. The workers need to know where this job actually is though, i.e. what method it corresponds to and what module that method lives in. The task of a *job resolver* is to take a task name,...
62598eea7d847024c075aae7
class Scheduler(Thread): <NEW_LINE> <INDENT> def _default_fun(*args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> _default_task = Task(0, _default_fun) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> Thread.__init__(self) <NEW_LINE> self.id_generator = itertools.count() <NEW_LINE> self.entry_finder = {} <...
A this class is used to execute a Task after a certain time (delay)
62598eea4f6381625f198848
class BrightcoveApiClientError(ApiClientError): <NEW_LINE> <INDENT> default_msg = _('Brightcove API error.')
Brightcove specific api client errors.
62598eea99cbb53fe682f5cb
class CellLocation(Module): <NEW_LINE> <INDENT> class Location(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.row = -1 <NEW_LINE> self.col = -1 <NEW_LINE> self.rowSpan = -1 <NEW_LINE> self.colSpan = -1 <NEW_LINE> self.sheetReference = None <NEW_LINE> <DEDENT> <DEDENT> def compute(self): <NEW_...
CellLocation is a Vistrail Module that allow users to specify where to put a visualization on a sheet, i.e. row, column location
62598eea435de62698e9a4ee
class AssociateIpToInstanceForm(BaseSecureForm): <NEW_LINE> <INDENT> associate_ip_error_msg = _(u'IP is required') <NEW_LINE> ip_address = wtforms.SelectField( label=_(u'IP address:'), validators=[validators.InputRequired(message=associate_ip_error_msg)], ) <NEW_LINE> def __init__(self, request, conn=None, **kwargs): <...
CSRF-protected form to associate IP to an instance
62598eea4a966d76dd5ed5fe
class QLearningAgent(ReinforcementAgent): <NEW_LINE> <INDENT> def __init__(self, **args): <NEW_LINE> <INDENT> ReinforcementAgent.__init__(self, **args) <NEW_LINE> self.Q=util.Counter() <NEW_LINE> self.used=util.Counter() <NEW_LINE> <DEDENT> def getQValue(self, state, action): <NEW_LINE> <INDENT> return self.Q[(state,ac...
Q-Learning Agent Functions you should fill in: - computeValueFromQValues - computeActionFromQValues - getQValue - getAction - update Instance variables you have access to - self.epsilon (exploration prob) - self.alpha (learning rate) - self.discount (discount rate) Functions you should use - self.g...
62598eea435de62698e9a4ef
class SciFile: <NEW_LINE> <INDENT> instance = None <NEW_LINE> def clean(self): <NEW_LINE> <INDENT> if self.instance is not None: <NEW_LINE> <INDENT> kill_scifile(self) <NEW_LINE> self.instance = None
Variables used in sci-func block
62598eea796e427e5384ceb1
class Parcel: <NEW_LINE> <INDENT> parcel_id: int <NEW_LINE> volume: int <NEW_LINE> depot: str <NEW_LINE> destination: str <NEW_LINE> def __init__(self, parcel_id: int, volume: int, depot: str, dest: str) -> None: <NEW_LINE> <INDENT> self.parcel_id = parcel_id <NEW_LINE> self.volume = volume <NEW_LINE> self.d...
A parcel should be delivered to destination from the depot city === Public Attributes === parcel_id: a unique id of parcel volume: the space this parcel will use depot: the start city of this parcel destination: the destination === Private Attributes ===
62598eeae5267d203ee6a020
class TaskManager(object): <NEW_LINE> <INDENT> def __init__(self, threads=10, max_queue=200, daemon=True): <NEW_LINE> <INDENT> self.num_threads = threads <NEW_LINE> self.max_queue = max_queue <NEW_LINE> self.daemon = daemon <NEW_LINE> self.queue = None <NEW_LINE> <DEDENT> def _spawn(self): <NEW_LINE> <INDENT> self.queu...
The `TaskManager` is a singleton that manages the threads used to parallelize processing and the queue that manages the current set of prepared tasks.
62598eea7cff6e4e811b4108
class GposTable(LayoutTable): <NEW_LINE> <INDENT> tag = 'GPOS' <NEW_LINE> lookup_types = {1: SingleAdjustmentSubtable, 2: PairAdjustmentSubtable, 3: CursiveAttachmentSubtable, 4: MarkToBaseAttachmentSubtable, 6: MarkToMarkAttachmentSubtable, 9: ExtensionPositioning}
Glyph positioning table
62598eea090684286d592a6e
class SVMPrediction(PredictBaseCommand): <NEW_LINE> <INDENT> def get_parser(self, prog_name): <NEW_LINE> <INDENT> print("cli.predict.py SVMPrediction.get_parser") <NEW_LINE> parser = super().get_parser(prog_name) <NEW_LINE> parser.add_argument("--complexity", type=float, required=True, help="The SVM complexity") <NEW_...
Generate predictions on some data using LibLINEAR
62598eea2eb69b55b15a0717
class AbstractThrottle(object): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> def __init__(self, intopic, outtopic): <NEW_LINE> <INDENT> self._intopic = intopic <NEW_LINE> self._outtopic = outtopic <NEW_LINE> self._process = None <NEW_LINE> atexit.register(self._cleanup) <NEW_LINE> <DEDENT> def stop(self): <NE...
Represents an abstract throttler. Should not be used externally. Attributes: intopic (str): topic to be throttled outtopic (str): topic to publish throttled output to process (Popen): topic_tools throttling process if running, otherwise None
62598eea76e4537e8c3edcd3
class BaseField(object): <NEW_LINE> <INDENT> name: str = None <NEW_LINE> total_creation_counter = 0 <NEW_LINE> def __init__( self, db_field: str = None, default: Union[Any, Callable] = None, required: bool = False, null: bool = False, on_save: Callable = None, unique: bool = False, unique_with: str = None, sparse: bool...
This class is the base to all fields. This is not supposed to be used directly in documents.
62598eea71ff763f4b5e5e77
class MAVLink_huch_cam_cmd_message(MAVLink_message): <NEW_LINE> <INDENT> def __init__(self, cam_index, exposure, contrast, gain): <NEW_LINE> <INDENT> MAVLink_message.__init__(self, MAVLINK_MSG_ID_HUCH_CAM_CMD, 'HUCH_CAM_CMD') <NEW_LINE> self._fieldnames = ['cam_index', 'exposure', 'contrast', 'gain'] <NEW_LINE> self.ca...
Camera state
62598eea442bda511e95ab7c
class ProtectionPolicyQueryObject(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'backup_management_type': {'key': 'backupManagementType', 'type': 'str'}, 'fabric_name': {'key': 'fabricName', 'type': 'str'}, 'workload_type': {'key': 'workloadType', 'type': 'str'}, } <NEW_LINE> def __init__( self, *...
Filters the list backup policies API. :ivar backup_management_type: Backup management type for the backup policy. Possible values include: "Invalid", "AzureIaasVM", "MAB", "DPM", "AzureBackupServer", "AzureSql", "AzureStorage", "AzureWorkload", "DefaultBackup". :vartype backup_management_type: str or ~azure.mgmt.re...
62598eeaa8370b77170eeafe
class TkBDZDiamondSprite (S.TkBDDiamondSprite): <NEW_LINE> <INDENT> STATUS = { "default": { "loop": True, "sequence": True, "delay": 100, }, }
Zombie-killer Diamond sprite in the mine;
62598eeacc0a2c111447971e
class PublicCategoryApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> <DEDENT> def test_failed_login_required(self): <NEW_LINE> <INDENT> res = self.client.get(CATEGORIES_URL) <NEW_LINE> self.assertEqual(res.status_code, status.HTTP_401_UNAUTHORIZED)
Test the publicity available categories API
62598eea4f88993c371ef874
class MessageHeader(NamedTuple): <NEW_LINE> <INDENT> protocol: int <NEW_LINE> message_type: int <NEW_LINE> stream_type: int <NEW_LINE> sequence: int <NEW_LINE> size: int
Message header struct
62598eea66673b3332c2eac3
class main_window(Tkinter.Tk): <NEW_LINE> <INDENT> def __init__(self,parent): <NEW_LINE> <INDENT> Tkinter.Tk.__init__(self,parent) <NEW_LINE> self.parent = parent <NEW_LINE> self.initialize() <NEW_LINE> <DEDENT> def initialize(self): <NEW_LINE> <INDENT> self.grid() <NEW_LINE> self.entry = Tkinter.Entry(self) <NEW_LINE>...
Main screen for the app
62598eea63d6d428bbee0ee8
class Create(BaseOpen): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> <DEDENT> def __call__(self, name, cpu, memory, disk, cdrom, mac_addr, vnc_password): <NEW_LINE> <INDENT> vmgen = VmGen() <NEW_LINE> volcreate = VolCreate() <NEW_LINE> if not volcreate(disk['pool'], name, di...
Create VM parameters: name: VM (domain) name cpu: arch: cpu architecture nvcpu: number of vcpus memory: memory size of VM disk: pool: pool name where disk is stored size: volume size cdrom: iso image path mac_addr: mac address vnc_password: vnc password
62598eea167d2b6e312b56b4
class TCPStreamServer(object): <NEW_LINE> <INDENT> def __init__(self, host, port, connection_callback=None, data_received_callback=None, loop=None): <NEW_LINE> <INDENT> self._host = host <NEW_LINE> self._port = port <NEW_LINE> self.transports = {} <NEW_LINE> self.loop = loop or asyncio.get_event_loop() <NEW_LINE> self....
A TCP server based on asyncio streams. This is a high-level implementation of the asyncio server using streams. See `https://docs.python.org/3/library/asyncio-stream.html`__ for details. Parameters ---------- host : str The server host. port : int The server port. connection_callback Callback to call when...
62598eea60cbc95b06362a58
class TestSafetyEventBehaviorLabelSource(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return ...
SafetyEventBehaviorLabelSource unit test stubs
62598eea8e7ae83300ee77aa
class TrainerComponents(): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def LabelSmoothRegularization(label, numOfClasses, smoothing = 0.0): <NEW_LINE> <INDENT> confidence = 1.0 - smoothing <NEW_LINE> labelShape = torch.Size((label.size(0), numOfClasses)) <NEW_LINE> with torch.no_grad(): <NEW_LINE> <INDENT> smoothedLab...
This class is used to setting the trainer components.
62598eea627d3e7fe0e055a5
class FeatureExtractionPipeline(Pipeline): <NEW_LINE> <INDENT> task = "feature-extraction" <NEW_LINE> def __init__( self, model: Optional = None, tokenizer: PreTrainedTokenizer = None, modelcard: Optional[ModelCard] = None, framework: Optional[str] = None, args_parser: ArgumentHandler = None, device: int = -1, ): <NEW_...
Feature extraction pipeline using Model head. This pipeline extracts the hidden states from the base transformer, which can be used as features in a downstream tasks. This feature extraction pipeline can currently be loaded from the :func:`~transformers.pipeline` method using the following task identifier(s): - "feat...
62598eea99fddb7c1ca62192
class CharacterEmbeddings(TokenEmbeddings): <NEW_LINE> <INDENT> def __init__(self, path_to_char_dict: str = None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.name = 'Char' <NEW_LINE> self.static_embeddings = False <NEW_LINE> if path_to_char_dict is None: <NEW_LINE> <INDENT> self.char_dictionary: Dictionary ...
Character embeddings of words, as proposed in Lample et al., 2016.
62598eeafff4ab517ebcbef3
class EmailHashRegenerationOneOffJob(jobs.BaseMapReduceOneOffJobManager): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def entity_classes_to_map_over(cls): <NEW_LINE> <INDENT> return [email_models.SentEmailModel] <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def map(email_model): <NEW_LINE> <INDENT> email_model.put() <NE...
One-off job for re-generating hash for all Sent Email Models. For every instance we call the put() method. The put() method results in a hash value (new hash value in case the hash function changes or no hash was present before.) getting generated and updated for each instance.
62598eeadd821e528d6d7660
class GroupInvitation(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(User, null=False) <NEW_LINE> group = models.ForeignKey(Group, null=False) <NEW_LINE> inviting = models.BooleanField(null=False, default=True) <NEW_LINE> def accept(self): <NEW_LINE> <INDENT> self.group.members.add(self.user) <NEW_LINE> se...
An invitation for a group.
62598eea5fdd1c0f98e5c6bd
class AdminAPIToolResumeError(AdminAPIToolError): <NEW_LINE> <INDENT> pass
Problem with resuming domain user iteration.
62598eea5fc7496912d47600
class ISaveData(IAction): <NEW_LINE> <INDENT> showFields = zope.schema.List( title=_(u"label_savefields_text", default=u"Saved Fields"), description=_( u"help_savefields_text", default=u"Pick the fields whose inputs you'd like to include in " u"the saved data. If empty, all fields will be saved.", ), unique=True, requi...
A form action adapter that will save form input data and return it in csv- or tab-delimited format.
62598eea7047854f4633daf0
class Command: <NEW_LINE> <INDENT> def __init__(self, cooker): <NEW_LINE> <INDENT> self.cooker = cooker <NEW_LINE> self.cmds_sync = CommandsSync() <NEW_LINE> self.cmds_async = CommandsAsync() <NEW_LINE> self.currentAsyncCommand = None <NEW_LINE> <DEDENT> def runCommand(self, commandline, ro_only = False): <NEW_LINE> <I...
A queue of asynchronous commands for bitbake
62598eeaa8ecb0332586f906
class NewRemindersTest(BaseTest): <NEW_LINE> <INDENT> @freeze_time(FROZEN_TIME) <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(NewRemindersTest, self).setUp() <NEW_LINE> self.reminder = Reminder( user=self.user, content="test test", start_date=self.today, start_time=(self.now - timedelta(minutes=5)).time() ) <NE...
Test fetching new reminders since given date
62598eea7c178a314d78bbae
class TechTicketCompleteUpdateForm(forms.ModelForm): <NEW_LINE> <INDENT> ticket_number = forms.CharField(widget=forms.TextInput(attrs={'readonly':'readonly'})) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Ticket <NEW_LINE> fields = ('ticket_number','completed','repair_notes','additional_work')
Form used for technicians to update parts of the Ticket model
62598eea498bea3a75a5624d
class Graph: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.a = defaultdict(list) <NEW_LINE> <DEDENT> def addEdge(self, u,v ): <NEW_LINE> <INDENT> self.a[u].append(v) <NEW_LINE> <DEDENT> def dfs(self, s): <NEW_LINE> <INDENT> search_list = [] <NEW_LINE> visited = [False]*len(self.a) <NEW_LINE> return s...
This class represents a directed graph using adjacency list representation
62598eea2eb69b55b15a0718
class testMustPass(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass
Testing that "perfect" assignments pass all tests
62598eea76e4537e8c3edcd5
class TacCommentInput(InputObjectType): <NEW_LINE> <INDENT> proposal_code = String(required=True, description='The proposal code, such as \'2017-2-SCI-042\'.') <NEW_LINE> comment = String(required=True, description='The comment made by tac while they were allocating time.')
A tac comment for a proposal
62598eea236d856c2adc87a3
class TestArrivalBoardApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = swagger_client.apis.arrival_board_api.ArrivalBoardApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_get_arrival_board(self): <NEW_LINE> <INDENT> pass
ArrivalBoardApi unit test stubs
62598eeaa8370b77170eeb00
class Limit(object): <NEW_LINE> <INDENT> def __init__(self, request): <NEW_LINE> <INDENT> self.request = request.with_prefix('account/identity') <NEW_LINE> <DEDENT> def get(self, identity_id, service): <NEW_LINE> <INDENT> return self.request.get(str(identity_id) + '/limit/' + service) <NEW_LINE> <DEDENT> def list(self,...
Represents the DataSift limit API and provides the ability to query it. Internal class instantiated as part of the Client object.
62598eea4f88993c371ef875
class Track(wavelink.Track): <NEW_LINE> <INDENT> __slots__ = ('requester', 'requested_at') <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args) <NEW_LINE> self.requester = kwargs.get('requester') <NEW_LINE> self.requested_at = kwargs.get('requested_at', datetime.utcnow()) <NEW_LIN...
Wavelink Track object with a requester attribute.
62598eea8a43f66fc4bf0890
@MetaborgReleng.subcommand("set-versions") <NEW_LINE> class MetaborgRelengSetVersions(cli.Application): <NEW_LINE> <INDENT> fromVersion = cli.SwitchAttr(names=['-f', '--from'], argtype=str, mandatory=True, help='Maven version to change from') <NEW_LINE> toVersion = cli.SwitchAttr(names=['-t', '--to'], argtype=str, mand...
Sets Maven and Eclipse version numbers to given version number
62598eea4428ac0f6e656c6f
class Cluster: <NEW_LINE> <INDENT> def __init__(self, fips_codes, horiz_pos, vert_pos, population, risk): <NEW_LINE> <INDENT> self._fips_codes = fips_codes <NEW_LINE> self._horiz_center = horiz_pos <NEW_LINE> self._vert_center = vert_pos <NEW_LINE> self._total_population = population <NEW_LINE> self._averaged_risk = ri...
Class for creating and merging clusters of counties
62598eea01c39578d7f114c6
class AARectangle(object): <NEW_LINE> <INDENT> __slots__ = ['_left','_bottom','_right','_top'] <NEW_LINE> def __init__(self,*points): <NEW_LINE> <INDENT> self._top = max([y for x,y in points]) <NEW_LINE> self._bottom = min([y for x,y in points]) <NEW_LINE> self._left = min([x for x,y in points]) <NEW_LINE> self._right ...
Axis-aligned rectangle class. Defines the smallest axis-aligned rectangle that encloses a set of points. Usage: aar = AARectangle( (x1,y1),(x2,y2), ... , (xN,yN) )
62598eea85dfad0860cbedf6
class Solution: <NEW_LINE> <INDENT> def sift_up(self, A, node): <NEW_LINE> <INDENT> while node != 0: <NEW_LINE> <INDENT> father = (node - 1)//2 <NEW_LINE> if A[father] > A[node]: <NEW_LINE> <INDENT> A[father], A[node] = A[node], A[father] <NEW_LINE> node = father <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> break <NEW...
@param: A: Given an integer array @return: nothing
62598eea2ae34c7f260a9804
class UbidotsInvalidInputError(UbidotsError): <NEW_LINE> <INDENT> pass
Exception thrown when client-side verification fails
62598eea92d797404e387f09
class MockCloudifyContext(CloudifyContext): <NEW_LINE> <INDENT> def __init__(self, node_id=None, node_name=None, blueprint_id=None, deployment_id=None, execution_id=None, properties=None, runtime_properties=None, capabilities=None, related=None, operation=None, resources=None): <NEW_LINE> <INDENT> super(MockCloudifyCon...
Cloudify context mock to be used when testing Cloudify plugins.
62598eea63d6d428bbee0eea
class cLine(): <NEW_LINE> <INDENT> def __init__(self,id,name): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.name = name <NEW_LINE> self.GetStopPoints() <NEW_LINE> <DEDENT> def GetStopPoints(self): <NEW_LINE> <INDENT> self.stop_point_request = cTFL_Line_Stoppoints_Request(self.id) <NEW_LINE> <DEDENT> def __str__(sel...
simplified definition of a line
62598eea38b623060ffa77b8
class Articles: <NEW_LINE> <INDENT> def __init__(self,id,author,title,description,url,urlToImage,publishedAt): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.author = author <NEW_LINE> self.title = title <NEW_LINE> self.description = description <NEW_LINE> self.url = url <NEW_LINE> self.urlToImage = urlToImage <NEW_L...
News Articles class to define News Article Objects
62598eea60cbc95b06362a5a
class Square(Rectangle): <NEW_LINE> <INDENT> def __init__(self, size): <NEW_LINE> <INDENT> self.integer_validator('size', size) <NEW_LINE> self.__size = size <NEW_LINE> super().__init__(self.__size, self.__size) <NEW_LINE> <DEDENT> def area(self): <NEW_LINE> <INDENT> return self.__size ** 2 <NEW_LINE> <DEDENT> def __st...
Square class that inherits from Rectangle
62598eea5fdd1c0f98e5c6be
class Timeout (elasticsearch.exceptions.ConnectionTimeout): <NEW_LINE> <INDENT> pass
Database timeout exception
62598eea435de62698e9a4f3
class CallExpr(Node): <NEW_LINE> <INDENT> callee = None <NEW_LINE> args = None <NEW_LINE> arg_kinds = None <NEW_LINE> arg_names = None <NEW_LINE> def __init__(self, callee, args, arg_kinds, arg_names): <NEW_LINE> <INDENT> self.callee = callee <NEW_LINE> self.args = args <NEW_LINE> self.arg_kinds = arg_kinds <NEW_LINE> ...
Call expression
62598eea4a966d76dd5ed602
class Method(object): <NEW_LINE> <INDENT> def __init__(self, request_method, register_method, method_name): <NEW_LINE> <INDENT> self.__request_method = request_method <NEW_LINE> self.__register_method = register_method <NEW_LINE> self.__method_name = method_name <NEW_LINE> <DEDENT> def __getattr__(self, method_name): <...
Map the methods called on the server to json-rpc methods.
62598eea16aa5153ce3fec1c
class Wheelchair: <NEW_LINE> <INDENT> def __init__(self, environment, localino_tag, xPos=100, yPos=100, orientation=0, height=32, width=32, mass=300, wheels=((32, 0), (32, 16))): <NEW_LINE> <INDENT> self.image = tkinter.PhotoImage(file="Wheelchair.png") <NEW_LINE> self.height = height <NEW_LINE> self.width = width <NE...
Represents a the wheelchair Note: x1, y1, x2, y2 must represent upper left corner and lower right corner of the object CHALLENGE: HOW TO TURN
62598eea627d3e7fe0e055a7
class Opera(Driver): <NEW_LINE> <INDENT> _name = "local_Opera" <NEW_LINE> def _start_driver(self): <NEW_LINE> <INDENT> return webdriver.Opera(**self._capabilities)
Local Opera webdriver Configuration settings:: { 'class': 'selenium_configurator.drivers.local.Opera', 'capabilities': { ... } }
62598eea3539df3088eca9cf
class testaPontos(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "object.testa_pontos" <NEW_LINE> bl_label = "TestaPontos" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> testaPontosDef(self, context) <NEW_LINE> return {'FINISHED'}
Tooltip
62598eea0c0af96317c54ab5
class general(defs.optiongroup): <NEW_LINE> <INDENT> class terminal_type(defs.option): <NEW_LINE> <INDENT> default = 'vte' <NEW_LINE> rtype = types.stringlist('vte', 'moo')
Terminal options.
62598eea2eb69b55b15a0719
class Api(Client): <NEW_LINE> <INDENT> BASE_URL = "https://api.mailtest.in" <NEW_LINE> VERSION = "/v1" <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(Api, self).__init__(self, **kwargs) <NEW_LINE> self.version = self.VERSION <NEW_LINE> self.base_url = "%s%s" % (self.BASE_URL, self.version) <NEW_LINE...
MailTest API
62598eeaa79ad1619776873b