code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class GPServerCachingDeleteMapCache(CoClass): <NEW_LINE> <INDENT> _reg_clsid_ = GUID('{24620C31-DAB4-403D-8D1B-6B582D938C4A}') <NEW_LINE> _idlflags_ = [] <NEW_LINE> _typelib_path_ = typelib_path <NEW_LINE> _reg_typelib_ = ('{C031A050-82C6-4F8F-8836-5692631CFFE6}', 10, 2)
Delete pre-rendered tile cache for the MapServer.
62598f8121bff66bcd7226ae
class TestConfigurationLoader(TestCase): <NEW_LINE> <INDENT> empty_context = {} <NEW_LINE> qa_context = {"environment": "qa"} <NEW_LINE> resource_dir = os.path.dirname( os.path.realpath('__file__')) + "/resources" <NEW_LINE> def test_loader(self): <NEW_LINE> <INDENT> fetcher_metrics = ConfigurationFetcherMetrics() <NEW...
Unit tests for configuration loader.
62598f8107d97122c42166e8
class _TabsMixin(object): <NEW_LINE> <INDENT> def _tabs(self, string): <NEW_LINE> <INDENT> return string.replace(' ', '\t')
mixin that adds _tabs method to test classes
62598f81a4f1c619b294e031
class FeaturedSpeakerForm(messages.Message): <NEW_LINE> <INDENT> featuredSpeaker = messages.StringField(1) <NEW_LINE> sessions = messages.StringField(2, repeated=True) <NEW_LINE> conference = messages.StringField(3)
FeaturedMessage-- outbound
62598f8191af0d3eaad39846
class String(_LExprNode): <NEW_LINE> <INDENT> def __init__(self, chars): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.chars = chars <NEW_LINE> <DEDENT> def _lvalue(self, il_code, symbol_table, c): <NEW_LINE> <INDENT> il_value = ILValue(ArrayCType(ctypes.char, len(self.chars))) <NEW_LINE> il_code.register_stri...
Expression that is a string. chars (List(int)) - String this expression represents, as a null-terminated list of the ASCII representations of each character.
62598f81d6c5a102081e1b8d
class getRowOrBefore_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT,(TCell, TCell.thrift_spec)), None, ), (1, TType.STRUCT, 'io', (IOError, IOError.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, success=None, io=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> ...
Attributes: - success - io
62598f8166673b3332c2fe0a
class EventStream(Subscribee): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self._observers = {} <NEW_LINE> <DEDENT> def notify(self): <NEW_LINE> <INDENT> for callback in self._observers.values(): <NEW_LINE> <INDENT> callback(self) <NEW_LINE> <DEDENT> <DEDE...
An implementation of `Subscribee` that notifies subscribers when updates occur.
62598f81711fe17d825e012d
class FourroomsCoinRandomNoiseV2(FourroomsCoin): <NEW_LINE> <INDENT> def __init__(self, *args, obs_size=64, **kwargs): <NEW_LINE> <INDENT> super(FourroomsCoinRandomNoiseV2, self).__init__(*args, **kwargs) <NEW_LINE> self.obs_size = obs_size <NEW_LINE> self.obs_height = obs_size <NEW_LINE> self.obs_width = obs_size <NEW...
FourroomsCoin Game with a kid randomly appears.
62598f81a79ad16197769aa5
class SquareFindStorePage(SuperPage): <NEW_LINE> <INDENT> def __init__(self, testcase, driver, logger): <NEW_LINE> <INDENT> super(SquareFindStorePage, self).__init__(testcase, driver, logger) <NEW_LINE> <DEDENT> def validSelf(self): <NEW_LINE> <INDENT> logger.info("Check 找店页面 begin") <NEW_LINE> API().assertElementByTex...
作者 刘涛 首页=>广场=>找店
62598f8130dc7b766599f29e
class MyHTTPRedirectHandler(mechanize.HTTPRedirectHandler): <NEW_LINE> <INDENT> def redirect_request(self, req, fp, code, msg, headers, newurl): <NEW_LINE> <INDENT> urls_redirected_to.append(newurl) <NEW_LINE> return mechanize.HTTPRedirectHandler.redirect_request( self, req, fp, code, msg, headers, newurl)
Custom HTTPRedirectHandler which stores the URLs redirected to.
62598f816fece00bbaccb3cd
class Brain(object): <NEW_LINE> <INDENT> def __init__(self, genome=None): <NEW_LINE> <INDENT> self.fitness = 0.0 <NEW_LINE> self.chance = 0.0 <NEW_LINE> if not genome: self.genome = [random.uniform(-1, 1) for i in xrange(TOTAL_VALUES)] <NEW_LINE> else: self.genome = genome <NEW_LINE> <DEDENT> def __str__(self): <NEW_LI...
An object that holds both all necessary values, plus a fitness level, and chance value used for genetic algorithms.
62598f811f037a2d8b9e3b2e
class IGCloaderDialogTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.dialog = IGCloaderDialog(None) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self.dialog = None <NEW_LINE> <DEDENT> def test_dialog_ok(self): <NEW_LINE> <INDENT> button = self.dialog.button_box.butt...
Test dialog works.
62598f81d99f1b3c44d050f3
class MarketSchema(ResultSchema): <NEW_LINE> <INDENT> exch_id = f.Int(required=True) <NEW_LINE> exch_name = f.Str(required=True) <NEW_LINE> exch_code = f.Str(required=True) <NEW_LINE> mkt_id = f.Int(required=True) <NEW_LINE> mkt_name = f.Str(required=True) <NEW_LINE> exchmkt_id = f.Int(required=True)
A currency trade pair
62598f816aa9bd52df0d4921
class BaseNotifier(WithSettings): <NEW_LINE> <INDENT> config_entry_name: str = 'notifiers' <NEW_LINE> def __init_subclass__(cls, **kwargs): <NEW_LINE> <INDENT> if cls.alias: <NEW_LINE> <INDENT> NotifierClassesRegistry.add(cls) <NEW_LINE> <DEDENT> <DEDENT> def register(self): <NEW_LINE> <INDENT> NotifierObjectsRegistry....
Base Notifier class. All Notifier classes should inherit from this.
62598f81d10714528d69d916
class DescribeKeyResponse(object): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.key_metadata = None <NEW_LINE> self.request_id = "" <NEW_LINE> self.parse(value) <NEW_LINE> <DEDENT> def parse(self, value): <NEW_LINE> <INDENT> response = json.loads(value) <NEW_LINE> if "KeyMetadata" in response...
获取指定密钥相关信息返回值类
62598f817c178a314d78cef1
@dataclass <NEW_LINE> class PandemicSimConfig: <NEW_LINE> <INDENT> num_persons: int = 1000 <NEW_LINE> location_configs: Sequence[LocationConfig] = () <NEW_LINE> regulation_compliance_prob: float = 0.99 <NEW_LINE> max_hospital_capacity: int = field(init=False, default=-1) <NEW_LINE> person_routine_assignment: Optional[P...
Config for setting up the simulator
62598f81d53ae8145f917ed4
class NumpyEncoder(json.JSONEncoder): <NEW_LINE> <INDENT> def default(self, obj): <NEW_LINE> <INDENT> if isinstance(obj, np.ndarray): <NEW_LINE> <INDENT> return obj.tolist() <NEW_LINE> <DEDENT> elif isinstance(obj, np.int64): <NEW_LINE> <INDENT> return int(obj) <NEW_LINE> <DEDENT> elif isinstance(obj, np.float64): <NEW...
Helper class for json.dumps to coerce numpy objects to native python
62598f8107d97122c42166ea
class Combinable(Protocol[TContra, TCo]): <NEW_LINE> <INDENT> def __add__(self, other: TContra) -> TCo: <NEW_LINE> <INDENT> ... <NEW_LINE> <DEDENT> def __sub__(self, other: TContra) -> TCo: <NEW_LINE> <INDENT> ...
A protocol that provides addition and subtraction special methods
62598f8191af0d3eaad39848
class Error(Exception): <NEW_LINE> <INDENT> pass
General error used for all naclports-specific errors.
62598f81bde94217f3707389
class Section(object): <NEW_LINE> <INDENT> def __init__(self, header, name, stream): <NEW_LINE> <INDENT> self.header = header <NEW_LINE> self.name = name <NEW_LINE> self.stream = stream <NEW_LINE> <DEDENT> def data(self): <NEW_LINE> <INDENT> self.stream.seek(self['sh_offset']) <NEW_LINE> return self.stream.read(self['s...
Base class for ELF sections. Also used for all sections types that have no special functionality. Allows dictionary-like access to the section header. For example: > sec = Section(...) > sec['sh_type'] # section type
62598f8115fb5d323ce7e771
class SearchProblem: <NEW_LINE> <INDENT> def getStartState(self): <NEW_LINE> <INDENT> util.raiseNotDefined() <NEW_LINE> <DEDENT> def isGoalState(self, state): <NEW_LINE> <INDENT> util.raiseNotDefined() <NEW_LINE> <DEDENT> def getSuccessors(self, state): <NEW_LINE> <INDENT> util.raiseNotDefined() <NEW_LINE> <DEDENT> def...
This class outlines the structure of a search problem, but doesn't implement any of the methods (in object-oriented terminology: an abstract class). You do not need to change anything in this class, ever.
62598f81711fe17d825e012f
class HdfPartition(PartitionBase): <NEW_LINE> <INDENT> _id_class = HdfPartitionIdentity <NEW_LINE> _db_class = _hdf_db_class <NEW_LINE> def __init__(self, bundle, record, **kwargs): <NEW_LINE> <INDENT> super(HdfPartition, self).__init__(bundle, record) <NEW_LINE> <DEDENT> @property <NEW_LINE> def database(self): <NEW_L...
A Partition that hosts a Spatialite for geographic data
62598f81f8510a7c17d7de9b
class EnvConfig(object): <NEW_LINE> <INDENT> def __init__(self, app=None, prefix=DEFAULT_ENV_PREFIX): <NEW_LINE> <INDENT> self.app = app <NEW_LINE> if app is not None: <NEW_LINE> <INDENT> self.init_app(app, prefix) <NEW_LINE> <DEDENT> <DEDENT> def init_app(self, app, prefix=DEFAULT_ENV_PREFIX): <NEW_LINE> <INDENT> for ...
Configure Flask from environment variables.
62598f8191af0d3eaad39849
class Bracket(Base): <NEW_LINE> <INDENT> def calculate_step(self): <NEW_LINE> <INDENT> x, f, gtg, gtp, step_count, update_count = self.search_history() <NEW_LINE> if step_count==0 and update_count==0: <NEW_LINE> <INDENT> alpha = gtg[-1]**-1 <NEW_LINE> status = 0 <NEW_LINE> <DEDENT> elif step_count==0: <NEW_LINE> <INDEN...
Implements bracketing line search Variables x - list of step lenths from current line search f - correpsonding list of function values gtg - dot product of gradient with itself gtp - dot product of gradient and search direction Status codes status > 0 : finished status == ...
62598f81ec188e330fdf82e6
class Incomplete(Exception): <NEW_LINE> <INDENT> pass
Indicates the data given was incomplete.
62598f81b830903b9686e195
class Sprite(pygame.surface.Surface): <NEW_LINE> <INDENT> def __init__(self, images, **tags): <NEW_LINE> <INDENT> self.images = dict(images) <NEW_LINE> self.state = self.images.keys()[0] <NEW_LINE> self.is_alive = True <NEW_LINE> self.tags = tags <NEW_LINE> super(Sprite, self).__init__(self.images.values()[0].get_size(...
Docstring missing...
62598f8123e79379d538bf41
class Router(NetworkNotificationBase): <NEW_LINE> <INDENT> metadata_keys = [ "status", "external_gateway_info", "admin_state_up", "name", ] <NEW_LINE> resource_name = 'router'
Listen for Quantum notifications in order to mediate with the metering framework.
62598f8171ff763f4b5e71b5
class WebLinkbackWebPagesAvailabilityTest(InvenioTestCase): <NEW_LINE> <INDENT> def test_linkback_pages_availability(self): <NEW_LINE> <INDENT> error_messages = [] <NEW_LINE> baseurl = cfg['CFG_SITE_SECURE_URL'] + '/%s/10/linkbacks/' % cfg['CFG_SITE_RECORD'] <NEW_LINE> _exports = ['', 'display', 'index', 'approve', 're...
Test WebLinkback web pages whether they are up or not
62598f8110dbd63aa1c705fa
class DatetimeRange: <NEW_LINE> <INDENT> def __init__(self, low, high): <NEW_LINE> <INDENT> self.low = low <NEW_LINE> self.high = high <NEW_LINE> <DEDENT> def __contains__(self, dt): <NEW_LINE> <INDENT> return self.low <= dt < self.high
Класс для реализации определения принадлежности времени к определённому диапазону.
62598f814e696a045264db25
@dataclass <NEW_LINE> class SenderEvent(Event): <NEW_LINE> <INDENT> dsn: int = None <NEW_LINE> size: int = None <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> res = super().__str__() <NEW_LINE> res += " dsn={s.dsn} size={s.size}".format(s=self) <NEW_LINE> return res
dsn in bytes
62598f81e76e3b2f99fd847d
class DashExtension(Extension): <NEW_LINE> <INDENT> def extendMarkdown(self, md, md_globals): <NEW_LINE> <INDENT> md.inlinePatterns.add('hr', SimpleTagPattern(DASH_RE, 'hr'), '<not_strong')
Adds cite extension to Markdown class
62598f8121a7993f00c659ba
class APIRequestException(Exception): <NEW_LINE> <INDENT> def __init__(self, expression, response): <NEW_LINE> <INDENT> super().__init__(expression) <NEW_LINE> self.response = response
An adapter encountered an error while calling a remote API. The response field contains the Response object from the requests library
62598f81d53ae8145f917ed6
class TestMiMeutil (unittest.TestCase): <NEW_LINE> <INDENT> def mime_test (self, filename, mime_expected): <NEW_LINE> <INDENT> absfilename = get_file(filename) <NEW_LINE> with open(absfilename) as fd: <NEW_LINE> <INDENT> mime = linkcheck.mimeutil.guess_mimetype(absfilename, read=fd.read) <NEW_LINE> <DEDENT> self.assert...
Test file utility functions.
62598f8150485f2cf55da9bb
class MC_Dropout(Layer): <NEW_LINE> <INDENT> def __init__(self, rate, noise_shape=None, seed=None, **kwargs): <NEW_LINE> <INDENT> super(MC_Dropout, self).__init__(**kwargs) <NEW_LINE> self.rate = min(1., max(0., rate)) <NEW_LINE> self.noise_shape = noise_shape <NEW_LINE> self.seed = seed <NEW_LINE> self.supports_maskin...
Applies Monte Carlo Dropout at prediction
62598f8123849d37ff850b06
@sla.configure(name="outliers") <NEW_LINE> class Outliers(sla.SLA): <NEW_LINE> <INDENT> CONFIG_SCHEMA = { "type": "object", "$schema": consts.JSON_SCHEMA, "properties": { "max": {"type": "integer", "minimum": 0}, "min_iterations": {"type": "integer", "minimum": 3}, "sigmas": {"type": "number", "minimum": 0.0, "exclusiv...
Limit the number of outliers (iterations that take too much time). The outliers are detected automatically using the computation of the mean and standard deviation (std) of the data.
62598f81bde94217f370738a
class _RpmConflicts(_RpmEntry): <NEW_LINE> <INDENT> __slots__ = ()
Parse rpm:conflicts children.
62598f8116aa5153ce3fff49
class BallastGenerator(collector.EntityCollector): <NEW_LINE> <INDENT> outputs = ["Timestamps", "Named"] <NEW_LINE> @classmethod <NEW_LINE> def is_active(cls, session): <NEW_LINE> <INDENT> return session.GetParameter("generate_ballast") > 0 <NEW_LINE> <DEDENT> def collect(self, hint): <NEW_LINE> <INDENT> for i in range...
Generates ballast entities to stress-test the entity system.
62598f81a4f1c619b294e035
class Alive(RuleChecker): <NEW_LINE> <INDENT> def __init__(self, *, alive=None, max_age=110, age=None, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.age = age or Check_Success() <NEW_LINE> self.max_age = max_age <NEW_LINE> self.alive = alive or Check_Success() <NEW_LINE> <DEDENT> def initial...
Check that the person is still alive
62598f81a05bb46b3848a2c4
class CommandSequenceCommand(Command): <NEW_LINE> <INDENT> def __init__(self, cmdline='', **kwargs): <NEW_LINE> <INDENT> Command.__init__(self, **kwargs) <NEW_LINE> self.cmdline = cmdline.strip() <NEW_LINE> <DEDENT> @inlineCallbacks <NEW_LINE> def apply(self, ui): <NEW_LINE> <INDENT> for cmdstring in split_commandline(...
Meta-Command that just applies a sequence of given Commands in order
62598f81b5575c28eb7129eb
class TestSetup(unittest.TestCase): <NEW_LINE> <INDENT> layer = MY_MAP_INTEGRATION_TESTING <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.portal = self.layer['portal'] <NEW_LINE> self.installer = api.portal.get_tool('portal_quickinstaller') <NEW_LINE> <DEDENT> def test_product_installed(self): <NEW_LINE> <INDENT>...
Test that my.map is properly installed.
62598f81009cb60464d00f76
class CreateDBInstancesRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Zone = None <NEW_LINE> self.Memory = None <NEW_LINE> self.Storage = None <NEW_LINE> self.InstanceChargeType = None <NEW_LINE> self.ProjectId = None <NEW_LINE> self.GoodsNum = None <NEW_LINE> self.SubnetId = N...
CreateDBInstances请求参数结构体
62598f8130dc7b766599f2a2
class ErrorMessageForm(HelpForm): <NEW_LINE> <INDENT> COLOR = "CRITICAL"
Alert.
62598f81fb3f5b602db47ed5
class AreaSelectStyle(BaseOption): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.width = None <NEW_LINE> self.borderWidth = None <NEW_LINE> self.borderColor = None <NEW_LINE> self.color = None <NEW_LINE> self.opacity = None <NEW_LINE> <DEDENT> @check_args <NEW_LINE> def set_keys(self, width: int=None...
This Class Is For ParallelAxis
62598f81d53ae8145f917ed7
class productIDProp(SchemaProperty): <NEW_LINE> <INDENT> _prop_schema = 'productID' <NEW_LINE> _expected_schema = None <NEW_LINE> _enum = False <NEW_LINE> _format_as = "TextField"
SchemaField for productID Usage: Include in SchemaObject SchemaFields as your_django_field = productIDProp() schema.org description:The product identifier, such as ISBN. For example: &lt;meta itemprop=&#39;productID&#39; content=&#39;isbn:123-456-789&#39;/&gt;. prop_schema returns just the property without url# form...
62598f81f7d966606f747a31
class MyListModelMixin(object): <NEW_LINE> <INDENT> def list(self, request, *args, **kwargs): <NEW_LINE> <INDENT> queryset = self.filter_queryset(Categories.objects.filter(user=request.user)) <NEW_LINE> page = self.paginate_queryset(queryset) <NEW_LINE> if page is not None: <NEW_LINE> <INDENT> serializer = self.get_ser...
List a queryset.
62598f815f7d997b871f90fd
class V1beta3_PersistentVolumeClaimSpec(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swaggerTypes = { 'accessModes': 'list[V1beta3_AccessModeType]', 'resources': 'V1beta3_ResourceRequirements' } <NEW_LINE> self.attributeMap = { 'accessModes': 'accessModes', 'resources': 'resources' } <NEW_L...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598f81fbf16365ca793af3
@dataclass <NEW_LINE> class CSVLogger(LearnerCallback): <NEW_LINE> <INDENT> filename: str = 'history' <NEW_LINE> def __post_init__(self): <NEW_LINE> <INDENT> super().__post_init__() <NEW_LINE> self.path = self.learn.path/f'{self.filename}.csv' <NEW_LINE> <DEDENT> def read_logged_file(self): <NEW_LINE> <INDENT> return p...
A `LearnerCallback` that saves history of metrics while training `learn` into CSV `filename`.
62598f81596a8972361276bc
class TestExample(fake_filesystem_unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.setUpPyfakefs() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self.tearDownPyfakefs() <NEW_LINE> <DEDENT> def test_create_file(self): <NEW_LINE> <INDENT> self.assertFalse(os.path.isdir('/tes...
Test the pyfakefs.example module.
62598f81e76e3b2f99fd847f
class IRatingProduct(interface.Interface): <NEW_LINE> <INDENT> pass
product
62598f819b70327d1c57e7e9
class CircuitClosedState(CircuitBreakerState): <NEW_LINE> <INDENT> def __init__(self, cb, prev_state=None, notify=False): <NEW_LINE> <INDENT> super(CircuitClosedState, self).__init__(cb, STATE_CLOSED) <NEW_LINE> if notify: <NEW_LINE> <INDENT> self._breaker._state_storage.reset_counter() <NEW_LINE> for listener in self....
In the normal "closed" state, the circuit breaker executes operations as usual. If the call succeeds, nothing happens. If it fails, however, the circuit breaker makes a note of the failure. Once the number of failures exceeds a threshold, the circuit breaker trips and "opens" the circuit.
62598f8130c21e258be98254
class Error(MissingValueBase): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> header = "ERROR"
unknown errored value.
62598f81a4f1c619b294e037
class ParameterColumn: <NEW_LINE> <INDENT> header_names: List[str] = [] <NEW_LINE> parameter_type: Type[Parameter] = Parameter <NEW_LINE> def __init__(self, column: int, header_row_idx: int = 0): <NEW_LINE> <INDENT> self.column = column <NEW_LINE> self.header_row_idx = header_row_idx <NEW_LINE> <DEDENT> def __str__(sel...
A column of Parameter instances, like accession numbers or pseudonyms supposed to be part of a grid like a csv file or xls file Does fuzzy finding of column header and parsing of values
62598f81c432627299fa2a19
class NeedsSelectionUICommandMixin: <NEW_LINE> <INDENT> def __init__(self, parent=None, *, container, **kwargs): <NEW_LINE> <INDENT> self._container = container <NEW_LINE> super().__init__(parent, **kwargs) <NEW_LINE> self.add_signal_check(container.selectionChanged) <NEW_LINE> <DEDENT> def container(self): <NEW_LINE> ...
A mixin for UICommand. The constructor takes a `container` keyword argument. This must be an object which implements a `selectionChanged` signal (of any signature) and a `selection()` method, which should return the selection as an object with a __len__.
62598f817b25080760ed6ef0
class UnQLitePlugin(object): <NEW_LINE> <INDENT> name = 'unqlite' <NEW_LINE> api = 2 <NEW_LINE> ''' python3 moves unicode to str ''' <NEW_LINE> try: <NEW_LINE> <INDENT> unicode <NEW_LINE> <DEDENT> except NameError: <NEW_LINE> <INDENT> unicode = str <NEW_LINE> <DEDENT> UNQLITE_OPEN_READONLY = 0x00000001 <NEW_LINE> UNQLI...
This plugin passes an unqlite database handle to route callbacks that accept a `db` keyword argument. If a callback does not expect such a parameter, no connection is made. You can override the database settings on a per-route basis.
62598f81d99f1b3c44d050f8
class AddAcquiredLogTests(SynchronousTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.log = mock_log() <NEW_LINE> self.ret = ("r", True) <NEW_LINE> self.func = lambda: succeed(self.ret) <NEW_LINE> self.wf = zk.add_acquired_log(self.log, "m", self.func) <NEW_LINE> <DEDENT> def test_message_logged...
Tests for :func:`add_acquired_log`
62598f81b5575c28eb7129ec
class MaxPooling2D(Operator): <NEW_LINE> <INDENT> def __init__(self, name: Optional[str], ksize: IntOrTuple, stride: IntOrTuple, padding: IntOrTuple): <NEW_LINE> <INDENT> super().__init__(name) <NEW_LINE> self.parameters["ksize"] = to_tuple(ksize) <NEW_LINE> self.parameters["stride"] = to_tuple(stride) <NEW_LINE> self....
Max pooling 2D operator Args: name (str): Operator name. ksize (int or tuple of int): Kernel size. stride (int or tuple of int): Stride size. padding (int or tuple of int): Padding size.
62598f818a349b6b43685c8f
class ResourceListExecutor(Executor): <NEW_LINE> <INDENT> def prepare_metadata_dir(self): <NEW_LINE> <INDENT> if self.para.is_saving_sitemaps: <NEW_LINE> <INDENT> self.clear_metadata_dir() <NEW_LINE> <DEDENT> <DEDENT> def generate_rs_documents(self, filenames: iter) -> [SitemapData]: <NEW_LINE> <INDENT> sitemap_data_i...
:samp:`Executes the new resourcelist strategy` A ResourceListExecutor clears the metadata directory and creates new resourcelist(s) every time the executor runs (and is_saving_sitemaps).
62598f810383005118f6d14d
class MyAccountView(ConfigPagesView): <NEW_LINE> <INDENT> title = _('My Account') <NEW_LINE> css_bundle_names = [ 'account-page', ] <NEW_LINE> js_bundle_names = [ '3rdparty-jsonlint', 'config-forms', 'account-page', ] <NEW_LINE> @method_decorator(login_required) <NEW_LINE> @method_decorator(check_read_only) <NEW_LINE> ...
Displays the My Account page containing user preferences. The page will be built based on registered pages and forms. This makes it easy to plug in new bits of UI for the page, which is handy for extensions that want to offer customization for users.
62598f810fa83653e46f493a
class _TableData(object): <NEW_LINE> <INDENT> def __init__(self, columnCount): <NEW_LINE> <INDENT> self.__colCount = columnCount <NEW_LINE> self.__data = [] <NEW_LINE> <DEDENT> def rowCount(self): <NEW_LINE> <INDENT> return len(self.__data) <NEW_LINE> <DEDENT> def columnCount(self): <NEW_LINE> <INDENT> return self.__co...
Modelize a table with header, row and column span. It is mostly defined as a row based table.
62598f81c432627299fa2a1a
class CommandTerminationReason(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> UnknownTerminationReason = 0 <NEW_LINE> CompletedTerminationReason = 1 <NEW_LINE> CancelledTerminationReason = 2 <NEW_LINE> AbortedTerminationReason = 3 <NEW_LINE> PreEmptedTerminationReason = 4 <NEW_L...
Defines the termination reason for a command. Commands can be terminated for a number of different reasons, and based on the reason commands have to do different things during termination so this enum defines various reasons for termination
62598f818e71fb1e983bb505
class MyImagesPipeline(ImagesPipeline): <NEW_LINE> <INDENT> def get_media_requests(self, item, info): <NEW_LINE> <INDENT> image_url = item['userImg'] <NEW_LINE> return [scrapy.Request(image_url)] <NEW_LINE> <DEDENT> def item_completed(self, results, item, info): <NEW_LINE> <INDENT> if(results[0][0]): <NEW_LINE> <INDENT...
先安装:pip install Pillow
62598f816fece00bbaccb3d3
class ResNeXt(nn.Module): <NEW_LINE> <INDENT> def __init__(self, baseWidth, cardinality, layers, num_classes): <NEW_LINE> <INDENT> super(ResNeXt, self).__init__() <NEW_LINE> block = Bottleneck <NEW_LINE> self.cardinality = cardinality <NEW_LINE> self.baseWidth = baseWidth <NEW_LINE> self.num_classes = num_classes <NEW_...
ResNext optimized for the ImageNet dataset, as specified in https://arxiv.org/pdf/1611.05431.pdf
62598f8194891a1f408b9414
class MailAggregator(InboundMailHandler): <NEW_LINE> <INDENT> SAVE_FULL_TEXT = True <NEW_LINE> FAKE_MESSAGE_ID = 'FAKEMESSAGEID' <NEW_LINE> FAKE_MESSAGE_ID_SUFFIX_FORMAT = '%Y%m%d%H%M%S' <NEW_LINE> def receive(self, mail): <NEW_LINE> <INDENT> message_id = mail.original.get('Message-ID') <NEW_LINE> if message_id is None...
Handles incoming mail where each message is delivered individually.
62598f81d164cc61758209c3
class DummyForeignVcsRepository(groupcompress_repo.CHKInventoryRepository, foreign.ForeignRepository): <NEW_LINE> <INDENT> pass
Dummy foreign vcs repository.
62598f81f7d966606f747a33
class SynthesisTransform(tf.keras.layers.Layer): <NEW_LINE> <INDENT> def __init__(self, num_filters, *args, **kwargs): <NEW_LINE> <INDENT> self.num_filters = num_filters <NEW_LINE> super(SynthesisTransform, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def build(self, input_shape): <NEW_LINE> <INDENT> self._layer...
The synthesis transform.
62598f811d351010ab8f3589
class ParentSignalsWorkflow6(BaseWorkflow): <NEW_LINE> <INDENT> name = "signals-parent-6" <NEW_LINE> def run(self): <NEW_LINE> <INDENT> f = self.submit(ChildSignalsSelfWorkflow) <NEW_LINE> futures.wait(f) <NEW_LINE> child_signal = self.submit(self.wait_signal("IAmReady")) <NEW_LINE> assert child_signal.finished is Fals...
Assert we don't receive the child signal.
62598f81a4f1c619b294e038
class ReplayBuffer: <NEW_LINE> <INDENT> def __init__(self, buffer_size, batch_size, seed): <NEW_LINE> <INDENT> self.memory = deque(maxlen=buffer_size) <NEW_LINE> self.batch_size = batch_size <NEW_LINE> self.experience = namedtuple("Experience", field_names=["state", "action", "reward", "next_state", "done"]) <NEW_LINE>...
Fixed-size buffer to store experience tuples.
62598f81507cdc57c63a47d8
class SUVParts(PartsFactory): <NEW_LINE> <INDENT> def info(self): <NEW_LINE> <INDENT> return "Maufactured in SUV Parts Factory" <NEW_LINE> <DEDENT> def build_parts(self): <NEW_LINE> <INDENT> print("SUV parts built")
Concrete class for SUV parts.
62598f8123e79379d538bf45
class Msg_Streamer(ZMQ_Socket): <NEW_LINE> <INDENT> def __init__(self, ctx, url): <NEW_LINE> <INDENT> self.socket = zmq.Socket(ctx, zmq.PUB) <NEW_LINE> self.socket.connect(url) <NEW_LINE> <DEDENT> def send(self, payload, deprecated=()): <NEW_LINE> <INDENT> assert deprecated is (), "Depracted use of send()" <NEW_LINE> a...
Send messages on fast and efficient but without garatees. Not threadsave. Make a new one for each thread
62598f81596a8972361276bd
class MastodonInternalServerError(MastodonServerError): <NEW_LINE> <INDENT> pass
Raised if the Server returns a 500 error
62598f8110dbd63aa1c705fe
class CFM_621t25: <NEW_LINE> <INDENT> play = Hit(TARGET, 10)
Heart of Fire
62598f8150485f2cf55da9be
class DefaultLayout(BaseNonRdfLayout): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def local_path(root, uuid, bl=4, bc=4): <NEW_LINE> <INDENT> logger.debug('Generating path from uuid: {}'.format(uuid)) <NEW_LINE> term = len(uuid) if bc == 0 else min(bc * bl, len(uuid)) <NEW_LINE> path = [uuid[i : i + bl] for i in rang...
Default file layout. This is a simple filesystem layout that stores binaries in pairtree folders in a local filesystem. Parameters can be specified for the
62598f819b70327d1c57e7eb
class HassIO(object): <NEW_LINE> <INDENT> def __init__(self, loop, websession, ip): <NEW_LINE> <INDENT> self.loop = loop <NEW_LINE> self.websession = websession <NEW_LINE> self._ip = ip <NEW_LINE> <DEDENT> @asyncio.coroutine <NEW_LINE> def is_connected(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> with async_time...
Small API wrapper for HassIO.
62598f81bde94217f370738c
class BR(ParseModule.ParseModule): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> ParseModule.ParseModule.__init__(self) <NEW_LINE> <DEDENT> def make_cookies(self, url): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> def is_interesting_url(self, url): <NEW_LINE> <INDENT> parsed = urlparse.urlparse(url...
Module for parsing web pages from beerrecipes.org.
62598f81d6c5a102081e1b95
class AASeqProcessor: <NEW_LINE> <INDENT> def __init__(self,max_len,extra_chars=''): <NEW_LINE> <INDENT> self.max_len = max_len <NEW_LINE> self.tokenizer = Tokenizer(char_level=True,lower=False,filters='',oov_token='U') <NEW_LINE> self.undo_tokenizer = Tokenizer(char_level=True,lower=False,filters='') <NEW_LINE> self._...
A simple general processor for sequences of amino acids This processor will convert AA sequences (strings) into sequences of integers. Sequences will all be 0-padded to a fixed length which is chosen by the user. two forms of transformation are provided allowing for usage in different use cases. The transform_seqs me...
62598f81287bf620b6271600
class Rectangle: <NEW_LINE> <INDENT> def __init__(self, width=0, height=0): <NEW_LINE> <INDENT> self.height = height <NEW_LINE> self.width = width <NEW_LINE> <DEDENT> @property <NEW_LINE> def width(self): <NEW_LINE> <INDENT> return self.__width <NEW_LINE> <DEDENT> @width.setter <NEW_LINE> def width(self, value): <NEW_L...
Retangle object with getter and setters
62598f818c3a8732951f5f93
class StudioPageTestCase(CourseTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(StudioPageTestCase, self).setUp() <NEW_LINE> self.chapter = ItemFactory.create(parent_location=self.course.location, category='chapter', display_name="Week 1") <NEW_LINE> self.sequential = ItemFactory.create(parent_...
Base class for all tests of Studio pages.
62598f8107d97122c42166f0
class UserCreationForm(forms.ModelForm): <NEW_LINE> <INDENT> error_messages = { 'password_mismatch': _("The two password fields didn't match."), } <NEW_LINE> password1 = forms.CharField(label=_("Password"), strip=False, widget=forms.PasswordInput) <NEW_LINE> password2 = forms.CharField(label=_("Password confirmation"),...
A form that creates a user, with no privileges, from the given username and password.
62598f81442bda511e95bea8
class ProfileFeedPluginConf(CMSPlugin): <NEW_LINE> <INDENT> items_per_service = models.PositiveSmallIntegerField( default=5, verbose_name=_("number of items per service"), ) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return "items per service: %s" % self.items_per_service
Plugin model for storing profile feed related configuration.
62598f8130c21e258be98256
class Filter(object): <NEW_LINE> <INDENT> cls = "" <NEW_LINE> is_default_and = False <NEW_LINE> toggle = False <NEW_LINE> def __init__(self, name, lookup=None, key=None, coerce=None, extra_filters=None, switchable=False): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.lookup = name if lookup is None else lookup <...
Encapsulates the filtering possibilities for a single field.
62598f810383005118f6d14e
class VpnSiteLinkConnectionsOperations: <NEW_LINE> <INDENT> models = _models <NEW_LINE> def __init__(self, client, config, serializer, deserializer) -> None: <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._serialize = serializer <NEW_LINE> self._deserialize = deserializer <NEW_LINE> self._config = config <NE...
VpnSiteLinkConnectionsOperations async operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~azure.mgmt.network.v2020_06_01...
62598f818a43f66fc4bf1bce
class CacheServer(object): <NEW_LINE> <INDENT> __metaclass__ = ProblemMetaClass <NEW_LINE> def __init__(self, port=8000): <NEW_LINE> <INDENT> self.cache = {} <NEW_LINE> self.port = port <NEW_LINE> <DEDENT> def set(self, name, value, *args, **kwargs): <NEW_LINE> <INDENT> self.cache[name] = value <NEW_LINE> <DEDENT> def ...
cache server内部执行忽略延迟,认为延迟产生于客户端+网络(时间丢给客户端)
62598f817b25080760ed6ef2
class Solution: <NEW_LINE> <INDENT> def largestRectangleArea(self, height): <NEW_LINE> <INDENT> if not height: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> n = len(height) <NEW_LINE> ret = 0 <NEW_LINE> st = [] <NEW_LINE> for i in range(n+1): <NEW_LINE> <INDENT> cur = -1 if i == n else height[i] <NEW_LINE> while len...
@param height: A list of integer @return: The area of largest rectangle in the histogram
62598f8182261d6c5272fbfa
class EqualLinear(nn.Layer): <NEW_LINE> <INDENT> def __init__(self, in_dim, out_dim, bias=True, bias_init=0, lr_mul=1, activation=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.weight = self.create_parameter( (in_dim, out_dim), default_initializer=nn.initializer.Normal()) <NEW_LINE> self.weight.set_value...
This linear layer class stabilizes the learning rate changes of its parameters. Equalizing learning rate keeps the weights in the network at a similar scale during training.
62598f81d99f1b3c44d050fa
class File(FileSystemEntity): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> super(File, self).__init__(path) <NEW_LINE> <DEDENT> @property <NEW_LINE> def size(self): <NEW_LINE> <INDENT> return os.path.getsize(self.path) <NEW_LINE> <DEDENT> def has_extension(self, extension): <NEW_LINE> <INDENT> retu...
Encapsulates commonly used functions related to files.
62598f8130dc7b766599f2a6
class ColorDepth(Enum,IComparable,IFormattable,IConvertible): <NEW_LINE> <INDENT> def __eq__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __format__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __ge__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __gt__(self,*args): <NE...
Specifies the number of colors used to display an image in an System.Windows.Forms.ImageList control. enum ColorDepth,values: Depth16Bit (16),Depth24Bit (24),Depth32Bit (32),Depth4Bit (4),Depth8Bit (8)
62598f81097d151d1a2c0a72
class Task: <NEW_LINE> <INDENT> NORMAL = 'normal' <NEW_LINE> COMPLETED = 'completed' <NEW_LINE> def __init__(self, title, status = NORMAL): <NEW_LINE> <INDENT> self.title = title <NEW_LINE> self.status = status
Represents one Todo-Item
62598f81cad5886f8bdc4d73
class Tuple(object): <NEW_LINE> <INDENT> def __init__(self, token_string, compressed_key, value_length): <NEW_LINE> <INDENT> self.__token_string = token_string <NEW_LINE> self.__compressed_key = compressed_key <NEW_LINE> self.__value_length = value_length <NEW_LINE> <DEDENT> @property <NEW_LINE> def token_string(self):...
Tuple class represents a fixed length dictionary entry. It associates a token_string with a compressed_key. It also says how may bytes (the fixed length L) should be following the token_string or compressed_key (it should be the same as the last 2 bytes of the token_string).
62598f818e05c05ec3f6eb6e
class Observation(PolymorphicModel): <NEW_LINE> <INDENT> value = models.ForeignKey( AllowedValue, blank=False, null=True, on_delete=models.PROTECT, related_name="instances", ) <NEW_LINE> time = models.DateTimeField( db_index=True, help_text="Exact time the observation was made" ) <NEW_LINE> unit = models.ForeignKey( se...
An observation is a measured/observed value of a property of a unit at a certain time.
62598f81a4f1c619b294e03a
class Enum(dict): <NEW_LINE> <INDENT> def __init__(self, names=tuple(), values=0): <NEW_LINE> <INDENT> if isinstance(values, int): <NEW_LINE> <INDENT> items = tuple(enumerate(names, values)) <NEW_LINE> <DEDENT> elif isinstance(values, (tuple, list)): <NEW_LINE> <INDENT> items = zip(values, names) <NEW_LINE> <DEDENT> el...
A class for the enumeration. `names`: A tuple or list contains the symbolic names(strings). `values`: The start value of the enumeration or a tuple(list) of all enumeration values corresponding to the given names.
62598f81d10714528d69d91d
class ShippingPurchase(Purchase): <NEW_LINE> <INDENT> shipping_price = models.ForeignKey(ShippingPrice, on_delete=models.PROTECT)
Model for shipping purchaes.
62598f8129b78933be269e01
class SelectElementModel(GeoformElement): <NEW_LINE> <INDENT> def save(self, *args, **kwargs): <NEW_LINE> <INDENT> self.element_type = 'select' <NEW_LINE> super(SelectElementModel, self).save(*args, **kwargs) <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> proxy = True <NEW_LINE> verbose_name = _('Dropdown') <NEW_L...
This is a proxy model for the select dropdowns
62598f81e64d504609df90d7
class MilenageRandomTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_rand(self): <NEW_LINE> <INDENT> rand = Milenage.generate_rand() <NEW_LINE> self.assertEqual(len(rand), 16)
Test class RAND method
62598f81d10714528d69d91e
class Stream(object): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> def close(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> @property <NEW_LINE> def closed(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def fileno(self): <NEW_LINE> <INDENT> raise NotImplementedEr...
Base Stream
62598f81be383301e0253248
class MPCHECKER: <NEW_LINE> <INDENT> def __init__(self, ): <NEW_LINE> <INDENT> self.suspects = None <NEW_LINE> <DEDENT> def get_objects_which_overlap_FoV( pointing_variable ): <NEW_LINE> <INDENT> list_of_pointings = self._rectify_pointings(pointing_variable) <NEW_LINE> for p in list_of_pointings: <NEW_LINE> <INDENT> re...
Provide all methods associated with MPChecker - Get "shortlists" for night - Do detailed orbital advance - Get "refined" list of actual overlap with FoV - Associated refined list with detections/tracklets
62598f8130c21e258be98258
class TagConfig(object): <NEW_LINE> <INDENT> barred = { 'under':'u', } <NEW_LINE> family = { 'sans':'span class="sans"', 'typewriter':'tt', } <NEW_LINE> flex = { 'CharStyle:Code':'span class="code"', 'CharStyle:MenuItem':'span class="menuitem"', 'Code':'span class="code"', 'MenuItem':'span class="menuitem"', 'Noun':'sp...
Configuration class from elyxer.config file
62598f818a43f66fc4bf1bd0
@permission_classes([IsAuthenticated]) <NEW_LINE> class CreateRoom(APIView): <NEW_LINE> <INDENT> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> pt_slug: str = kwargs.get('role', None) <NEW_LINE> school_slug: str = kwargs.get('school', None) <NEW_LINE> diploma_slug: str = kwargs.get('diploma', None) <NEW_L...
View to create a new room. * Requires token authentication. * Only authenticated users are able to access this view.
62598f81379a373c97d98a60
class FilterModule(object): <NEW_LINE> <INDENT> def filters(self): <NEW_LINE> <INDENT> return { 'cidr_to_netmask': cidr_to_netmask, 'netmask_to_cidr': netmask_to_cidr, 'duplicate': duplicate }
custom jinja2 filters for working with collections
62598f8115baa723494619cd
class ScalarAttributeImpl(AttributeImpl): <NEW_LINE> <INDENT> accepts_scalar_loader = True <NEW_LINE> uses_objects = False <NEW_LINE> supports_population = True <NEW_LINE> collection = False <NEW_LINE> def delete(self, state, dict_): <NEW_LINE> <INDENT> if self.dispatch._active_history: <NEW_LINE> <INDENT> old = self.g...
represents a scalar value-holding InstrumentedAttribute.
62598f8182261d6c5272fbfb
@total_ordering <NEW_LINE> class Version: <NEW_LINE> <INDENT> def __init__(self, ver_str): <NEW_LINE> <INDENT> ver_list = split_ver_str(ver_str) <NEW_LINE> ver_tuple = tuple(get_ver_component(ver_list, idx) for idx in (0, 1, 2)) <NEW_LINE> self.major = ver_tuple[0] <NEW_LINE> self.minor = ver_tuple[1] <NEW_LINE> self.p...
Simple wrapper around three-component version. This class provides convenient accessors to version components represented by decimal numbers. Suitable for LLVM version in IGC.
62598f8126238365f5fac5be