code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class RepoGroupDistributorResourceView(View): <NEW_LINE> <INDENT> @auth_required(authorization.READ) <NEW_LINE> def get(self, request, repo_group_id, distributor_id): <NEW_LINE> <INDENT> distributor_manager = managers_factory.repo_group_distributor_manager() <NEW_LINE> dist = distributor_manager.get_distributor(repo_gr... | View for a single repo group distributor association. | 62598f087c178a314d78bf87 |
class FileNotFoundError(GeneralAPIException): <NEW_LINE> <INDENT> def __init__(self, msg=None, path=None, type=None): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.type = type <NEW_LINE> if msg is not None: <NEW_LINE> <INDENT> self.msg = msg <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if type is not None: <NEW... | File or directory not found on OneDrive.
Parameters
----------
msg : str, optional
path : str, optional
Remote path.
Attributes
----------
msg : str
path : str
type : str | 62598f08bf627c535bcaff5e |
class guid_by_date(addins.base): <NEW_LINE> <INDENT> def __init__(self, prefix='date:'): <NEW_LINE> <INDENT> self.prefix = prefix <NEW_LINE> <DEDENT> def on_need_guid(self, feed, item_dict): <NEW_LINE> <INDENT> date_tuple = item_dict.get('date_parsed') <NEW_LINE> if date_tuple: <NEW_LINE> <INDENT> return u'%s%s' % (sel... | Generates a guid based on the date of an item.
The date as a Unix timestamp will be used as the guid. A
similar effect could be achieved using ``guid_by_content``,
which would store a hash. However, what makes this one slightly
better is that if the feed starts giving dates in a different
timezone, it will still be ab... | 62598f088a349b6b43684d2c |
class UsageAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ["date", "team", "time", "usage", "updated_at"] <NEW_LINE> search_fields = ["team__name", ] <NEW_LINE> list_filter = ['team'] <NEW_LINE> date_hierarchy = "date" | Administrator display list: team, date, and energy. | 62598f08aad79263cf42d2f3 |
class CategoryProfile(MainHandler): <NEW_LINE> <INDENT> def get(self, category_slug=None): <NEW_LINE> <INDENT> logging.info('################ CategoryProfile::get ################') <NEW_LINE> user = self.current_user <NEW_LINE> logging.info('######### category_slug = '+category_slug+' ##########') <NEW_LINE> category_... | Returns content for Category Profile pages.
| 62598f08dc8b845886d520b0 |
class Posterior(LogLikelihoodRatio): <NEW_LINE> <INDENT> def __init__(self, pos_label=1, neg_label=None): <NEW_LINE> <INDENT> super(Posterior, self).__init__(pos_label=pos_label, neg_label=neg_label) <NEW_LINE> <DEDENT> def transform(self, X): <NEW_LINE> <INDENT> lr = np.exp(-super(Posterior, self).transform(X)) <NEW_L... | Multivariate posterior probabiliy estimator
... based on non-parametric Gaussian-kernel density estimator
Parameters
----------
pos_label : int, optional
Label of positive samples. Defaults to 1.
neg_label : int, optional
Label of negative samples.
If it is not provided, all samples that are not positive ... | 62598f0860cbc95b06362e1b |
class EdtAssigne(Uniligne): <NEW_LINE> <INDENT> def __init__(self, pere, objet=None, attribut=None): <NEW_LINE> <INDENT> Uniligne.__init__(self, pere, objet, attribut) <NEW_LINE> <DEDENT> def interpreter(self, msg): <NEW_LINE> <INDENT> entree = msg.split(" ")[0].lower() <NEW_LINE> joueur = None <NEW_LINE> joueurs = imp... | Classe définissant le contexte éditeur 'assigné à'.
Ce contexte permet d'assigner un rapport à quelqu'un. | 62598f085fdd1c0f98e5ca8a |
class MissingConfigException(Exception): <NEW_LINE> <INDENT> pass | Raise when required configuration is missing. | 62598f08fbf16365ca792b86 |
class Container(tuple): <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> return ("<{} object of {} artists>" .format(type(self).__name__, len(self))) <NEW_LINE> <DEDENT> def __new__(cls, *args, **kwargs): <NEW_LINE> <INDENT> return tuple.__new__(cls, args[0]) <NEW_LINE> <DEDENT> def __init__(self, kl, label=... | Base class for containers.
Containers are classes that collect semantically related Artists such as
the bars of a bar plot. | 62598f08d486a94d0ba2aab0 |
class UsersHandler(CachedPageHandler): <NEW_LINE> <INDENT> PAGE_SIZE = 100 <NEW_LINE> @canonicalize_domain <NEW_LINE> def get(self): <NEW_LINE> <INDENT> return super(UsersHandler, self).get(cache=not self.request.params) <NEW_LINE> <DEDENT> def template_file(self): <NEW_LINE> <INDENT> return 'templates/users.html' <NEW... | Handler for /users.
Semi-optimized. Pages by source name. Queries each source type for results
with name greater than the start_name query param, then merge sorts the
results and truncates at PAGE_SIZE.
The start_name param is expected to be capitalized because capital letters
sort lexicographically before lower case... | 62598f0871ff763f4b5e624d |
class JSONField(TextField): <NEW_LINE> <INDENT> def db_value(self, value): <NEW_LINE> <INDENT> return json.dumps(value) <NEW_LINE> <DEDENT> def python_value(self, value): <NEW_LINE> <INDENT> if value is not None: <NEW_LINE> <INDENT> return json.loads(value) | A Peewee database field with transparent JSON dump/load. | 62598f0850812a4eaa620160 |
class MemcacheMiddleware(object): <NEW_LINE> <INDENT> def __init__(self, app, conf): <NEW_LINE> <INDENT> pass <NEW_LINE> self.app = app <NEW_LINE> self.conf = conf <NEW_LINE> <DEDENT> def __call__(self, env, start_response): <NEW_LINE> <INDENT> pass <NEW_LINE> start_response('200 OK', [('Content-Type', 'text/plain')]) ... | docstring for MemcacheMiddleware | 62598f087b180e01f3e485bd |
class DateTimeProperty(Property): <NEW_LINE> <INDENT> _attributes = Property._attributes + ['_auto_now', '_auto_now_add'] <NEW_LINE> _auto_now = False <NEW_LINE> _auto_now_add = False <NEW_LINE> @utils.positional(1 + Property._positional) <NEW_LINE> def __init__(self, name=None, auto_now=False, auto_now_add=False, **kw... | A Property whose value is a datetime object.
Note: Unlike Django, auto_now_add can be overridden by setting the
value before writing the entity. And unlike classic db, auto_now
does not supply a default value. Also unlike classic db, when the
entity is written, the property values are updated to match what
was writt... | 62598f08cc40096d6161974f |
class Rescale(Layer): <NEW_LINE> <INDENT> def __init__(self, scale_factor, **kwargs): <NEW_LINE> <INDENT> self.scale_factor = scale_factor <NEW_LINE> super().__init__(**kwargs) <NEW_LINE> <DEDENT> def build(self, input_shape): <NEW_LINE> <INDENT> super().build(input_shape) <NEW_LINE> <DEDENT> def call(self, x): <NEW_LI... | Rescales a layer by some factor. | 62598f08377c676e912f62da |
class DataFormatter(Formatter): <NEW_LINE> <INDENT> dot_re = re.compile(r"\.(\w+)") <NEW_LINE> def get_field(self, field_name, args, kwargs): <NEW_LINE> <INDENT> field_name = self.dot_re.sub(r"[\1]", field_name) <NEW_LINE> return Formatter.get_field(self, field_name, args, kwargs) <NEW_LINE> <DEDENT> def format_data(se... | String formatter for processing the API responses according to user
provided templates. | 62598f08ec188e330fdf739c |
class FeatureNet(nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.conv1 = nn.Conv2d(3, 32, 5, 1) <NEW_LINE> self.conv2 = nn.Conv2d(32, 64, 4, 2) <NEW_LINE> <DEDENT> def freeze(self): <NEW_LINE> <INDENT> for p in self.parameters(): <NEW_LINE> <INDENT> p.requires_... | Network section parametrized by theta_1 | 62598f08ad47b63b2c5a6304 |
class StackFamily: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.data = dict() <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '{' + ', '.join(['%s: %s' % (k, self.data[k]) for k in sorted(self.data.keys())]) + '}' <NEW_LINE> <DEDENT> def push_front(self, score, candidate): <NEW_LI... | Family of stacks. Used for the manipulation of Maximin.
>>> sf = StackFamily()
>>> print(sf.pop_front())
None
>>> sf.push_front(42, 4)
>>> sf.push_front(51, 0)
>>> sf.push_front(42, 2)
>>> sf.push_front(42, 3)
>>> sf
{42: [4, 2, 3], 51: [0]}
>>> sf.pop_front()
3
>>> sf
{42: [4, 2], 51: [0]}
A StackFamily contains a d... | 62598f087c178a314d78bf89 |
class TestWorkspaceIsPublic(MongoIntegrationTransactionTestCase): <NEW_LINE> <INDENT> def test_is_workspace_public_return_http_200(self): <NEW_LINE> <INDENT> user = UserFixtures().create_user(username="user1") <NEW_LINE> workspace = WorkspaceFixtures().create_workspace(user.id, TITLE_1) <NEW_LINE> response = RequestMoc... | Test Workspace Is Public | 62598f0855399d3f05625011 |
class ReplayBuffer(ReplayBufferBase): <NEW_LINE> <INDENT> def __init__(self, config: RNNConfigBase): <NEW_LINE> <INDENT> super(ReplayBuffer, self).__init__(config.replay_buffer) <NEW_LINE> self.sample_from_actor_def = config.sample_from_actor_def <NEW_LINE> <DEDENT> def split_sample(self, sample: SampleFromActor) -> Tu... | Replay buffer implementation.
Args:
config: Configuration of CNN. | 62598f088a349b6b43684d2e |
class I18nPlugin(TablePlugin): <NEW_LINE> <INDENT> def __init__(self, lang_code: Optional[str] = None): <NEW_LINE> <INDENT> self.lang = lang_code <NEW_LINE> <DEDENT> def contribute_to_config(self, config: dict, table: 'Table'): <NEW_LINE> <INDENT> super().contribute_to_config(config, table) <NEW_LINE> code = self.lang ... | Internationalization plugin. | 62598f08851cf427c66b6db4 |
class TestCeleryWorker(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.settings = Settings() <NEW_LINE> <DEDENT> def setUp(self): <NEW_LINE> <INDENT> if self.settings is not None: <NEW_LINE> <INDENT> self.settings.__init__() <NEW_LINE> <DEDENT> <DEDENT> def t... | Unit tests for Celery worker related methods | 62598f0860cbc95b06362e1d |
class ToHDF(Step): <NEW_LINE> <INDENT> def __init__(self, objects_to_ascii=False, **kwargs): <NEW_LINE> <INDENT> Step.__init__(self, objects_to_ascii=objects_to_ascii, **kwargs) <NEW_LINE> self._target = True <NEW_LINE> <DEDENT> def run(self, **kwargs): <NEW_LINE> <INDENT> store = pd.HDFStore(os.path.join(self._dump_di... | write DataFrames to an HDF store
pass put_arguments (format, mode, data_columns, etc.) to init
pass DataFrames by name via inputs | 62598f08d486a94d0ba2aab2 |
class TestQuarterMultiply(object): <NEW_LINE> <INDENT> cases = [ dict( q_times=[0], q_durs=[10], note_ons=[0, 10, 20], note_offs=[10, 20, 30], factor=100, new_note_ons=[0, 1000, 2000], new_note_offs=[1000, 2000, 3000], ), dict( q_times=[0, 10], q_durs=[10, 100], note_ons=[0, 10, 110], note_offs=[10, 110, 210], factor=2... | Test whether timepoints are adjusted correctly when calling
set_quarter_duration with the option adjust_times=True. | 62598f089f288636728172e3 |
class HashtagNameView(TemplateView): <NEW_LINE> <INDENT> template_name = 'hashtags/by-name.html' <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> hashtag_name = kwargs['p_hashtag_name'] <NEW_LINE> l_categories = Category.objects.all() <NEW_LINE> l_attributes = Attribute.objects.all() <NEW_LINE> t... | Index view, displays list of hashtags | 62598f083617ad0b5ee04c19 |
class Mirror(Object): <NEW_LINE> <INDENT> def __init__(self, hash=None, mirrors=None, status=None): <NEW_LINE> <INDENT> self.hash = hash <NEW_LINE> self.mirrors = mirrors <NEW_LINE> self.status = status | Mirror or file replica settings.
Attributes:
hash (str):
mirrors (int): number of file replicas.
status (str): current file replica status. | 62598f0831939e2706ed0fd8 |
class Selector(nose.selector.Selector): <NEW_LINE> <INDENT> tags = "" <NEW_LINE> def __init__(self, config): <NEW_LINE> <INDENT> nose.selector.Selector.__init__(self, config) <NEW_LINE> clearTestRunnerRegistry() <NEW_LINE> self.compiledRoot = getattr(config.options, 'compiled_root', None) <NEW_LINE> if '' == self.compi... | Replacement test selector. Able to handle compiled test runners in a
special way, independently of python tests.
Examines test candidates and determines whether, given the specified
configuration, the test candidate should be selected as a test. | 62598f080fa83653e46f39d1 |
class ContentIdCounter: <NEW_LINE> <INDENT> new_content_ids = [] <NEW_LINE> def __init__(self, next_content_id_index): <NEW_LINE> <INDENT> self.next_content_id_index = next_content_id_index <NEW_LINE> <DEDENT> def generate_content_id(self, content_id_prefix): <NEW_LINE> <INDENT> content_id = '%s%i' % ( content_id_prefi... | This helper class is used to keep track of
next_content_id_index and new_content_ids, and provides a
function to generate new content_ids. | 62598f08377c676e912f62db |
class Product(SampleGenerator): <NEW_LINE> <INDENT> def __init__(self, first, second, amplitude=1.0): <NEW_LINE> <INDENT> super(Product, self).__init__(amplitude=amplitude) <NEW_LINE> self.first = first <NEW_LINE> self.second = second <NEW_LINE> <DEDENT> def __next__(self): <NEW_LINE> <INDENT> first_chunk = next(self.f... | Element-wise product of two generators chunks. | 62598f08ec188e330fdf739e |
class PostPage(Handler): <NEW_LINE> <INDENT> def get(self, post_id): <NEW_LINE> <INDENT> post = Post.get_by_id(int(post_id), parent=blog_key()) <NEW_LINE> if not post: <NEW_LINE> <INDENT> self.error(404) <NEW_LINE> return <NEW_LINE> <DEDENT> self.render('permalink.html', post=post) | Class that will lead to each post | 62598f08aad79263cf42d2f6 |
class Lambda(IterableDataset): <NEW_LINE> <INDENT> def __init__(self, dataset, fn=lambda _x: _x): <NEW_LINE> <INDENT> self.dataset = dataset <NEW_LINE> self.fn = fn <NEW_LINE> <DEDENT> def __getitem__(self, index): <NEW_LINE> <INDENT> return self.fn(self.dataset[index]) <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE>... | Preprocessing fn | 62598f084a966d76dd5ed9c1 |
class EmployeeLeaveDaysServiceStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.EligibleForLeave = channel.unary_unary( '/work_leave.EmployeeLeaveDaysService/EligibleForLeave', request_serializer=Employee.SerializeToString, response_deserializer=LeaveEligibility.FromString, ) <NEW_... | Service. define the methods that the grpc server can expose to the client.
| 62598f08adb09d7d5dc0909b |
class TextItems(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swaggerTypes = { 'List': 'list[TextItem]', 'Links': 'list[Link]' } <NEW_LINE> self.attributeMap = { 'List': 'List','Links': 'Links'} <NEW_LINE> self.List = None <NEW_LINE> self.Links = None | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f088a349b6b43684d30 |
class TestInlineResponse2009Params(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 testInlineResponse2009Params(self): <NEW_LINE> <INDENT> pass | InlineResponse2009Params unit test stubs | 62598f08ab23a570cc2d42e3 |
class Fcomb(nn.Module): <NEW_LINE> <INDENT> def __init__(self, num_filters, latent_dim, num_output_channels, num_classes, no_convs_fcomb, initializers, use_tile=True): <NEW_LINE> <INDENT> super(Fcomb, self).__init__() <NEW_LINE> self.num_channels = num_output_channels <NEW_LINE> self.num_classes = num_classes <NEW_LINE... | A function composed of no_convs_fcomb times a 1x1 convolution that combines the sample taken from the latent space,
and output of the UNet (the feature map) by concatenating them along their channel axis. | 62598f089f288636728172e5 |
class AWarehouse( AnAbstractBuilding ): <NEW_LINE> <INDENT> __slots__ = ( "__storage", "__capacity", "__specialization" ) <NEW_LINE> def __init__( self, specialization=SPECIALIZATIONS[ "WEAPONS" ], capacity=100, **kwargs ): <NEW_LINE> <INDENT> super( AWarehouse, self ).__init__( **kwargs ) <NEW_LINE> assert specializat... | docstring for AWarehouse | 62598f08283ffb24f3cf239a |
@python_2_unicode_compatible <NEW_LINE> class Like(TimeStampedModel): <NEW_LINE> <INDENT> creator = models.ForeignKey(user_models.User, null=True, on_delete=models.CASCADE) <NEW_LINE> image = models.ForeignKey(Image, null=True, on_delete=models.CASCADE, related_name='likes') <NEW_LINE> def __str__(self): <NEW_LINE> <IN... | Like Model | 62598f08cc40096d61619751 |
@dataclass <NEW_LINE> class Polygon: <NEW_LINE> <INDENT> vertices: List[LatLngPoint] | A class to hold the polygon object | 62598f084c34283577618dd8 |
class Battleship( Ship ): <NEW_LINE> <INDENT> win_damage = 3 <NEW_LINE> draw_damage = 1 <NEW_LINE> type = 'Battleship' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> Ship.__init__(self) <NEW_LINE> self.hp = 6 <NEW_LINE> <DEDENT> def own(self, fleet): <NEW_LINE> <INDENT> fleet.battleships.append(self) | I cause 3 hp of damage on win. 1 HP on draw
I move 1 units per turn.
I have 6 HP
I can be built in 4 turns. | 62598f08ec188e330fdf73a0 |
class MarkdownParser(Parser): <NEW_LINE> <INDENT> output_ext = 'html' <NEW_LINE> def _parse_text(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> import markdown <NEW_LINE> <DEDENT> except ImportError: <NEW_LINE> <INDENT> raise Exception("The Python markdown library isn't installed. " + "Install with `pip install ma... | Markdown Parser | 62598f0855399d3f05625015 |
class CompassDevice(): <NEW_LINE> <INDENT> port = '' <NEW_LINE> timeout = 1 <NEW_LINE> def get_heading(self): <NEW_LINE> <INDENT> return 0.0 <NEW_LINE> <DEDENT> def get_heading_compensated(self, offset=MAG_ADJUSTMENT): <NEW_LINE> <INDENT> raw_heading = self.get_heading() <NEW_LINE> if raw_heading >= offset: <NEW_LINE> ... | Generic Compass Driver | 62598f08099cdd3c6367494f |
class AlignmentConstraintFactory(SequenceConstraintFactory): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_items(cls, items, anchor_name, spacing): <NEW_LINE> <INDENT> return cls._make_cns(items, anchor_name, anchor_name, spacing) | A SequenceConstraintFactory subclass which represents an
alignmnent constraint, which is a constraint between two anchors of
different components which are aligned but may be separated by some
amount of space. It provides a 'from_items' classmethod which will
create a list of alignment constraints from a sequence of i... | 62598f08d486a94d0ba2aab6 |
class PunctuationAnalyzer(_SingleShapeAnalyzer): <NEW_LINE> <INDENT> TAG_STR = 'PNCT' <NEW_LINE> def check_shape(self, word, word_lower): <NEW_LINE> <INDENT> return is_punctuation(word) | This analyzer tags punctuation marks as "PNCT".
Example: "," -> PNCT | 62598f08cc40096d61619752 |
class ComputeHost(mb.BlazarBase): <NEW_LINE> <INDENT> __tablename__ = 'computehosts' <NEW_LINE> id = _id_column() <NEW_LINE> vcpus = sa.Column(sa.Integer, nullable=False) <NEW_LINE> cpu_info = sa.Column(MediumText(), nullable=False) <NEW_LINE> hypervisor_type = sa.Column(MediumText(), nullable=False) <NEW_LINE> hypervi... | Description
Specifies resources asked by reservation from
Compute Host Reservation API. | 62598f08ec188e330fdf73a2 |
@inheritdocstring <NEW_LINE> class XavierInitializer(WeightInitializer): <NEW_LINE> <INDENT> def __init__(self, distribution, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.distribution = distribution <NEW_LINE> <DEDENT> def initialize(self): <NEW_LINE> <INDENT> scale = np.sqrt(... | Args:
distribution: String. Either "normal" or "uniform". | 62598f084a966d76dd5ed9c5 |
class FrontendExport(object): <NEW_LINE> <INDENT> swagger_types = { 'apis': 'list[VirtualizedAPI]', 'methods': 'list[VirtualizedMethodExport]', 'backend_methods': 'list[BackendMethodExport]', 'imagedata': 'dict(str, str)' } <NEW_LINE> attribute_map = { 'apis': 'apis', 'methods': 'methods', 'backend_methods': 'backendMe... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f08851cf427c66b6dba |
class TestBranchUtility(object): <NEW_LINE> <INDENT> def __init__(self, branches, channels): <NEW_LINE> <INDENT> self._branches = branches <NEW_LINE> self._channels = channels <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def CreateWithCannedData(): <NEW_LINE> <INDENT> return TestBranchUtility(CANNED_BRANCHES, CANNED_CH... | Mimics BranchUtility to return valid-ish data without needing omahaproxy
data. | 62598f088a349b6b43684d34 |
class RiscoSensor(CoordinatorEntity, SensorEntity): <NEW_LINE> <INDENT> def __init__(self, coordinator, category_id, excludes, name, entry_id) -> None: <NEW_LINE> <INDENT> super().__init__(coordinator) <NEW_LINE> self._event = None <NEW_LINE> self._category_id = category_id <NEW_LINE> self._excludes = excludes <NEW_LIN... | Sensor for Risco events. | 62598f08be7bc26dc92513db |
class MultiDict(web.storage): <NEW_LINE> <INDENT> def getall(self, name): <NEW_LINE> <INDENT> if name in self: <NEW_LINE> <INDENT> value = self[name] <NEW_LINE> if not isinstance(value, list): <NEW_LINE> <INDENT> value = [value] <NEW_LINE> <DEDENT> return value <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return [] | wtforms expect the formdate to be a multi-dict instance with getall method.
This is a hack to make it work with web.py apps. | 62598f0871ff763f4b5e6255 |
class User(Document): <NEW_LINE> <INDENT> username = StringField(unique=True) <NEW_LINE> password = StringField() <NEW_LINE> favorite = ListField(ObjectIdField()) <NEW_LINE> user_type = IntField(default=const.CUSTOMER) <NEW_LINE> nickname = StringField() <NEW_LINE> info = EmbeddedDocumentField(UserInfo) <NEW_LINE> is_a... | 用户 | 62598f083617ad0b5ee04c1e |
class TestV1ListMeta(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 testV1ListMeta(self): <NEW_LINE> <INDENT> pass | V1ListMeta unit test stubs | 62598f0850812a4eaa620164 |
class Timer(object): <NEW_LINE> <INDENT> def __enter__(self): <NEW_LINE> <INDENT> self.s0 = time.clock() <NEW_LINE> return self <NEW_LINE> <DEDENT> def __exit__(self, *args): <NEW_LINE> <INDENT> self.s1 = time.clock() <NEW_LINE> self.time = self.s1 - self.s0 | Timer class for timing sections of code.
The timer class follows the context management protocol and
thus is used with the `with` statement.
Examples
--------
>>> with Timer() as t:
... # code to time here
>>> print('Request took %.03f sec.' % t.time) | 62598f0997e22403b38399d2 |
class Architecture(ABC): <NEW_LINE> <INDENT> def __init__(self, worker_cls: type, learner_cls: type, cfg: dict): <NEW_LINE> <INDENT> self.cfg = cfg <NEW_LINE> self.num_workers = self.cfg["num_workers"] <NEW_LINE> self.num_learners = self.cfg["num_learners"] <NEW_LINE> self.worker_cls = worker_cls <NEW_LINE> self.learne... | Abstract Architecture used for all distributed architectures | 62598f09cc40096d61619753 |
class AgentAvailabilityMessage(): <NEW_LINE> <INDENT> def __init__(self, *, message: str = None) -> None: <NEW_LINE> <INDENT> self.message = message <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_dict(cls, _dict: Dict) -> 'AgentAvailabilityMessage': <NEW_LINE> <INDENT> args = {} <NEW_LINE> if 'message' in _dict: ... | AgentAvailabilityMessage.
:attr str message: (optional) The text of the message. | 62598f09956e5f7376df4bf5 |
class SafeString(str, SafeData): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> def __add__(self, rhs): <NEW_LINE> <INDENT> t = super().__add__(rhs) <NEW_LINE> if isinstance(rhs, SafeData): <NEW_LINE> <INDENT> return SafeString(t) <NEW_LINE> <DEDENT> return t <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> re... | A str subclass that has been specifically marked as "safe" for HTML output
purposes. | 62598f0931939e2706ed0fdb |
class PacketCaptureFilter(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'protocol': {'key': 'protocol', 'type': 'str'}, 'local_ip_address': {'key': 'localIPAddress', 'type': 'str'}, 'remote_ip_address': {'key': 'remoteIPAddress', 'type': 'str'}, 'local_port': {'key': 'localPort', 'type': 'str'}, '... | Filter that is applied to packet capture request. Multiple filters can be applied.
:param protocol: Protocol to be filtered on. Possible values include: "TCP", "UDP", "Any".
Default value: "Any".
:type protocol: str or ~azure.mgmt.network.v2019_02_01.models.PcProtocol
:param local_ip_address: Local IP Address to be f... | 62598f090fa83653e46f39d7 |
class LoadMovie(): <NEW_LINE> <INDENT> exists = False <NEW_LINE> def __init__(self, title, imdb_id, runtime, synopsis, theater_date, keywords): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.movie, self.created = Movie.objects.get_or_create( title=title, imdb_id=imdb_id, runtime=runtime, synopsis=synopsis, theater_d... | This manager inserts a movie into the database along with its
corresponding genres, actors, and directors. | 62598f09d486a94d0ba2aab8 |
class DisplaySchemata(FacetedSchemata): <NEW_LINE> <INDENT> label = u'display' <NEW_LINE> fields = field.Fields(IAutocompleteSchema).select( u'placeholder' ) | Schemata display
| 62598f09be7bc26dc92513dc |
class Settings(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.screen_width = 800 <NEW_LINE> self.screen_height = 600 <NEW_LINE> self.bg_colour = (230, 230, 230) <NEW_LINE> self.ship_limit = 3 <NEW_LINE> self.fleet_drop_speed = 15 <NEW_LINE> self.bullet_width = 6 <NEW_LINE> self.bullet_height = 12 <... | A class to store all settings for Alien Invasion! | 62598f095fcc89381b2656a5 |
class Notification(Object): <NEW_LINE> <INDENT> ID = "notification" <NEW_LINE> def __init__(self, id, date, is_silent, type, **kwargs): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.date = date <NEW_LINE> self.is_silent = is_silent <NEW_LINE> self.type = type <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def read(q: ... | Contains information about a notification
Attributes:
ID (:obj:`str`): ``Notification``
Args:
id (:obj:`int`):
Unique persistent identifier of this notification
date (:obj:`int`):
Notification date
is_silent (:obj:`bool`):
True, if the notification was initially silent
t... | 62598f097cff6e4e811b44da |
class OptionParser(optparse.OptionParser): <NEW_LINE> <INDENT> OPTION_LIST = [] <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> optparse.OptionParser.__init__(self, *args, **kwargs) <NEW_LINE> self.set_defaults(action=None, section=None) <NEW_LINE> for option in self.OPTION_LIST: <NEW_LINE> <INDENT>... | OptionParser that raises exception on errors.
This class should not be used directly, use parse_args instead. | 62598f09a219f33f346c5320 |
class Database(object): <NEW_LINE> <INDENT> packet_id = 0 <NEW_LINE> @classmethod <NEW_LINE> def save_key_frame(cls, frame, key_frame_id): <NEW_LINE> <INDENT> with open('{0}.kframe'.format(key_frame_id), 'w') as _file: <NEW_LINE> <INDENT> _file.write(frame) <NEW_LINE> <DEDENT> <DEDENT> @classmethod <NEW_LINE> def save_... | Interface to save key frames and packets to file system. | 62598f09091ae3566870370e |
class DurationField(Field): <NEW_LINE> <INDENT> DURATION_RE = re.compile(r"(?P<duration>[0-9]+)\s*(?P<units>[a-z]*)", re.IGNORECASE) <NEW_LINE> MINUTE = 60 <NEW_LINE> HOUR = 3600 <NEW_LINE> DAY = 86400 <NEW_LINE> WEEK = 604800 <NEW_LINE> UNITS = { "w": WEEK, "week": WEEK, "d": DAY, "day": DAY, "h": HOUR, "hour": HOUR, ... | The duration field represents a duration as represented by a string such as 1d for a 24 hour period.
The string is converted to an integer indicating the number of seconds. | 62598f099f288636728172ea |
class TalktoMeList(APIView): <NEW_LINE> <INDENT> def get(self, request, kw, *args, **kwargs): <NEW_LINE> <INDENT> logger.debug(request) <NEW_LINE> logger.debug(kw) <NEW_LINE> queryset_contains = ChatMessages.objects.filter(message__icontains="%s"%kw) <NEW_LINE> messages = [] <NEW_LINE> for q in queryset_contains: <NEW... | attend requests by guests | 62598f094527f215b58e89ef |
class ApiResourceList(ApiAttributeMixin, ApiResource, Iterator): <NEW_LINE> <INDENT> metadata = ApiAttribute('metadata') <NEW_LINE> def __init__(self, auth=None, metadata=None): <NEW_LINE> <INDENT> ApiAttributeMixin.__init__(self) <NEW_LINE> ApiResource.__init__(self) <NEW_LINE> self.auth = auth <NEW_LINE> self.UpdateM... | Abstract class of all api list resources.
Inherits ApiResource and builds iterator to list any API resource. | 62598f090fa83653e46f39d9 |
class BirchMurnaghanBase(eos.EquationOfState): <NEW_LINE> <INDENT> def volume(self,pressure, temperature, params): <NEW_LINE> <INDENT> return volume(pressure,params) <NEW_LINE> <DEDENT> def pressure(self, temperature, volume, params): <NEW_LINE> <INDENT> return birch_murnaghan(params['V_0']/volume, params) <NEW_LINE> <... | Base class for the isothermal Birch Murnaghan equation of state. This is third order in strain, and
has no temperature dependence. However, the shear modulus is sometimes fit to a second order
function, so if this is the case, you should use that. For more see :class:`burnman.birch_murnaghan.BM2` and :class:`burnma... | 62598f09851cf427c66b6dbd |
class Database(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.conn = sqlite3.connect(os.getcwd() + '/xrates.db') <NEW_LINE> self.c = self.conn.cursor() <NEW_LINE> <DEDENT> def constructDB(self): <NEW_LINE> <INDENT> self.c.execute("CREATE TABLE usd (date text, name text, sell real, buy real)") <NEW_... | Class for interacting with sqlite3 database and basic methods. | 62598f09ff9c53063f519154 |
class MyRedis(object): <NEW_LINE> <INDENT> _instance = None <NEW_LINE> redis <NEW_LINE> def __init__(self, host, port, password, decode_responses): <NEW_LINE> <INDENT> self.redis = redis.StrictRedis(host=host, port=port, password=password, decode_responses=decode_responses) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> d... | redis config | 62598f097cff6e4e811b44dc |
class TestRemoveGroupReadRightToWorkspace(MongoIntegrationTransactionTestCase): <NEW_LINE> <INDENT> def test_remove_group_read_right_to_workspace_return_http_200(self): <NEW_LINE> <INDENT> user = UserFixtures().create_user(username="user1") <NEW_LINE> group = GroupFixtures().create_group(name="group1") <NEW_LINE> works... | Test Remove Group Read Right To Workspace | 62598f0950812a4eaa620166 |
class MetatabRowGenerator(Source): <NEW_LINE> <INDENT> def __init__(self, ref, cache=None, working_dir=None, path = None, **kwargs): <NEW_LINE> <INDENT> super().__init__(ref, cache, working_dir, **kwargs) <NEW_LINE> self._rows = ref <NEW_LINE> self._path = path or '<none>' <NEW_LINE> <DEDENT> @property <NEW_LINE> def p... | An object that generates rows. The current implementation mostly just a wrapper around
csv.reader, but it adds a path property so term interperters know where the terms are coming from | 62598f09f548e778e596a07e |
class AutoID(object): <NEW_LINE> <INDENT> id = db.Column(db.Integer, primary_key=True) | Mixin adding a primary key integer column named 'id'. | 62598f09851cf427c66b6dbf |
class MontecarloLoadFlow(PowerFactorySim): <NEW_LINE> <INDENT> def gen_normal_loads_pq(self, p_total, q_total, p_base, q_base, std_dev=0.1): <NEW_LINE> <INDENT> rand1 = random.uniform(0,1) <NEW_LINE> rand2 = random.uniform(0,1) <NEW_LINE> p_total_rand = p_total*(1 + std_dev*sqrt(-2*log(rand1))*cos(2*pi*rand2)) <NEW_LIN... | Class to run a monte carlo load flow. Credit:
{Probabilistic Power Flow Module for PowerFactory DIgSILENT,
Saeed Teimourzadeh, Behnam Mohammadi-Ivatloo} | 62598f09be7bc26dc92513de |
class TwoSumII(object): <NEW_LINE> <INDENT> def twoSumIIMine(self, numbers, target): <NEW_LINE> <INDENT> dic = {} <NEW_LINE> for i,v in enumerate(numbers, start = 1): <NEW_LINE> <INDENT> if v in dic: <NEW_LINE> <INDENT> if v == target / 2: <NEW_LINE> <INDENT> return [i - 1, i] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDE... | Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2. Please note that your returned answers (both... | 62598f09ec188e330fdf73a7 |
class Risk: <NEW_LINE> <INDENT> def __init__(self, risk_score): <NEW_LINE> <INDENT> self.risk_score = risk_score <NEW_LINE> <DEDENT> def get_risk_label(self): <NEW_LINE> <INDENT> if self.risk_score < 0 or self.risk_score > 100: <NEW_LINE> <INDENT> raise RiskScoreOutRange(self.risk_score) <NEW_LINE> <DEDENT> if self.ris... | @todo As the risk score is only used by the get_risk_label function the function could be made standalone | 62598f097b180e01f3e485c3 |
class Test_DotUPath(UPathTestCase): <NEW_LINE> <INDENT> def test_dflt(I): <NEW_LINE> <INDENT> p = uripath.UPath() <NEW_LINE> I.assertIsDot(p) <NEW_LINE> <DEDENT> def test_dot(I): <NEW_LINE> <INDENT> p = uripath.UPath('.') <NEW_LINE> I.assertIsDot(p) <NEW_LINE> <DEDENT> def test_None(I): <NEW_LINE> <INDENT> p = uripath.... | Tests for "." (current directory). | 62598f09d8ef3951e32c73cf |
class lifetime_Voc(LTC): <NEW_LINE> <INDENT> V = None <NEW_LINE> gen_V = None <NEW_LINE> Fs = None <NEW_LINE> _type = 'Voc' <NEW_LINE> Qscr_correction = False <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(**kwargs).__init__() <NEW_LINE> <DEDENT> def _cal_nxc(self): <NEW_LINE> <INDENT> if self.sampl... | this class can be used for
a) self consisent QSSVoc analysis
b) lifetime from suns Voc
c) genralised Voc analysis.
Inptuts:
1. sample, doping
2. thickness
2. Generation. This is provided in gen_V and Fs
3. time in seconts (time)
4. Voltage (V) | 62598f09091ae35668703712 |
class LoginView(TemplateView): <NEW_LINE> <INDENT> template_name = 'login.html' <NEW_LINE> @sensitive_variables('client_id', 'client_secret') <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super().get_context_data(**kwargs) <NEW_LINE> client_id = settings.CLIENT_ID <NEW_LINE> client_secr... | Displays a link to the mercadolibre site | 62598f09cc40096d61619756 |
class ResolvePrivateLinkServiceIdOperations: <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 = confi... | ResolvePrivateLinkServiceIdOperations 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.containerservi... | 62598f0960cbc95b06362e2a |
class InversionError(Error): <NEW_LINE> <INDENT> _condition: float <NEW_LINE> def __init__(self, matrix: Array) -> None: <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> from .algebra import compute_condition_number <NEW_LINE> self._condition = compute_condition_number(matrix) <NEW_LINE> <DEDENT> def __str__(self) -> ... | Problems with inverting a matrix. | 62598f097047854f4633debe |
class LegacyFieldMappingProcessor(object): <NEW_LINE> <INDENT> def __call__(self, event): <NEW_LINE> <INDENT> if 'context' in event: <NEW_LINE> <INDENT> context = event['context'] <NEW_LINE> for field in CONTEXT_FIELDS_TO_INCLUDE: <NEW_LINE> <INDENT> if field in context: <NEW_LINE> <INDENT> event[field] = context[field... | Ensures all required fields are included in emitted events | 62598f09ad47b63b2c5a6312 |
class BAD_REQUEST(HttpResponse): <NEW_LINE> <INDENT> def __init__(self, content='',status=400,content_type="text/plain"): <NEW_LINE> <INDENT> super(BAD_REQUEST, self).__init__(content=content, status=status, content_type=content_type) | A class extending HttpResponse for creating user friendly error messages
on HTTP 400 errors from the API. | 62598f0955399d3f0562501e |
class person: <NEW_LINE> <INDENT> def __init__(self,name,pnum='',email=''): <NEW_LINE> <INDENT> self.name=name <NEW_LINE> self.pnum=pnum <NEW_LINE> self.email=email <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return(self.name+' '+self.pnum+' '+self.email) | Represents a person,containing his/her personal info | 62598f09be7bc26dc92513df |
class TokenLogin(BasicLogin): <NEW_LINE> <INDENT> token_generator_class = RestFrameworkTokenGenerator <NEW_LINE> def get_return_data(self, request, user): <NEW_LINE> <INDENT> return {'token': self.token_generator_class().get_token(user).key} <NEW_LINE> <DEDENT> def logout(self, request, **kwargs): <NEW_LINE> <INDENT> s... | A login class that accepts user/pass combinations in header or post data and returns a user
authentication token. This method, in its default configuration is only available if
rest_framework.authtoken is in installed_apps | 62598f097b180e01f3e485c4 |
@pd.api.extensions.register_dataframe_accessor("convert") <NEW_LINE> class _Convert(object): <NEW_LINE> <INDENT> def __init__(self, df): <NEW_LINE> <INDENT> self._validate(df) <NEW_LINE> self._df = df <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _validate(df): <NEW_LINE> <INDENT> if not len(df): <NEW_LINE> <INDENT>... | Conversions to DataFrame representation of package dependencies. | 62598f09ec188e330fdf73aa |
class alignedText(object): <NEW_LINE> <INDENT> def __init__(self, docName, dataPath = 'data/aligned/'): <NEW_LINE> <INDENT> self.docName = docName <NEW_LINE> self.dataPath = dataPath <NEW_LINE> self.sentList = list(tuples()) <NEW_LINE> self.TextFragment = '' <NEW_LINE> <DEDENT> def readAligned(self): <NEW_LINE> <INDENT... | Aligned texts are very useful objects with complex structure.
This class implement methods to access them. | 62598f095fcc89381b2656a8 |
class AuthorSitemap(Sitemap): <NEW_LINE> <INDENT> priority = 0.5 <NEW_LINE> changefreq = 'monthly' <NEW_LINE> def items(self): <NEW_LINE> <INDENT> return Author.published.all() <NEW_LINE> <DEDENT> def lastmod(self, obj): <NEW_LINE> <INDENT> nodetypes = obj.nodetypes_published() <NEW_LINE> if not nodetypes: <NEW_LINE> <... | Sitemap for authors | 62598f09a05bb46b38489371 |
class Regression: <NEW_LINE> <INDENT> def __init__(self, ax): <NEW_LINE> <INDENT> self.ax = ax <NEW_LINE> self.lines = ax.lines[:] <NEW_LINE> self.x_data = [list(line.get_xdata()) for line in self.lines] <NEW_LINE> self.x_data = self.x_data[0] <NEW_LINE> self.y_data = [list(line.get_ydata()) for line in self.lines] <NE... | The specific regression types inherit from this class. | 62598f097cff6e4e811b44e0 |
class RetryConfig(_messages.Message): <NEW_LINE> <INDENT> jobAgeLimit = _messages.StringField(1) <NEW_LINE> maxBackoffSeconds = _messages.StringField(2) <NEW_LINE> maxDoublings = _messages.IntegerField(3, variant=_messages.Variant.INT32) <NEW_LINE> minBackoffSeconds = _messages.StringField(4) <NEW_LINE> retryCount = _m... | Settings that determine the retry behavior. By default, if a job does
not complete successfully (meaning that an acknowledgement is not received
from the handler before the
[deadline](/appengine/docs/python/taskqueue/push/#the_task_deadline), then
it will be retried with exponential backoff according to the settings i... | 62598f09fff4ab517ebcc2cd |
class TExecuteStatementReq: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'statement', None, None, ), ) <NEW_LINE> def __init__(self, statement=None,): <NEW_LINE> <INDENT> self.statement = statement <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinar... | Attributes:
- statement | 62598f0971ff763f4b5e625d |
class State: <NEW_LINE> <INDENT> def __init__(self, graph, ants, limit, gen_size, colony): <NEW_LINE> <INDENT> self.graph = graph <NEW_LINE> self.ants = ants <NEW_LINE> self.limit = limit <NEW_LINE> self.gen_size = gen_size <NEW_LINE> self.colony = colony <NEW_LINE> self.solutions = None <NEW_LINE> self.record = None <... | Solver state.
This class tracks the state of a solution in progress and is passed to each
plugin hook. Specially it contains:
===================== ======================================
Attribute Description
===================== ======================================
``graph`` graph being so... | 62598f093617ad0b5ee04c26 |
class XiaomiAirQualityMonitor(Entity): <NEW_LINE> <INDENT> def __init__(self, name, device, model, unique_id): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._device = device <NEW_LINE> self._model = model <NEW_LINE> self._unique_id = unique_id <NEW_LINE> self._icon = "mdi:cloud" <NEW_LINE> self._unit_of_measure... | Representation of a Xiaomi Air Quality Monitor. | 62598f090fa83653e46f39df |
class BayesMandM(BayesBasic): <NEW_LINE> <INDENT> def likelihood(self, inData): <NEW_LINE> <INDENT> lh = np.zeros(len(self.hypotheses)) <NEW_LINE> dict1994 = {'Bl': 0.00, 'Br': 0.30, 'Ye': 0.20, 'Re': 0.20, 'Gr': 0.10, 'Or': 0.10, 'Ta': 0.10} <NEW_LINE> dict1996 = {'Bl': 0.24, 'Br': 0.13, 'Ye': 0.14, 'Re': 0.13, 'Gr': ... | Likelihood function for M&M problem.
Quite unique and unlikely to be used in other applications. | 62598f09851cf427c66b6dc3 |
class V9TemplateRecord: <NEW_LINE> <INDENT> def __init__(self, template_id, field_count, fields: list): <NEW_LINE> <INDENT> self.template_id = template_id <NEW_LINE> self.field_count = field_count <NEW_LINE> self.fields = fields <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "<TemplateRecord {} with... | A template record contained in a TemplateFlowSet.
| 62598f0955399d3f05625020 |
class MailActivations(GenericClass): <NEW_LINE> <INDENT> @Time('list') <NEW_LINE> @Cache(arguments=True) <NEW_LINE> def list(self, domain_id=None): <NEW_LINE> <INDENT> if domain_id is None: <NEW_LINE> <INDENT> domain_id = "LinShareRootDomain" <NEW_LINE> <DEDENT> url = "mail_activations?domainId={d}" <NEW_LINE> url = ur... | TODO | 62598f09ad47b63b2c5a6313 |
class TestOutputTerminal(unittest.TestCase): <NEW_LINE> <INDENT> def test_create(self): <NEW_LINE> <INDENT> Output_terminal = OutputTerminal('OutputTerminal') <NEW_LINE> self.assertTrue(isinstance(Output_terminal, OutputTerminal)) <NEW_LINE> <DEDENT> def test_get_parent_class(self): <NEW_LINE> <INDENT> self.assertEqual... | Test OutputTerminal Class | 62598f099f288636728172f1 |
class Lower_Translator(object): <NEW_LINE> <INDENT> def gettext(self, s): <NEW_LINE> <INDENT> return s.lower() <NEW_LINE> <DEDENT> def ngettext(self, singular, plural, n): <NEW_LINE> <INDENT> if n == 1: <NEW_LINE> <INDENT> return singular.lower() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return plural.lower() | A fake translator that just converts everything to lowercase. | 62598f09d486a94d0ba2aac1 |
class SimpleTrainingPlot(tf.keras.callbacks.Callback): <NEW_LINE> <INDENT> def __init__(self, plt): <NEW_LINE> <INDENT> super(SimpleTrainingPlot, self).__init__() <NEW_LINE> self.fig = plt.figure(figsize=(9, 4)) <NEW_LINE> self.ax1 = plt.subplot(1, 2, 1) <NEW_LINE> self.ax2 = plt.subplot(1, 2, 2) <NEW_LINE> plt.ion() <... | Requires matplotlib.pyplot passed as argument plt
when this callback is instantiated.
Training metric for accuracy needs to be set as 'accuracy'
and not 'acc' | 62598f0926068e7796d4b452 |
class ExpandedNumList(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.b_key = "expanded-num-list" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> self.ext_list_num = "" <NEW_LINE> self.rules_list = [] <NEW_LINE> for keys, value in kwargs.items(): <NEW... | This class does not support CRUD Operations please use parent.
:param ext_list_num: {"description": "Extended Community list number (expanded)", "format": "number", "type": "number", "maximum": 199, "minimum": 100, "optional": false}
:param rules_list: {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, ... | 62598f098a349b6b43684d3e |
class CreateFoodAndWater(Spell): <NEW_LINE> <INDENT> name = "Create Food And Water" <NEW_LINE> level = 3 <NEW_LINE> casting_time = "1 action" <NEW_LINE> casting_range = "30 feet" <NEW_LINE> components = ('V', 'S') <NEW_LINE> materials = """""" <NEW_LINE> duration = "Instantaneous" <NEW_LINE> ritual = False <NEW_LINE> m... | You create 45 pounds of food and 30 gallons of water on the ground or in
containers within range, enough to sustain up to fifteen humanoids or five
steeds for 24 hours. The food is bland but nourishing, and spoils if uneaten
after 24 hours. The water is clean and doesn’t go bad. | 62598f0971ff763f4b5e625f |
class EngineDebugException(Exception): <NEW_LINE> <INDENT> pass | Exception that will be thrown by engine_debug. | 62598f093346ee7daa336be1 |
class E8sProxyMiddleware(object): <NEW_LINE> <INDENT> def process_request(self, request, spider): <NEW_LINE> <INDENT> rds = get_redis() <NEW_LINE> ipstr = rds.srandmember("proxy:e8s") <NEW_LINE> if ipstr: <NEW_LINE> <INDENT> request.meta['proxy'] = "http://%s" % ipstr | 代理ip切换 | 62598f09167d2b6e312b5a97 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.