code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class RGBImagesFromList(BasePreprocessor): <NEW_LINE> <INDENT> interpolation_func = { 'as_is': lambda num_frames_param, num_frames: np.linspace(0, num_frames, num_frames, endpoint=False).astype(int), 'interpolate': lambda num_frames_param, num_frames: np.linspace(0, num_frames, num_frames_param, endpoint=False).astype(...
Provides a transformed RGB images in CTHW, TCHW layout from list of files
62598fc44f88993c371f0668
class QueryBuilder: <NEW_LINE> <INDENT> operators = { "$gt": ">", "$gte": ">=", "$lt": "<", "$lte": "<=", "$eq": "=", } <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.params = [] <NEW_LINE> self.current_column = None <NEW_LINE> <DEDENT> def group(self, value, action): <NEW_LINE> <INDENT> query = self.build(val...
Builds a simple select query string
62598fc4aad79263cf42ea90
class VAE(Transform): <NEW_LINE> <INDENT> def __init__(self, encoder, decoder): <NEW_LINE> <INDENT> super(VAE, self).__init__() <NEW_LINE> self.encoder = encoder <NEW_LINE> self.decoder = decoder <NEW_LINE> <DEDENT> def call(self, inputs): <NEW_LINE> <INDENT> mu, logstd = self.encoder(inputs) <NEW_LINE> posterior = Nor...
Variational Autoencoder.
62598fc4a8370b77170f0697
class CursesAsciiPlot(object): <NEW_LINE> <INDENT> def __init__(self, curses_win, **kwargs): <NEW_LINE> <INDENT> self.win = curses_win <NEW_LINE> size = list(self.win.getmaxyx()[::-1]) <NEW_LINE> size[1] -= 1 <NEW_LINE> self.ascii_plotter = AsciiPlot(size=size, **kwargs) <NEW_LINE> <DEDENT> def plot(self, *args, **kwar...
A Curses Ascii Plot
62598fc44428ac0f6e6587e1
class Inotify: <NEW_LINE> <INDENT> def __init__(self, flags): <NEW_LINE> <INDENT> inotify_fd = inotify_init(flags) <NEW_LINE> self._inotify_fd = inotify_fd <NEW_LINE> self._paths = {} <NEW_LINE> <DEDENT> def fileno(self): <NEW_LINE> <INDENT> return self._inotify_fd <NEW_LINE> <DEDENT> def close(self): <NEW_LINE> <INDEN...
Inotify system interface.
62598fc4283ffb24f3cf3b41
class GetEventListTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.base_url = "http://127.0.0.1:8000/api/get_event_list/" <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> print(self.result) <NEW_LINE> <DEDENT> def test_get_event_list_eid_error(self): <NEW_LINE> <INDENT> ...
获得发布会信息
62598fc49f288636728189da
class SetDiscussionGroup(TLObject): <NEW_LINE> <INDENT> __slots__ = ["broadcast", "group"] <NEW_LINE> ID = 0x40582bb2 <NEW_LINE> QUALNAME = "functions.channels.SetDiscussionGroup" <NEW_LINE> def __init__(self, *, broadcast, group): <NEW_LINE> <INDENT> self.broadcast = broadcast <NEW_LINE> self.group = group <NEW_LINE> ...
Attributes: LAYER: ``112`` Attributes: ID: ``0x40582bb2`` Parameters: broadcast: Either :obj:`InputChannelEmpty <pyrogram.api.types.InputChannelEmpty>`, :obj:`InputChannel <pyrogram.api.types.InputChannel>` or :obj:`InputChannelFromMessage <pyrogram.api.types.InputChannelFromMessage>` group: Either :o...
62598fc47c178a314d78d75c
class Human: <NEW_LINE> <INDENT> species = "Mammal" <NEW_LINE> def __init__(self, name, age): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.age = age <NEW_LINE> self.__weight = 90 <NEW_LINE> <DEDENT> def does(self, action): <NEW_LINE> <INDENT> return "{} does {}".format(self.name, action) <NEW_LINE> <DEDENT> def...
This is a class for humans
62598fc499fddb7c1ca62f4b
class ODM_GCPoint(object): <NEW_LINE> <INDENT> def __init__(self, x, y, z): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.z = z
docstring for ODMPoint
62598fc45166f23b2e24369e
class CognitiveServicesAccountCreateParameters(Model): <NEW_LINE> <INDENT> _validation = { 'sku': {'required': True}, 'kind': {'required': True}, 'location': {'required': True}, 'properties': {'required': True}, } <NEW_LINE> _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, 'kind': {'key': 'kind', 'type': 'str'}...
The parameters to provide for the account. :param sku: Required. Gets or sets the SKU of the resource. :type sku: :class:`Sku <azure.mgmt.cognitiveservices.models.Sku>` :param kind: Required. Gets or sets the Kind of the resource. Possible values include: 'Academic', 'Bing.Autosuggest', 'Bing.Search', 'Bing.Speech',...
62598fc44a966d76dd5ef192
class MenuBar(WidgetComponent): <NEW_LINE> <INDENT> menus = Property(depends_on='children') <NEW_LINE> @cached_property <NEW_LINE> def _get_menus(self): <NEW_LINE> <INDENT> isinst = isinstance <NEW_LINE> menus = (child for child in self.children if isinst(child, Menu)) <NEW_LINE> return tuple(menus)
A widget used as a menu bar in a MainWindow.
62598fc4283ffb24f3cf3b42
class OptionsAccountBook(object): <NEW_LINE> <INDENT> openapi_types = {'time': 'float', 'change': 'str', 'balance': 'str', 'type': 'str', 'text': 'str'} <NEW_LINE> attribute_map = {'time': 'time', 'change': 'change', 'balance': 'balance', 'type': 'type', 'text': 'text'} <NEW_LINE> def __init__( self, time=None, change=...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62598fc4f548e778e596b85d
class CreateTodo(graphene.Mutation): <NEW_LINE> <INDENT> todo = graphene.Field(TodoType) <NEW_LINE> class Arguments: <NEW_LINE> <INDENT> title = graphene.String(required=True) <NEW_LINE> description = graphene.String(required=True) <NEW_LINE> priority = graphene.String(default_value="low") <NEW_LINE> <DEDENT> def mutat...
A class to create a new todo item. Methods ------- mutate(info, **kwargs): creates a new todo
62598fc4099cdd3c63675541
class StudyNotCreated(Exception): <NEW_LINE> <INDENT> pass
Exception type thrown when an attempt to create a submission with an invalid study id is made.
62598fc40fa83653e46f51a5
@register('direct') <NEW_LINE> class Direct(Driver): <NEW_LINE> <INDENT> def run(self, *command): <NEW_LINE> <INDENT> for key, value in self.environment().items(): <NEW_LINE> <INDENT> os.environ[key] = value <NEW_LINE> <DEDENT> return self._run([self.target] + list(command)) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE>...
Execute the application directly.
62598fc471ff763f4b5e7a3c
class FakeModule(object): <NEW_LINE> <INDENT> def __init__(self, parser): <NEW_LINE> <INDENT> self.parser = parser <NEW_LINE> self.pre_parse_string = None <NEW_LINE> self.string = None <NEW_LINE> self.config = None <NEW_LINE> <DEDENT> def pre_parse(self, string): <NEW_LINE> <INDENT> self.pre_parse_string = string <NEW_...
An empty mock parser module
62598fc4167d2b6e312b7236
class Question(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=500) <NEW_LINE> content = models.TextField() <NEW_LINE> code = models.CharField(max_length=8, null=True, blank=True) <NEW_LINE> user = models.ForeignKey(User, on_delete=models.CASCADE) <NEW_LINE> categories = models.ManyToManyField('C...
Question model
62598fc463b5f9789fe85432
@unittest.skip("Enable this and fill in credentials if you want it to run") <NEW_LINE> class TestBasic(unittest.TestCase): <NEW_LINE> <INDENT> def test_create_process_with_logonw(self): <NEW_LINE> <INDENT> _advapi32.CreateProcessWithLogonW( username=None, domain=None, password=None, command_line='%s -c "import sys; pri...
Do just enough to exercise the module: ensure that it imports and that basically functionality functions
62598fc4ad47b63b2c5a7b17
class Arc(XYObjectMixin, LineAndFillMixin, DrawObject): <NEW_LINE> <INDENT> def __init__(self, StartXY, EndXY, CenterXY, LineColor = "Black", LineStyle = "Solid", LineWidth = 1, FillColor = None, FillStyle = "Solid", InForeground = False): <NEW_LINE> <INDENT> DrawObject.__init__(self, InForeground) <NEW_LINE> ...
Draws an arc of a circle, centered on point ``CenterXY``, from the first point ``StartXY`` to the second ``EndXY``. The arc is drawn in an anticlockwise direction from the start point to the end point.
62598fc460cbc95b063645fd
class IserviceUser(User): <NEW_LINE> <INDENT> name = models.CharField(max_length=100) <NEW_LINE> picture = models.CharField(null=True, max_length=150) <NEW_LINE> favorites_services = models.ManyToManyField('Service') <NEW_LINE> def add_favorite_service(self, service): <NEW_LINE> <INDENT> self.favorites_services.add(ser...
This class represents a system user.
62598fc4f9cc0f698b1c5431
class TestCitationRetrieval(TestCase): <NEW_LINE> <INDENT> def create_app(self): <NEW_LINE> <INDENT> app_ = app.create_app() <NEW_LINE> return app_ <NEW_LINE> <DEDENT> @mock.patch('metrics_service.models.execute_SQL_query', return_value=testdata) <NEW_LINE> def test_get_citations(self, mock_execute_SQL_query): <NEW_LIN...
Check if the citation retrieval function returns expected results
62598fc4aad79263cf42ea95
class MESH_OT_flip_custom_normals(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "mesh.flip_custom_normals" <NEW_LINE> bl_label = "Flip Custom Normals" <NEW_LINE> bl_options = {'UNDO'} <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> return context.object and context.object.type == '...
Flip active mesh's normals, including custom ones (only in Object mode)
62598fc4956e5f7376df57de
class Area(AttrsMixin, XHTMLElement): <NEW_LINE> <INDENT> XMLNAME = (XHTML_NAMESPACE, 'area') <NEW_LINE> XMLATTR_shape = ('shape', Shape.from_str_lower, Shape.to_str) <NEW_LINE> XMLATTR_coords = ('coords', Coords.from_str, to_text) <NEW_LINE> XMLATTR_href = ('href', uri.URI.from_octets, to_text) <NEW_LINE> XMLATTR_targ...
Client-side image map area :: <!ELEMENT AREA - O EMPTY -- client-side image map area --> <!ATTLIST AREA %attrs; -- %coreattrs, %i18n, %events -- shape %Shape; rect -- controls interpretation of coords -- coords %Coords; #IMPLIED ...
62598fc4bf627c535bcb1767
class Tempering(FKSMCsampler): <NEW_LINE> <INDENT> def __init__(self, model, mh_options=None, exponents=None): <NEW_LINE> <INDENT> FKSMCsampler.__init__(self, model, mh_options=mh_options) <NEW_LINE> self.exponents = exponents <NEW_LINE> self.deltas = np.diff(exponents) <NEW_LINE> <DEDENT> @property <NEW_LINE> def T(se...
FeynmanKac class for tempering SMC. Parameters ---------- exponents: list-like Tempering exponents (must starts with 0., and ends with 1.) See base class for other parameters.
62598fc450812a4eaa620d45
class SequenceIntField(fields.AbstractIntField): <NEW_LINE> <INDENT> def __init__(self, sequence, **kwargs): <NEW_LINE> <INDENT> if not isinstance(sequence, SQLSequence): <NEW_LINE> <INDENT> raise TypeError('Sequence provided must be an instance of ' 'pyxact.sequences.SQLSequence') <NEW_LINE> <DEDENT> self.sequence = s...
Represents an integer field in an SQLTransaction that has a link to a SQLSequence. It can be retrieved and set as a normal SQLField, but when get_new_context is called on the SQLTransaction, it will be updated from the next value of the sequence and the name:value pair will be returned as part of the context dictionary...
62598fc492d797404e388cc2
class Bluetooth(Sensor): <NEW_LINE> <INDENT> bluetooth_state = models.BooleanField(default=False) <NEW_LINE> bluetooth_is_discovering = models.BooleanField(default=False) <NEW_LINE> bluetooth_scan_mode = models.BooleanField(default=False) <NEW_LINE> bluetooth_local_address = models.BooleanField(default=False) <NEW_LINE...
Model for Bluetooth
62598fc4a219f33f346c6ac8
class Service: <NEW_LINE> <INDENT> priority = None <NEW_LINE> types_list = [] <NEW_LINE> attributes_map = {} <NEW_LINE> def __init__(self, priority = "none"): <NEW_LINE> <INDENT> self.priority = priority <NEW_LINE> self.types_list = [] <NEW_LINE> self.attributes_map = {} <NEW_LINE> <DEDENT> def get_attribute(self, attr...
The service class, describing a yadis service.
62598fc45fcc89381b2662ad
class SessionType(messages.Enum): <NEW_LINE> <INDENT> NOT_SPECIFIED = 1 <NEW_LINE> LECTURE = 2 <NEW_LINE> KEYNODE = 3 <NEW_LINE> WORKSHOP = 4
SessionType -- session type enumeration value
62598fc44f88993c371f066b
class ProductLogsConfigDyn(LEDMTree): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> super().__init__(data) <NEW_LINE> <DEDENT> @property <NEW_LINE> def event_logs(self): <NEW_LINE> <INDENT> event_codes = [] <NEW_LINE> event_code_nodes = self.data.findAll("EventCode") <NEW_LINE> for event_code_node i...
ProductConfigDyn tree /DevMgmt/ProductLogsConfigDyn.xml
62598fc4a05bb46b3848ab2d
@group('smoke') <NEW_LINE> class Echo(base_tests.SimpleProtocol): <NEW_LINE> <INDENT> def runTest(self): <NEW_LINE> <INDENT> request = ofp.message.echo_request() <NEW_LINE> response, pkt = self.controller.transact(request) <NEW_LINE> self.assertTrue(response is not None, "Did not get echo reply") <NEW_LINE> self.assert...
Test echo response with no data
62598fc471ff763f4b5e7a3e
class DictWrapper(dict): <NEW_LINE> <INDENT> def __init__(self, data, func, prefix): <NEW_LINE> <INDENT> super(DictWrapper, self).__init__(data) <NEW_LINE> self.func = func <NEW_LINE> self.prefix = prefix <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> if key.startswith(self.prefix): <NEW_LINE> <IND...
Wraps accesses to a dictionary so that certain values (those starting with the specified prefix) are passed through a function before being returned. The prefix is removed before looking up the real value. Used by the SQL construction code to ensure that values are correctly quoted before being used.
62598fc44c3428357761a57e
class BasePluginsParser(BaseParser): <NEW_LINE> <INDENT> NAME = 'base_plugin_parser' <NEW_LINE> DESCRIPTION = u'' <NEW_LINE> _plugin_classes = None <NEW_LINE> @classmethod <NEW_LINE> def DeregisterPlugin(cls, plugin_class): <NEW_LINE> <INDENT> plugin_name = plugin_class.NAME.lower() <NEW_LINE> if plugin_name not in cls...
Class that implements the parser with plugins object interface.
62598fc4283ffb24f3cf3b46
class TextMagicClient(_TextMagicClientBase): <NEW_LINE> <INDENT> api_url = 'https://www.textmagic.com/app/api' <NEW_LINE> def __init__(self, username, password): <NEW_LINE> <INDENT> super(TextMagicClient, self).__init__(username, password) <NEW_LINE> <DEDENT> def _submit_request(self, params_dict): <NEW_LINE> <INDENT> ...
An instance of this class is used to perform API commands. An instance of this class has to be created to make TextMagic SMS API calls. Once the instance is created, you can invoke the TextMagic API functionality by calling: - send - account - message_status - receive - delete_reply - check_num...
62598fc47cff6e4e811b5ce7
class DatasetCompressionLevel(str, Enum): <NEW_LINE> <INDENT> optimal = "Optimal" <NEW_LINE> fastest = "Fastest"
All available compression levels.
62598fc476e4537e8c3ef867
class Case(object): <NEW_LINE> <INDENT> def __init__(self, N): <NEW_LINE> <INDENT> self.batch = Batch(N) <NEW_LINE> <DEDENT> def assess_likes(self, likes): <NEW_LINE> <INDENT> successes = 0 <NEW_LINE> for i in range(0, len(likes) - 1, 2): <NEW_LINE> <INDENT> X = likes[i] <NEW_LINE> Y = Case.recode_col(likes[i + 1]) <NE...
Assesses customers within a case.
62598fc4ec188e330fdf8b56
class Note(object): <NEW_LINE> <INDENT> def __init__(self, path, line, column, message): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.line = line <NEW_LINE> self.column = column <NEW_LINE> self.message = message <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return self.path == other.path and ...
Represents a note and also this is the base class of Message.
62598fc44527f215b58ea192
class DummyOAuthProvider(auth.OAuthProvider): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> super(DummyOAuthProvider, self).__init__(name) <NEW_LINE> self.access_token = None <NEW_LINE> <DEDENT> def getTitle(self): <NEW_LINE> <INDENT> return self.name.capitalize() + " account" <NEW_LINE> <DEDENT> de...
Dummy OAuth authentication provider used by automatic tests
62598fc4d8ef3951e32c7fbd
class Project: <NEW_LINE> <INDENT> @lazy <NEW_LINE> def settings(self): <NEW_LINE> <INDENT> mod = importlib.import_module(NINA_CONF_MODULE) <NEW_LINE> conf = NinaConf(self, **extra_config(self)) <NEW_LINE> mod.__dict__.update(conf.get_settings()) <NEW_LINE> return mod <NEW_LINE> <DEDENT> @property <NEW_LINE> def urls(s...
Instances represent Django projects.
62598fc4ff9c53063f51a910
class CourseUpdate(models.Model): <NEW_LINE> <INDENT> course = models.ForeignKey(Course) <NEW_LINE> title = models.CharField(max_length=255, default="No Title Provided") <NEW_LINE> content = models.TextField(max_length=2000, default="*No Content Provided*") <NEW_LINE> date_post = models.DateTimeField(editable=True) <NE...
CourseUpdate objects are announcement postings for a course Attributes: course: ForeignKey to course title: Title of post content: Content of post date_post: Date published, can be future date (only shows past dates) date_edit: Date last edited creator: ForeignKey to user who w...
62598fc4099cdd3c63675543
class InvalidInput(FuxiException): <NEW_LINE> <INDENT> pass
Request data is invalidate
62598fc49f288636728189dd
class BrowserCodingItem(BrowserItem): <NEW_LINE> <INDENT> def __init__(self, parent, text): <NEW_LINE> <INDENT> BrowserItem.__init__(self, parent, text) <NEW_LINE> self.type_ = BrowserItemCoding <NEW_LINE> self.icon = UI.PixmapCache.getIcon("textencoding.png") <NEW_LINE> <DEDENT> def lessThan(self, other, column, order...
Class implementing the data structure for browser coding items.
62598fc4a05bb46b3848ab2f
class ColorLoggerMixin(object): <NEW_LINE> <INDENT> CODE_COLOR_MAPPING = { '1': ('yellow',), '2': ('green',), '3': ('cyan',), '4': ('magenta',), '5': ('red',), } <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self._supports_color = supports_color() <NEW_LINE> super(ColorLoggerMixin, self).__init__(...
Mixin class that does common initialization and color handling.
62598fc47c178a314d78d762
class SnapshotDomain(): <NEW_LINE> <INDENT> def __init__(self, template, basename, i): <NEW_LINE> <INDENT> self.template = template <NEW_LINE> self.basename = basename <NEW_LINE> self.i = i <NEW_LINE> self.xml = None <NEW_LINE> self.agentname = "" <NEW_LINE> self.agentsnapshotid = 0 <NEW_LINE> <DEDENT> def getName(self...
Tworzenie definicji domeny
62598fc44a966d76dd5ef198
class Mem(IntervalModule): <NEW_LINE> <INDENT> format = "{avail_mem} MiB" <NEW_LINE> divisor = 1024**2 <NEW_LINE> color = "#00FF00" <NEW_LINE> warn_color = "#FFFF00" <NEW_LINE> alert_color = "#FF0000" <NEW_LINE> warn_percentage = 50 <NEW_LINE> alert_percentage = 80 <NEW_LINE> round_size = 1 <NEW_LINE> settings = ( ("fo...
Shows memory load .. rubric:: Available formatters * {avail_mem} * {percent_used_mem} * {used_mem} * {total_mem} Requires psutil (from PyPI)
62598fc4283ffb24f3cf3b48
class LinuxDistro: <NEW_LINE> <INDENT> def __init__(self, name, version, release, arch): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.version = version <NEW_LINE> self.release = release <NEW_LINE> self.arch = arch <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '<LinuxDistro: name=%s, version...
Simple collection of information for a Linux Distribution
62598fc47cff6e4e811b5ce9
class StaticHandler(webapp2.RequestHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> orgs = [org for org in models.Organization.all()] <NEW_LINE> random.shuffle(orgs) <NEW_LINE> webapputils.render_page(self, self.request.path, {'orgs': orgs})
Handles GET requests for static pages.
62598fc4aad79263cf42ea99
class ChooseOneStepOf(FeatureUnion): <NEW_LINE> <INDENT> def __init__(self, steps, hyperparams=None): <NEW_LINE> <INDENT> FeatureUnion.__init__(self, steps, joiner=SelectNonEmptyDataInputs()) <NEW_LINE> self._make_all_steps_optional() <NEW_LINE> if hyperparams is None: <NEW_LINE> <INDENT> self.set_hyperparams(Hyperpara...
A pipeline to allow choosing one step using an hyperparameter. Example usage : .. code-block:: python p = Pipeline([ ChooseOneStepOf([ ('a', Identity()), ('b', Identity()) ]) ]) p.set_hyperparams({ 'ChooseOneOrManyStepsOf__choice': 'a', }) # or ...
62598fc44527f215b58ea194
class TestDestinyDefinitionsDestinyLocationReleaseDefinition(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 testDestinyDefinitionsDestinyLocationReleaseDefinition(self): <NEW_LINE> <INDENT> pass
DestinyDefinitionsDestinyLocationReleaseDefinition unit test stubs
62598fc492d797404e388cc4
class AbuseProcessor(DataProcessor): <NEW_LINE> <INDENT> def get_example_from_tensor_dict(self, tensor_dict): <NEW_LINE> <INDENT> return InputExample( tensor_dict["idx"].numpy(), tensor_dict["comment_text"].numpy().decode("utf-8"), None, str(tensor_dict["label"].numpy()), ) <NEW_LINE> <DEDENT> def get_train_examples(se...
Processor for the OnlineAbuse data set.
62598fc4adb09d7d5dc0a840
class TestFeaturedCollectionCoverItem(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 testFeaturedCollectionCoverItem(self): <NEW_LINE> <INDENT> pass
FeaturedCollectionCoverItem unit test stubs
62598fc4a219f33f346c6acc
class log2(Function): <NEW_LINE> <INDENT> nargs = 1 <NEW_LINE> def fdiff(self, argindex=1): <NEW_LINE> <INDENT> if argindex == 1: <NEW_LINE> <INDENT> return S.One/(log(_Two)*self.args[0]) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise ArgumentIndexError(self, argindex) <NEW_LINE> <DEDENT> <DEDENT> @classmethod <NE...
Represents the logarithm function with base two. Explanation =========== The benefit of using ``log2(x)`` over ``log(x)/log(2)`` is that the latter is not as efficient under finite precision arithmetic. Examples ======== >>> from sympy.abc import x >>> from sympy.codegen.cfunctions import log2 >>> log2(4).evalf() =...
62598fc4283ffb24f3cf3b49
class ShoppingList(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def OrderGroceries(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): <NEW_LINE> <INDENT> return grpc.experimental.unary_unary(request,...
Service Definition
62598fc4f548e778e596b863
class NamesTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_first_last_name(self): <NEW_LINE> <INDENT> formmated_name = get_fomatted_name("jack","jones"); <NEW_LINE> self.assertEqual(formmated_name, 'Jack Jones')
测试name_function_py
62598fc4099cdd3c63675544
class CollectionFilesExportPlugin(plugin.ExportPlugin): <NEW_LINE> <INDENT> name = "collection_files" <NEW_LINE> description = "Downloads files referenced from the RDFValueCollection." <NEW_LINE> def ConfigureArgParser(self, parser): <NEW_LINE> <INDENT> parser.add_argument("--path", required=True, help="Path to the RDF...
ExportPlugin that downloads files and directories.
62598fc47c178a314d78d764
class TransparentDataEncryptionState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> ENABLED = "Enabled" <NEW_LINE> DISABLED = "Disabled"
Specifies the state of the transparent data encryption.
62598fc4ad47b63b2c5a7b1d
class LinkedImageSystemChildPlugin(li.LinkedImageChildPlugin): <NEW_LINE> <INDENT> def __init__(self, lic): <NEW_LINE> <INDENT> li.LinkedImageChildPlugin.__init__(self, lic) <NEW_LINE> self.__linked = lic.child_pimage.linked <NEW_LINE> <DEDENT> def munge_props(self, props): <NEW_LINE> <INDENT> pass
See parent class for docstring.
62598fc43617ad0b5ee0640c
class SpecBasedBiblioEntry(BiblioEntry): <NEW_LINE> <INDENT> def __init__(self, spec, preferredURL=None): <NEW_LINE> <INDENT> super(SpecBasedBiblioEntry, self).__init__() <NEW_LINE> if preferredURL is None: <NEW_LINE> <INDENT> preferredURL = constants.refStatus.snapshot <NEW_LINE> <DEDENT> self.spec = spec <NEW_LINE> s...
Generates a "fake" biblio entry from a spec reference, for when we don't have "real" bibliography data for a reference.
62598fc47cff6e4e811b5ceb
class ChildFlow(flow.GRRFlow): <NEW_LINE> <INDENT> @flow.StateHandler(next_state="ReceiveHello") <NEW_LINE> def Start(self): <NEW_LINE> <INDENT> self.CallClient("ReturnHello", next_state="ReceiveHello") <NEW_LINE> <DEDENT> @flow.StateHandler() <NEW_LINE> def ReceiveHello(self, responses): <NEW_LINE> <INDENT> for respon...
This flow will be called by our parent.
62598fc4bf627c535bcb176d
class Message(object): <NEW_LINE> <INDENT> def __init__(self,subject,to,cc=None,bcc=None,text=None,html=None, attachments=None, sender=None, reply_to=None): <NEW_LINE> <INDENT> if not html and not attachments: <NEW_LINE> <INDENT> self.root = MIMEText(text,'plain',self._charset(text)) <NEW_LINE> <DEDENT> else: <NEW_LINE...
Wrapper around email.Message class simplifying creation of simple email message objects. Allows most basic email messages types (including text, html & attachments) to be created simply from constructor. More complex messages should be created using the email.mime classes directly Class wraps the email.Message class ...
62598fc4283ffb24f3cf3b4b
class Var: <NEW_LINE> <INDENT> def __init__(self, x, y, color, radius): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.color = color <NEW_LINE> self.radius = radius
Keeping constant(same)/ variables for each class in superclass(here)
62598fc4ff9c53063f51a914
class RSparsematrixstats(RPackage): <NEW_LINE> <INDENT> homepage = "https://bioconductor.org/packages/sparseMatrixStats/" <NEW_LINE> git = "https://git.bioconductor.org/packages/sparseMatrixStats" <NEW_LINE> version('1.2.1', commit='9726f3d5e0f03b50c332d85d5e4c339c18b0494c') <NEW_LINE> depends_on('r-matrixgenerics...
Summary Statistics for Rows and Columns of Sparse Matrices High performance functions for row and column operations on sparse matrices. For example: col / rowMeans2, col / rowMedians, col / rowVars etc. Currently, the optimizations are limited to data in the column sparse format. This package is inspired by the matr...
62598fc47c178a314d78d766
class GETMethodProcessor(MethodProcessor): <NEW_LINE> <INDENT> not_accept_headers = ['Transfer-Encoding'] <NEW_LINE> @staticmethod <NEW_LINE> def make_response(response, provider): <NEW_LINE> <INDENT> headers = [(name, val) for name, val in response.headers.items() if name not in GETMethodProcessor.not_accept_headers] ...
Класс для обработки GET запросов и ответов к внешнему API
62598fc466673b3332c3069c
class SearchSignal(Base): <NEW_LINE> <INDENT> name = Column(String(40)) <NEW_LINE> value = Column(Integer) <NEW_LINE> contact_id = Column(ForeignKey('contact.id', ondelete='CASCADE'), nullable=False)
Represents a signal used for contacts search result ranking. Examples of signals might include number of emails sent to or received from this contact, or time since last interaction with the contact.
62598fc43346ee7daa3377ac
class IntegerVar(ScriptVariable): <NEW_LINE> <INDENT> form_field = forms.IntegerField <NEW_LINE> def __init__(self, min_value=None, max_value=None, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> if min_value: <NEW_LINE> <INDENT> self.field_attrs['min_value'] = min_value <NEW_LINE> <D...
Integer representation. Can enforce minimum/maximum values.
62598fc4167d2b6e312b723e
class DatabaseRouter: <NEW_LINE> <INDENT> def db_for_read(self, model: Model, **hints: Any) -> str: <NEW_LINE> <INDENT> assert model._meta.app_label in APP_LABEL_TO_DATABASE <NEW_LINE> return APP_LABEL_TO_DATABASE[model._meta.app_label] <NEW_LINE> <DEDENT> def db_for_write(self, model: Model, **hints: Any) -> str: <NEW...
A router to control all database operations on models in Concent.
62598fc4851cf427c66b857d
@content( 'proposal', icon='icon novaideo-icon icon-proposal', ) <NEW_LINE> @implementer(IProposal) <NEW_LINE> class Proposal(Commentable, VersionableEntity, SearchableEntity, DuplicableEntity, CorrelableEntity, PresentableEntity): <NEW_LINE> <INDENT> icon = 'icon novaideo-icon icon-proposal' <NEW_LINE> result_template...
Proposal class
62598fc45fdd1c0f98e5e25b
class NaiveTimeField(_IsoFormatMixin, Field): <NEW_LINE> <INDENT> default_error_messages = { "invalid": "Not a valid time string.", } <NEW_LINE> data_type_name = "Naive ISO-8601 Time" <NEW_LINE> def __init__(self, ignore_timezone=False, **options): <NEW_LINE> <INDENT> super(NaiveTimeField, self).__init__(**options) <NE...
Field that handles time values encoded as a string. The format of the string is that defined by ISO-8601. The naive time field differs from :py:`~TimeField` in the handling of the timezone, a timezone will not be applied if one is not specified. Use the ``ignore_timezone`` flag to have any timezone information ignor...
62598fc44527f215b58ea198
class StaticQueueInfo(queue_info.QueueInfoBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.queues = { 'default': StaticTaskQueue(name='default', priority=75, default_priority=75), 'large': StaticTaskQueue(name='large', priority=75, default_priority=75), 'highp': StaticTaskQueue(name='highp', prio...
Hardcoded queue information.
62598fc4adb09d7d5dc0a844
class DummyMonitor(BaseMonitor): <NEW_LINE> <INDENT> running = Bool() <NEW_LINE> monitored_entries = set_default(['default_path']) <NEW_LINE> received_news = List() <NEW_LINE> def start(self): <NEW_LINE> <INDENT> self.running = True <NEW_LINE> <DEDENT> def stop(self): <NEW_LINE> <INDENT> self.running = False <NEW_LINE>...
Dummy monitor used for testing.
62598fc492d797404e388cc6
class LocalStatusUpdater(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, update_hook): <NEW_LINE> <INDENT> super(LocalStatusUpdater, self).__init__() <NEW_LINE> self.should_quit = False <NEW_LINE> self.should_update_now = False <NEW_LINE> self.update_hook = update_hook <NEW_LINE> self.local_suites = [] <NEW_L...
Update the local suites status in the background.
62598fc4ff9c53063f51a916
class RadosRequest(UserRequest): <NEW_LINE> <INDENT> def __init__(self, headline, fsid, cluster_name, commands): <NEW_LINE> <INDENT> self._commands = commands <NEW_LINE> super(RadosRequest, self).__init__(headline, fsid, cluster_name) <NEW_LINE> <DEDENT> def _submit(self, commands=None): <NEW_LINE> <INDENT> if commands...
A user request whose remote operations consist of librados mon commands
62598fc4dc8b845886d53884
class Solution: <NEW_LINE> <INDENT> def threeSumClosest(self, numbers, target): <NEW_LINE> <INDENT> n = len(numbers) <NEW_LINE> if n < 3: return 0 <NEW_LINE> numbers.sort() <NEW_LINE> result = numbers[0] + numbers[1] + numbers[2] <NEW_LINE> for i in range(n): <NEW_LINE> <INDENT> j = i + 1 <NEW_LINE> k = n - 1 <NEW_LINE...
@param numbers: Give an array numbers of n integer @param target : An integer @return : return the sum of the three integers, the sum closest target.
62598fc48a349b6b43686508
class Leaf(object): <NEW_LINE> <INDENT> position = None <NEW_LINE> direction = None <NEW_LINE> right = None <NEW_LINE> def __init__(self, pos, direction, right): <NEW_LINE> <INDENT> self.position = pos <NEW_LINE> self.direction = direction <NEW_LINE> self.right = right <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def ge...
Class to store data for each leaf in the system
62598fc44a966d76dd5ef19e
class BrillouinZone(object): <NEW_LINE> <INDENT> def __init__(self, reciprocal_lattice, tolerance=0.01): <NEW_LINE> <INDENT> self._reciprocal_lattice = np.array(reciprocal_lattice) <NEW_LINE> self._tolerance = min( np.sum(reciprocal_lattice ** 2, axis=0)) * tolerance <NEW_LINE> self._reduced_bases = get_reduced_bases(r...
Move qpoints to first Brillouin zone by lattice translation. Attributes ---------- shortest_qpoints : list Each element of the list contains a set of q-points that are in first Brillouin zone (BZ). When inside BZ, there is only one q-point for each element, but on the surface, multiple q-points that are ...
62598fc45fc7496912d483df
class City(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=32) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name
Primary city where Superhero lives/works.
62598fc4adb09d7d5dc0a846
class Fork: <NEW_LINE> <INDENT> def __init__(self, timeout=0, verbose=False): <NEW_LINE> <INDENT> self.timeout = timeout <NEW_LINE> self.verbose = verbose <NEW_LINE> <DEDENT> def __call__(self, f): <NEW_LINE> <INDENT> P = Parallel(p_iter='fork', ncpus=1, timeout=self.timeout, verbose=self.verbose) <NEW_LINE> g = P(f) <...
A ``fork`` decorator class.
62598fc45fdd1c0f98e5e25e
class MutabilityRule: <NEW_LINE> <INDENT> def __init__( self, field_rule, values=(), exclude_fields=(), exclude_on_create=True, exclude_on_update=False, exclude_on_delete=False, error_message="", ): <NEW_LINE> <INDENT> self.field_rule = field_rule <NEW_LINE> self.values = values <NEW_LINE> self.exclude_fields = exclude...
This class serves to define the rule when an model is mutable. To define mutability rule it is mandatory to define "field_rule" of the model from which depend model mutability. To define relation field use '__' as separator in "field_rule" Once, "field_rule" is defined, model becomes immutable if the rule is not fulfi...
62598fc471ff763f4b5e7a48
class JoinUs(BrowserView): <NEW_LINE> <INDENT> index = ViewPageTemplateFile("template/join_us.pt") <NEW_LINE> def __call__(self): <NEW_LINE> <INDENT> return self.index()
Join Us
62598fc4377c676e912f6eda
class LocalSite(models.Model): <NEW_LINE> <INDENT> name = models.SlugField(_('name'), max_length=32, blank=False, unique=True) <NEW_LINE> users = models.ManyToManyField(User, blank=True, related_name='local_site') <NEW_LINE> admins = models.ManyToManyField(User, blank=True, related_name='local_site_admins') <NEW_LINE> ...
A division within a Review Board installation. This allows the creation of independent, isolated divisions within a given server. Users can be designated as members of a LocalSite, and optionally as admins (which allows them to manipulate the repositories, groups and users in the site). Pretty much every other model ...
62598fc43d592f4c4edbb17d
class EnsembleTransmissionParameters(object): <NEW_LINE> <INDENT> def __init__(self, decoders, transform): <NEW_LINE> <INDENT> self.untransformed_decoders = np.array(decoders) <NEW_LINE> self.transform = np.array(transform) <NEW_LINE> self.decoders = np.dot(transform, decoders.T) <NEW_LINE> self.untransformed_decoders....
Transmission parameters for a connection originating at an Ensemble. Attributes ---------- decoders : array Decoders to use for the connection.
62598fc43317a56b869be6b6
class TestPriceModificationValueChangeDecreaseAllOf(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDE...
PriceModificationValueChangeDecreaseAllOf unit test stubs
62598fc47047854f4633f69f
class RelationshipProcessComponent(StructuredRel): <NEW_LINE> <INDENT> weight = FloatProperty()
A class to represent the relationship between a Process and a Component. Attributes ---------- weight : float is the weight of the relationship
62598fc4851cf427c66b8581
class User(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> GENDER_CHOICE = ( ('M', '男'), ('F', '女'), ) <NEW_LINE> username = models.CharField(_('用户名'), unique=True, db_index=True, max_length=100, null=True) <NEW_LINE> password = models.CharField(_('密码'), max_length=128) <NEW_LINE> email = models.EmailField(_('...
自定义用户,需要在settings.py中指定这个User类为AUTH_USER_MODEL
62598fc45fdd1c0f98e5e25f
@attr.s <NEW_LINE> class Criterion(object): <NEW_LINE> <INDENT> name = attr.ib() <NEW_LINE> predicate = attr.ib() <NEW_LINE> def evaluate(self, attributes): <NEW_LINE> <INDENT> return (self.name in attributes and self.predicate(attributes[self.name]))
A criterion evaluates a predicate (callable object returning boolean) against an attribute with the given name.
62598fc450812a4eaa620d4b
class AssignMentorRoleForOrgTest(test_utils.DjangoTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.init() <NEW_LINE> self.program = program_utils.seedProgram() <NEW_LINE> self.org = org_utils.seedOrganization(self.program.key()) <NEW_LINE> self.profile = profile_utils.seedNDBProfile(self.program...
Unit tests for assignMentorRoleForOrg function.
62598fc492d797404e388cc8
class GEventRegister(EventRegister): <NEW_LINE> <INDENT> def __init__(self, events=None): <NEW_LINE> <INDENT> if events is not None: <NEW_LINE> <INDENT> self.__events__ = events <NEW_LINE> <DEDENT> EventRegister.__init__(self) <NEW_LINE> <DEDENT> def __getattr__(self, event): <NEW_LINE> <INDENT> if event == '__events__...
Event register for the :class:`GSignals` class. Automatically converts signal names with underscores('foo_bar') to names with hyphens ('foo-bar'). Same API as :class:`EventRegister`.
62598fc4f548e778e596b86b
@dataclass <NEW_LINE> class SynonymPredicateChange(NodeSynonymChange): <NEW_LINE> <INDENT> _inherited_slots: ClassVar[List[str]] = [] <NEW_LINE> class_class_uri: ClassVar[URIRef] = KGCL.SynonymPredicateChange <NEW_LINE> class_class_curie: ClassVar[str] = "kgcl:SynonymPredicateChange" <NEW_LINE> class_name: ClassVar[str...
A node synonym change where the predicate of a synonym is changed. Background: synonyms can be represented by a variety of predicates. For example, many OBO ontologies make use of predicates such as oio:hasExactSynonym, oio:hasRelatedSynonym, etc
62598fc4099cdd3c63675548
class ConnectionException(XBeeException): <NEW_LINE> <INDENT> pass
This exception will be thrown when any problem related to the connection with the XBee device occurs. All functionality of this class is the inherited of `Exception <https://docs.python.org/2/library/exceptions.html?highlight=exceptions.exception#exceptions.Exception>`_.
62598fc45166f23b2e2436ae
class NativeLibraryWrapper: <NEW_LINE> <INDENT> def __init__(self, base_folder, library_name, path_to_library=""): <NEW_LINE> <INDENT> if path_to_library == "": <NEW_LINE> <INDENT> os_ending = { "nt": "dll", "posix": "so" } <NEW_LINE> for os_name in os_ending: <NEW_LINE> <INDENT> if os.name == os_name: <NEW_LINE> <INDE...
Wrapper for a dynamic library with automatic conversion of numpy arrays.
62598fc466673b3332c306a2
class Packable(object): <NEW_LINE> <INDENT> def pack(self): <NEW_LINE> <INDENT> raise NotImplementedError('Must implement in subclass')
Base for all types that provide a .pack() method.
62598fc4f9cc0f698b1c5438
class Guess: <NEW_LINE> <INDENT> def __init__(self, symbol, number): <NEW_LINE> <INDENT> self.symbol=symbol <NEW_LINE> self.number=number <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "Guess('{0}',{1})".format(self.symbol, self.number) <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT...
Fields: symbol: Str number: Nat requires: See Assignment Specifications
62598fc45fc7496912d483e1
class StatusEnum(Enum): <NEW_LINE> <INDENT> DELETED = "deleted"
The status of the deletion request.
62598fc4283ffb24f3cf3b52
class B(Segment): <NEW_LINE> <INDENT> def __init__(self, dist: int): <NEW_LINE> <INDENT> super().__init__(dist)
A segment of the B road.
62598fc47047854f4633f6a1
class QueryNextResponse(FrozenClass): <NEW_LINE> <INDENT> ua_types = { 'TypeId': 'NodeId', 'ResponseHeader': 'ResponseHeader', 'Parameters': 'QueryNextResult', } <NEW_LINE> def __init__(self, binary=None): <NEW_LINE> <INDENT> if binary is not None: <NEW_LINE> <INDENT> self._binary_init(binary) <NEW_LINE> self._freeze =...
:ivar TypeId: :vartype TypeId: NodeId :ivar ResponseHeader: :vartype ResponseHeader: ResponseHeader :ivar Parameters: :vartype Parameters: QueryNextResult
62598fc47cff6e4e811b5cf3
class PolynomialBase(FittableModel): <NEW_LINE> <INDENT> _param_names = () <NEW_LINE> linear = True <NEW_LINE> col_fit_deriv = False <NEW_LINE> @lazyproperty <NEW_LINE> def param_names(self): <NEW_LINE> <INDENT> return self._param_names <NEW_LINE> <DEDENT> def __getattr__(self, attr): <NEW_LINE> <INDENT> if self._param...
Base class for all polynomial-like models with an arbitrary number of parameters in the form of coefficients. In this case Parameter instances are returned through the class's ``__getattr__`` rather than through class descriptors.
62598fc4956e5f7376df57e5
class WebClusterPicture: <NEW_LINE> <INDENT> def __init__(self, label, data=None): <NEW_LINE> <INDENT> self.label = label <NEW_LINE> if data is None: <NEW_LINE> <INDENT> self._data = self._get_dbdata() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._data = data <NEW_LINE> <DEDENT> <DEDENT> def _get_dbdata(self): <N...
Class for retrieving cluster picture information from the database
62598fc4cc40096d6161a33f
class UniquePerson(object): <NEW_LINE> <INDENT> def __call__(self, form, field): <NEW_LINE> <INDENT> if form.lead.data.number == form.follow.data.number: <NEW_LINE> <INDENT> raise ValidationError(field.gettext(f"{form.lead.data} cannot dance with himself or herself."))
Checks if there are no double dancers in the competition.
62598fc4091ae35668704ef6
class StyleStore(object) : <NEW_LINE> <INDENT> __styles = {} <NEW_LINE> @classmethod <NEW_LINE> def styles ( kls ) : <NEW_LINE> <INDENT> return kls.__styles
Store for all created/cofigures styles
62598fc45fdd1c0f98e5e262
class EndPoint(object): <NEW_LINE> <INDENT> def __init__(self, api, path, suffix=''): <NEW_LINE> <INDENT> self.api = api <NEW_LINE> self.path = path <NEW_LINE> self.suffix = suffix <NEW_LINE> <DEDENT> def __getitem__(self, item): <NEW_LINE> <INDENT> return EndPoint(self.api, '/'.join([self.path, str(item)]), self.suffi...
A potential end point of an API, where we can get JSON data from. An instance of `EndPoint` is a callable that upon invocation performs a GET request. Any kwargs passed in to the call will be used to build a query string.
62598fc4fff4ab517ebcdab5
class ConnectionsException(ProsperBotException): <NEW_LINE> <INDENT> pass
class for prosper_bots.connections
62598fc44f88993c371f0672