code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class RequiredIfActive(object): <NEW_LINE> <INDENT> missing_message = _('Required when active.') <NEW_LINE> def __init__(self, fields): <NEW_LINE> <INDENT> self.fields = fields <NEW_LINE> self.serializer_field = None <NEW_LINE> <DEDENT> def set_context(self, serializer): <NEW_LINE> <INDENT> self.instance = getattr(seri...
This validator makes it easy to add required fields to an Integration serializer that are only required when the integration `is_active`.
625990643cc13d1c6d466e63
class PreWikiCloseParams(object): <NEW_LINE> <INDENT> def __init__(self, wikiroot: 'outwiker.core.tree.WikiDocument'): <NEW_LINE> <INDENT> self.wikiroot = wikiroot <NEW_LINE> self.abortClose = False
Parameters set for onPreWikiClose event
62599064a8ecb03325872938
class PrivateEndpointConnection(ProxyResource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'typ...
A private endpoint connection. 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}. :...
625990641f5feb6acb16430b
class MessageEntity(_MessageEntityBase): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> @staticmethod <NEW_LINE> def from_result(result): <NEW_LINE> <INDENT> if result is None: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> return MessageEntity( type=result.get('type'), offset=result.get('offset'), length=result.ge...
This object represents a chat. Attributes: type (str) :Type of the entity. One of mention (@username), hashtag, bot_command, url, email, bold (bold text), italic (italic text), code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_m...
625990642ae34c7f260ac808
class Workspace(_Workspace): <NEW_LINE> <INDENT> TASKNAME = 'refresh-pool-avoid-groups-hostnames-dispatcher' <NEW_LINE> @step <NEW_LINE> def entry(self) -> None: <NEW_LINE> <INDENT> self.handle_success('entered-task') <NEW_LINE> <DEDENT> @step <NEW_LINE> def dispatch_refresh(self) -> None: <NEW_LINE> <INDENT> for pool ...
Workspace for hostname groups refresh dispatcher.
62599064442bda511e95d8ea
class CheckIfFileExists(Action): <NEW_LINE> <INDENT> def execute(self, context, obj): <NEW_LINE> <INDENT> connection = S3Connection() <NEW_LINE> bucket = Bucket(connection=connection, name=context['bucket']) <NEW_LINE> key = Key(bucket=bucket, name=context['name']) <NEW_LINE> if key.exists(): <NEW_LINE> <INDENT> return...
Checks if the file exists.
625990648e71fb1e983bd1eb
class NexellFastbootBootAction(Action): <NEW_LINE> <INDENT> def __init__(self,parameters): <NEW_LINE> <INDENT> super(NexellFastbootBootAction, self).__init__() <NEW_LINE> self.name = "nexell-boot-on-uboot" <NEW_LINE> self.summary = "attempt to boot" <NEW_LINE> self.description = "nexell boot into system" <NEW_LINE> sel...
This action calls fastboot to boot into the system.
625990643eb6a72ae038bd80
@dataclass <NEW_LINE> class TAITime: <NEW_LINE> <INDENT> seconds: int <NEW_LINE> nanos: int <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> secs = self.seconds + self.nanos / 1e9 <NEW_LINE> dt = datetime.fromtimestamp(secs, timezone.utc) <NEW_LINE> return dt.strftime('%Y-%m-%dT%H:%M:%S.%f') + "Z" <NEW_LINE> <DEDENT> ...
Creates a TAITime containing seconds since the epoch (1970) and the offset from seconds in nanoseconds
62599064f7d966606f74944a
class OffPolicyRLModel(BaseRLModel): <NEW_LINE> <INDENT> def __init__(self, policy, env, replay_buffer, verbose=0, *, requires_vec_env, policy_base, policy_kwargs=None): <NEW_LINE> <INDENT> super(OffPolicyRLModel, self).__init__(policy, env, verbose=verbose, requires_vec_env=requires_vec_env, policy_base=policy_base, p...
The base class for off policy RL model :param policy: (BasePolicy) Policy object :param env: (Gym environment) The environment to learn from (if registered in Gym, can be str. Can be None for loading trained models) :param replay_buffer: (ReplayBuffer) the type of replay buffer :param verbose: (int) the ve...
6259906463d6d428bbee3e19
class TaskPolicy: <NEW_LINE> <INDENT> sensitive_list = [] <NEW_LINE> openapi_types = { 'schedule_time': 'str', 'retry_count': 'int', 'retry_interval': 'int' } <NEW_LINE> attribute_map = { 'schedule_time': 'schedule_time', 'retry_count': 'retry_count', 'retry_interval': 'retry_interval' } <NEW_LINE> def __init__(self, s...
Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition.
62599064e64d504609df9f5e
class OidcServiceProviderViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = ServiceProvider.objects.all() <NEW_LINE> permission_classes = [IsAuthenticated] <NEW_LINE> serializer_class = OidcServiceProviderSerializer <NEW_LINE> filter_backends = [filters.SearchFilter, DjangoFilterBackend] <NEW_LINE> search_f...
API endpoint for OIDC relying partys. list: Returns a list of all the existing OIDC relying partys. retrieve: Returns the given OIDC relying party. create: Creates a new OIDC relying party instance. update: Updates the given OIDC relying party. partial_update: Updates the given OIDC relying party. destroy: Removes the...
6259906445492302aabfdbfd
class GenericRemotePlugin(HookBaseClass): <NEW_LINE> <INDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return "Publish Plugin that runs REMOTELY" <NEW_LINE> <DEDENT> @property <NEW_LINE> def description(self): <NEW_LINE> <INDENT> return "This plugin should NOT process items locally" <NEW_LINE> <DEDENT> ...
This should NOT process the item locally...
625990644a966d76dd5f0617
class NetworkDevicesGridRemote(RemoteModel): <NEW_LINE> <INDENT> properties = ("id", "DeviceID", "DeviceIPDotted", "DeviceName", "DeviceType", )
| ``id:`` none | ``attribute type:`` string | ``DeviceID:`` none | ``attribute type:`` string | ``DeviceIPDotted:`` none | ``attribute type:`` string | ``DeviceName:`` none | ``attribute type:`` string | ``DeviceType:`` none | ``attribute type:`` string
62599064e5267d203ee6cf4f
class ChapterParser(BaseParser): <NEW_LINE> <INDENT> CATEGORY = "chapter" <NEW_LINE> @classmethod <NEW_LINE> def _accepts(cls, str_element): <NEW_LINE> <INDENT> return re.match("[0-9][.][a-z][)]", str_element, re.U) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def _parse(cls, chapter): <NEW_LINE> <INDENT> res = {} <NEW_...
Parser for chapter.
6259906429b78933be26ac55
class PostgresqlDb(IDB): <NEW_LINE> <INDENT> __db = {} <NEW_LINE> DEBUG = False <NEW_LINE> def __init__(self, dbname, host="", username="", passwd="", multiThreaded=True, connect=True): <NEW_LINE> <INDENT> self.dbname = dbname <NEW_LINE> self.host = host <NEW_LINE> self.username = username <NEW_LINE> self.passwd = pass...
@class PostgresqlDb provides generall database access
62599064d7e4931a7ef3d716
class LinkingStage(PipelineStage): <NEW_LINE> <INDENT> def transform(self, ast, env): <NEW_LINE> <INDENT> func_env = env.translation.crnt <NEW_LINE> env.context.intrinsic_library.link(func_env.lfunc.module) <NEW_LINE> env.constants_manager.link(func_env.lfunc.module) <NEW_LINE> if func_env.link: <NEW_LINE> <INDENT> fun...
Link the resulting LLVM function into the global fat module.
62599064796e427e5384fe98
class PTracker(object): <NEW_LINE> <INDENT> def __init__(self, user=None, password=None, token=None, ssl=True): <NEW_LINE> <INDENT> self.client = Client(ssl=ssl) <NEW_LINE> if token is None: <NEW_LINE> <INDENT> token = self._get_token_for_credentials(user, password) <NEW_LINE> <DEDENT> self.client.token = token <NEW_LI...
Base api entry point
625990642ae34c7f260ac809
class Odometry: <NEW_LINE> <INDENT> def __init__(self, line): <NEW_LINE> <INDENT> self.parse(line) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "Odometry: %s %s %s %s" % (self.x, self.y, self.theta, self.ts) <NEW_LINE> <DEDENT> def parse(self, line): <NEW_LINE> <INDENT> self.x, self.y, self.theta,...
Odometry data type. Contains x, y, theta, and timestamp data, all in reference to the standard odometry frame.
62599064a8370b77170f1af1
class Entity(BaseModel): <NEW_LINE> <INDENT> is_member = BooleanField() <NEW_LINE> name = CharField() <NEW_LINE> email = CharField(null=True) <NEW_LINE> phone = CharField(null=True) <NEW_LINE> reminder_date = DateField(null=True) <NEW_LINE> joined_date = DateField(null=True) <NEW_LINE> agreement_date = DateField(null=T...
An Entity sends money to the organisation or recieves money from the organistaion. Members are a special type of entity.
6259906499cbb53fe6832606
class Timeseries(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swagger_types = { 'tags': 'dict(str, str)', 'points': 'list[Point]' } <NEW_LINE> self.attribute_map = { 'tags': 'tags', 'points': 'points' } <NEW_LINE> self._tags = None <NEW_LINE> self._points = None <NEW_LINE> <DEDENT> @propert...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
6259906497e22403b383c62f
class LoginPageBaseModel(page_base.PageModel): <NEW_LINE> <INDENT> username = elements.TextInput(byset=by.By.ID, locator='username') <NEW_LINE> password = elements.PasswordInput(byset=by.By.ID, locator='password') <NEW_LINE> domain = elements.Select(byset=by.By.ID, locator='profile') <NEW_LINE> login_btn = elements.But...
Common page model for the login page.
625990644428ac0f6e659c54
class Dog(): <NEW_LINE> <INDENT> def __init__(self, name, age): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.age = age <NEW_LINE> <DEDENT> def sit(self): <NEW_LINE> <INDENT> print(self.name.title() + " is now sitting!") <NEW_LINE> <DEDENT> def roll_over(self): <NEW_LINE> <INDENT> print (self.name.title() + ' ro...
A simple attempt to model a dog.
625990648e7ae83300eea7b0
class GameStats(): <NEW_LINE> <INDENT> def __init__(self, ai_settings): <NEW_LINE> <INDENT> self.ai_settings = ai_settings <NEW_LINE> self.reset_stats() <NEW_LINE> self.ships_left = self.ai_settings.ship_limit <NEW_LINE> self.game_active = True <NEW_LINE> <DEDENT> def reset_stats(self): <NEW_LINE> <INDENT> self.ships_l...
Track statistics for Alien Invasion.
625990647d847024c075daf9
class TestReferenceWithUserIDLink(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 testReferenceWithUserIDLink(self): <NEW_LINE> <INDENT> pass
ReferenceWithUserIDLink unit test stubs
62599064009cb60464d02c5b
class TreeState(BaseModel): <NEW_LINE> <INDENT> name = models.CharField(max_length=150) <NEW_LINE> question = models.ForeignKey(Question) <NEW_LINE> num_retries = models.PositiveIntegerField( blank=True, null=True, help_text="The number of tries the user has to get out of this state" ) <NEW_LINE> def __str__(self): <NE...
A TreeState is a location in a tree. It is associated with a question and a set of answers (transitions) that allow traversal to other states.
625990644e4d562566373b2a
class InvalidEndpoint(Exception): <NEW_LINE> <INDENT> pass
Raised when the provided endpoint was deemed invalid.
62599064462c4b4f79dbd12a
class OrderMain(Base): <NEW_LINE> <INDENT> __tablename__ = 'OrderMain' <NEW_LINE> OMid = Column(String(64), primary_key=True) <NEW_LINE> OMno = Column(String(64), nullable=False, comment='订单编号') <NEW_LINE> OPayno = Column(String(64), comment='付款流水号,与orderpay对应') <NEW_LINE> USid = Column(String(64), nullable=False, comm...
订单主单, 下单时每种品牌单独一个订单, 但是一并付费
6259906467a9b606de547634
class Join(Node): <NEW_LINE> <INDENT> def template(self, items): <NEW_LINE> <INDENT> for item in items: <NEW_LINE> <INDENT> if item: <NEW_LINE> <INDENT> if isinstance(item, list): <NEW_LINE> <INDENT> self.template(item) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if isinstance(item, str): <NEW_LINE> <INDENT> item = T...
Node class for joining nodes.
625990641f5feb6acb16430f
class MailTemplate(models.Model): <NEW_LINE> <INDENT> name = models.CharField(_(u"Name"), max_length=255) <NEW_LINE> plain = models.TextField(_(u"Plaintext Body")) <NEW_LINE> html = models.TextField(_(u"HTML Body"), blank=True, null=True) <NEW_LINE> subject = models.CharField(_(u"Subject"), max_length=255) <NEW_LINE> d...
Holds a template for the email. Both, HTML and plaintext, versions can be stored. If both are present the email will be send out as HTML with an alternate plain part. If only plaintext is entered, the email will be send as text-only. HTML-only emails are currently not supported because I don't like them.
62599064435de62698e9d52d
class FieldSelectorResolutionTests(unittest.TestCase): <NEW_LINE> <INDENT> @unittest.skipIf(not current.deployment_settings.has_module("project"), "project module disabled") <NEW_LINE> def testResolveSelectorsWithoutComponents(self): <NEW_LINE> <INDENT> resource = current.s3db.resource("project_project") <NEW_LINE> sel...
Test field selector resolution
6259906491f36d47f2231a21
class PortfolioCreateForTeam(LoginRequiredMixin, CreateView): <NEW_LINE> <INDENT> model = Portfolio <NEW_LINE> form_class = PortfolioCreateForm <NEW_LINE> http_method_names = ['get', 'post', ] <NEW_LINE> template_name = 'gallery/portfolio_form_create_for_team.html' <NEW_LINE> success_url = reverse_lazy('gallery:portfol...
Create Portfolio for Project
6259906445492302aabfdc00
class StationItem(ButtonListItem): <NEW_LINE> <INDENT> BUTTON_PLAY = "play" <NEW_LINE> BUTTON_RENAME = "rename" <NEW_LINE> BUTTON_REMOVE = "remove" <NEW_LINE> def __init__(self, freq, name): <NEW_LINE> <INDENT> self.__title = self.escape_xml(name) <NEW_LINE> self.__freq = freq <NEW_LINE> ButtonListItem.__init__(self) <...
List item for radio stations.
62599064442bda511e95d8ec
class WaterSideEconomizerDBTemperatureMaximum(BSElement): <NEW_LINE> <INDENT> element_type = "xs:decimal"
The control temperature of the outside air dry-bulb temperature above which the water-side economizer is disabled. (°F)
625990640c0af96317c578f1
class Solution1: <NEW_LINE> <INDENT> def minSubArrayLen(self, s: int, nums: List[int]) -> int: <NEW_LINE> <INDENT> if not nums: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> n = len(nums) <NEW_LINE> min_len = n+1 <NEW_LINE> left = 0 <NEW_LINE> sum_val = 0 <NEW_LINE> for right in range(n): <NEW_LINE> <INDENT> sum_val...
Time:O(n) space:O(1)
625990648e71fb1e983bd1ed
class TestIOReaderWriter(unittest.TestCase): <NEW_LINE> <INDENT> def test_io_dump(self): <NEW_LINE> <INDENT> vcheck = {"x": 25282, "y": 43770, "spatialReference": {"wkid": 4326}} <NEW_LINE> if IS_PY3: <NEW_LINE> <INDENT> with tempfile.TemporaryDirectory() as d: <NEW_LINE> <INDENT> fp = os.path.join(d, "test.json") <NEW...
Tests the load/dump methods
6259906497e22403b383c631
class DummyUpload(object): <NEW_LINE> <INDENT> def __init__(self, path, name): <NEW_LINE> <INDENT> self.stream = open(path, 'rb') <NEW_LINE> self.name = name <NEW_LINE> self.size = os.path.getsize(path) <NEW_LINE> <DEDENT> def read(self, number_of_bytes=None): <NEW_LINE> <INDENT> return self.stream.read(number_of_bytes...
Upload and read file.
625990644428ac0f6e659c56
class AbinitEvent(yaml.YAMLObject): <NEW_LINE> <INDENT> color = None <NEW_LINE> def __init__(self, src_file, src_line, message): <NEW_LINE> <INDENT> self.message = message <NEW_LINE> self.src_file = src_file <NEW_LINE> self.src_line = src_line <NEW_LINE> <DEDENT> @pmg_serialize <NEW_LINE> def as_dict(self): <NEW_LINE> ...
Example (YAML syntax):: Normal warning without any handler: --- !Warning message: | This is a normal warning that won't trigger any handler in the python code! src_file: routine_name src_line: 112 ... Critical warning that will trigger some action in the python code. ...
625990647d847024c075dafb
class ParenteiaObjetos(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "object.parenteia_objetos" <NEW_LINE> bl_label = "Parenteia objetos" <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> ParenteiaObjetosDef() <NEW_LINE> return {'FINISHED'}
Tooltip
62599064a17c0f6771d5d738
class Insert(ValuesBase): <NEW_LINE> <INDENT> __visit_name__ = 'insert' <NEW_LINE> _supports_multi_parameters = True <NEW_LINE> def __init__(self, table, values=None, inline=False, bind=None, prefixes=None, returning=None, return_defaults=False, **dialect_kw): <NEW_LINE> <INDENT> ValuesBase.__init__(self, table, values...
Represent an INSERT construct. The :class:`.Insert` object is created using the :func:`~.expression.insert()` function. .. seealso:: :ref:`coretutorial_insert_expressions`
6259906463d6d428bbee3e1b
class MicrosoftPartnerSdkContractsV1CollectionsResourceCollectionMicrosoftPartnerSdkContractsAnalyticsCustomerLicensesDeploymentInsights(Model): <NEW_LINE> <INDENT> _validation = { 'total_count': {'readonly': True}, 'items': {'readonly': True}, 'attributes': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'total_co...
Contains a collection of resources with JSON properties to represent the output. Variables are only populated by the server, and will be ignored when sending a request. :ivar total_count: Gets the total count. :vartype total_count: int :ivar items: Gets the collection items. :vartype items: list[~microsoft.store.par...
6259906467a9b606de547635
class Visualizer(pg.QtGui.QMainWindow, RemoteObject): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Visualizer, self).__init__() <NEW_LINE> RemoteObject.__init__(self, rep_port=REPLY_PORT) <NEW_LINE> self._setup_ui() <NEW_LINE> self.data_file = None <NEW_LINE> self.buffer = np.zeros((32,32,3), dtype...
docstring for Visualizer
6259906491af0d3eaad3b54e
class code(object): <NEW_LINE> <INDENT> def __init__(self, code: int): <NEW_LINE> <INDENT> if code > 999: <NEW_LINE> <INDENT> raise Exception( "Numeric code must be an integer less than 999 for a code hook." ) <NEW_LINE> <DEDENT> self._code = code <NEW_LINE> <DEDENT> def __call__(self, func: Callable): <NEW_LINE> <INDE...
TODO: Documentation
625990648da39b475be0490f
@functional_datapipe('filter') <NEW_LINE> class FilterIterDataPipe(MapIterDataPipe[T_co]): <NEW_LINE> <INDENT> def __init__(self, datapipe: IterDataPipe[T_co], filter_fn: Callable[..., bool], fn_args: Optional[Tuple] = None, fn_kwargs: Optional[Dict] = None, ) -> None: <NEW_LINE> <INDENT> super().__init__(datapipe, fn=...
:class:`FilterIterDataPipe`. Iterable DataPipe to filter elements from datapipe according to filter_fn. args: datapipe: Iterable DataPipe being filterd filter_fn: Customized function mapping an element to a boolean. fn_args: Positional arguments for `filter_fn` fn_kwargs: Keyword arguments for `filter_...
625990644e4d562566373b2d
@gin.configurable <NEW_LINE> class DriftingLinearEnvironment(nsse.NonStationaryStochasticEnvironment): <NEW_LINE> <INDENT> def __init__(self, observation_distribution: types.Distribution, observation_to_reward_distribution: types.Distribution, drift_distribution: types.Distribution, additive_reward_distribution: types....
Implements a drifting linear environment.
62599064097d151d1a2c2791
class RPRecord(DNSRecord): <NEW_LINE> <INDENT> def __init__(self, zone, fqdn, *args, **kwargs): <NEW_LINE> <INDENT> if 'create' in kwargs: <NEW_LINE> <INDENT> super(RPRecord, self).__init__(zone, fqdn, kwargs['create']) <NEW_LINE> del kwargs['create'] <NEW_LINE> self._build(kwargs) <NEW_LINE> self.logger = logging.getL...
The Respnosible Person record allows an email address and some optional human readable text to be associated with a host. Due to privacy and spam considerations, :class:`RPRecords` are not widely used on public servers but can provide very useful contact data during diagnosis and debugging network problems.
62599064dd821e528d6da514
@attrs <NEW_LINE> class Configuration(object): <NEW_LINE> <INDENT> source_project_credentials = attrib() <NEW_LINE> target_project_credentials = attrib() <NEW_LINE> source_storage_client = attrib() <NEW_LINE> target_storage_client = attrib() <NEW_LINE> target_logging_client = attrib() <NEW_LINE> source_project = attrib...
Class to hold all of the config values set up on initial script run.
62599064d6c5a102081e384b
class Role(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=32, verbose_name='名称') <NEW_LINE> permissions = models.ManyToManyField('Permission', verbose_name='角色拥有的权限', blank=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name
角色表
6259906444b2445a339b74f3
class TSQR(object): <NEW_LINE> <INDENT> def __init__(self, matrix, block_size, sc): <NEW_LINE> <INDENT> self.matrix = matrix <NEW_LINE> self.block_size = block_size <NEW_LINE> self.sc = sc <NEW_LINE> <DEDENT> def tsqr(self): <NEW_LINE> <INDENT> partitioned_rdd = partition_rdd(self.matrix.matrix, self.matrix.m, self.blo...
Based on http://simons.berkeley.edu/sites/default/files/docs/782/gleichslides.pdf
625990644f6381625f19a037
@default_for_key('top_10_accuracy', k=10) <NEW_LINE> @default_for_key('top_5_accuracy') <NEW_LINE> @default_for_key('top_10_acc', k=10) <NEW_LINE> @default_for_key('top_5_acc') <NEW_LINE> @running_mean <NEW_LINE> @mean <NEW_LINE> class TopKCategoricalAccuracy(Metric): <NEW_LINE> <INDENT> def __init__(self, pred_key=tor...
Top K Categorical accuracy metric. Uses torch.topk to determine the top k predictions and compares to targets. Decorated with a mean, running_mean and std. Default for keys: 'top_5_acc', 'top_10_acc'. Args: pred_key (StateKey): The key in state which holds the predicted values target_key (StateKey): The key in...
62599064a8370b77170f1af5
class ESP8266ROMFirmwareImage(BaseFirmwareImage): <NEW_LINE> <INDENT> ROM_LOADER = ESP8266ROM <NEW_LINE> def __init__(self, load_file=None): <NEW_LINE> <INDENT> super(ESP8266ROMFirmwareImage, self).__init__() <NEW_LINE> self.flash_mode = 0 <NEW_LINE> self.flash_size_freq = 0 <NEW_LINE> self.version = 1 <NEW_LINE> if lo...
'Version 1' firmware image, segments loaded directly by the ROM bootloader.
6259906455399d3f05627c46
class Send(Get): <NEW_LINE> <INDENT> class Help: <NEW_LINE> <INDENT> synopsis = "send an email" <NEW_LINE> <DEDENT> xmlns = namespaces.email <NEW_LINE> dst = Attribute( "Destination to store exception object", type="reference", required=False ) <NEW_LINE> src = Attribute("Source email", type="index", default=None) <NEW...
Send an email.
6259906499cbb53fe683260a
class All2AllTanh(All2All): <NEW_LINE> <INDENT> __id__ = "b3a2bd5c-3c01-46ef-978a-fef22e008f31" <NEW_LINE> A = 1.7159 <NEW_LINE> B = 0.6666 <NEW_LINE> C = 9.0 <NEW_LINE> MAPPING = {"all2all_tanh"} <NEW_LINE> def initialize(self, device, **kwargs): <NEW_LINE> <INDENT> self.activation_mode = "ACTIVATION_TANH" <NEW_LINE> ...
All2All with scaled tanh() activation f(x) = 1.7159 * tanh(0.6666 * x).
6259906445492302aabfdc02
class ModelBuilder: <NEW_LINE> <INDENT> def __init__(self, model_path: str = None, save: bool = None): <NEW_LINE> <INDENT> self.path = model_path <NEW_LINE> self.save = save <NEW_LINE> self.reg = LinearRegression() <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return f"ModelBuilder(path: {self.path}, save...
Class for train and print results of ml model
62599064442bda511e95d8ed
class Register(Signup): <NEW_LINE> <INDENT> def done(self): <NEW_LINE> <INDENT> u = User.by_name(self.username) <NEW_LINE> if u: <NEW_LINE> <INDENT> msg = 'That user already exists.' <NEW_LINE> self.render('signup.html', error_username = msg) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> u = User.register(self.username...
Register : creates new user for blog
62599064f7d966606f74944d
class TestDockerNetDef(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 testDockerNetDef(self): <NEW_LINE> <INDENT> pass
DockerNetDef unit test stubs
62599064a17c0f6771d5d739
class Pop3(UpdateMonitorMixin, Resource): <NEW_LINE> <INDENT> def __init__(self, pop3s): <NEW_LINE> <INDENT> super(Pop3, self).__init__(pop3s) <NEW_LINE> self._meta_data['required_json_kind'] = 'tm:ltm:monitor:pop3:pop3state'
BIG-IP® Pop3 monitor resource.
62599064cc0a2c111447c663
class VizQuadType(object): <NEW_LINE> <INDENT> VIZ_QUAD_GENERIC_2D = 0 <NEW_LINE> VIZ_QUAD_GENERIC_3D = 1 <NEW_LINE> VIZ_QUAD_MAT_MARKER = 2 <NEW_LINE> VIZ_QUAD_PLANNER_OBSTACLE = 3 <NEW_LINE> VIZ_QUAD_PLANNER_OBSTACLE_REPLAN = 4 <NEW_LINE> VIZ_QUAD_ROBOT_BOUNDING_BOX ...
Automatically-generated uint_8 enumeration.
62599064e64d504609df9f61
class SudokuTreeNodeTests(unittest.TestCase): <NEW_LINE> <INDENT> def setup_empty(self): <NEW_LINE> <INDENT> self.board = Board() <NEW_LINE> self.number = random.randint(1, 9) <NEW_LINE> <DEDENT> def setup_solved(self): <NEW_LINE> <INDENT> x = Actual() <NEW_LINE> x.create() <NEW_LINE> self.board = x.board <NEW_LINE> se...
unittests created for all the methods of class SudokuTreeNode 2 setup methods are created so that the code runs faster as a solved board will not be created when it is not needed
6259906445492302aabfdc03
class SparseArray(object): <NEW_LINE> <INDENT> def __init__(self,_set=None): <NEW_LINE> <INDENT> self._set = _set if _set else {0}^{0} <NEW_LINE> <DEDENT> def __setitem__(self,offset, val): <NEW_LINE> <INDENT> if val: <NEW_LINE> <INDENT> self._set.add(offset) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._set.disc...
a mtuable sequence facade for set()
62599064e5267d203ee6cf52
class UDPStatusGetter(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.key = cfg.CONF.health_manager.heartbeat_key <NEW_LINE> self.ip = cfg.CONF.health_manager.bind_ip <NEW_LINE> self.port = cfg.CONF.health_manager.bind_port <NEW_LINE> self.sockaddr = None <NEW_LINE> LOG.info('attempting to lis...
This class defines methods that will gather heatbeats The heartbeats are transmitted via UDP and this class will bind to a port and absorb them
62599064baa26c4b54d509cc
class ngamsInitCmdTest(ngamsTestSuite): <NEW_LINE> <INDENT> def test_handleCmdInit_1(self): <NEW_LINE> <INDENT> self.prepExtSrv(8888, 1, 1, 1) <NEW_LINE> info(1,"TODO: Change some cfg. parameter") <NEW_LINE> tmpStatFile = sendExtCmd(getHostName(), 8888, NGAMS_INIT_CMD) <NEW_LINE> refStatFile = "ref/ngamsInitCmdTest_tes...
Synopsis: Test Suite for the INIT Command. Description: The purpose of the Test Suite is to exercise the INIT Command. Missing Test Cases: - Missing Test Cases for abnormal conditions. - Test normal case when loading cfg. from the DB.
625990647b25080760ed8875
class ParenthesesVector(TokenVector, ValueType, ListType): <NEW_LINE> <INDENT> def parse(self, expect_single: bool=False) -> object: <NEW_LINE> <INDENT> if not self.tokens: <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> if not any(isinstance(token, LexicalSeparator) for token in self.tokens): <NEW_LINE> <INDENT> ret...
Describes a vector of tokens bounded in parentheses, such as those in a method call's arguments or those signifying order-of-operations in an arithmetic operations
62599064796e427e5384fe9e
class DataLoader(object): <NEW_LINE> <INDENT> IID = False <NEW_LINE> MAX_NUM_CLASSES_PER_CLIENT = 5 <NEW_LINE> NUM_CLASSES = 10 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> img_rows, img_cols = 28, 28 <NEW_LINE> (x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data() <NEW_LINE> if tf.keras.back...
Generic dataloading object
6259906499cbb53fe683260b
class TypeDetailView(ListView): <NEW_LINE> <INDENT> paginate_by = settings.GEARTRACKER_PAGINATE_BY <NEW_LINE> def category(self, **kwargs): <NEW_LINE> <INDENT> return get_object_or_404(Category, slug=self.kwargs['category']) <NEW_LINE> <DEDENT> def type(self, **kwargs): <NEW_LINE> <INDENT> return get_object_or_404(Type...
Display all items of a given type.
6259906476e4537e8c3f0cab
class AzureDataLakeStorageRESTAPI(object): <NEW_LINE> <INDENT> def __init__( self, url, **kwargs ): <NEW_LINE> <INDENT> base_url = '{url}' <NEW_LINE> self._config = AzureDataLakeStorageRESTAPIConfiguration(url, **kwargs) <NEW_LINE> self._client = PipelineClient(base_url=base_url, config=self._config, **kwargs) <NEW_LIN...
Azure Data Lake Storage provides storage for Hadoop and other big data workloads. :ivar service: ServiceOperations operations :vartype service: azure.storage.filedatalake.operations.ServiceOperations :ivar file_system: FileSystemOperations operations :vartype file_system: azure.storage.filedatalake.operations.FileSyst...
625990642ae34c7f260ac80f
class Preference(xmlnode.XMLNode): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> xmlnode.XMLNode.__init__(self) <NEW_LINE> self._tag = 'preference' <NEW_LINE> self._attr['name'] = None <NEW_LINE> self._attr['value'] = None
An xmlnode.XMLNode subclass representing a single environment preference: :: >>> from music21 import environment >>> a = environment.Preference()
625990642ae34c7f260ac810
class TestCharactersLeftInRow(TestCase): <NEW_LINE> <INDENT> def test_with_characters(self): <NEW_LINE> <INDENT> row = ["foo", "bar", "baz"] <NEW_LINE> output = table.characters_left_in_row(row) <NEW_LINE> self.assertTrue(output) <NEW_LINE> <DEDENT> def test_with_no_characters(self): <NEW_LINE> <INDENT> row = [] <NEW_L...
tests for table.characters_left_in_row
625990647d43ff2487427fa4
class NSNitroNserrCrlShmemAllocFail(NSNitroSsl2Errors): <NEW_LINE> <INDENT> pass
Nitro error code 3648 Crl node allocation in the shared mem is failed
62599064f548e778e596ccb2
class Unique(object): <NEW_LINE> <INDENT> field_flags = ('unique', ) <NEW_LINE> def __init__(self, get_session, model, column, message=None): <NEW_LINE> <INDENT> self.get_session = get_session <NEW_LINE> self.model = model <NEW_LINE> self.column = column <NEW_LINE> self.message = message <NEW_LINE> <DEDENT> def __call_...
Checks field value unicity against specified table field. :param get_session: A function that return a SQAlchemy Session. :param model: The model to check unicity against. :param column: The unique column. :param message: The error message.
6259906463d6d428bbee3e1d
class CreateListenerRequest(JDCloudRequest): <NEW_LINE> <INDENT> def __init__(self, parameters, header=None, version="v1"): <NEW_LINE> <INDENT> super(CreateListenerRequest, self).__init__( '/regions/{regionId}/listeners', 'PUT', header, version) <NEW_LINE> self.parameters = parameters
创建监听器
625990640a50d4780f706954
class DecrypterTestCase(test_lib.DecrypterTestCase): <NEW_LINE> <INDENT> def testInitialize(self): <NEW_LINE> <INDENT> test_decrypter = decrypter.Decrypter() <NEW_LINE> self.assertIsNotNone(test_decrypter) <NEW_LINE> with self.assertRaises(ValueError): <NEW_LINE> <INDENT> decrypter.Decrypter(key=b'test1')
Tests for the decrypter interface.
625990647047854f46340ade
class UserProfileSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = models.UserProfile <NEW_LINE> fields = ('id', 'email', 'name', 'password') <NEW_LINE> extra_kwargs = { 'password' : { 'write_only': True, 'style': {'input_type': 'password'} } } <NEW_LINE> <DEDENT> def ...
Serializers a suer profile object
62599064462c4b4f79dbd130
class DictionaryImportResolver(idl.parser.ImportResolverBase): <NEW_LINE> <INDENT> def __init__(self, import_dict): <NEW_LINE> <INDENT> self._import_dict = import_dict <NEW_LINE> super(DictionaryImportResolver, self).__init__() <NEW_LINE> <DEDENT> def resolve(self, base_file, imported_file_name): <NEW_LINE> <INDENT> if...
An import resolver resolves files from a dictionary.
62599064f548e778e596ccb3
class LabelEncoder(base.BaseEstimator): <NEW_LINE> <INDENT> def __init__(self, min_obs=10): <NEW_LINE> <INDENT> self.min_obs = min_obs <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return ('LabelEncoder(min_obs={})').format(self.min_obs) <NEW_LINE> <DEDENT> def _get_label_encoder_and_max(self, x): <NEW_LI...
Label Encoder that groups infrequent values into one label. Attributes: min_obs (int): minimum number of observation to assign a label. label_encoders (list of dict): label encoders for columns label_maxes (list of int): maximum of labels for columns
6259906445492302aabfdc05
@zope.interface.implementer(interfaces.IAddForm) <NEW_LINE> class AddForm(Form): <NEW_LINE> <INDENT> ignoreContext = True <NEW_LINE> ignoreReadonly = True <NEW_LINE> _finishedAdd = False <NEW_LINE> @button.buttonAndHandler(_('Add'), name='add') <NEW_LINE> def handleAdd(self, action): <NEW_LINE> <INDENT> data, errors = ...
A field and button based add form.
625990644a966d76dd5f061f
class Phonebook: <NEW_LINE> <INDENT> def __init__(self, filename, num_digits, alphabet): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> self.num_digits = num_digits <NEW_LINE> self.alphabet = alphabet <NEW_LINE> self._numbers = PrefixSet() <NEW_LINE> self._new_numbers = [] <NEW_LINE> self._import(filename) <NE...
Phonebook storing and creating reachable phone numbers. The phone numbers are of length 'num_digits' (although shorter phone numbers are accepted) and comprise characters from the given 'alphabet'.
625990643539df3088ecd9c7
class UngenerateCertificatesTest(CertificateManagementTest): <NEW_LINE> <INDENT> command = 'ungenerated_certs' <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> self.course = self.courses[0] <NEW_LINE> <DEDENT> @override_settings(CERT_QUEUE='test-queue') <NEW_LINE> @patch('capa.xqueue_interface...
Tests for generating certificates.
6259906491af0d3eaad3b552
class SuperCall(object): <NEW_LINE> <INDENT> def __init__(self, class_, object_): <NEW_LINE> <INDENT> object.__init__(self) <NEW_LINE> self.__dict__['_class'] = class_ <NEW_LINE> self.__dict__['_object'] = object_ <NEW_LINE> <DEDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> return super(self._class, sel...
Obviates issues when using a "super" functional. Since functionals of a job-folder are deepcopied, the following line will not result in calling the next class in the __mro__. >>> jobfolder.functional = super(Functional, functional) Indeed, this line will first call the __getitem__, __setitem__ (or __deepcopy__) of ...
62599064dd821e528d6da516
class SavedWindowState(GObject.GObject): <NEW_LINE> <INDENT> __gtype_name__ = 'SavedWindowState' <NEW_LINE> width = GObject.property( type=int, nick='Current window width', default=-1) <NEW_LINE> height = GObject.property( type=int, nick='Current window height', default=-1) <NEW_LINE> is_maximized = GObject.property( t...
Utility class for saving and restoring GtkWindow state
625990643cc13d1c6d466e6d
class Employee(): <NEW_LINE> <INDENT> def __init__(self, firstname, lastname, salary): <NEW_LINE> <INDENT> self.firstname = firstname <NEW_LINE> self.lastname = lastname <NEW_LINE> self.salary = salary <NEW_LINE> <DEDENT> def give_raise(self, amount = 5000): <NEW_LINE> <INDENT> self.salary += amount
Simulate an employee
62599064498bea3a75a59195
class Boton(object): <NEW_LINE> <INDENT> def __init__(self, pin, nombre='boton1'): <NEW_LINE> <INDENT> self.gpio = mraa.Gpio(pin) <NEW_LINE> self.gpio.dir(mraa.DIR_IN) <NEW_LINE> self.gpio.mode(mraa.MODE_PULLUP) <NEW_LINE> self.nombre = nombre <NEW_LINE> self.pin = pin <NEW_LINE> <DEDENT> def leer_estado(self): <NEW_LI...
Clase para crear un boton con pin pullup
625990649c8ee82313040d1d
class InvoiceDetail(LoginRequiredMixin, DetailView): <NEW_LINE> <INDENT> model = Invoice <NEW_LINE> template_name = 'coin/invoice.html' <NEW_LINE> context_object_name = 'invoice_detail' <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return Invoice.objects.filter( Q(invoiced_to=self.request.user) | Q(issuer=self...
Returns details of given invoice.
62599064379a373c97d9a748
class IntegrateAndFire(): <NEW_LINE> <INDENT> _R_M = 50e6 <NEW_LINE> _C_M = 200e-12 <NEW_LINE> _V_E = -70e-3 <NEW_LINE> _V_TH = -40e-3 <NEW_LINE> _V_RESET = -80e-3 <NEW_LINE> _T_TOT = 1e-1/3 <NEW_LINE> _DELTA_T = 10e-6 <NEW_LINE> _T_REF = 3e-3 <NEW_LINE> t = np.arange(0.0, _T_TOT, _DELTA_T) <NEW_LINE> _I_m = None <NEW_...
Standard Integrate-and-Fire Model
625990647d43ff2487427fa5
class HostCertWindow(TitledPage): <NEW_LINE> <INDENT> def __init__(self, parent, title): <NEW_LINE> <INDENT> TitledPage.__init__(self, parent, title) <NEW_LINE> self.emailId = wx.NewId() <NEW_LINE> self.hostId = wx.NewId() <NEW_LINE> self.text = wx.StaticText(self, -1, "The e-mail address will be used for verification,...
Includes information for requesting a host certificate.
6259906445492302aabfdc06
class Operations(object): <NEW_LINE> <INDENT> models = models <NEW_LINE> def __init__(self, client, config, serializer, deserializer): <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._serialize = serializer <NEW_LINE> self._deserialize = deserializer <NEW_LINE> self.api_version = "2017-09-01-preview" <NEW_LIN...
Operations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. :ivar api_version: The API version. Constant value: "2017-09-01-preview".
6259906416aa5153ce401c07
class LazyLoaderVirtualEnabledTest(TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.opts = salt.config.minion_config(None) <NEW_LINE> cls.opts['disable_modules'] = ['pillar'] <NEW_LINE> cls.opts['grains'] = grains(cls.opts) <NEW_LINE> <DEDENT> def setUp(self): <NEW_LIN...
Test the base loader of salt.
625990645166f23b2e244afb
class UpdateEvent(Model): <NEW_LINE> <INDENT> def __init__(self, event_type=None, event_content=None): <NEW_LINE> <INDENT> self.swagger_types = { 'event_type': str, 'event_content': object } <NEW_LINE> self.attribute_map = { 'event_type': 'event_type', 'event_content': 'event_content' } <NEW_LINE> self._event_type = ev...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
625990648e7ae83300eea7b8
class AddField(FieldOperation): <NEW_LINE> <INDENT> def __init__(self, model_name, name, field, preserve_default=True): <NEW_LINE> <INDENT> self.preserve_default = preserve_default <NEW_LINE> super().__init__(model_name, name, field) <NEW_LINE> <DEDENT> def deconstruct(self): <NEW_LINE> <INDENT> kwargs = { 'model_name'...
Add a field to a model.
62599064a17c0f6771d5d73b
class settings(ProtectedPage): <NEW_LINE> <INDENT> def GET(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> with open('./data/proto.json', 'r') as f: <NEW_LINE> <INDENT> settings = json.load(f) <NEW_LINE> <DEDENT> <DEDENT> except IOError: <NEW_LINE> <INDENT> settings = {} <NEW_LINE> <DEDENT> return template_render.p...
Load an html page for entering plugin settings.
6259906466673b3332c31b27
class Wikipedia(Engine): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> Engine.__init__(self, **kwargs) <NEW_LINE> <DEDENT> def _search(self, query): <NEW_LINE> <INDENT> if not query.top: <NEW_LINE> <INDENT> raise QueryParamException(self.name, "Total result amount (query.top) not specified") <NE...
Wikipedia search engine.
625990645fdd1c0f98e5f6ae
class AircraftSerializer(serializers.HyperlinkedModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Aircraft <NEW_LINE> fields = ('man_type', 'tail_number', 'license_type', 'id', 'photo') <NEW_LINE> <DEDENT> def create(self, validated_data): <NEW_LINE> <INDENT> user = self.context['request'].u...
Serializer to access Aircraft
625990647047854f46340adf
class RedLockFactory(object): <NEW_LINE> <INDENT> def __init__(self, connection_details): <NEW_LINE> <INDENT> self.redis_nodes = [] <NEW_LINE> for conn in connection_details: <NEW_LINE> <INDENT> if isinstance(conn, redis.StrictRedis): <NEW_LINE> <INDENT> node = conn <NEW_LINE> <DEDENT> elif 'url' in conn: <NEW_LINE> <I...
A Factory class that helps reuse multiple Redis connections.
62599064cc0a2c111447c665
class RingSensor(RingEntityMixin, SensorEntity): <NEW_LINE> <INDENT> def __init__(self, config_entry_id, device, sensor_type): <NEW_LINE> <INDENT> super().__init__(config_entry_id, device) <NEW_LINE> self._sensor_type = sensor_type <NEW_LINE> self._extra = None <NEW_LINE> self._icon = f"mdi:{SENSOR_TYPES.get(sensor_typ...
A sensor implementation for Ring device.
625990642c8b7c6e89bd4f1b
class AggregateSavingRule(HARKobject): <NEW_LINE> <INDENT> def __init__(self,intercept,slope): <NEW_LINE> <INDENT> self.intercept = intercept <NEW_LINE> self.slope = slope <NEW_LINE> self.distance_criteria = ['slope','intercept'] <NEW_LINE> <DEDENT> def __call__(self,Mnow): <NEW_LINE> <INDENT> Aagg ...
A class to represent agent beliefs about aggregate saving at the end of this period (AaggNow) as a function of (normalized) aggregate market resources at the beginning of the period (MaggNow).
62599064f548e778e596ccb5
class Memory(ProcfsMetric): <NEW_LINE> <INDENT> TOTAL, FREE, _AVAIL, _BUFFERS, CACHED = xrange(5) <NEW_LINE> NAME_FIELD, VALUE_FIELD, UNITS_FIELD = xrange(3) <NEW_LINE> TOTAL_FIELD_NAME = 'MemTotal:' <NEW_LINE> FREE_FIELD_NAME = 'MemFree:' <NEW_LINE> CACHED_FIELD_NAME = 'Cached:' <NEW_LINE> SUFFIX = 'kB' <NEW_LINE> Mem...
Memory metrics from /proc/memifo.
625990648da39b475be04915
class VarLibCFFDictMergeError(VarLibMergeError): <NEW_LINE> <INDENT> def __init__(self, key, value, values): <NEW_LINE> <INDENT> error_msg = ( f"For the Private Dict key '{key}', the default font value list:" f"\n\t{value}\nhad a different number of values than a region font:" ) <NEW_LINE> for region_value in values: <...
Raised when a CFF PrivateDict cannot be merged.
62599064097d151d1a2c2797
class VirtualEnvironment(object): <NEW_LINE> <INDENT> def __init__(self, location, *args, **kwargs): <NEW_LINE> <INDENT> self.location = Path(location) <NEW_LINE> self.pip_source_dir = kwargs.pop("pip_source_dir") <NEW_LINE> self._system_site_packages = kwargs.pop("system_site_packages", False) <NEW_LINE> home, lib, in...
An abstraction around virtual environments, currently it only uses virtualenv but in the future it could use pyvenv.
625990643539df3088ecd9c9
class ROUGEScorer(Scorer): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ROUGEScorer, self).__init__("ROUGE") <NEW_LINE> <DEDENT> def summarize(self, writer, step, score): <NEW_LINE> <INDENT> self._summarize_value(writer, step, "external_evaluation/ROUGE-1", score["rouge-1"]) <NEW_LINE> self._summar...
ROUGE scorer based on https://github.com/pltrdy/rouge.
625990643539df3088ecd9ca
class GaussianNoise(Operation): <NEW_LINE> <INDENT> def __init__(self, probability, mean, std): <NEW_LINE> <INDENT> Operation.__init__(self, probability) <NEW_LINE> self.mean = mean <NEW_LINE> self.std = std <NEW_LINE> <DEDENT> def perform_operation(self, image): <NEW_LINE> <INDENT> w, h = image.size <NEW_LINE> c = len...
The class `:class noise` is used to perfrom random noise on images passed to its :func:`perform_operation` function.
62599064435de62698e9d535
class BaseStudentEngagementTaskMapTest(InitializeOpaqueKeysMixin, MapperTestMixin, TestCase): <NEW_LINE> <INDENT> DEFAULT_USER_ID = 10 <NEW_LINE> DEFAULT_TIMESTAMP = "2013-12-17T15:38:32.805444" <NEW_LINE> DEFAULT_DATE = "2013-12-17" <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(BaseStudentEngagementTaskMapTest...
Base class for test analysis of detailed student engagement
6259906492d797404e3896f3