code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class EventViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Event.objects.all() <NEW_LINE> serializer_class = EventSerializer <NEW_LINE> permission_classes = (IsAuthenticated,) | Disponibiliza os eventos da agenda como uma API REST. | 62598f6163f4b57ef0085892 |
class DownloadPicByThreading(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, que_, log_path, f_write_urls): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.sleep_program = RandomSleepTime() <NEW_LINE> self.que = que_ <NEW_LINE> self.downloaded_urls_path = PicFileHandle.get_downloaded_urls_... | 多线程下载
Parameters
----------
threading : thread
python多线程的包 | 62598f6176d4e153a661c258 |
class PersonTest(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 test_create_fellow(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_create_staff(self): <NEW_LINE> <INDENT> pass | Tests for the Person Class | 62598f61507cdc57c63a43e2 |
class LemmaExtractor(BaseEstimator, TransformerMixin): <NEW_LINE> <INDENT> def __init__(self, col_name=None, spacy_nlp=SPACY_NLP, contractions_mapper=CONTRACTION_MAP): <NEW_LINE> <INDENT> self.col_name = col_name <NEW_LINE> self.contractions_mapper = contractions_mapper <NEW_LINE> self.spacy_nlp = spacy_nlp <NEW_LINE> ... | Takes in data-frame, gets lemmatized words | 62598f6121a7993f00c655bd |
class SmearDensityModifier(_PinTypeAssemblyModifier): <NEW_LINE> <INDENT> def _getBlockTypesToModify(self): <NEW_LINE> <INDENT> return flags.Flags.FUEL <NEW_LINE> <DEDENT> def _adjustBlock(self, b): <NEW_LINE> <INDENT> b.adjustSmearDensity(self.value) | Adjust the smeared density to the specified value.
This is effectively how much of the space inside the cladding tube is occupied by
fuel at fabrication.
See Also
--------
armi.reactor.blocks.Block.adjustSmearDensity
Actually adjusts the smeared density | 62598f6166673b3332c2fa01 |
class ImageName(object): <NEW_LINE> <INDENT> swagger_types = { 'name': 'str' } <NEW_LINE> attribute_map = { 'name': 'Name' } <NEW_LINE> def __init__(self, name=None): <NEW_LINE> <INDENT> self._name = None <NEW_LINE> if name is not None: <NEW_LINE> <INDENT> self.name = name <NEW_LINE> <DEDENT> <DEDENT> @property <NEW_LI... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f617c178a314d78cae4 |
class InvSSASolver(object): <NEW_LINE> <INDENT> def __init__(self, ssarun, method): <NEW_LINE> <INDENT> self.ssarun = ssarun <NEW_LINE> self.config = ssarun.config <NEW_LINE> self.method = method <NEW_LINE> <DEDENT> def solveForward(self, zeta, out=None): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDE... | Abstract base class for SSA inverse problem solvers. | 62598f61ff9c53063f519c98 |
class Glove: <NEW_LINE> <INDENT> def __init__(self, fn, dim = None): <NEW_LINE> <INDENT> self.fn = fn <NEW_LINE> self.dim = dim <NEW_LINE> logging.debug("Loading GloVe embeddings from: {} ...".format(self.fn)) <NEW_LINE> self._load(self.fn) <NEW_LINE> logging.debug("Done!") <NEW_LINE> <DEDENT> def _load(self, fn): <NEW... | Stores pretrained word embeddings for GloVe, and
outputs a Keras Embeddings layer. | 62598f6130c21e258be97e44 |
class RemovedInPytest4Warning(DeprecationWarning): <NEW_LINE> <INDENT> pass | warning class for features removed in pydistill X.X | 62598f619b70327d1c57e3ef |
class CXLog(db.Model, IdMixin, TimestampMixin): <NEW_LINE> <INDENT> __tablename__ = 'cxlog' <NEW_LINE> users = db.Column(db.Unicode(200), nullable=False) <NEW_LINE> sent = db.Column(db.Boolean, nullable=False) <NEW_LINE> log_message = db.Column(db.Unicode, nullable=True) | Contact Exchange Logs | 62598f61d164cc61758205c0 |
class YamlExtensionPoint(ChunkExtensionPoint): <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> super().__init__("yaml") <NEW_LINE> self.extensions: Dict[str, YamlExtension] = {} <NEW_LINE> <DEDENT> def register(self, extension: YamlExtension): <NEW_LINE> <INDENT> for ttype in ( [extension.type] if i... | For extension that are based on Yaml chunks. | 62598f61be8e80087fbbe6a2 |
class AuthMiddleware(object): <NEW_LINE> <INDENT> def __init__(self, app): <NEW_LINE> <INDENT> self.app = app <NEW_LINE> <DEDENT> def __call__(self, environ, start_response): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self._remove_auth_headers(environ) <NEW_LINE> token = self._validate_token(environ) <NEW_LINE> self.... | WSGI middleware to handle authentication | 62598f6130c21e258be97e46 |
class ListHandler(IterableHandler): <NEW_LINE> <INDENT> iterable_cls = list <NEW_LINE> iterable_add = list.append <NEW_LINE> def iterable_update(list_, data): <NEW_LINE> <INDENT> list_[:] = data | Handler for packing list iterables | 62598f61167d2b6e312b65c8 |
class DBUtils: <NEW_LINE> <INDENT> __host = None <NEW_LINE> __port = None <NEW_LINE> __user = None <NEW_LINE> __pword = None <NEW_LINE> __database = None <NEW_LINE> __connection = None <NEW_LINE> __cursor = None <NEW_LINE> def __init__(self, conf): <NEW_LINE> <INDENT> config = conf <NEW_LINE> self.__host = config.get("... | Class for Database Access | 62598f61be8e80087fbbe6a4 |
class Trading: <NEW_LINE> <INDENT> def __init__(self, config_file): <NEW_LINE> <INDENT> self.conf = cfg.init(config_file) <NEW_LINE> self.loop = 1 <NEW_LINE> self.connect = None <NEW_LINE> if self.conf.connection == 'coinbase': <NEW_LINE> <INDENT> self.connect = connection.coinBase.CoinBaseConnect( self.conf.connection... | Trading process. | 62598f615166f23b2e242a25 |
class StandaloneEntryPoint(BaseEntryPoint): <NEW_LINE> <INDENT> def __init__(self, graph_to_call): <NEW_LINE> <INDENT> self.graph = graph_to_call <NEW_LINE> <DEDENT> def get_name(self): <NEW_LINE> <INDENT> return 'main' <NEW_LINE> <DEDENT> def render(self, ilasm): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> ARG0 = sel... | This class produces a 'main' method that converts the argv in a
List of Strings and pass it to the real entry point. | 62598f6176d4e153a661c25e |
class LinkHebergementMetadata(GitesMappedClassBase): <NEW_LINE> <INDENT> __tablename__ = u'link_hebergement_metadata' <NEW_LINE> link_met_pk = sa.Column('link_met_pk', sa.Integer, nullable=False, primary_key=True, unique=True, doc=u"Numéro d'identifiant") <NEW_LINE> heb_fk = sa.Column('heb_fk', sa.Integer(), sa.Foreign... | Table de jointure permettant de gérer les métadata d'un hébergement | 62598f6156b00c62f0fb1f02 |
class FormValidationError(FormError): <NEW_LINE> <INDENT> pass | Error raised when a value cannot be validated. | 62598f618c3a8732951f5b9e |
class CourseWikiPage(CoursePage): <NEW_LINE> <INDENT> url_path = "wiki" <NEW_LINE> def is_browser_on_page(self): <NEW_LINE> <INDENT> return self.q(css='.breadcrumb').present <NEW_LINE> <DEDENT> def open_editor(self): <NEW_LINE> <INDENT> edit_button = self.q(css='.fa-pencil') <NEW_LINE> edit_button.click() <NEW_LINE> <D... | Course wiki navigation and objects. | 62598f61ac7a0e7691f71b5e |
class Config(object): <NEW_LINE> <INDENT> SQLALCHEMY_DATABASE_URI = "mysql://root:root@127.0.0.1:8889/ihome" <NEW_LINE> SQLALCHEMY_TRACK_MODIFICATIONS = False <NEW_LINE> SECRET_KEY = 'AeHLwvUll230jVSRGZt5pbhX4zX+2oU=' <NEW_LINE> REDIS_PORT = 6379 <NEW_LINE> REDIS_HOST = '127.0.0.1' <NEW_LINE> PERMANENT_SESSION_LIFETIME... | 基本配置参数 | 62598f61796e427e5384dde0 |
class Rcp(Rsh): <NEW_LINE> <INDENT> def __init__(self, node, source, dest, worker, stderr, timeout, preserve, reverse): <NEW_LINE> <INDENT> Rsh.__init__(self, node, None, worker, stderr, timeout) <NEW_LINE> self.source = source <NEW_LINE> self.dest = dest <NEW_LINE> self.popen = None <NEW_LINE> self.preserve = preserve... | Rcp EngineClient. | 62598f6176d4e153a661c260 |
class DoExcel(): <NEW_LINE> <INDENT> def __init__(self,filepath): <NEW_LINE> <INDENT> self.excle = xlrd.open_workbook(filepath) <NEW_LINE> <DEDENT> def get_sheet_by_name(self,sheet_name): <NEW_LINE> <INDENT> return self.excle.sheet_by_name(sheet_name) <NEW_LINE> <DEDENT> def get_all_sheets(self): <NEW_LINE> <INDENT> re... | 操作(读、写:xlwt、openpyxl)excel文件 | 62598f6166673b3332c2fa09 |
class RunningPunchRecord(models.Model): <NEW_LINE> <INDENT> punch_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) <NEW_LINE> goal = models.ForeignKey(RunningGoal, related_name="punch", on_delete=models.PROTECT) <NEW_LINE> record_time = models.DateTimeField(null=False) <NEW_LINE> voucher_ref ... | Model for running task record
To save user's actual running distance per day | 62598f61287bf620b6271207 |
class WelcomeController: <NEW_LINE> <INDENT> def __init__(self, maze, window): <NEW_LINE> <INDENT> self._maze = maze <NEW_LINE> self._views = WelcomeView(window) <NEW_LINE> <DEDENT> def set_up_game(self): <NEW_LINE> <INDENT> self._maze.add_items() <NEW_LINE> <DEDENT> def get_user_input(self): <NEW_LINE> <INDENT> state ... | Controls the player input at the start of the game, before the maze. | 62598f616e29344779affca7 |
class package(BaseNode): <NEW_LINE> <INDENT> def checker(self): <NEW_LINE> <INDENT> clear().run() <NEW_LINE> return True <NEW_LINE> <DEDENT> def action(self): <NEW_LINE> <INDENT> if not os.path.exists("./dist/pbs_helper"): <NEW_LINE> <INDENT> os.makedirs("./dist/pbs_helper") <NEW_LINE> <DEDENT> files = glob.glob("./pbs... | package prject to release file (zip) | 62598f61ff9c53063f519ca0 |
class PlanningProblem: <NEW_LINE> <INDENT> def __init__(self, initial, goals, actions): <NEW_LINE> <INDENT> self.initial = self.convert(initial) <NEW_LINE> self.goals = self.convert(goals) <NEW_LINE> self.actions = actions <NEW_LINE> <DEDENT> def convert(self, clauses): <NEW_LINE> <INDENT> if not isinstance(clauses, Ex... | Planning Domain Definition Language (PlanningProblem) used to define a search problem.
It stores states in a knowledge base consisting of first order logic statements.
The conjunction of these logical statements completely defines a state. | 62598f6130c21e258be97e4b |
class RecursiveTraversal(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def inorder(root): <NEW_LINE> <INDENT> if root is None: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> RecursiveTraversal.inorder(root.left) <NEW_LINE> print(root.data, end=' ... | Implements tree traversal in recursive approach | 62598f6163f4b57ef0085897 |
class DynamicSelectWidget(SelectWidget): <NEW_LINE> <INDENT> _data_add_url_attr = "data-add-item-url" <NEW_LINE> def render(self, *args, **kwargs): <NEW_LINE> <INDENT> add_item_url = self.get_add_item_url() <NEW_LINE> if add_item_url is not None: <NEW_LINE> <INDENT> self.attrs[self._data_add_url_attr] = add_item_url <N... | ``Select`` widget to handle dynamic changes to the available choices.
A subclass of the ``Select`` widget which renders extra attributes for
use in callbacks to handle dynamic changes to the available choices. | 62598f61a4f1c619b294dc43 |
class VecSeqField(Field): <NEW_LINE> <INDENT> def __init__(self, preprocessing=None, postprocessing=None, include_lengths=False, batch_first=False, pad_index=0, is_target=False): <NEW_LINE> <INDENT> super(VecSeqField, self).__init__( sequential=True, use_vocab=False, init_token=None, eos_token=None, fix_length=False, d... | Defines an vector datatype and instructions for converting to Tensor.
See :class:`Fields` for attribute descriptions. | 62598f61925a0f43d25e7686 |
class Test_Tokens(TestBase): <NEW_LINE> <INDENT> def test_forceToken(self): <NEW_LINE> <INDENT> oldToken = self.sdk.OAuthTokenManager.GetToken() <NEW_LINE> newToken = self.sdk.authenticationManager.CreateToken() <NEW_LINE> self.assertNotEqual(oldToken.access_token, newToken.access_token) <NEW_LINE> self.sdk.OAuthTokenM... | Tests basic methods for token management | 62598f62bf627c535bcb0ad0 |
@extras_features('custom_fields', 'custom_links', 'export_templates', 'webhooks') <NEW_LINE> class PowerPanel(ChangeLoggedModel, CustomFieldModel): <NEW_LINE> <INDENT> site = models.ForeignKey( to='Site', on_delete=models.PROTECT ) <NEW_LINE> rack_group = models.ForeignKey( to='RackGroup', on_delete=models.PROTECT, bla... | A distribution point for electrical power; e.g. a data center RPP. | 62598f625e10d32532ce3410 |
class TestDirective(SphinxDirective): <NEW_LINE> <INDENT> has_content = True <NEW_LINE> required_arguments = 0 <NEW_LINE> optional_arguments = 1 <NEW_LINE> final_argument_whitespace = True <NEW_LINE> def run(self): <NEW_LINE> <INDENT> if 'skipif' in self.options: <NEW_LINE> <INDENT> condition = self.options['skipif'] <... | Base class for doctest-related directives. | 62598f626e29344779affca9 |
class d_CriticalError(d_DitError): <NEW_LINE> <INDENT> def __init__(self, message: str, loc: CodeLocation = None): <NEW_LINE> <INDENT> super().__init__(_concat("CriticalError", message), loc) | Essentially an assertion. This exception should never be raised.
Will error out to the command line like other exceptions. | 62598f62796e427e5384dde4 |
class FileLock(object): <NEW_LINE> <INDENT> def __init__(self, path_to_lock, retries=10): <NEW_LINE> <INDENT> self.path_to_lock = abspath(path_to_lock) <NEW_LINE> self.retries = retries <NEW_LINE> self.lock_file_path = "%s.pid{0}.%s" % (self.path_to_lock, LOCK_EXTENSION) <NEW_LINE> self.lock_file_glob_str = "%s.pid*.%s... | Lock a path (file or directory) with the lock file sitting *beside* path.
:param path_to_lock: the path to be locked
:param retries: max number of retries | 62598f62a8ecb03325870854 |
class ActiveImagerManager(models.Manager): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> qs = super(ActiveImagerManager, self).get_queryset() <NEW_LINE> return qs.filter(user__is_active__exact=True) | Return active users, inherit query set | 62598f62711fe17d825dfd48 |
class SaverWithCallback(tf.train.Saver): <NEW_LINE> <INDENT> _callback_op = None <NEW_LINE> def __init__(self, callback_op, **kwargs ): <NEW_LINE> <INDENT> self._callback_op = callback_op <NEW_LINE> super().__init__(**kwargs) <NEW_LINE> <DEDENT> def set_callback(self, callback_op): <NEW_LINE> <INDENT> self._callback_op... | override tf.train.Saver to call `callback_op` after tf.train.Saver.save()
pass `callback_op(sess, save_path, **kwargs)` as the first arg to the constructor, or
call self.set_callback(callback_op)
example:
```
def after_save(sess, save_path, **kwargs):
step = kwargs['checkpoint_step']
path = kwargs['check... | 62598f625166f23b2e242a2d |
class PurchaseRequest(models.Model): <NEW_LINE> <INDENT> person = models.ForeignKey(User, verbose_name=_(u"Submit Person")) <NEW_LINE> item = models.ForeignKey(ItemTemplate, verbose_name=_(u"item")) <NEW_LINE> assets = models.ManyToManyField(asset, verbose_name=_(u"Assets"), null=True, blank=True) <NEW_LINE> storage = ... | the location of the products | 62598f621d351010ab8f3196 |
class LimitedInputFilter(object): <NEW_LINE> <INDENT> def __init__(self, application): <NEW_LINE> <INDENT> self.app = application <NEW_LINE> <DEDENT> def __call__(self, environ, start_response): <NEW_LINE> <INDENT> content_length = environ.get('CONTENT_LENGTH', '') <NEW_LINE> if content_length: <NEW_LINE> <INDENT> inpu... | WSGI middleware that limits the input length of a request to that
specified in Content-Length. | 62598f6226238365f5fac1ca |
class WordEmbeddingsDropout(nn.Module): <NEW_LINE> <INDENT> def __init__(self, p: float): <NEW_LINE> <INDENT> super(WordEmbeddingsDropout, self).__init__() <NEW_LINE> self.word_embeddings_dropout = nn.Dropout2d(p=p) <NEW_LINE> <DEDENT> def forward(self, x: torch.Tensor) -> torch.Tensor: <NEW_LINE> <INDENT> x = self.wor... | Word Embeddings Dropout drops a certain percentage of entire words in the training sample.
explanation: https://arxiv.org/abs/1512.05287v5. | 62598f620383005118f6cd5b |
class Human(GraspingRobot): <NEW_LINE> <INDENT> _name = "Human avatar" <NEW_LINE> add_property('_animations', True, 'Animations', 'bool', "If " "true (default), will enable various animations like" " the walk cycle animation.") <NEW_LINE> def __init__(self, obj, parent=None): <NEW_LINE> <INDENT> logger.info('%s initial... | MORSE allows the simulation of humans: you can add a human model in your
scene, you can control it like any other robot (including from the keyboard
or via external scripts), and export from your simulation various data like
the full body pose.
The human is managed by MORSE as a regular robot, which means it can have
... | 62598f6221a7993f00c655cb |
class ISO8859TagError(RichTextConversionError): <NEW_LINE> <INDENT> pass | This error is raised when we are doing a conversion with
strict=True, the input string is unicode and we get an iso-8859-x
tag. Unicode should not contain mixed charsets. | 62598f62d164cc61758205cd |
class TestHashCache(TestCaseInTempDir): <NEW_LINE> <INDENT> def make_hashcache(self): <NEW_LINE> <INDENT> os.mkdir('.bzr') <NEW_LINE> hc = HashCache(u'.', '.bzr/stat-cache') <NEW_LINE> return hc <NEW_LINE> <DEDENT> def reopen_hashcache(self): <NEW_LINE> <INDENT> hc = HashCache(u'.', '.bzr/stat-cache') <NEW_LINE> hc.rea... | Test the hashcache against a real directory | 62598f621f037a2d8b9e3746 |
class TemplateController(BaseController): <NEW_LINE> <INDENT> def view(self, url): <NEW_LINE> <INDENT> abort(404) | The fallback controller for tg2express.
By default, the final controller tried to fulfill the request
when no other routes match. It may be used to display a template
when all else fails, e.g.::
def view(self, url):
return render('/%s' % url)
Or if you're using Mako and want to explicitly send a 404 (Not... | 62598f6226238365f5fac1cc |
class CollectionTools(object): <NEW_LINE> <INDENT> prefix = "prefix" <NEW_LINE> collectionName = "IntentionallyLeftBlank" <NEW_LINE> fullCollectionName = "NAVRIE_Custom_IntentionallyLeftBlank" <NEW_LINE> def createColection(collectionName): <NEW_LINE> <INDENT> fullCollectionName = DatabaseConnection.db.createCollection... | description of class | 62598f62796e427e5384dde8 |
class Passenger(object): <NEW_LINE> <INDENT> def __init__(self, ticketed, rank): <NEW_LINE> <INDENT> self.ticketed = ticketed <NEW_LINE> self.rank = rank <NEW_LINE> self.seat = None <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "Passenger: ticketed: %s, rank: %s, seat: %s" % ( self.ticketed, self.r... | A Passenger has a ticketed seat, a rank, and the seat they are in | 62598f62711fe17d825dfd4c |
class InvitationDeclineView(InvitationResponseView): <NEW_LINE> <INDENT> def get_question(self): <NEW_LINE> <INDENT> msg = "Are you sure you want to decline your invitation to join %s?" <NEW_LINE> return msg % self.invitation.party.name <NEW_LINE> <DEDENT> def agreed(self): <NEW_LINE> <INDENT> self.invitation.decline()... | Allows a user to decline an invitation | 62598f621d351010ab8f3199 |
class TagPager(tornado.web.UIModule): <NEW_LINE> <INDENT> def render(self, *args, **kwargs): <NEW_LINE> <INDENT> tag_slug = args[0] <NEW_LINE> current = int(args[1]) <NEW_LINE> taginfo = MCategory.get_by_slug(tag_slug) <NEW_LINE> num_of_tag = MPost2Catalog.count_of_certain_category(taginfo.uid) <NEW_LINE> pager_count =... | Pager for tag. | 62598f6256b00c62f0fb1f0c |
@python_2_unicode_compatible <NEW_LINE> class Snippet(models.Model): <NEW_LINE> <INDENT> name = models.CharField(_("name"), max_length=255, unique=True) <NEW_LINE> html = models.TextField(_("HTML"), blank=True) <NEW_LINE> template = models.CharField(_("template"), max_length=50, blank=True, help_text=_('Enter a ... | A snippet of HTML or a Django template | 62598f625e10d32532ce3413 |
class TestV1AggregationRule(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 testV1AggregationRule(self): <NEW_LINE> <INDENT> pass | V1AggregationRule unit test stubs | 62598f623eb6a72ae0389c98 |
class bannerPageLocation(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = bannerPageLocation.objects.filter() <NEW_LINE> serializer_class = bannerPageLocationSerializer <NEW_LINE> paginate_by = 10 <NEW_LINE> paginate_by_param = 'page_size' <NEW_LINE> max_paginate_by = 100 <NEW_LINE> def get_queryset(self): <NEW_L... | Manage Bannerpage locations | 62598f6226238365f5fac1ce |
class ApplyTOPUP(FSLCommand): <NEW_LINE> <INDENT> _cmd = 'applytopup' <NEW_LINE> input_spec = ApplyTOPUPInputSpec <NEW_LINE> output_spec = ApplyTOPUPOutputSpec <NEW_LINE> def _parse_inputs(self, skip=None): <NEW_LINE> <INDENT> if skip is None: <NEW_LINE> <INDENT> skip = [] <NEW_LINE> <DEDENT> if not isdefined(self.inpu... | Interface for FSL topup, a tool for estimating and correcting
susceptibility induced distortions.
`General reference
<http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/topup/ApplytopupUsersGuide>`_
and `use example
<http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/topup/ExampleTopupFollowedByApplytopup>`_.
Examples
--------
>>> from nipyp... | 62598f62d99f1b3c44d04d0b |
@unique <NEW_LINE> class OPTION(IntEnum): <NEW_LINE> <INDENT> FORCE_AUDIT = 0x01 <NEW_LINE> COMMAND_AUDIT = 0x03 <NEW_LINE> ALGORITHM_TOGGLE = 0x04 <NEW_LINE> FIPS_MODE = 0x05 | YubiHSM device options | 62598f620383005118f6cd5f |
class LoveNum(object): <NEW_LINE> <INDENT> def __init__(self, h2_real, h2_imag, k2_real, k2_imag, l2_real, l2_imag): <NEW_LINE> <INDENT> self.h2 = h2_real + h2_imag*1.0j <NEW_LINE> self.k2 = k2_real + k2_imag*1.0j <NEW_LINE> self.l2 = l2_real + l2_imag*1.0j <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> ret... | A container class for the complex Love numbers: h2, k2, and l2.
@ivar h2: the degree 2 complex, frequency dependent Love number h.
@type h2: complex
@ivar k2: the degree 2 complex, frequency dependent Love number k.
@type k2: complex
@ivar l2: the degree 2 complex, frequency dependent Love number l.
@type l2: complex | 62598f62925a0f43d25e768e |
class Target(object): <NEW_LINE> <INDENT> def __init__(self, target_id, target_type, extra=None): <NEW_LINE> <INDENT> temp = target_id.split(" ") <NEW_LINE> if len(temp) == 1: <NEW_LINE> <INDENT> self._target_id = target_id <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise IDError() <NEW_LINE> <DEDENT> if not target_... | This class represents a target. The target is applicable to any type of activity for which the English preposition
"to" can be considered applicable in the sense of identifying the indirect object or destination of the activity's
object. See https://www.w3.org/TR/activitystreams-vocabulary/#origin-target for more infor... | 62598f6291af0d3eaad39460 |
class GUIValueError(GUIError): <NEW_LINE> <INDENT> pass | Raised if argument value is bad. | 62598f626e29344779affcb1 |
class ShuffleNetV2(HybridBlock): <NEW_LINE> <INDENT> def __init__(self, channels, init_block_channels, final_block_channels, use_se=False, use_residual=False, in_channels=3, in_size=(224, 224), classes=1000, **kwargs): <NEW_LINE> <INDENT> super(ShuffleNetV2, self).__init__(**kwargs) <NEW_LINE> self.in_size = in_size <N... | ShuffleNetV2 model from 'ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design,'
https://arxiv.org/abs/1807.11164.
Parameters:
----------
channels : list of list of int
Number of output channels for each unit.
init_block_channels : int
Number of output channels for the initial unit.
final_b... | 62598f62a4f1c619b294dc4d |
class Response(object): <NEW_LINE> <INDENT> status = 200 <NEW_LINE> responses = BaseHTTPServer.BaseHTTPRequestHandler.responses <NEW_LINE> def __init__(self, content='', content_type='text/html', status=None, message=None, headers=None): <NEW_LINE> <INDENT> if isinstance(content, str): <NEW_LINE> <INDENT> content = [co... | Response class contains the Response to be sent back from
a request.
@param content: content to be returned. Can be string or list (but not
other iterables, as we need to be able to get the len() of the response).
@param content_type: mime type of content.
@param status: standard integer status code. Default is 200
@... | 62598f6256b00c62f0fb1f10 |
class DTR2(_SpecialCommand): <NEW_LINE> <INDENT> _cmdval = 0xc5 <NEW_LINE> _hasparam = True <NEW_LINE> uses_dtr2 = True | This is a broadcast command to set the value of the DTR2 register. | 62598f627c178a314d78caf8 |
class BtMetricsUtilsTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> if not hasattr(logging, "log_path"): <NEW_LINE> <INDENT> setattr(logging, "log_path", "/tmp/logs") <NEW_LINE> <DEDENT> self.tmp_dir = tempfile.mkdtemp() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> shuti... | This test class has unit tests for the implementation of everything
under acts.controllers.android_device. | 62598f626e29344779affcb3 |
class __CardMonitorSingleton(Observable): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Observable.__init__(self) <NEW_LINE> if _START_ON_DEMAND_: <NEW_LINE> <INDENT> self.rmthread = None <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.rmthread = CardMonitoringThread(self) <NEW_LINE> <DEDENT> <DEDENT> ... | The real smart card monitor class.
A single instance of this class is created
by the public CardMonitor class. | 62598f62bf627c535bcb0ada |
class NRSur3dq8Remnant(NRFits): <NEW_LINE> <INDENT> def _get_fit_params(self, m1, m2, chiA_vec, chiB_vec, f_ref, extra_params_dict): <NEW_LINE> <INDENT> if f_ref != -1: <NEW_LINE> <INDENT> raise ValueError("This model only works for f_ref=-1.") <NEW_LINE> <DEDENT> q = m1/m2 <NEW_LINE> fit_params = [q, chiA_vec[2], chiB... | Class for NRSur3dq8Remnant model for the remnant mass, spin and kick
velocity for nonprecessing BBH systems. This model was called surfinBH3dq8
in the paper.
Paper: arxiv:1809.09125. The model is referred to as surfinBH3dq8 in the
paper.
Parameter ranges for usage:
q = [1, 9.1]
$\chi_{1z}, \chi_{2z}$ = ... | 62598f62ac7a0e7691f71b6c |
class FPSDisplay(NumericText): <NEW_LINE> <INDENT> def __init__(self, x, y, font_colour, font_size, font_name='DEFAULT'): <NEW_LINE> <INDENT> super(FPSDisplay, self).__init__('fps', 'fps', 'FPS: %5.2f', colour=font_colour, font_size=font_size, value=0, font_name=font_name) <NEW_LINE> self.setLayerName('ui') <NEW_LINE> ... | Displays the current FPS on the screen | 62598f624d74a7450cd58a06 |
class XnetRobotSolver(BasicRobotProblemSolver, QueueSolver): <NEW_LINE> <INDENT> def __init__(self, args): <NEW_LINE> <INDENT> QueueSolver.__init__(self, args) <NEW_LINE> BasicRobotProblemSolver.__init__(self, args) <NEW_LINE> self.build_solver_processor(self.commandQ, self, self.xnet_worker) <NEW_LINE> self.world = se... | Combines BasicRobotProblemSolver and QueueSolver in a single class. | 62598f621d351010ab8f319e |
class ManagedClusterLoadBalancerProfileOutboundIPPrefixes(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'public_ip_prefixes': {'key': 'publicIPPrefixes', 'type': '[ResourceReference]'}, } <NEW_LINE> def __init__( self, *, public_ip_prefixes: Optional[List["ResourceReference"]] = None, **kwargs ): ... | Desired outbound IP Prefix resources for the cluster load balancer.
:ivar public_ip_prefixes: A list of public IP prefix resources.
:vartype public_ip_prefixes:
list[~azure.mgmt.containerservice.v2021_02_01.models.ResourceReference] | 62598f62796e427e5384ddee |
@Singleton <NEW_LINE> class Config(object): <NEW_LINE> <INDENT> _configuration = [ CfgParam('OS_AUTH_URL', None, six.text_type), CfgParam('OS_IDENTITY_API_VERSION', "3", six.text_type), CfgParam('OS_USERNAME', None, six.text_type), CfgParam('OS_PASSWORD', "password", six.text_type), CfgParam('OS_TENANT_NAME', "service"... | Plugin confguration. | 62598f62d164cc61758205d4 |
class NullAction (Action): <NEW_LINE> <INDENT> def __init__ (self, manager, prop_set): <NEW_LINE> <INDENT> Action.__init__ (self, manager, None, None, prop_set) <NEW_LINE> <DEDENT> def actualize (self): <NEW_LINE> <INDENT> if not self.actualized_: <NEW_LINE> <INDENT> self.actualized_ = True <NEW_LINE> for i in self.tar... | Action class which does nothing --- it produces the targets with
specific properties out of nowhere. It's needed to distinguish virtual
targets with different properties that are known to exist, and have no
actions which create them. | 62598f6291af0d3eaad39464 |
class DeletedEdgeImpulse(list): <NEW_LINE> <INDENT> def id(self): <NEW_LINE> <INDENT> self.append(lambda x: "id") <NEW_LINE> <DEDENT> def data(self, config: Callable[['EdgeKeyOne'], None]): <NEW_LINE> <INDENT> def callback(registry: VariableRegistry): <NEW_LINE> <INDENT> entity = EdgeKeyOne() <NEW_LINE> config(entity) ... | Impulse which indicates the result of a delete edge impulse | 62598f626e29344779affcb5 |
class ContainerProjectsZonesClustersLoggingRequest(_messages.Message): <NEW_LINE> <INDENT> clusterId = _messages.StringField(1, required=True) <NEW_LINE> projectId = _messages.StringField(2, required=True) <NEW_LINE> setLoggingServiceRequest = _messages.MessageField('SetLoggingServiceRequest', 3) <NEW_LINE> zone = _mes... | A ContainerProjectsZonesClustersLoggingRequest object.
Fields:
clusterId: The name of the cluster to upgrade.
projectId: The Google Developers Console [project ID or project
number](https://support.google.com/cloud/answer/6158840).
setLoggingServiceRequest: A SetLoggingServiceRequest resource to be passed
... | 62598f62796e427e5384ddf0 |
class NonPlugBase(object): <NEW_LINE> <INDENT> pass | A base class that is not a BasePlug. | 62598f62d99f1b3c44d04d11 |
class Provider(BaseProvider): <NEW_LINE> <INDENT> vat_id_formats = ( 'DE#########', ) <NEW_LINE> def vat_id(self): <NEW_LINE> <INDENT> return self.bothify(self.random_element(self.vat_id_formats)) | A Faker provider for the German VAT IDs | 62598f62287bf620b6271217 |
class ISrcsgt(INotice): <NEW_LINE> <INDENT> noticeTypeName = schema.TextLine( title=_(u"Notice Type Name"), default=_(u"Sources Sought"), required=True, ) | SRCSGT content type | 62598f62be8e80087fbbe6b8 |
class ClientAuthentication(object): <NEW_LINE> <INDENT> def __init__(self, client_auth_type, client_id, client_secret=None): <NEW_LINE> <INDENT> self.client_auth_type = client_auth_type <NEW_LINE> self.client_id = client_id <NEW_LINE> self.client_secret = client_secret | Defines the client authentication credentials for basic and request-body
types based on https://tools.ietf.org/html/rfc6749#section-2.3.1. | 62598f62ff9c53063f519cb0 |
class Settings(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.screen_width = 711 <NEW_LINE> self.screen_height = 720 <NEW_LINE> self.bg_color = (195, 200, 201) <NEW_LINE> self.background = pygame.image.load("/usr/lib/earth_defense/images/background.png") <NEW_LINE> self.delay = 60 <NEW_LINE> self.s... | 储存《外星人入侵》的所有设置的类 | 62598f621d351010ab8f31a3 |
class OpfrontSession(object): <NEW_LINE> <INDENT> def __init__(self, email, password, **kwargs): <NEW_LINE> <INDENT> client = OpfrontClient(email, password, **kwargs) <NEW_LINE> self.banner = OpfrontResource('/banners', client) <NEW_LINE> self.spectacle = OpfrontResource('/spectacles', client) <NEW_LINE> self.store = S... | OpfrontSession defines the set of resources available from the Opfront API.
Can be used as a standard object as and as a context manager.
Args:
email (str): Email with which to login
password (str): Password associated with the email | 62598f62a8ecb03325870862 |
class firstClass: <NEW_LINE> <INDENT> def __init__(self, a, b): <NEW_LINE> <INDENT> print("constructor chacha. object created") <NEW_LINE> print("a= " + str(a)) <NEW_LINE> print("b= " + str(b)) <NEW_LINE> <DEDENT> def myfunc(self): <NEW_LINE> <INDENT> print("my first class") | function with class scope | 62598f62d99f1b3c44d04d13 |
class User(models.Model): <NEW_LINE> <INDENT> no = models.AutoField(primary_key=True, verbose_name='No.') <NEW_LINE> username = models.CharField(max_length = 20, unique=True, verbose_name='Username') <NEW_LINE> password = models.CharField(max_length=32, verbose_name='Password') <NEW_LINE> regdate = models.DateTimeField... | Users | 62598f624d74a7450cd58a08 |
class UnknownFieldError(RuntimeError): <NEW_LINE> <INDENT> def __init__(self, key, name): <NEW_LINE> <INDENT> super().__init__(f'Field "{key}" is not specified for "{name}"') | Field provided is not present in resource schema | 62598f62796e427e5384ddf3 |
class CouponTieredPercentOffItems(object): <NEW_LINE> <INDENT> swagger_types = { 'items': 'list[str]', 'limit': 'float', 'tiers': 'list[CouponTierQuantityPercent]' } <NEW_LINE> attribute_map = { 'items': 'items', 'limit': 'limit', 'tiers': 'tiers' } <NEW_LINE> def __init__(self, items=None, limit=None, tiers=None): <NE... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f621f037a2d8b9e3751 |
class MediatorState(State): <NEW_LINE> <INDENT> __slots__ = ( 'our_address', 'routes', 'block_number', 'hashlock', 'secret', 'transfers_pair', ) <NEW_LINE> def __init__( self, our_address, routes, block_number, hashlock): <NEW_LINE> <INDENT> self.our_address = our_address <NEW_LINE> self.routes = routes <NEW_LINE> self... | State of a node mediating a transfer.
Args:
our_address (address): This node address.
routes (RoutesState): Routes available for this transfer.
block_number (int): Latest known block number.
hashlock (bin): The hashlock used for this transfer. | 62598f628c3a8732951f5bb0 |
@python_2_unicode_compatible <NEW_LINE> class RoleDescription(models.Model): <NEW_LINE> <INDENT> created_at = models.DateTimeField(auto_now_add=True, help_text=_("Date/time of creation (in ISO format)")) <NEW_LINE> slug = models.SlugField( help_text=_("Unique identifier shown in the URL bar")) <NEW_LINE> organization =... | By default, when a ``User`` grants a ``Role`` on an ``Organization``
to another ``User``, the grantee is required to opt-in the relationship
unless ``skip_optin_on_grant`` is ``True``. Then the newly created
relationship is effective immediately. | 62598f629b70327d1c57e406 |
class ToolTip: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def createToolTip(widget, text): <NEW_LINE> <INDENT> toolTip = ToolTip(widget) <NEW_LINE> def enter(event): <NEW_LINE> <INDENT> toolTip.showtip(text) <NEW_LINE> <DEDENT> def leave(event): <NEW_LINE> <INDENT> toolTip.hidetip() <NEW_LINE> <DEDENT> widget.bind('<... | Tooltip recipe from
http://www.voidspace.org.uk/python/weblog/arch_d7_2006_07_01.shtml#e387 | 62598f625e10d32532ce3418 |
class _RestrictedDict(dict): <NEW_LINE> <INDENT> def __init__(self, length): <NEW_LINE> <INDENT> dict.__init__(self) <NEW_LINE> self._length = int(length) <NEW_LINE> <DEDENT> def __setitem__(self, key, value): <NEW_LINE> <INDENT> if not hasattr(value, "__len__") or not hasattr(value, "__getitem__") or (hasattr(s... | Dict which only allows sequences of given length as values (PRIVATE).
This simple subclass of the Python dictionary is used in the SeqRecord
object for holding per-letter-annotations. This class is intended to
prevent simple errors by only allowing python sequences (e.g. lists,
strings and tuples) to be stored, and o... | 62598f62d164cc61758205d9 |
class RebaseError(GitError): <NEW_LINE> <INDENT> def __init__(self, current_branch, target_branch, **kwargs): <NEW_LINE> <INDENT> kwargs.pop('message', None) <NEW_LINE> kwargs.pop('command', None) <NEW_LINE> kwargs.pop('status', None) <NEW_LINE> message = "Failed to rebase {1} onto {0}".format( current_branch, target_b... | Error during rebase command | 62598f62287bf620b627121b |
class RecipeDetailSerializer(RecipeSerializer): <NEW_LINE> <INDENT> ingredients = IngredientSerializer(many=True, read_only=True) <NEW_LINE> tags = TagSerializer(many=True, read_only=True) | Serialize details for a recipe | 62598f62a8ecb03325870864 |
class Cluster(PartialCluster): <NEW_LINE> <INDENT> def __init__(self, exprs, ispace, dspace, atomics=None, guards=None): <NEW_LINE> <INDENT> self._exprs = exprs <NEW_LINE> self._exprs = tuple(ClusterizedEq(v, ispace=ispace, dspace=dspace) for v in self.trace.values()) <NEW_LINE> self._ispace = ispace <NEW_LINE> self._d... | A Cluster is an immutable :class:`PartialCluster`. | 62598f628c3a8732951f5bb2 |
class A: <NEW_LINE> <INDENT> def __new__(cls, *args, **kwargs): <NEW_LINE> <INDENT> if not hasattr(cls, '_instance'): <NEW_LINE> <INDENT> setattr(cls, '_instance', super().__new__(cls)) <NEW_LINE> setattr(cls, '_count', 0) <NEW_LINE> <DEDENT> return cls._instance <NEW_LINE> <DEDENT> def __init__(self, url, debug): <NEW... | 1,使用__new__魔术方法在构造类的实例,添加一个属性_instance
缺点:不能构造第二个类,否则抛出异常 | 62598f6291af0d3eaad3946a |
class Cprotocol: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> return | This is the class that defines any contact protocol related data and behaviors | 62598f62a4f1c619b294dc56 |
class Dummy(ReactionCommand): <NEW_LINE> <INDENT> def _matches(self, *args): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> def _action(self, *args): <NEW_LINE> <INDENT> pass | Extending Dummy will make the command a dummy command (ie the command won't do anything)
Great for setting up the data structure of the public_namespace in Multi | 62598f62d164cc61758205db |
class TestLogger(unittest.TestCase): <NEW_LINE> <INDENT> def testInsertRemoveSeqs(self): <NEW_LINE> <INDENT> for s in ['Goo$fooStr\nBoo', '$RESTFUL $TEST']: <NEW_LINE> <INDENT> self.assertEqual(_insert_seqs(s), s) <NEW_LINE> self.assertEqual(_remove_seqs(s), s) <NEW_LINE> <DEDENT> RESET_SEQ = "\033[0m" <NEW_LINE> COLOR... | Tests for the logger module | 62598f62711fe17d825dfd59 |
class WLEDEntity(CoordinatorEntity): <NEW_LINE> <INDENT> coordinator: WLEDDataUpdateCoordinator <NEW_LINE> @property <NEW_LINE> def device_info(self) -> DeviceInfo: <NEW_LINE> <INDENT> return DeviceInfo( connections={ (CONNECTION_NETWORK_MAC, self.coordinator.data.info.mac_address) }, identifiers={(DOMAIN, self.coordin... | Defines a base WLED entity. | 62598f625166f23b2e242a3e |
class ProcessCpuModelName(process.Processor): <NEW_LINE> <INDENT> KEY = 'cpu_model_name' <NEW_LINE> @staticmethod <NEW_LINE> def process(output, dependencies=None): <NEW_LINE> <INDENT> return get_line(output['stdout_lines']) | Process the model name of the cpu. | 62598f62925a0f43d25e769a |
class Reducer(BeatingProcess, PMRJob): <NEW_LINE> <INDENT> def __init__(self, reducer_cls, num_workers, partition_num, heartbeat_id="Reducer", slow_mode=False): <NEW_LINE> <INDENT> BeatingProcess.__init__(self) <NEW_LINE> self.heartbeat_id = heartbeat_id <NEW_LINE> self.slow_mode = slow_mode <NEW_LINE> self.reducer_cls... | @brief Class for reducer. | 62598f627c178a314d78cb02 |
class Gini(Metric): <NEW_LINE> <INDENT> def calc(self, g: List[np.ndarray]) -> float: <NEW_LINE> <INDENT> return 1.-sum([(self.p(g, v))**2 for _, v in self.classes(g)]) | Gini
1 - Sum(j) p[j]^2 | 62598f62a4f1c619b294dc58 |
class TestTrader(unittest.TestCase): <NEW_LINE> <INDENT> pass | Trader test case | 62598f621d351010ab8f31a8 |
class IngredientTestCase(WorkoutManagerTestCase): <NEW_LINE> <INDENT> def test_compare(self): <NEW_LINE> <INDENT> language = Language.objects.get(pk=1) <NEW_LINE> ingredient1 = Ingredient.objects.get(pk=1) <NEW_LINE> ingredient2 = Ingredient.objects.get(pk=1) <NEW_LINE> ingredient2.name = 'A different name altogether' ... | Tests other ingredient functions | 62598f620383005118f6cd6e |
class Container(Component): <NEW_LINE> <INDENT> __slots__ = ['inventory'] <NEW_LINE> def __init__(self, inventory=None): <NEW_LINE> <INDENT> self.inventory = inventory if inventory else set() | Ability to have an inventory. For rooms and players. | 62598f6226238365f5fac1dc |
@base.ReleaseTracks(base.ReleaseTrack.GA) <NEW_LINE> class Import(base.UpdateCommand): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> flags.AddTemplateResourceArg(parser, 'import', api_version='v1') <NEW_LINE> flags.AddTemplateSourceFlag(parser, V1_SCHEMA_PATH) <NEW_LINE> <DEDENT> de... | Import a workflow template.
If the specified template resource already exists, it will be overwritten.
Otherwise, a new template will be created.
To edit an existing template, you can export the template to a file, edit its
configuration, and then import the new configuration. | 62598f62d164cc61758205de |
class OrderForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Order <NEW_LINE> exclude = ['user', 'ip_address', 'status'] <NEW_LINE> <DEDENT> def __init__(self, request, **kwargs): <NEW_LINE> <INDENT> super(OrderForm, self).__init__(**kwargs) <NEW_LINE> self.request = request <NEW_LINE> ... | Order form | 62598f6230c21e258be97e62 |
class Sphere(CGO): <NEW_LINE> <INDENT> def __init__(self, p, radius, color): <NEW_LINE> <INDENT> x, y, z = p <NEW_LINE> r, g, b = color <NEW_LINE> self._primitive = [ cgo.COLOR, r, g, b, cgo.SPHERE, x, y, z, radius, ] | A sphere compiled graphic object
ARGUMENTS
p A coordinate vector (x, y, z) of the center of the sphere
radius A radius of the sphere
color A color vector (r, g, b) of the sphere | 62598f6263f4b57ef00858a2 |
class EarlyStopping(object): <NEW_LINE> <INDENT> def __init__(self, mode='minimize', min_delta=0, patience=10): <NEW_LINE> <INDENT> self.mode = mode <NEW_LINE> self._check_mode() <NEW_LINE> self.min_delta = min_delta <NEW_LINE> self.patience = patience <NEW_LINE> self.best = None <NEW_LINE> self.num_bad_epochs = 0 <NEW... | Implements early stopping in PyTorch
Reference: https://gist.github.com/stefanonardo/693d96ceb2f531fa05db530f3e21517d | 62598f628c3a8732951f5bb7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.