code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class FieldPaginator(Paginator): <NEW_LINE> <INDENT> def __init__(self, context, entries, *, inline=True, **kwargs): <NEW_LINE> <INDENT> super().__init__(context, entries, **kwargs) <NEW_LINE> self.inline = inline <NEW_LINE> if len(self._pages) > 25: <NEW_LINE> <INDENT> raise ValueError("too many fields per page (maxim...
Similar to Paginator, but uses the fields instead of the description
62598edad486a94d0ba2a4f7
class Actor(nn.Module): <NEW_LINE> <INDENT> def __init__(self, state_size, action_size, seed, fc1_units=256, fc2_units=128): <NEW_LINE> <INDENT> super(Actor, self).__init__() <NEW_LINE> self.seed = torch.manual_seed(seed) <NEW_LINE> self.fc1 = nn.Linear(state_size, fc1_units) <NEW_LINE> self.bn1 = nn.BatchNorm1d(fc1_un...
Actor (Policy) Model.
62598edacc0a2c1114479523
class FFNNVAD(): <NEW_LINE> <INDENT> def __init__(self, model, filter_length, sample_rate, framesize, frameshift, usehamming, preemcoef, numchans, ceplifter, numceps, enormalise, zmeansource, usepower, usec0, usecmn, usedelta, useacc, n_last_frames, n_prev_frames, lofreq, hifreq, mel_banks_only): <NEW_LINE> <INDENT> s...
This is implementation of a FFNN based voice activity detector. It only implements decisions whether input frame is speech of non speech. It returns the posterior probability of speech for N last input frames.
62598eda460517430c4309aa
class ConfluentManagementClient(object): <NEW_LINE> <INDENT> def __init__( self, credential, subscription_id, base_url=None, **kwargs ): <NEW_LINE> <INDENT> if not base_url: <NEW_LINE> <INDENT> base_url = 'https://management.azure.com' <NEW_LINE> <DEDENT> self._config = ConfluentManagementClientConfiguration(credential...
ConfluentManagementClient. :ivar marketplace_agreements: MarketplaceAgreementsOperations operations :vartype marketplace_agreements: azure.mgmt.confluent.operations.MarketplaceAgreementsOperations :ivar organization_operations: OrganizationOperationsOperations operations :vartype organization_operations: azure.mgmt.co...
62598edadd821e528d6d7469
class Edges: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._edges = [False, False, False, False] <NEW_LINE> <DEDENT> def __getitem__(self, direction): <NEW_LINE> <INDENT> return self._edges[direction.index] <NEW_LINE> <DEDENT> def __setitem__(self, direction, value): <NEW_LINE> <INDENT> self._edges[d...
List (of length four) representing the possible edges of a node. Item true if edge is present.
62598eda596a897236126189
class SpatialTransformationMethod(Attack): <NEW_LINE> <INDENT> def __init__(self, model, sess=None, dtypestr='float32', **kwargs): <NEW_LINE> <INDENT> if not isinstance(model, Model): <NEW_LINE> <INDENT> model = CallableModelWrapper(model, 'probs') <NEW_LINE> <DEDENT> super(SpatialTransformationMethod, self).__init__( ...
Spatial transformation attack
62598eda2eb69b55b15a0619
class ModelConfig(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.input_file_pattern = None <NEW_LINE> self.image_format = "jpeg" <NEW_LINE> self.values_per_input_shard = 2300 <NEW_LINE> self.input_queue_capacity_factor = 2 <NEW_LINE> self.num_input_reader_threads = 1 <NEW_LINE> self.image1_da...
Wrapper class for model hyperparameters.
62598eda60cbc95b0636285d
class TestTeacher(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 testTeacher(self): <NEW_LINE> <INDENT> pass
Teacher unit test stubs
62598eda7047854f4633d905
class PMMLRidge(PMMLGeneralizedLinearRegressor, Ridge): <NEW_LINE> <INDENT> def fit(self, x, y): <NEW_LINE> <INDENT> return PMMLGeneralizedLinearRegressor.fit(self, x, y) <NEW_LINE> <DEDENT> def _more_tags(self): <NEW_LINE> <INDENT> return Ridge._more_tags(self)
Linear least squares with l2 regularization. Minimizes the objective function:: ||y - Xw||^2_2 + alpha * ||w||^2_2 This model solves a regression model where the loss function is the linear least squares function and regularization is given by the l2-norm. Also known as Ridge Regression or Tikhonov regularization. T...
62598edaa17c0f6771d5a77e
class MQTTThread(threading.Thread): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> print("Starting mqtt thread") <NEW_LINE> mqttc.loop_forever() <NEW_LINE> print("Exiting mqtt thread")
Thread that proccesses commands from MQTT
62598eda16aa5153ce3fea1c
class TestInit: <NEW_LINE> <INDENT> def test_init(self): <NEW_LINE> <INDENT> c_availability = AVAIAILABILITY["candidates"] <NEW_LINE> p_availability = AVAIAILABILITY["positions"] <NEW_LINE> candidates = ["Alice", "Bob", "Charlie"] <NEW_LINE> positions = ["Position 1", "Position 2", "Position 3"] <NEW_LINE> schedule = S...
Tests Scheduler.__init__()
62598eda004d5f362081e290
class GameHighScore(Result): <NEW_LINE> <INDENT> def __init__(self, position, user, score, _raw=None): <NEW_LINE> <INDENT> super(GameHighScore, self).__init__() <NEW_LINE> from .peer import User <NEW_LINE> assert_type_or_raise(position, int, parameter_name="position") <NEW_LINE> self.position = position <NEW_LINE> asse...
This object represents one row of the high scores table for a game. https://core.telegram.org/bots/api#gamehighscore Parameters: :param position: Position in high score table for the game :type position: int :param user: User :type user: pytgbot.api_types.receivable.peer.User :param score: Score :type score: i...
62598eda99cbb53fe682f3d4
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.
62598eda498bea3a75a56058
class OrganizationOption(Model): <NEW_LINE> <INDENT> organization = FlexibleForeignKey('sentry.Organization') <NEW_LINE> key = models.CharField(max_length=64) <NEW_LINE> value = UnicodePickledObjectField() <NEW_LINE> objects = OrganizationOptionManager() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> app_label = 'sentry' <...
Organization options apply only to an instance of a organization. Options which are specific to a plugin should namespace their key. e.g. key='myplugin:optname' key: onboarding:complete value: { updated: datetime }
62598eda0a50d4780f7038ca
class TestTsv2MD(unittest.TestCase): <NEW_LINE> <INDENT> def test_python2(self): <NEW_LINE> <INDENT> out, status = cmd.run("python2 {} -v".format(script_path)) <NEW_LINE> self.assertEqual(status, 0) <NEW_LINE> <DEDENT> def test_python3(self): <NEW_LINE> <INDENT> out, status = cmd.run( "python3 {} -v".format(os.path.joi...
Unit tests for tsv2md.py
62598eda55399d3f05624a50
class MTurkBox(Base): <NEW_LINE> <INDENT> __tablename__ = "mturk_training_boxes" <NEW_LINE> id = Column(Integer, nullable=False, primary_key=True, autoincrement = True) <NEW_LINE> box_id = Column(Integer, ForeignKey('boxes.id'), nullable = False) <NEW_LINE> box_hit_id = Column(Integer, ForeignKey('mturk_box_hits.id'), ...
A single box on a HIT. Each BoxHit has multiple MturkBoxes
62598eda9c8ee8231303f3e9
class Server: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def send_message(cls, message: str, from_client_id: int, only_to_client_id:Optional[str]=None) -> None: <NEW_LINE> <INDENT> print(f'[SERVER]: {message}') <NEW_LINE> if not only_to_client_id: <NEW_LINE> <INDENT> client_id_hex = 0xffffffff <NEW_LINE> <DEDENT> else...
Server data structure Incapsulates server manipulation
62598eda56ac1b37e6300711
class ResponseHeader(object): <NEW_LINE> <INDENT> def __init__(self, response): <NEW_LINE> <INDENT> super(ResponseHeader, self).__init__() <NEW_LINE> self.header = {} <NEW_LINE> self.reason = '' <NEW_LINE> self.fromcache = False <NEW_LINE> self.parse(response) <NEW_LINE> <DEDENT> def parse(self, response): <NEW_LINE> <...
ResponseHeader parses HTTP response header
62598edabd1bec0571e1435d
class MOGI(ArrayChunk): <NEW_LINE> <INDENT> item = GroupInfo <NEW_LINE> data = "infos" <NEW_LINE> infos: List[GroupInfo]
Group informations
62598edad99f1b3c44d03bda
class FdtPropertyWords(pyfdt.FdtPropertyWords): <NEW_LINE> <INDENT> def __init__(self, name, words): <NEW_LINE> <INDENT> if type(words) != list: <NEW_LINE> <INDENT> words = [words] <NEW_LINE> <DEDENT> words = [int(w, base=0) if type(w) == str else int(w) for w in words] <NEW_LINE> super().__init__(name, words)
Create a property with word (32-bit unsigned) values.
62598eda66673b3332c2e8c9
@unique <NEW_LINE> class FileTransferType(Enum): <NEW_LINE> <INDENT> PUT = auto() <NEW_LINE> GET = auto()
This enum keeps track of the possible file transfer types.
62598eda91f36d47f2230136
class Gro(Enum): <NEW_LINE> <INDENT> RESNUM_S = 0 <NEW_LINE> RESNUM_E = 5 <NEW_LINE> RESTYPE_S = 5 <NEW_LINE> RESTYPE_E = 10 <NEW_LINE> ATONAME_S = 10 <NEW_LINE> ATONAME_E = 15 <NEW_LINE> ATONUM_S = 15 <NEW_LINE> ATONUM_E = 20 <NEW_LINE> XCOORD_S = 20 <NEW_LINE> XCOORD_E = 28 <NEW_LINE> YCOORD_S = 28 <NEW_LINE> YCOORD_...
Enum for the start and end of the components in the grofile Please refer to GRO file format in the Groamcas manual for more information S: stand for start E: stand for end the number belong to positions in the grofile lines.
62598edad7e4931a7ef3a5bf
class FeatureEngineering(object): <NEW_LINE> <INDENT> def __init__(self, df): <NEW_LINE> <INDENT> super(FeatureEngineering, self).__init__() <NEW_LINE> self.df = df <NEW_LINE> <DEDENT> def project_categorical_variable_on_target_mean(self, cat_var, target): <NEW_LINE> <INDENT> df_copy = self.df.copy(deep=True) <NEW_LINE...
docstring for FeatureEngineering.
62598edaadb09d7d5dc08aea
class AlphaBetaAgent(MultiAgentSearchAgent): <NEW_LINE> <INDENT> def getAction(self, gameState): <NEW_LINE> <INDENT> def nextAgent(agent): <NEW_LINE> <INDENT> if agent+1 <= gameState.getNumAgents()-1: <NEW_LINE> <INDENT> return agent+1 <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> <DEDENT> ...
Your minimax agent with alpha-beta pruning (question 3)
62598edad268445f26638e20
class Inventory(models.Model): <NEW_LINE> <INDENT> created_by = models.ForeignKey(User, on_delete=models.SET_NULL, null=True) <NEW_LINE> created = models.DateTimeField(auto_now_add=True) <NEW_LINE> shop = models.ForeignKey('Shop', on_delete=models.CASCADE, verbose_name="sklep") <NEW_LINE> is_active = models.BooleanFiel...
inventory list
62598eda29b78933be269360
class TemporaryFailError(CouchbaseError): <NEW_LINE> <INDENT> pass
Temporary failure (on server) The server tried to perform the requested operation, but failed due to a temporary constraint. Retrying the operation may work. This error may also be delivered if the key being accessed was locked. .. seealso:: :meth:`couchbase.bucket.Bucket.lock` :meth:`couchbase.bucket.Bucke...
62598eda56b00c62f0fb0df4
class PWSine(PWarp): <NEW_LINE> <INDENT> def __init__(self, length=1, amp=0.5): <NEW_LINE> <INDENT> self.length = length <NEW_LINE> self.amp = amp <NEW_LINE> self.pos = 0.0 <NEW_LINE> <DEDENT> def __next__(self): <NEW_LINE> <INDENT> self.pos += self.timeline.tick_duration <NEW_LINE> if self.pos > self.length: <NEW_LINE...
PWSine: Sinosoidal warp, period `length` beats, amplitude +/-<amp>. >>> p = PWAmp(8, 0.5)
62598edbe1aae11d1e7cdad0
class OptionError(Error): <NEW_LINE> <INDENT> def __init__(self, message, source=None): <NEW_LINE> <INDENT> super().__init__(message) <NEW_LINE> self.option_error_message = (source + ": ") if source is not None else "" <NEW_LINE> self.option_error_message += message <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <IN...
Error to indicate that a value passed to a command line option must be fixed.
62598edbb7558d5895461b71
class IEpuManagementClient(object): <NEW_LINE> <INDENT> def subscribe_domain(self, domain_id, subscriber_name, subscriber_op): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def unsubscribe_domain(self, domain_id, subscriber_name): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def add_domain(self, domain_id, definition_id...
This is a fake interface class that contains the methods any EPU Management client implementation will have. There can be several types of messaging implementations that will have different implementations of this client. And there can be mocks. See EPUManagement for parameter documentation.
62598edb8a43f66fc4bf0696
class V_PARAMETER(Base): <NEW_LINE> <INDENT> __tablename__ = View.PARAMETER <NEW_LINE> __table_args__ = {'autoload':True} <NEW_LINE> parameter_id = Column('parameter_id', Integer, primary_key=True)
V_PARAMETER
62598edb99cbb53fe682f3d7
class LEDMockBoard(Board): <NEW_LINE> <INDENT> @property <NEW_LINE> def name(self) -> str: <NEW_LINE> <INDENT> return "Test Board 2" <NEW_LINE> <DEDENT> @property <NEW_LINE> def serial_number(self) -> str: <NEW_LINE> <INDENT> return "TEST2" <NEW_LINE> <DEDENT> def make_safe(self) -> None: <NEW_LINE> <INDENT> pass <NEW_...
A test board.
62598edbbe383301e0251cfb
class MigrateVolumesParallel(action.Action): <NEW_LINE> <INDENT> def __init__(self, init): <NEW_LINE> <INDENT> super(MigrateVolumesParallel, self).__init__(init) <NEW_LINE> self.init = init <NEW_LINE> <DEDENT> def run(self, **kwargs): <NEW_LINE> <INDENT> num_processes = self.cfg.migrate.num_processes_for_volume_migrati...
Copies cinder volumes from source to destination cloud in parallel Depends on: - `get_volumes_db_data` task (`GetVolumesDb` class) Config options: - [MIGRATE] num_processes_for_volume_migration
62598edb0a50d4780f7038cc
class TakeSmallest(_RankedTakeSmallest): <NEW_LINE> <INDENT> def apply(self, l, n, evaluation, options): <NEW_LINE> <INDENT> return self._compute(l, n, evaluation, options)
<dl> <dt>'TakeSmallest[$list$, $f$, $n$]' <dd>returns the a sorted list of the $n$ smallest items in $list$. </dl> For details on how to use the ExcludedForms option, see TakeLargest[]. >> TakeSmallest[{100, -1, 50, 10}, 2] = {-1, 10}
62598edba219f33f346c4d5d
class ReviewLikeEditView(OwnerPermission,generics.DestroyAPIView): <NEW_LINE> <INDENT> serializer_class = ReviewLikeSerializer <NEW_LINE> model = ReviewLike <NEW_LINE> permission_classes = (permissions.IsAuthenticated,OwnerPermission) <NEW_LINE> queryset = model.objects.all() <NEW_LINE> def delete(self, request,pk): <N...
pk is like_id
62598edb32920d7e50bc4552
class BaseClient(Singleton): <NEW_LINE> <INDENT> def __init__(self, path, provider, cloud_config): <NEW_LINE> <INDENT> self.driver = None <NEW_LINE> self.set_driver(path, provider, cloud_config) <NEW_LINE> <DEDENT> def set_driver(self, path, provider, cloud_config): <NEW_LINE> <INDENT> _provider = provider.lower() <NEW...
Base Client :params path: module path of driver, for e.x: 'calplus.v1.network.driver' :params provider: provider for e.x: 'OpenStack' :params cloud_config:
62598edb32920d7e50bc4553
class hook(object): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> self.commands = args <NEW_LINE> <DEDENT> def __call__(self, func): <NEW_LINE> <INDENT> if not hasattr(func, ATTR_ACTION_HOOK): <NEW_LINE> <INDENT> setattr(func, ATTR_ACTION_HOOK, list(self.commands)) <NEW_LINE> <DEDENT> else: <NEW_LI...
Decorator for calling module methods in response to IRC actions. Example: .. code-block:: python @hook("PRIVMSG") def mymyethod(self, message): print("IRC server sent PRIVMSG") This stores a list of IRC actions each function is tagged for in method.__tag_hooks. This attribute is scanned during module...
62598edb01c39578d7f112cc
class CardView(QGraphicsView): <NEW_LINE> <INDENT> back_card = QSvgRenderer('cards/Red_Back_2.svg') <NEW_LINE> all_cards = read_cards() <NEW_LINE> def __init__(self, card_model: CardModel, label_model=None, card_spacing: int = 50, padding: int = 10, font_size: int = 50, card_scale: int = 1): <NEW_LINE> <INDENT> self.sc...
A View widget that represents the table area displaying a players cards.
62598edbd53ae8145f9169af
class TestCreatePriceRequest(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 testCreatePriceRequest(self): <NEW_LINE> <INDENT> pass
CreatePriceRequest unit test stubs
62598edb76e4537e8c3edae6
class ActionRenew(): <NEW_LINE> <INDENT> def __init__(self, *, tls_cert: bool = None) -> None: <NEW_LINE> <INDENT> self.tls_cert = tls_cert <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_dict(cls, _dict: Dict) -> 'ActionRenew': <NEW_LINE> <INDENT> args = {} <NEW_LINE> if 'tls_cert' in _dict: <NEW_LINE> <INDENT> a...
ActionRenew. :attr bool tls_cert: (optional) Set to `true` to renew the tls cert for this component.
62598edbcc0a2c1114479527
class Organization(Base): <NEW_LINE> <INDENT> __tablename__ = "organization" <NEW_LINE> id = sql.Column(sql.Integer, primary_key=True) <NEW_LINE> desc = sql.Column(sql.Text, unique=True) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.desc <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> ret...
Table of organizations
62598edb796e427e5384ccbe
class Instrument(models.Model): <NEW_LINE> <INDENT> ticker = models.CharField(max_length=20) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.ticker
Stores a financial instrument information.
62598edb2c8b7c6e89bd1cef
class GetInput: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> print("For more on your options, please see:") <NEW_LINE> print( "https://github.com/shen3443/" "wine-quality-dataset-vanilla-python-ML" "/blob/main/README.md#settings" ) <NEW_LINE> print() <NEW_LINE> <DEDENT> def get_activation(self): <NEW_LIN...
Class that handles recieving user input
62598edb460517430c4309ae
class CountGroupHandler(web.View): <NEW_LINE> <INDENT> def __init__(self, request: Request): <NEW_LINE> <INDENT> super().__init__(request) <NEW_LINE> self._connection = request.app['connection'] <NEW_LINE> <DEDENT> async def get(self): <NEW_LINE> <INDENT> data = self._sql_query() <NEW_LINE> if data: <NEW_LINE> <INDENT>...
Class-based handler for get count of group.
62598edb1b99ca400228e79f
class Response(object): <NEW_LINE> <INDENT> def __init__(self, response, session): <NEW_LINE> <INDENT> self.response = response <NEW_LINE> self.session = session <NEW_LINE> self.total = self.response.json()['totalResults'] <NEW_LINE> self.next = urljoin(self.response.url, self.response.json()['next']) <NEW_LINE> self.l...
Webhose response. Usually contains a list of posts
62598edb66673b3332c2e8cb
@python_2_unicode_compatible <NEW_LINE> class CategorySubCategory(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = 'Hierarchie catégorie' <NEW_LINE> verbose_name_plural = 'Hierarchies catégories' <NEW_LINE> <DEDENT> category = models.ForeignKey(Category, verbose_name='Catégorie', db_ind...
ManyToMany between Category and SubCategory but save a boolean to know if category is his main category.
62598edb21a7993f00c64491
class LaTeXChoiceProposal(Proposal): <NEW_LINE> <INDENT> def __init__(self, overlap, source, label, details): <NEW_LINE> <INDENT> self._source = source <NEW_LINE> self._details = details <NEW_LINE> self._overlap = overlap <NEW_LINE> self._label = label <NEW_LINE> self._icon = GdkPixbuf.Pixbuf.new_from_file(Resources()....
A proposal inserting a simple string when activated
62598edbf8510a7c17d7d40f
class TestFetchTestCases(BaseTaskTestCase): <NEW_LINE> <INDENT> @patch.dict(config.config, {'query_wiki_test_cases': True}) <NEW_LINE> @patch('bodhi.server.models.Build.update_test_cases') <NEW_LINE> def test_update_nonexistent(self, fetch): <NEW_LINE> <INDENT> with pytest.raises(BodhiException) as exc: <NEW_LINE> <IND...
This test class contains tests for the main() function.
62598edb435de62698e9a2fc
class ForceQuitSignal(object): <NEW_LINE> <INDENT> pass
Force quit
62598edb66656f66f7d58906
class Handler(server.BaseHTTPRequestHandler): <NEW_LINE> <INDENT> def do_GET(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.send_response(HTTPStatus.OK) <NEW_LINE> parsed_url = urlparse(unquote(self.path)) <NEW_LINE> path = parsed_url.path <NEW_LINE> query_params = parse_qs(parsed_url.query) <NEW_LINE> if pat...
HTTP handler.
62598edbadb09d7d5dc08aec
class Submission: <NEW_LINE> <INDENT> def __init__(self, username, run, problem, contest_name): <NEW_LINE> <INDENT> self.username = username <NEW_LINE> self.unix_time = (run.time + config.CONTESTS_START_TIME) / 1000 <NEW_LINE> self.problem_alias = problem.alias <NEW_LINE> self.status = "success" if run.accepted == "yes...
Entity in submission list
62598edb2eb69b55b15a061b
class RemoveTeamMemberTest(UserAuthMixin, TestCase): <NEW_LINE> <INDENT> USERS = { 'john': {}, 'paul': {}, } <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.setup_users(login='john') <NEW_LINE> self.team = Team.objects.create_with_slug( owner=self.current_user, name="Team name", public=True) <NEW_LINE> self.team.a...
Tests for the :class:`distro_tracker.core.views.RemoveTeamMember`.
62598edbe5267d203ee69e28
class BaseModel: <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> if kwargs: <NEW_LINE> <INDENT> for key, value in kwargs.items(): <NEW_LINE> <INDENT> dic = {} <NEW_LINE> dic[key] = value <NEW_LINE> if key == "id": <NEW_LINE> <INDENT> self.id = value <NEW_LINE> <DEDENT> if key == "created_at...
is a base class
62598edb8c0ade5d55dc2916
class JarImportProducts(object): <NEW_LINE> <INDENT> JarImport = namedtuple('JarImport', ['coordinate', 'jar']) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._imports = defaultdict(list) <NEW_LINE> <DEDENT> def imported(self, target, coordinate, jar): <NEW_LINE> <INDENT> if not isinstance(target, ImportJarsMi...
Represents the products of jar import resolutions. Jar imports are jars containing source code to be unpacked and used locally.
62598edba79ad16197768540
class WeChatMedia(BaseWeChatAPI): <NEW_LINE> <INDENT> def upload(self, media_type, media_file): <NEW_LINE> <INDENT> return self._post('media/upload', params={'type': media_type}, files={'media': media_file}) <NEW_LINE> <DEDENT> def upload_img(self, image_file): <NEW_LINE> <INDENT> return self._post('media/uploadimg', f...
素材管理 https://work.weixin.qq.com/api/doc#90000/90135/91054
62598edb0c0af96317c548c4
class CmnliProcessor(DataProcessor): <NEW_LINE> <INDENT> def get_train_examples(self, data_dir): <NEW_LINE> <INDENT> return self._create_examples( self._read_json(os.path.join(data_dir, "train.json")), "train") <NEW_LINE> <DEDENT> def get_dev_examples(self, data_dir): <NEW_LINE> <INDENT> return self._create_examples( s...
Processor for the CMNLI data set (CLUE version).
62598edb5f7d997b871f8668
class View(BrowserView): <NEW_LINE> <INDENT> implements(interfaces.IArticleView) <NEW_LINE> template = ViewPageTemplateFile('view.pt') <NEW_LINE> def __call__(self): <NEW_LINE> <INDENT> return self.template()
View of an article.
62598edb30bbd7224646815f
class Gordon_etal(StateSpaceModel): <NEW_LINE> <INDENT> default_params = {'a': 0.05, 'b': .5, 'c': 25., 'd': 8., 'e': 1.2, 'sigmaX': 3.162278} <NEW_LINE> def PX0(self): <NEW_LINE> <INDENT> return dists.Normal(scale=2.) <NEW_LINE> <DEDENT> def PX(self, t, xp): <NEW_LINE> <INDENT> return dists.Normal(loc=self.b * xp + se...
Popular toy example that appeared initially in Gordon et al (1993). .. math:: X_0 & \sim N(0, 2^2) \\ X_t & = b X_{t-1} + c X_{t-1}/(1+X_{t-1}^2) + d*\cos(e*(t-1)) + \sigma_X V_t, \quad V_t \sim N(0,1) \\ Y_t|X_t=x_t & \sim N(a*x_t^2, 1)
62598edbe1aae11d1e7cdad1
class CheckTcbServiceRequest(AbstractModel): <NEW_LINE> <INDENT> pass
CheckTcbService请求参数结构体
62598edb8a43f66fc4bf0698
class MySQLConnection: <NEW_LINE> <INDENT> _instance = None <NEW_LINE> @staticmethod <NEW_LINE> def get_connection(): <NEW_LINE> <INDENT> if MySQLConnection._instance is None: <NEW_LINE> <INDENT> MySQLConnection._conn = pymysql.connect(DatabaseProperties.HOST, DatabaseProperties.USER, DatabaseProperties.PASSWORD, Datab...
This class handles the connection with a MySQL database
62598edb442bda511e95a98f
class Hiwat(TethysAppBase): <NEW_LINE> <INDENT> name = 'HIWAT HKH' <NEW_LINE> index = 'hiwat:home' <NEW_LINE> icon = 'hiwat/images/logo.png' <NEW_LINE> package = 'hiwat' <NEW_LINE> root_url = 'hiwat' <NEW_LINE> color = '#c0392b' <NEW_LINE> description = 'View latest HIWAT data' <NEW_LINE> tags = 'Weather' <NEW_LINE> en...
Tethys app class for HIWAT.
62598edb0c0af96317c548c5
class TrackedResource(Resource): <NEW_LINE> <INDENT> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, id: Op...
The resource model definition for a ARM tracked top level resource. :ivar id: Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}. :vartype id: str :ivar name: The name of the resource. ...
62598edba05bb46b38488da3
class LCESelector(GenericLocatorWidget): <NEW_LINE> <INDENT> ROOT = ParametrizedLocator("{@locator}") <NEW_LINE> LABELS = "./li/label[contains(@class, path-list-item-label)]" <NEW_LINE> CHECKBOX = './/input[@ng-model="item.selected"][parent::label[contains(., "{}")]]' <NEW_LINE> def __init__(self, parent, locator=None,...
Group of checkboxes that goes in a line one after another. Usually used to specify lifecycle environment Example html representation:: <ul[@class='path-list']> <li class="path-list-item ng-scope"...> <label class="path-list-item-label...> <input type="checkbox"...> <li ...
62598edb3eb6a72ae0388b66
class GIBar_Linkam(GIBar): <NEW_LINE> <INDENT> def __init__(self, name='GIBar', base=None, **kwargs): <NEW_LINE> <INDENT> super().__init__(name=name, base=base, **kwargs) <NEW_LINE> self._positional_axis = 'x' <NEW_LINE> self._axes['y'].origin = -16.8 <NEW_LINE> self._axes['y'].origin = 2.06
This class is a sample bar with heating/cooling feature and 6" long bar for grazing-incidence (GI) experiments.
62598edbbe383301e0251cfd
class TestRestoreModuleData(object): <NEW_LINE> <INDENT> def __init__(self, restoreType, code, currentAySem, targetAySem, quota, mountingChange): <NEW_LINE> <INDENT> self.restoreType = restoreType <NEW_LINE> self.code = code <NEW_LINE> self.currentAySem = currentAySem <NEW_LINE> self.aysem = targetAySem <NEW_LINE> self...
Emulate the data submitted by the 'Restore Module' button on the 'Modified Modules' pages
62598edb94891a1f408b80f7
class BaseRecipeAttrViewSet(viewsets.GenericViewSet, mixins.ListModelMixin, mixins.CreateModelMixin): <NEW_LINE> <INDENT> authentication_classes = (TokenAuthentication,) <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return self.queryset.filter(user=self.reques...
Base veiwset for user owned recipe attributes
62598edb99fddb7c1ca6209a
@slots_extender(('info',)) <NEW_LINE> class AddInfo(AbstractTestEventMessage): <NEW_LINE> <INDENT> pass
Register a success message. Attributes: info (str): success message.
62598edb01c39578d7f112ce
class MinimaxPlayer(IsolationPlayer): <NEW_LINE> <INDENT> def get_move(self, game, time_left): <NEW_LINE> <INDENT> self.time_left = time_left <NEW_LINE> best_move = (-1, -1) <NEW_LINE> try: <NEW_LINE> <INDENT> return self.minimax(game, self.search_depth) <NEW_LINE> <DEDENT> except SearchTimeout: <NEW_LINE> <INDENT> pas...
Game-playing agent that chooses a move using depth-limited minimax search. You must finish and test this player to make sure it properly uses minimax to return a good move before the search time limit expires.
62598edb56ac1b37e6300715
class TApplicationException(TException): <NEW_LINE> <INDENT> thrift_spec = { 1: (TType.STRING, 'message'), 2: (TType.I32, 'type'), } <NEW_LINE> UNKNOWN = 0 <NEW_LINE> UNKNOWN_METHOD = 1 <NEW_LINE> INVALID_MESSAGE_TYPE = 2 <NEW_LINE> WRONG_METHOD_NAME = 3 <NEW_LINE> BAD_SEQUENCE_ID = 4 <NEW_LINE> MISSING_RESULT = 5 <NEW...
Application level thrift exceptions.
62598edb76e4537e8c3edae8
class FromHeader(BoundValue[T]): <NEW_LINE> <INDENT> pass
A parameter obtained from request headers.
62598edb7b25080760ed59c1
class Plugin(object): <NEW_LINE> <INDENT> def __init__(self, pixel_count=1): <NEW_LINE> <INDENT> self._pixel_count = pixel_count <NEW_LINE> <DEDENT> def get_pixels(self, delta): <NEW_LINE> <INDENT> for _ in range(self._pixel_count): <NEW_LINE> <INDENT> yield (0, 0, 0) <NEW_LINE> <DEDENT> <DEDENT> def get_pixel_count(se...
PlasmaFX Plugin. A PlasmaFX plugin is responsible for the 4 lights on a single Plasma light board.
62598edbbaa26c4b54d4d7ff
class TVerifyingSSLSocket(object): <NEW_LINE> <INDENT> def __init__(self, socket, verify_pattern=None): <NEW_LINE> <INDENT> self.socket = socket <NEW_LINE> self.verify_pattern = None <NEW_LINE> if verify_pattern: <NEW_LINE> <INDENT> self.verify_pattern = re.compile(verify_pattern) <NEW_LINE> <DEDENT> <DEDENT> def _is_c...
Class used to verify SSL peer certificates after connecting Overriding the _verify_cn method will allow you to override the CN settings
62598edba17c0f6771d5a783
class AlertRuleResourceCollection(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[AlertRuleResource]'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(AlertRuleResourceCollection, self).__init__(**kwargs) <NEW_LINE> self.value = kwargs.get(...
Represents a collection of alert rule resources. :param value: the values for the alert rule resources. :type value: list[~$(python-base-namespace).v2015_07_01.models.AlertRuleResource]
62598edb66673b3332c2e8ce
class Pop3(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.required=[] <NEW_LINE> self.b_key = "pop3" <NEW_LINE> self.a10_url="/axapi/v3/health/monitor/{name}/method/pop3" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> self.pop3_password_string = "" ...
Class Description:: POP3 type. Class pop3 supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.` :param pop3_password_string: {"description": "Specify the user password, '' means empty passworddd", "format": "password", "minLength": 1, "optional": true, ...
62598edb23849d37ff84f5e9
class Arguments: <NEW_LINE> <INDENT> mobile_number = graphene.Int(required=True) <NEW_LINE> username = graphene.String(required=True) <NEW_LINE> password = graphene.String(required=True) <NEW_LINE> email = graphene.String(required=True)
Summary Attributes: email (TYPE): Description mobile_number (TYPE): Description password (TYPE): Description username (TYPE): Description
62598edb24f1403a92684b37
class _Config(object): <NEW_LINE> <INDENT> def __init__(self, cfg, defaults): <NEW_LINE> <INDENT> self._config = cfg <NEW_LINE> self._default = defaults <NEW_LINE> <DEDENT> def get(self, key): <NEW_LINE> <INDENT> return self._config.get(key, self._default.get(key))
Wraps a dict to provide default values from a provided dict.
62598edbcb5e8a47e493b40d
class ParseDictionaryType(NodeAxisTools): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def deserialize(data, graph, parser_classes, dkey='root', rnid=None): <NEW_LINE> <INDENT> nid = graph.add_node(dkey, format=return_instance_type(data), type='object') <NEW_LINE> if rnid: <NEW_LINE> <INDENT> graph.add_edge(rnid, nid) ...
Deserialize methods from Python dictionaries. The default PyDataNodeTools.serialize method is used for serialization as it return dictionaries by default.
62598edb07f4c71912bad987
class FutureResult(FutureResultBase): <NEW_LINE> <INDENT> result: Optional[PossibleResults] = None
Single computation result
62598edb6fb2d068a76930b4
class ExportResult(GenKey): <NEW_LINE> <INDENT> def handle_status(self, key, value): <NEW_LINE> <INDENT> if key in ("EXPORTED", "EXPORT_RES"): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> super(ExportResult, self).handle_status(key, value)
Handle status messages for --export[-secret-key]. For now, just use an existing class to base it on - if needed, we can override handle_status for more specific message handling.
62598edbadb09d7d5dc08aee
class Number(Template): <NEW_LINE> <INDENT> def convert(self, value, view): <NEW_LINE> <INDENT> if isinstance(value, util.NUMERIC_TYPES): <NEW_LINE> <INDENT> return value <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.fail( u'must be numeric, not {0}'.format(type(value).__name__), view, True )
A numeric type: either an integer or a floating-point number.
62598edbd7e4931a7ef3a5c4
class Binary(http.Controller): <NEW_LINE> <INDENT> @http.route('/web/binary/download_document', type='http', auth="public") <NEW_LINE> @serialize_exception <NEW_LINE> def download_document(self,model,field,id,filename=None, **kw): <NEW_LINE> <INDENT> env = Environment(request.cr, SUPERUSER_ID, {}) <NEW_LINE> res = env[...
Common controller to download file
62598edb1f037a2d8b9e262d
class InteractionHistoricalModel(models.Model): <NEW_LINE> <INDENT> documents_cache = ArrayField( models.JSONField(), blank=True, default=list, ) <NEW_LINE> def get_changed_fields(self, old_history): <NEW_LINE> <INDENT> changed_fields = self.diff_against(old_history).changed_fields <NEW_LINE> if "archived" in changed_f...
Abstract model for history models tracking document changes.
62598edba79ad16197768543
class Interval(object): <NEW_LINE> <INDENT> def __init__(self, interval_string): <NEW_LINE> <INDENT> self.interval_string = interval_string <NEW_LINE> <DEDENT> def get_oldest_datetime(self, reference=None): <NEW_LINE> <INDENT> if reference is None: <NEW_LINE> <INDENT> reference = datetime.datetime.now().replace(microse...
Represents an interval relative to the current date. You can use the following suffixes: ====== ========== suffix stands for ====== ========== m minutes h hours w weeks d days M months ====== ========== You can use this module for example to check whether some event happened in the la...
62598edb57b8e32f5250739c
class BatchNorm(KL.BatchNormalization): <NEW_LINE> <INDENT> def call(self, inputs, training=None): <NEW_LINE> <INDENT> return super(self.__class__, self).call(inputs, training=training)
Extends the Keras BatchNormalization class to allow a central place to make changes if needed. Batch normalization has a negative effect on training if batches are small so this layer is often frozen (via setting in Config class) and functions as linear layer.
62598edb4e4d562566370941
class DescribeVpcRequest(JDCloudRequest): <NEW_LINE> <INDENT> def __init__(self, parameters, header=None, version="v1"): <NEW_LINE> <INDENT> super(DescribeVpcRequest, self).__init__( '/regions/{regionId}/vpcs/{vpcId}', 'GET', header, version) <NEW_LINE> self.parameters = parameters
查询Vpc信息详情
62598edb4428ac0f6e656a84
class NotifiersHistoryViewSet(generics.ListAPIView, viewsets.GenericViewSet): <NEW_LINE> <INDENT> lookup_field = "uuid" <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> serializer_class = NotifiersHistorySerializer <NEW_LINE> queryset = NotifiersHistory.objects.all()
Notificaitons History ViewSet /api/v1/notifiers/history/
62598edb30bbd72246468161
class TrafficMatrixSequence(object): <NEW_LINE> <INDENT> def __init__(self, interval=None, t_unit='min'): <NEW_LINE> <INDENT> self.attrib = {} <NEW_LINE> if interval is not None: <NEW_LINE> <INDENT> if not t_unit in time_units: <NEW_LINE> <INDENT> raise ValueError("The t_unit argument is not valid") <NEW_LINE> <DEDENT>...
Class representing a sequence of traffic matrices. Parameters ---------- interval : float or int, optional The time interval elapsed between subsequent traffic matrices of the sequence t_unit : str, optional The unit of the interval value (e.g. 'sec' or 'min')
62598edbb7558d5895461b75
class Proxy: <NEW_LINE> <INDENT> def __init__(self, subject): <NEW_LINE> <INDENT> self._subject = subject <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> return getattr(self._subject, name) <NEW_LINE> <DEDENT> def get(self): <NEW_LINE> <INDENT> return self._subject <NEW_LINE> <DEDENT> def __eq__(se...
A simple generic Proxy class, forwarding all calls to subject. This means you can take an object, let's call it `'obj_a`, and wrap it in this Proxy class, with a statement like this:: proxy_obj = Proxy(obj_a) Then, if in the future, you do something like this:: x = proxy_obj.var1 since the :class:`Proxy` c...
62598edbe5267d203ee69e2b
class HyperKitty(MBox): <NEW_LINE> <INDENT> version = '0.6.0' <NEW_LINE> CATEGORIES = [CATEGORY_MESSAGE] <NEW_LINE> def __init__(self, url, dirpath, tag=None, archive=None, ssl_verify=True): <NEW_LINE> <INDENT> super().__init__(url, dirpath, tag=tag, archive=archive, ssl_verify=ssl_verify) <NEW_LINE> self.url = url <NE...
HyperKitty backend. This class allows the fetch the email messages stored on a HyperKitty archiver. Initialize this class passing the URL where the mailing list archiver is and the directory path where the mbox files will be fetched and stored. The origin of the data will be set to the value of `url`. :param url: URL...
62598edb8e71fb1e983b9f9a
class TrainStatusMessage: <NEW_LINE> <INDENT> pass
Represents a Train Status Message from the Push Port. Attributes ---------- late_reason : LateReason The reason for why the service is late. locations : list of Locations The locations for which information is present in this message. rid : string The Darwin RTTI identifier of the schedule this message ap...
62598edb3cc13d1c6d463c91
class Component_Data_Source(Base): <NEW_LINE> <INDENT> subclass_names = ['Proc_Target', 'Data_Target', 'Expr']
<component-data-source> = <expr> | <data-target> | <proc-target>
62598edbbe383301e0251cff
class NoAvailableVirtualenv(RuntimeError): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(NoAvailableVirtualenv, self).__init__('Cannot open a virtualenv, there are none selected.')
Indicate that there are not any known virtualenv
62598edb9c8ee8231303f3ec
@singleton_object <NEW_LINE> class CIdentity(Circuit, Expression, metaclass=Singleton): <NEW_LINE> <INDENT> _cdim = 1 <NEW_LINE> @property <NEW_LINE> def cdim(self): <NEW_LINE> <INDENT> return self._cdim <NEW_LINE> <DEDENT> @property <NEW_LINE> def args(self): <NEW_LINE> <INDENT> return tuple() <NEW_LINE> <DEDENT> def ...
Single pass-through channel; neutral element of :class:`SeriesProduct`
62598edb7d43ff2487426690
class CarRentalExtraCharges(object): <NEW_LINE> <INDENT> openapi_types = { 'charge_item': 'str' } <NEW_LINE> attribute_map = { 'charge_item': 'chargeItem' } <NEW_LINE> def __init__(self, charge_item=None): <NEW_LINE> <INDENT> self._charge_item = None <NEW_LINE> self.discriminator = None <NEW_LINE> if charge_item is not...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62598edb5fdd1c0f98e5c4d6
class AndroidCallPlugin(interface.SQLitePlugin): <NEW_LINE> <INDENT> NAME = 'android_calls' <NEW_LINE> DESCRIPTION = u'Parser for Android calls SQLite database files.' <NEW_LINE> QUERIES = [ ('SELECT _id AS id, date, number, name, duration, type FROM calls', 'ParseCallsRow')] <NEW_LINE> CALL_TYPE = { 1: u'INCOMING', 2:...
Parse Android contacts2 database.
62598edb236d856c2adc86a8
class IdConverter(BaseConverter): <NEW_LINE> <INDENT> type_ = str <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> BaseConverter.__init__(self, *args, **kwargs)
Id of the object you want to query
62598edba8ecb0332586f710
class TestTeacherStudentSigmoidLossOp(OpTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.op_type = "teacher_student_sigmoid_loss" <NEW_LINE> batch_size = 16 <NEW_LINE> num_classes = 1 <NEW_LINE> self.inputs = { 'X': logit( np.random.uniform(0, 1, (batch_size, num_classes)) .astype("float32")), 'Labe...
Test teacher_student_sigmoid_loss with discrete one-hot labels.
62598edbb7558d5895461b76
class IBachang(Interface): <NEW_LINE> <INDENT> id = schema.Int( title=_(u"talbe primary key") ) <NEW_LINE> name = schema.TextLine( title=_(u"ba chang ming cheng") ) <NEW_LINE> bcdm = schema.TextLine( title=_(u"ba chang dai ma") ) <NEW_LINE> location = schema.TextLine( title=_(u"ba chang wei zhi") ) <NEW_LINE> length = ...
靶场
62598edb6fb2d068a76930b5
@since('2.2') <NEW_LINE> class TestLargeColumn(Tester): <NEW_LINE> <INDENT> def stress_with_col_size(self, cluster, node, size): <NEW_LINE> <INDENT> size = str(size) <NEW_LINE> node.stress(['write', 'n=5', "no-warmup", "cl=ALL", "-pop", "seq=1...5", "-schema", "replication(factor=2)", "-col", "n=fixed(1)", "size=fixed(...
Check that inserting and reading large columns to the database doesn't cause off heap memory usage that is proportional to the size of the memory read/written.
62598edb63b5f9789fe8369c
class LocalAccount(BaseAccount): <NEW_LINE> <INDENT> def __init__(self, key, account): <NEW_LINE> <INDENT> self._publicapi = account <NEW_LINE> self._address = key.public_key.to_checksum_address() <NEW_LINE> key_raw = key.to_bytes() <NEW_LINE> self._private_key = key_raw <NEW_LINE> self._key_obj = key <NEW_LINE> <DEDEN...
A collection of convenience methods to sign and encrypt, with an embedded private key. :var bytes key: the 32-byte private key data .. code-block:: python >>> my_local_account.address # doctest: +SKIP "0xF0109fC8DF283027b6285cc889F5aA624EaC1F55" >>> my_local_account.key # doctest: +SKIP b"\x01\x23......
62598edb435de62698e9a300
class UpdateTwitterPictures(UpdatePictures): <NEW_LINE> <INDENT> SOURCE_CLS = Twitter
Finds :class:`Twitter` sources with new profile pictures and updates them. https://github.com/snarfed/granary/commit/dfc3d406a20965a5ed14c9705e3d3c2223c8c3ff http://indiewebcamp.com/Twitter#Profile_Image_URLs
62598edbadb09d7d5dc08af0