code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class FileStorage(object): <NEW_LINE> <INDENT> __file_path = "file.json" <NEW_LINE> __objects = {} <NEW_LINE> def all(self): <NEW_LINE> <INDENT> return self.__objects <NEW_LINE> <DEDENT> def new(self, obj): <NEW_LINE> <INDENT> self.__objects["{}.{}".format(obj.__class__.__name__, obj.id)] = obj <NEW_LINE> <DEDENT> def ...
serializes instances to a JSON file and deserializes JSON file to instances Attributes: __file_path (str): path to the JSON file __objects (dict): empty but will store all objects by <class name>.id (ex: to store a BaseModel object with id=12121212, the key will ...
62599022507cdc57c63a5c78
class OUStrategy(ExplorationStrategy): <NEW_LINE> <INDENT> def __init__(self, env_spec, mu=0, sigma=0.3, theta=0.15, dt=1e-2, x0=None): <NEW_LINE> <INDENT> self.env_spec = env_spec <NEW_LINE> self.action_space = env_spec.action_space <NEW_LINE> self.action_dim = self.action_space.flat_dim <NEW_LINE> self.mu = mu <NEW_L...
An OU exploration strategy to add noise to environment actions. Example: $ python garage/tf/exploration_strategies/ou_strategy.py
62599022be8e80087fbbff4a
class InputList(object): <NEW_LINE> <INDENT> input_list = None <NEW_LINE> name = None <NEW_LINE> def __init__(self, inputs): <NEW_LINE> <INDENT> self.input_list = inputs <NEW_LINE> <DEDENT> def __getitem__(self, name): <NEW_LINE> <INDENT> if isinstance(name, str): <NEW_LINE> <INDENT> for input_ in self.input_list: <NEW...
Convenience class for querying inputs. This class holds a list of input-tensors (e.g. as created by inputlayer) and provides simple access methods to obtain a certain layer by name.
625990228c3a8732951f742b
class CircularQueue: <NEW_LINE> <INDENT> class _Node: <NEW_LINE> <INDENT> __slots__ = '_element', '_next' <NEW_LINE> def __init__(self, element, next): <NEW_LINE> <INDENT> self._element = element <NEW_LINE> self._next = next <NEW_LINE> <DEDENT> <DEDENT> def __init__(self): <NEW_LINE> <INDENT> self._tail = None <NEW_LIN...
Queue implementation using circularly linked list for storage.
6259902230c21e258be996e9
class Alien(Sprite): <NEW_LINE> <INDENT> def __init__(self,ai_setting,screen): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.screen = screen <NEW_LINE> self.ai_setting = ai_setting <NEW_LINE> self.image = pygame.image.load('images/alien.bmp') <NEW_LINE> self.rect = self.image.get_rect() <NEW_LINE> self.rect.x ...
表示单个外星人的类
6259902291af0d3eaad3acfa
class PeopleImage(models.Model): <NEW_LINE> <INDENT> url = models.URLField(unique=True, max_length=400) <NEW_LINE> title = models.TextField(max_length=500) <NEW_LINE> category = models.ForeignKey( Category, on_delete=models.SET_NULL, null=True, blank=True ) <NEW_LINE> page = models.CharField(max_length=60) <NEW_LINE> s...
이미지.
62599022287bf620b6272ac2
class DisplayNameFilter(object): <NEW_LINE> <INDENT> def filter(self, record): <NEW_LINE> <INDENT> record.display_name = record.name <NEW_LINE> return True
A logging filter that sets display_name.
625990229b70327d1c57fc56
class VariableWindowIndexer(WindowIndexer): <NEW_LINE> <INDENT> def build(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def __new__(*args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DED...
create a variable length window indexer object that has start & end, that point to offsets in the index object; these are defined based on the win arguments Parameters ---------- input: ndarray input data array win: int64_t window size minp: int64_t min number of...
625990221d351010ab8f49eb
class User(Resource): <NEW_LINE> <INDENT> schema = UserSchema() <NEW_LINE> @staticmethod <NEW_LINE> def post(): <NEW_LINE> <INDENT> data = request.get_json() <NEW_LINE> try: <NEW_LINE> <INDENT> User.schema.load(data) <NEW_LINE> <DEDENT> except ValidationError as err: <NEW_LINE> <INDENT> raise BadRequest(err.messages) <...
User Resource
62599022d18da76e235b78b8
class AnkIncorrectFileFormat(AutoNetkitException): <NEW_LINE> <INDENT> pass
Wrong file format
62599022bf627c535bcb238b
class Batch: <NEW_LINE> <INDENT> def __init__(self, torch_batch, pad_index, use_cuda=False): <NEW_LINE> <INDENT> self.src, self.src_lengths = torch_batch.src <NEW_LINE> self.src_mask = (self.src != pad_index).unsqueeze(1) <NEW_LINE> self.nseqs = self.src.size(0) <NEW_LINE> self.trg_input = None <NEW_LINE> self.trg = No...
Object for holding a batch of data with mask during training. Input is a batch from a torch text iterator.
625990225166f23b2e2442ab
class UpPolicy(AbstractFileSyncPolicy): <NEW_LINE> <INDENT> def _make_transfer_action(self): <NEW_LINE> <INDENT> return B2UploadAction( self._source_folder.make_full_path(self._source_file.name), self._source_file.name, self._dest_folder.make_full_path(self._source_file.name), self._get_source_mod_time(), self._source_...
file is synced up (from disk the cloud)
62599022a8ecb033258720f6
class Url(BaseColumnsMixin, db.Model): <NEW_LINE> <INDENT> url = db.Column(db.String(512), unique=True) <NEW_LINE> site_id = db.Column(db.Integer, db.ForeignKey('site.id')) <NEW_LINE> site = db.relationship('Site', backref=db.backref('urls'))
A url.
62599022507cdc57c63a5c7c
class FunctionDefinition(RestrictedDefinition): <NEW_LINE> <INDENT> def __init__(self, moduleName, defName, linkedType, returnTypes, handler=None, constraints=None, forward=True): <NEW_LINE> <INDENT> RestrictedDefinition.__init__(self, moduleName, defName, "deffunction", linkedType) <NEW_LINE> self._handler = handler <...
Describe a Function Definition
625990228c3a8732951f742e
class CourseWikiSubviewPage(CoursePage): <NEW_LINE> <INDENT> def __init__(self, browser, course_id, course_info): <NEW_LINE> <INDENT> super(CourseWikiSubviewPage, self).__init__(browser, course_id) <NEW_LINE> self.course_id = course_id <NEW_LINE> self.course_info = course_info <NEW_LINE> self.article_name = "{org}.{cou...
Abstract base page for subviews within the wiki.
62599022be8e80087fbbff4e
class Test_switch: <NEW_LINE> <INDENT> def test_list_switches(self): <NEW_LINE> <INDENT> assert C.switch.list() == [ u'brocade-01', u'dell-01', u'mock-01', u'nexus-01' ] <NEW_LINE> <DEDENT> def test_show_switch(self): <NEW_LINE> <INDENT> assert C.switch.show('dell-01') == { u'name': u'dell-01', u'ports': [], u'capabili...
Tests switch related client calls.
625990228c3a8732951f742f
class BertEmbedding(TransformerEmbedding): <NEW_LINE> <INDENT> def to_dict(self) -> Dict[str, Any]: <NEW_LINE> <INDENT> info_dic = super(BertEmbedding, self).to_dict() <NEW_LINE> info_dic['config']['model_folder'] = self.model_folder <NEW_LINE> return info_dic <NEW_LINE> <DEDENT> def __init__(self, model_folder: str, *...
BertEmbedding is a simple wrapped class of TransformerEmbedding. If you need load other kind of transformer based language model, please use the TransformerEmbedding.
625990226e29344779b01528
class AdminOrdersView(AdminBaseView): <NEW_LINE> <INDENT> pagination_class = StandardResultsSetPagination <NEW_LINE> @AdminBaseView.permission_required( [AdminBaseView.staff_permissions.ADMIN_ORDER] ) <NEW_LINE> @use_args( { "order_types": StrToList( required=False, missing=[OrderType.NORMAL, OrderType.GROUPON], valida...
后台-订单-获取订单列表
6259902226238365f5fada2a
class ViewAvailablityPlayer(tk.Frame,ViewAvailablity): <NEW_LINE> <INDENT> def __init__(self, parent, controller): <NEW_LINE> <INDENT> tk.Frame.__init__(self, parent) <NEW_LINE> self.controller = controller <NEW_LINE> """ Widget Declearations """ <NEW_LINE> """ Widget Stylings """ <NEW_LINE> """ Widget Positions """
Methods: __init__ Variables: controller
62599023a8ecb033258720f8
class TableStats(GenericStruct): <NEW_LINE> <INDENT> table_id = UBInt8() <NEW_LINE> pad = Pad(3) <NEW_LINE> active_count = UBInt32() <NEW_LINE> lookup_count = UBInt64() <NEW_LINE> matched_count = UBInt64() <NEW_LINE> def __init__(self, table_id=None, name=None, max_entries=None, active_count=None, lookup_count=None, ma...
Body of reply to OFPST_TABLE request.
625990238c3a8732951f7431
class Send: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def move(motorID, speed, commandID=1): <NEW_LINE> <INDENT> output = struct.pack('<h', commandID) <NEW_LINE> output += struct.pack('<h', motorID) <NEW_LINE> output += struct.pack('<h', speed) <NEW_LINE> return output <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> de...
Commands to be used when sending.
62599023a4f1c619b294f4cd
class ShowObjects(object): <NEW_LINE> <INDENT> __slots__ = ( '_show', ) <NEW_LINE> @property <NEW_LINE> def show(self): <NEW_LINE> <INDENT> return self._show <NEW_LINE> <DEDENT> @show.setter <NEW_LINE> def show(self, value): <NEW_LINE> <INDENT> self._show = msgbuffers.validate_integer( 'ShowObjects.show', value, -128, ...
Generated message-passing message.
62599023d164cc6175821e50
class CertificateSearch(): <NEW_LINE> <INDENT> def __init__(self, site='crt.sh'): <NEW_LINE> <INDENT> if site not in SUPPORTED_SITES: <NEW_LINE> <INDENT> msg = '{} is not supported. Valid sites are {}'.format(site, SUPPORTED_SITES) <NEW_LINE> raise NotImplementedError(msg) <NEW_LINE> <DEDENT> self.site = site <NEW_LINE...
This class is a wrapper that queries issued HTTPS certificates of domains from various sources. It currently supports only crt.sh.
62599023d18da76e235b78ba
class VpnClientConfiguration(Model): <NEW_LINE> <INDENT> _attribute_map = { 'vpn_client_address_pool': {'key': 'vpnClientAddressPool', 'type': 'AddressSpace'}, 'vpn_client_root_certificates': {'key': 'vpnClientRootCertificates', 'type': '[VpnClientRootCertificate]'}, 'vpn_client_revoked_certificates': {'key': 'vpnClien...
VpnClientConfiguration for P2S client. :param vpn_client_address_pool: Gets or sets the reference of the Address space resource which represents Address space for P2S VpnClient. :type vpn_client_address_pool: ~azure.mgmt.network.v2015_06_15.models.AddressSpace :param vpn_client_root_certificates: VpnClientRootCertif...
62599023287bf620b6272ac8
class RCEInternalProtocol(Int32StringReceiver, _Protocol): <NEW_LINE> <INDENT> MAX_LENGTH = 1000000 <NEW_LINE> _MSG_ID_STRUCT = struct.Struct('!B') <NEW_LINE> _TRUE = struct.pack('!?', True) <NEW_LINE> _FALSE = struct.pack('!?', False) <NEW_LINE> def __init__(self, endpoint): <NEW_LINE> <INDENT> _Protocol.__init__(self...
Protocol which is used to connect Endpoints such that Interfaces in different Endpoint are able to communicate.
625990238c3a8732951f7432
class SchulzeVote(object): <NEW_LINE> <INDENT> def __init__(self, ranking, weight=1): <NEW_LINE> <INDENT> self.ranking = ranking <NEW_LINE> self.weight = weight
Class for a Schulze voting. It contains the weight of a voter (default 1) and the ranking. That is if there are n options to vote for for each option it contains the ranking position. Attributes: ranking (list of int): For each option the position in the ranking. weight (int): Weight of the voter (how many vo...
62599023a8ecb033258720fa
class ApiKeyTestCase(WorkoutManagerTestCase): <NEW_LINE> <INDENT> def test_api_key_page_shows_user_has_no_access(self): <NEW_LINE> <INDENT> self.user_login('test') <NEW_LINE> response = self.client.get(reverse('core:user:api-key')) <NEW_LINE> self.assertEqual(response.status_code, 200) <NEW_LINE> self.assertContains( r...
Tests if user has access
62599023a4f1c619b294f4cf
class StrandTest(ColorCycle): <NEW_LINE> <INDENT> def init_parameters(self): <NEW_LINE> <INDENT> super().init_parameters() <NEW_LINE> self.set_parameter('num_steps_per_cycle', self.strip.num_leds) <NEW_LINE> <DEDENT> def before_start(self): <NEW_LINE> <INDENT> self.color = 0x000000 <NEW_LINE> <DEDENT> def update(self, ...
Displays a classical LED test No parameters necessary
625990235e10d32532ce4072
class _MSRIDataSegment(_ExtractedDataSegment): <NEW_LINE> <INDENT> @deprecated_keywords({"loglevel": None}) <NEW_LINE> def __init__(self, msri, sample_rate, start_time, end_time, src_name, loglevel=None): <NEW_LINE> <INDENT> self.msri = msri <NEW_LINE> self.sample_rate = sample_rate <NEW_LINE> self.start_time = start_t...
Segment of data from a _MSRIterator
6259902391af0d3eaad3ad02
class EncoderCNNSmall(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_dim, hidden_dim, num_objects, act_fn='sigmoid', act_fn_hid='relu'): <NEW_LINE> <INDENT> super(EncoderCNNSmall, self).__init__() <NEW_LINE> self.cnn1 = nn.Conv2d( input_dim, hidden_dim, (10, 10), stride=10) <NEW_LINE> self.cnn2 = nn.Conv2d(hi...
CNN encoder, maps observation to obj-specific feature maps.
6259902356b00c62f0fb379d
class PythonRunner: <NEW_LINE> <INDENT> def __init__(self, bodyLines, functionStartAndStop=None, parameters=[]): <NEW_LINE> <INDENT> self.bodyLines = bodyLines <NEW_LINE> self.functionCoordinates = functionStartAndStop <NEW_LINE> functionLines = bodyLines <NEW_LINE> if functionStartAndStop is not None: <NEW_LINE> <INDE...
Represents a runner of a Python class
62599023be8e80087fbbff54
class IPsecSiteConnection(model_base.BASEV2, model_base.HasId, model_base.HasProject): <NEW_LINE> <INDENT> __tablename__ = 'ipsec_site_connections' <NEW_LINE> name = sa.Column(sa.String(db_const.NAME_FIELD_SIZE)) <NEW_LINE> description = sa.Column(sa.String(db_const.DESCRIPTION_FIELD_SIZE)) <NEW_LINE> peer_address = sa...
Represents a IPsecSiteConnection Object.
62599023796e427e5384f65b
class GEEnvironmentModel(Model): <NEW_LINE> <INDENT> def __init__(self, N, width, height, grid=10, seed=None): <NEW_LINE> <INDENT> if seed is None: <NEW_LINE> <INDENT> super(GEEnvironmentModel, self).__init__(seed=None) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> super(GEEnvironmentModel, self).__init__(seed) <NEW_LI...
A environemnt to model swarms
6259902326238365f5fada2e
class GELU(torch.autograd.Function): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(GELU, self).__init__() <NEW_LINE> <DEDENT> def forward(self, x): <NEW_LINE> <INDENT> assert x.is_contiguous() <NEW_LINE> self.saved = x.float() <NEW_LINE> output = self.saved.new(*self.saved.shape) <NEW_LINE> n = x.nu...
The Function is forced to work under fp32
62599023c432627299fa3ed0
class SluggedManager(Manager): <NEW_LINE> <INDENT> def get_by_natural_key(self, slug): <NEW_LINE> <INDENT> return self.get(slug=slug) <NEW_LINE> <DEDENT> def get_by_slug(self, slug, pk=None): <NEW_LINE> <INDENT> if 'slugs' in apps: <NEW_LINE> <INDENT> qs = self.get_queryset() <NEW_LINE> qs = qs.order_by('-slug_history_...
Provides access to items using their natural key: the ``slug`` field.
62599023925a0f43d25e8f24
class Solution(object): <NEW_LINE> <INDENT> def groupAnagrams(self, strs: List[str]) -> List[List[str]]: <NEW_LINE> <INDENT> ma = {} <NEW_LINE> for s in strs: <NEW_LINE> <INDENT> ss = "".join(sorted(s)) <NEW_LINE> if ss in ma: <NEW_LINE> <INDENT> ma[ss].append(s) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> ma[ss] = [...
word字符排序完当做key time: O(klogk * n) space: O(nk)
62599023287bf620b6272acc
class FileNameNormalizer(object): <NEW_LINE> <INDENT> implements(IFileNameNormalizer) <NEW_LINE> def normalize(self, text, locale=None, max_length=MAX_FILENAME_LENGTH): <NEW_LINE> <INDENT> if locale is not None: <NEW_LINE> <INDENT> util = queryUtility(IFileNameNormalizer, name=locale) <NEW_LINE> parts = locale.split('_...
This normalizer can normalize any unicode string and returns a version that only contains of ASCII characters allowed in a file name. Let's make sure that this implementation actually fulfills the API. >>> from zope.interface.verify import verifyClass >>> verifyClass(IFileNameNormalizer, FileNameNormalizer) Tru...
62599023be8e80087fbbff56
class DatastoreNameEnum(Enum): <NEW_LINE> <INDENT> running = 0 <NEW_LINE> startup = 1 <NEW_LINE> operational = 2 <NEW_LINE> @staticmethod <NEW_LINE> def _meta_info(): <NEW_LINE> <INDENT> from ydk.models.cisco_ios_xe._meta import _tailf_confd_monitoring as meta <NEW_LINE> return meta._meta_table['ConfdState.Internal.Dat...
DatastoreNameEnum Name of one of the datastores implemented by CDB. .. data:: running = 0 .. data:: startup = 1 .. data:: operational = 2
6259902356b00c62f0fb379f
class Loss(object): <NEW_LINE> <INDENT> def __init__(self, cfg, tb_writer=None): <NEW_LINE> <INDENT> self.cfg = cfg <NEW_LINE> self.meter_dict = OrderedDict() <NEW_LINE> self.tb_writer = tb_writer <NEW_LINE> <DEDENT> def reset_meters(self): <NEW_LINE> <INDENT> for k, v in self.meter_dict.items(): <NEW_LINE> <INDENT> v....
Base class for calculating loss and managing log.
625990238c3a8732951f7436
class Multimeter(Gpib): <NEW_LINE> <INDENT> def __init__(self, name='hp3478a', pad=23, sad=0, asksleep=0.02): <NEW_LINE> <INDENT> Gpib.__init__(self, name=name, pad=pad, sad=sad) <NEW_LINE> self.asksleep = asksleep <NEW_LINE> <DEDENT> def readuntil(self, term=''): <NEW_LINE> <INDENT> mystr = '' <NEW_LINE> numterms = 0 ...
A Gpib helper class for interfacing with the HP3457A digital multimeter
6259902326238365f5fada30
class PamService(Model): <NEW_LINE> <INDENT> topic = SystemInfoTopic <NEW_LINE> service = fields.String() <NEW_LINE> modules = fields.List(fields.String())
Pam service description This model contains information about pam modules used by specific PAM service/filename
62599023d18da76e235b78bd
class NEP6DiskWallet(Wallet): <NEW_LINE> <INDENT> _default_path = './wallet.json' <NEW_LINE> def __init__(self, path: str, name: Optional[str] = None, version: str = Wallet._wallet_version, scrypt: Optional[ScryptParameters] = None, accounts: List[Account] = None, default_account: Optional[Account] = None, extra: Optio...
A specialised wallet for persisting wallets to media.
6259902391af0d3eaad3ad06
class Quit(flow.SWFlow): <NEW_LINE> <INDENT> def __init__(self, ui_spawner): <NEW_LINE> <INDENT> super().__init__(None, ui_spawner, None) <NEW_LINE> self.register_entry_point(ENTRY_POINT, self.quit) <NEW_LINE> <DEDENT> def quit(self): <NEW_LINE> <INDENT> self.ui_spawner.finish() <NEW_LINE> raise flow.EndFlow()
Game shutdown.
625990235166f23b2e2442b5
class WikiCandidatesSelector: <NEW_LINE> <INDENT> def __init__(self, logger=DEFAULT_LOGGER, separate: bool = True, n: int = 3, **kwargs): <NEW_LINE> <INDENT> self.profiler = kwargs.get('profiler', DEFAULT_MEASURER) <NEW_LINE> self.logger = logger <NEW_LINE> self.tagger = SequenceTagger.load('ner-fast') <NEW_LINE> self....
Class responsible for model of candidates selection from Wikipedia (Model level one) :param logger: logger to use in model :param separate: if make separate queries for each found entity :param n: number of results return after each query
6259902356b00c62f0fb37a1
class TestProjection(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.atol = 1e-12 <NEW_LINE> self.rtol = 1e-12 <NEW_LINE> <DEDENT> def test_inside(self): <NEW_LINE> <INDENT> assert_allclose(projgrad.project(np.array([1.0, 0.0])), np.array([1.0, 0.0]), atol=self.atol, rtol=self.rtol) <N...
Test projection onto probability simplex for simple examples.
625990235166f23b2e2442b7
class AlarmDiginTest(BaseTest): <NEW_LINE> <INDENT> ID = "T2" <NEW_LINE> REQS = ["R1.1"]
Digin alarm temp test
62599023796e427e5384f661
class DummyFile: <NEW_LINE> <INDENT> def __init__(self,data): <NEW_LINE> <INDENT> self.data = data; <NEW_LINE> <DEDENT> def close(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def readlines(self): <NEW_LINE> <INDENT> return self.data.split(u"\n")
wrap a bunch of string data in a file interface
6259902391af0d3eaad3ad0a
class Resnet(BaseModel): <NEW_LINE> <INDENT> def __init__(self, pretrained, num_classes=10): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.resnet = models.resnet18(pretrained) <NEW_LINE> num_ftrs = self.resnet.fc.in_features <NEW_LINE> self.resnet.fc = nn.Linear(num_ftrs, num_classes) <NEW_LINE> <DEDENT> def f...
resnet18
62599023a4f1c619b294f4d8
class GraphVerticalLine(object): <NEW_LINE> <INDENT> pass
Draw a vertical line at time. Its color is composed from three hexadecimal numbers specifying the rgb color components (00 is off, FF is maximum) red, green and blue. Optionally, a legend box and string is printed in the legend section. time may be a number or a variable from a VDEF. It is an error to use vnames from D...
625990239b70327d1c57fc66
class _ForwardHandler(socketserver.BaseRequestHandler): <NEW_LINE> <INDENT> remote_address = None <NEW_LINE> ssh_transport = None <NEW_LINE> logger = None <NEW_LINE> info = None <NEW_LINE> def _redirect(self, chan): <NEW_LINE> <INDENT> while True: <NEW_LINE> <INDENT> rqst, _, _ = select([self.request, chan], [], [], 5)...
Base handler for tunnel connections
625990238c3a8732951f743c
class IncrementalPushTests(AsyncTestCase): <NEW_LINE> <INDENT> def test_less_data(self): <NEW_LINE> <INDENT> pool = build_pool(self) <NEW_LINE> service = service_for_pool(self, pool) <NEW_LINE> volume = service.get(MY_VOLUME) <NEW_LINE> creating = pool.create(volume) <NEW_LINE> def created(filesystem): <NEW_LINE> <INDE...
Tests for incremental push based on ZFS snapshots.
6259902356b00c62f0fb37a5
class ActivitySerializer(BaseSerializer): <NEW_LINE> <INDENT> def dumps(self, activity): <NEW_LINE> <INDENT> self.check_type(activity) <NEW_LINE> activity_time = datetime_to_epoch(activity.time) <NEW_LINE> parts = [activity.actor_id, activity.verb.id, activity.object_id, activity.target_id or 0] <NEW_LINE> extra_contex...
Serializer optimized for taking as little memory as possible to store an Activity Serialization consists of 5 parts - actor_id - verb_id - object_id - target_id - extra_context (pickle) None values are stored as 0
62599023be8e80087fbbff5c
class SchemaCacheBase(SchemaNonCache): <NEW_LINE> <INDENT> pass
Implements methods This is a base class, use either SchemaStrongCache or SchemaWeakCache. DONT USE THIS DIRECTLY.
62599023a8ecb03325872104
class AuctionList: <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> self.auctions = [] <NEW_LINE> self.winning_bids_logs = [] <NEW_LINE> <DEDENT> def compile_winning_bids_info(self) -> None: <NEW_LINE> <INDENT> for auction in self.auctions: <NEW_LINE> <INDENT> if auction.highest_bid is None: <NEW_LIN...
This class is responsible for processing the outcome auctions' bids.
62599023ac7a0e7691f733d0
class BinQuery(abc_resource_queries.BinQuery, osid_queries.OsidCatalogQuery): <NEW_LINE> <INDENT> def __init__(self, runtime): <NEW_LINE> <INDENT> self._runtime = runtime <NEW_LINE> <DEDENT> @utilities.arguments_not_none <NEW_LINE> def match_resource_id(self, resource_id, match): <NEW_LINE> <INDENT> raise errors.Unimpl...
This is the query for searching bins. Each method specifies an ``AND`` term while multiple invocations of the same method produce a nested ``OR``.
62599023bf627c535bcb239b
class JsonConfig: <NEW_LINE> <INDENT> def __init__(self, json_file, schema): <NEW_LINE> <INDENT> self._file = json_file <NEW_LINE> self._schema = schema <NEW_LINE> self._data = {} <NEW_LINE> self.read_data() <NEW_LINE> <DEDENT> def reset_data(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self._data = self._schema...
Hass core object for handle it.
6259902321bff66bcd723b49
class AbstractResponseInterceptor(object): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> @abstractmethod <NEW_LINE> def process(self, handler_input, dispatch_output): <NEW_LINE> <INDENT> raise NotImplementedError
Interceptor that runs after the handler is called. The ``process`` method has to be implemented, to run custom logic on the input and the dispatch output generated after the handler is executed on the input.
62599023d164cc6175821e5d
class SVR_function: <NEW_LINE> <INDENT> def __init__(self, bounds=None,sd=None): <NEW_LINE> <INDENT> self.input_dim = 3 <NEW_LINE> if bounds == None: <NEW_LINE> <INDENT> self.bounds = OrderedDict([('C',(0.1,1000)),('epsilon',(0.000001,1)),('gamma',(0.00001,5))]) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.bound...
SVR_function: function :param sd: standard deviation, to generate noisy evaluations of the function.
6259902330c21e258be996fd
class aeroo_add_print_button(models.TransientModel): <NEW_LINE> <INDENT> _name = 'aeroo.add_print_button' <NEW_LINE> _description = 'Add print button' <NEW_LINE> @api.model <NEW_LINE> def _check(self): <NEW_LINE> <INDENT> irval_mod = self.env.get('ir.values') <NEW_LINE> report = self.env.get(self._context['active_model...
Add Print Button
62599023a8ecb03325872106
class LazySettings(LazyObject): <NEW_LINE> <INDENT> pass
A lazy proxy for either global Django settings or a custom settings object. The user can manually configure settings prior to using them. Otherwise, Django uses the settings module pointed to by DJANGO_SETTINGS_MODULE.
62599023ac7a0e7691f733d2
class Permute(Layer): <NEW_LINE> <INDENT> def __init__(self, dims, **kwargs): <NEW_LINE> <INDENT> super(Permute, self).__init__(**kwargs) <NEW_LINE> self.dims = tuple(dims) <NEW_LINE> <DEDENT> @property <NEW_LINE> def output_shape(self): <NEW_LINE> <INDENT> input_shape = list(self.input_shape) <NEW_LINE> output_shape =...
Permute the dimensions of the input according to a given pattern. Useful for e.g. connecting RNNs and convnets together. # Input shape Arbitrary. Use the keyword argument `input_shape` (tuple of integers, does not include the samples axis) when using this layer as the first layer in a model. # Output sha...
625990236fece00bbaccc8a1
class TestSearchQuestionsViewTemplate(TestCaseWithFactory): <NEW_LINE> <INDENT> layer = DatabaseFunctionalLayer <NEW_LINE> def assertViewTemplate(self, context, file_name): <NEW_LINE> <INDENT> view = create_initialized_view(context, '+questions') <NEW_LINE> self.assertEqual( file_name, os.path.basename(view.template.fi...
Test the behavior of SearchQuestionsView.template
6259902321a7993f00c66e65
class ListSeed(wx.Panel): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> wx.Panel.__init__(self, parent, style = (wx.CLIP_CHILDREN | wx.TAB_TRAVERSAL | wx.FULL_REPAINT_ON_RESIZE)) <NEW_LINE> self.list_ctrl = wx.ListCtrl(self, wx.NewId(), (0,0), (0,0), wx.LC_REPORT) <NEW_LINE> sizer = wx.BoxSizer(wx...
@author rpereira Panel da lista de seed de pacotes
625990238c3a8732951f7440
class Atm(): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> for arg, value in kwargs.items(): <NEW_LINE> <INDENT> setattr(self, arg, value) <NEW_LINE> <DEDENT> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> clean_dict = self.__dict__.copy() <NEW_LINE> return '{0}({1})'.format(self.__class__, cl...
Represents an atm location record with methods for constructing atm location methods instances.
62599023d164cc6175821e5f
class TensorProducts(TensorProductsCategory): <NEW_LINE> <INDENT> @cached_method <NEW_LINE> def extra_super_categories(self): <NEW_LINE> <INDENT> return [self.base_category()]
The category of modules constructed by tensor product of modules.
625990231d351010ab8f4a00
class MaxEnterError(Exception): <NEW_LINE> <INDENT> def __init__(self, ErrorInfo): <NEW_LINE> <INDENT> super().__init__(self) <NEW_LINE> self.errorinfo = ErrorInfo <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.errorinfo
输入关键字最大尝试次数
62599023c432627299fa3edc
@attr.s(frozen=True, slots=True) <NEW_LINE> class CompositionDescription: <NEW_LINE> <INDENT> component: str = attr.ib(validator=instance_of(str)) <NEW_LINE> molar_fraction = attrib_scalar(default=Scalar(0, "mol/mol")) <NEW_LINE> reference_enthalpy = attrib_scalar(default=Scalar(0, "J/mol"))
:ivar component: Name of the component available created on: PvtModelCompositionalDescription.light_components PvtModelCompositionalDescription.heavy_components .. note:: CompositionDescription can only refer to components created from the same PvtModelCompositionalDescription .. include:: /al...
625990236fece00bbaccc8a3
class UnsetRouter(command.Command): <NEW_LINE> <INDENT> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(UnsetRouter, self).get_parser(prog_name) <NEW_LINE> parser.add_argument( '--route', metavar='destination=<subnet>,gateway=<ip-address>', action=parseractions.MultiKeyValueAction, dest='routes', de...
Unset router properties
62599023d164cc6175821e61
class ObjectReplicationPolicy(Resource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'policy_id': {'readonly': True}, 'enabled_time': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', ...
The replication policy between two storage accounts. Multiple rules can be defined in one policy. 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}/pro...
62599023d18da76e235b78c3
class NewsTag(models.Model): <NEW_LINE> <INDENT> label = models.CharField(max_length=100) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.label
Тэг.
625990231d351010ab8f4a02
class print_purchase_report(osv.TransientModel): <NEW_LINE> <INDENT> _name = "print.purchase.report" <NEW_LINE> def __get_company_object(self, cr, uid): <NEW_LINE> <INDENT> user = self.pool.get('res.users').browse(cr, uid, uid) <NEW_LINE> if not user.company_id: <NEW_LINE> <INDENT> raise except_osv(_('ERROR !'), _( 'Th...
OpenERP Wizard : print.purchase.report
62599023ac7a0e7691f733d6
class Ball: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.radius = randint(20, 50) <NEW_LINE> self.x = randint(0 + self.radius, root_width - self.radius) <NEW_LINE> self.y = randint(0 + self.radius, root_height - self.radius) <NEW_LINE> self.dx, self.dy = 2, 2 <NEW_LINE> self.colors = ['yellow', 'gre...
Initiate ball with movement radius - random 20 - 50 x, y - coordinates of ball's centre (random in canvas) dx, dy - move steps colors - list of colors, selected randomly
62599023c432627299fa3ede
class Default(HttpLocust): <NEW_LINE> <INDENT> task_set = DefaultBehavior <NEW_LINE> min_wait = 3000 <NEW_LINE> max_wait = 10000
Default Locust Class
625990238c3a8732951f7444
class SimulationTime(object): <NEW_LINE> <INDENT> def __init__(self, simdata): <NEW_LINE> <INDENT> self.simdata = simdata <NEW_LINE> <DEDENT> def get_total_time(self): <NEW_LINE> <INDENT> period_data = self.simdata.mfdata[ ('tdis', 'perioddata', 'perioddata')].get_data() <NEW_LINE> total_time = 0.0 <NEW_LINE> for perio...
Represents a block in a MF6 input file Parameters ---------- Attributes ---------- Methods ------- See Also -------- Notes ----- Examples --------
62599023d164cc6175821e64
class MainPage(tornado.web.RequestHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> fc = self.application.fig_container <NEW_LINE> figure = self.application.fig_container['fig1'] <NEW_LINE> fc.get_manager('fig2').set_window_title("HEY!!") <NEW_LINE> fc.flush('fig2') <NEW_LINE> loop = tornado.ioloop.IOLoo...
Serves the main HTML page.
62599023c432627299fa3ee0
class Location(ndb.Model): <NEW_LINE> <INDENT> country = ndb.StringProperty(indexed=True) <NEW_LINE> countryCode = ndb.StringProperty(indexed=True) <NEW_LINE> name = ndb.StringProperty(indexed=True) <NEW_LINE> parentid = ndb.IntegerProperty(indexed=True) <NEW_LINE> placeTypeCode = ndb.IntegerProperty(indexed=True) <NEW...
A model for representing locations
6259902321a7993f00c66e6b
class ForestRegressor(six.with_metaclass(ABCMeta, BaseForest, RegressorMixin)): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def __init__(self, base_estimator, n_estimators=10, estimator_params=tuple(), bootstrap=False, oob_score=False, n_jobs=1, random_state=None, verbose=0, warm_start=False): <NEW_LINE> <INDENT> su...
Base class for forest of trees-based regressors. Warning: This class should not be used directly. Use derived classes instead.
62599023d164cc6175821e66
class DataSchemeWennerAlpha(DataSchemeBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> DataSchemeBase.__init__(self) <NEW_LINE> self.name = "Wenner Alpha (C-P-P-C)" <NEW_LINE> self.prefix = "wa" <NEW_LINE> self.type = Pseudotype.WennerAlpha <NEW_LINE> <DEDENT> def createData(self, **kwargs): <NEW_LINE...
Wenner alpha (C--P--P--C) data scheme with equal distances.
62599023a8ecb0332587210e
class DataSourceDetails(Model): <NEW_LINE> <INDENT> _attribute_map = { 'data_source_name': {'key': 'dataSourceName', 'type': 'str'}, 'data_source_url': {'key': 'dataSourceUrl', 'type': 'str'}, 'headers': {'key': 'headers', 'type': '[AuthorizationHeader]'}, 'parameters': {'key': 'parameters', 'type': '{str}'}, 'resource...
DataSourceDetails. :param data_source_name: Gets or sets the data source name. :type data_source_name: str :param data_source_url: Gets or sets the data source url. :type data_source_url: str :param headers: Gets or sets the request headers. :type headers: list of :class:`AuthorizationHeader <service-endpoint.v4_1.mod...
625990231d351010ab8f4a06
class DomainModel(TimestampMixin, Model): <NEW_LINE> <INDENT> __abstract__ = True
Abstract base model class for defining domain models providing a UUID backed primary key field and timestamp fields.
625990233eb6a72ae038b554
class AlphaExample(): <NEW_LINE> <INDENT> def __init__(self, separator=': ', **kwargs): <NEW_LINE> <INDENT> self.target = kwargs <NEW_LINE> self.data = np.array(kwargs['data']) <NEW_LINE> self.difference = krippendorff.Difference(*kwargs['args']) <NEW_LINE> self.separator = separator <NEW_LINE> self.labels = ( 'Data', ...
A class to facilitate printing alpha examples.
62599023a4f1c619b294f4e4
class EndStopCheck(TargetCheck): <NEW_LINE> <INDENT> check_id = "end_stop" <NEW_LINE> name = _("Trailing stop") <NEW_LINE> description = _("Source and translation do not both end with a full stop") <NEW_LINE> severity = "warning" <NEW_LINE> def check_single(self, source, target, unit): <NEW_LINE> <INDENT> if len(source...
Check for final stop.
625990236fece00bbaccc8a9
class RiskModel(object): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> @abstractmethod <NEW_LINE> def __call__(self, dt, weights): <NEW_LINE> <INDENT> raise NotImplementedError( "Should implement __call__()" )
Abstract interface for an RiskModel callable. A derived-class instance of RiskModel takes in an Asset Universe and an optional DataHandler instance in order to modify weights on Assets generated by an AlphaModel. These adjusted weights are used within the PortfolioConstructionModel to generate new target weights for ...
62599023507cdc57c63a5c96
class OhUnknownException(Exception): <NEW_LINE> <INDENT> pass
This exception should be raised when some improper condition has been reached and no further information is available
62599023be8e80087fbbff68
class VectorVelocityDataParticleKey(BaseEnum): <NEW_LINE> <INDENT> ANALOG_INPUT2 = "analog_input_2" <NEW_LINE> COUNT = "ensemble_counter" <NEW_LINE> PRESSURE = "seawater_pressure" <NEW_LINE> ANALOG_INPUT1 = "analog_input_1" <NEW_LINE> VELOCITY_BEAM1 = "turbulent_velocity_east" <NEW_LINE> VELOCITY_BEAM2 = "turbulent_vel...
Velocity Data Paticles
6259902366673b3332c312de
class Deallocate(Statement): <NEW_LINE> <INDENT> match = re.compile(r'deallocate\s*\(.*\)\Z',re.I).match <NEW_LINE> def process_item(self): <NEW_LINE> <INDENT> line = self.item.get_line()[10:].lstrip()[1:-1].strip() <NEW_LINE> self.items = specs_split_comma(line, self.item) <NEW_LINE> return <NEW_LINE> <DEDENT> def tof...
DEALLOCATE ( <allocate-object-list> [ , <dealloc-opt-list> ] ) <allocate-object> = <variable-name> | <structure-component> <structure-component> = <data-ref> <dealloc-opt> = STAT = <stat-variable> | ERRMSG = <errmsg-variable>
625990235e10d32532ce407d
class Test17(unittest.TestCase): <NEW_LINE> <INDENT> def test_cbc_padding_oracle_attack(self) -> None: <NEW_LINE> <INDENT> c = m17.cbc_oracle() <NEW_LINE> m = m17.attack(c) <NEW_LINE> self.assertTrue(m)
The CBC padding oracle
625990231d351010ab8f4a08
class SetPasswordForm(auth_forms.SetPasswordForm): <NEW_LINE> <INDENT> new_password1 = forms.CharField( label=_('New password'), min_length=6, widget=forms.PasswordInput(attrs={'class': 'text'}), error_messages={'required': _('Password required'), 'min_length': _('Password length should be at lease 6 ' 'symbols')}) <NE...
User set password form.
62599023ac7a0e7691f733dc
class AudioMetaData(Mapping): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> self._path = path <NEW_LINE> self._name = path.stem <NEW_LINE> self._extension = path.suffix <NEW_LINE> self._collection = {} <NEW_LINE> try: <NEW_LINE> <INDENT> self._tag = File(path).tags <NEW_LINE> <DEDENT> except Attribu...
Undocumented.
625990238c3a8732951f744a
class TestExpectations(object): <NEW_LINE> <INDENT> def __init__(self, url=DEFAULT_TEST_EXPECTATIONS_LOCATION): <NEW_LINE> <INDENT> self.all_test_expectation_info = {} <NEW_LINE> resp = urllib2.urlopen(url) <NEW_LINE> if resp.code != 200: <NEW_LINE> <INDENT> raise NameError('Test expectation file does not exist in %s' ...
A class to model the content of test expectation file for analysis. This class retrieves the TestExpectations file via HTTP from WebKit and uses the WebKit layout test processor to process each line. The resulting dictionary is stored in |all_test_expectation_info| and looks like: {'<test name>': [{'<modifier0>': ...
625990238c3a8732951f744b
class state(GenericGetSetCommandClass): <NEW_LINE> <INDENT> cmd = 'Input:Pdiode:Filter:Lpass:STATe' <NEW_LINE> full_acces = 'input.pdiode.filter.lpass.state' <NEW_LINE> value = Argument(0, ["OFF", "0", "ON", "1"])
Sets the bandwidth of the photodiode input stage
62599023d18da76e235b78c7
class ConsumptionDataset(UrbansimDataset): <NEW_LINE> <INDENT> id_name_default = ["grid_id","billyear","billmonth"] <NEW_LINE> in_table_name_default = "WCSR_grid" <NEW_LINE> out_table_name_default = "WCSR_grid" <NEW_LINE> entity_name_default = "consumption"
Set of consumption data.
62599023d164cc6175821e6c
class Decoder(nn.Module): <NEW_LINE> <INDENT> def __init__(self, num_ch_enc, num_out_ch, oct_map_size): <NEW_LINE> <INDENT> super(Decoder, self).__init__() <NEW_LINE> self.num_output_channels = num_out_ch <NEW_LINE> self.num_ch_enc = num_ch_enc <NEW_LINE> self.num_ch_dec = np.array([16, 32, 64]) <NEW_LINE> self.oct_map...
Encodes the Image into low-dimensional feature representation Attributes ---------- num_ch_enc : list channels used by the ResNet Encoder at different layers Methods ------- forward(x, ): Processes input image features into output occupancy maps/layouts
625990238c3a8732951f744d
class TestMonthlyTelemetrySchedule(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 testMonthlyTelemetrySchedule(self): <NEW_LINE> <INDENT> pass
MonthlyTelemetrySchedule unit test stubs
625990233eb6a72ae038b55a
class CoberturaPackage(object): <NEW_LINE> <INDENT> def __init__(self, name: str) -> None: <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.classes = {} <NEW_LINE> self.packages = {} <NEW_LINE> self.total_lines = 0 <NEW_LINE> self.covered_lines = 0 <NEW_LINE> <DEDENT> def as_xml(self) -> Any: <NEW_LINE> <INDENT> pa...
Container for XML and statistics mapping python modules to Cobertura package
625990236e29344779b01547
class pyCisCommandError(Exception): <NEW_LINE> <INDENT> pass
Exception class indicating a problem while executing a management command. If this exception is raised during the execution of a management command, it will be caught and turned into a nicely-printed error message to the appropriate output stream (i.e., stderr); as a result, raising this exception (with a sensible des...
62599023be8e80087fbbff6e
class Diagnose: <NEW_LINE> <INDENT> def __init__(self, demo): <NEW_LINE> <INDENT> self.demo = demo <NEW_LINE> <DEDENT> def cover(self, decision, base): <NEW_LINE> <INDENT> if decision[0]: <NEW_LINE> <INDENT> if not self.demo: <NEW_LINE> <INDENT> print('Generating set of possible hypotheses...', end='') <NEW_LINE> <DEDE...
inference layer class responsible for diagnosing why behavior will be abnormal in the future
625990231d351010ab8f4a0d
class LicenseLibpng(LicenseOpen): <NEW_LINE> <INDENT> HIDDEN = False <NEW_LINE> DESCRIPTION = ("Permission is granted to use, copy, modify, and distribute the " "source code, or portions hereof, for any purpose, without fee, subject " "to 3 restrictions; http://libpng.org/pub/png/src/libpng-LICENSE.txt for full license...
The PNG license is derived from the zlib license, http://libpng.org/pub/png/src/libpng-LICENSE.txt
625990231d351010ab8f4a0e
class UnableToAddCommentToWorkflow(WorkflowException): <NEW_LINE> <INDENT> pass
To be raised if the WorkflowActivity is unable to log a comment in the WorkflowHistory
62599023c432627299fa3eea
class GatewayRouteListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[GatewayRoute]'}, } <NEW_LINE> def __init__( self, *, value: Optional[List["GatewayRoute"]] = None, **kwargs ): <NEW_LINE> <INDENT> super(GatewayRouteListResult, self).__init__(**kwargs) <...
List of virtual network gateway routes. :param value: List of gateway routes. :type value: list[~azure.mgmt.network.v2020_07_01.models.GatewayRoute]
62599023287bf620b6272ae6