code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class UserModuleDeleter(object): <NEW_LINE> <INDENT> def __init__(self, namelist=None, pathlist=None): <NEW_LINE> <INDENT> if namelist is None: <NEW_LINE> <INDENT> namelist = [] <NEW_LINE> <DEDENT> self.namelist = namelist+['sitecustomize', 'spyderlib', 'spyderplugins'] <NEW_LINE> if pathlist is None: <NEW_LINE> <INDEN... | User Module Deleter (UMD) aims at deleting user modules
to force Python to deeply reload them during import
pathlist [list]: blacklist in terms of module path
namelist [list]: blacklist in terms of module name | 62598eeeeab8aa0e5d30a51f |
class AlphaBetaPlayer(IsolationPlayer): <NEW_LINE> <INDENT> def get_move(self, game, time_left): <NEW_LINE> <INDENT> self.time_left = time_left <NEW_LINE> best_move = (-1, -1) <NEW_LINE> try: <NEW_LINE> <INDENT> i=1 <NEW_LINE> while True: <NEW_LINE> <INDENT> best_move= self.alphabeta(game, i) <NEW_LINE> i=i+1 <NEW_LINE... | Game-playing agent that chooses a move using iterative deepening minimax
search with alpha-beta pruning. You must finish and test this player to
make sure it returns a good move before the search time limit expires. | 62598eee7d43ff24874267cd |
class Test(AnodAction): <NEW_LINE> <INDENT> pass | Anod test primitive. | 62598eeebe383301e0251f7b |
class EvalComparisonOp(): <NEW_LINE> <INDENT> opMap = { "<" : lambda a,b : a < b, "<=" : lambda a,b : a <= b, ">" : lambda a,b : a > b, ">=" : lambda a,b : a >= b, "==" : lambda a,b : a == b, "!=" : lambda a,b : a != b, } <NEW_LINE> def __init__(self, tokens): <NEW_LINE> <INDENT> self.value = tokens[0] <NEW_LINE> <DE... | Class to evaluate comparison expressions | 62598eee7b25080760ed5c3d |
@attrs <NEW_LINE> class _ReaderBase: <NEW_LINE> <INDENT> done = attrib() | Provides the positional attributes of Reader. | 62598eee3317a56b869bd937 |
class UUTProgramBootloader(UUTBusy): <NEW_LINE> <INDENT> pass | UUT Program Bootloader | 62598eee44b2445a339b5d3c |
class TestRelativeId: <NEW_LINE> <INDENT> def test_only_one_resource_has_no_id(self, resource_urls): <NEW_LINE> <INDENT> result = fetch(resource_urls) <NEW_LINE> assert all(not cr.id_in_origin for cr in result.crawled_resources) <NEW_LINE> <DEDENT> def test_the_index_is_added_to_the_ids(self, resources, resource_urls_u... | When a resource is crawled, it should get its individual id.
This id iscomputed from the index in the file the resource is from. | 62598eee435de62698e9a572 |
class HelloBot(BotPlugin): <NEW_LINE> <INDENT> @botcmd <NEW_LINE> def hello(self, msg, args): <NEW_LINE> <INDENT> return "Hello, " + format(msg.frm) | 'Hello!' plugin for Errbot | 62598eeea8370b77170eeb87 |
class ArticleTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = User.objects.create_user( username="user", email="user@mail.com", password="Pa@bbgbh" ) <NEW_LINE> self.article = Articles.objects.create( author=User.objects.first(), title="the 3 musketeers", body="is a timeless story", ... | Unit tests for `User` model. | 62598eee379a373c97d97798 |
class FlagExplorationHandler(base.BaseHandler): <NEW_LINE> <INDENT> URL_PATH_ARGS_SCHEMAS = { 'exploration_id': { 'schema': { 'type': 'basestring', 'validators': [{ 'id': 'is_regex_matched', 'regex_pattern': constants.ENTITY_ID_REGEX }] } } } <NEW_LINE> HANDLER_ARGS_SCHEMAS = { 'POST': { 'report_text': { 'schema': { 't... | Handles operations relating to learner flagging of explorations. | 62598eee796e427e5384cf3b |
class AfterCreate(object): <NEW_LINE> <INDENT> def __init__(self, view, created, deserialized): <NEW_LINE> <INDENT> self.view = view <NEW_LINE> self.created = created <NEW_LINE> self.deserialized = deserialized | Fired after :meth:`spree.rest.traversal.APICollection.create` is called.
You can achieve similar results using :meth:`spree.rest.traversal.APICollection.after_create` | 62598eee30bbd722464683d8 |
class OpeningBalances(VismaModel): <NEW_LINE> <INDENT> name = fields.String(data_key='Name') <NEW_LINE> number = fields.Integer(data_key='Number') <NEW_LINE> balance = fields.Number(data_key='Balance') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> endpoint = '/fiscalyears/openingbalances' <NEW_LINE> allowed_methods = ['li... | Represents opening balances
:argument str name: Name
:argument int number: Account number.
:argument number balance: Account balance. | 62598eeedc8b845886d51d66 |
class Individual(object): <NEW_LINE> <INDENT> bounds = None <NEW_LINE> weight = None <NEW_LINE> def __init__(self, genome, origin=None): <NEW_LINE> <INDENT> self.genome = genome <NEW_LINE> self.origin = origin <NEW_LINE> self.value = None <NEW_LINE> self.wvalue = None <NEW_LINE> <DEDENT> def __getitem__(self, key): <NE... | 進化計算個体
遺伝子と評価値を管理する | 62598eeebe8e80087fbbd7f3 |
class RowDimension(Dimension): <NEW_LINE> <INDENT> __fields__ = Dimension.__fields__ + ('ht', 'customFormat', 'customHeight', 's', 'thickBot', 'thickTop') <NEW_LINE> r = Alias('index') <NEW_LINE> s = Alias('style_id') <NEW_LINE> ht = Float(allow_none=True) <NEW_LINE> height = Alias('ht') <NEW_LINE> thickBot = Bool() <N... | Information about the display properties of a row. | 62598eee283ffb24f3cf2054 |
class ListAutoscalers(base_classes.BaseCommand): <NEW_LINE> <INDENT> def Run(self, args): <NEW_LINE> <INDENT> log.warn('Please use instead [gcloud compute instance-groups ' 'managed list].') <NEW_LINE> client = self.context['autoscaler-client'] <NEW_LINE> messages = self.context['autoscaler_messages_module'] <NEW_LINE>... | List Autoscaler instances. | 62598eee5fdd1c0f98e5c744 |
class SupervisedAgent(Agent): <NEW_LINE> <INDENT> def __init__(self, env): <NEW_LINE> <INDENT> super(SupervisedAgent, self).__init__(env) <NEW_LINE> self.controller = SupervisedController(self) <NEW_LINE> <DEDENT> def train(self): <NEW_LINE> <INDENT> while self.done == False: <NEW_LINE> <INDENT> move = self.controller.... | docstring for SupervisedAgent
| 62598eee56ac1b37e630098f |
class TripletLoss(nn.Module): <NEW_LINE> <INDENT> def __init__(self, margin=0.5): <NEW_LINE> <INDENT> super(TripletLoss, self).__init__() <NEW_LINE> self.margin = margin <NEW_LINE> self.ranking_loss = nn.MarginRankingLoss(margin=margin) <NEW_LINE> <DEDENT> def forward(self, inputs, targets): <NEW_LINE> <INDENT> n = inp... | Triplet loss with hard positive/negative mining.
Reference:
Hermans et al. In Defense of the Triplet Loss for Person Re-Identification. arXiv:1703.07737.
Code imported from https://github.com/Cysu/open-reid/blob/master/reid/loss/triplet.py.
Args:
margin (float): margin for triplet. | 62598eee097d151d1a2bf7c1 |
class GroupRMSprop(Optimizer): <NEW_LINE> <INDENT> def __init__(self, params, lr=1e-2, beta=0.99, eps=1e-6): <NEW_LINE> <INDENT> if not 0.0 <= lr: <NEW_LINE> <INDENT> raise ValueError("Invalid learning rate: {}".format(lr)) <NEW_LINE> <DEDENT> if not 0.0 <= eps: <NEW_LINE> <INDENT> raise ValueError("Invalid epsilon val... | A different version of RMSprop optimizer with a global learning rate adjusting.
| 62598eeeb7558d5895461dea |
class Edge(): <NEW_LINE> <INDENT> def __init__(self, v1, v2): <NEW_LINE> <INDENT> self.v1 = v1 <NEW_LINE> self.v2 = v2 <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return str(self.v1) + "-->" + str(self.v2) <NEW_LINE> <DEDENT> def get_vertices(self): <NEW_LINE> <INDENT> return (self.v1, self.v2) <NEW_LINE... | The edges of our graph. | 62598eee4f6381625f19888d |
class Display: <NEW_LINE> <INDENT> def __init__(self, scl_pin, sda_pin, out_pin): <NEW_LINE> <INDENT> self.i2c = machine.I2C(0, scl=machine.Pin(scl_pin), sda=machine.Pin(sda_pin)) <NEW_LINE> self.pin = machine.Pin(out_pin, machine.Pin.OUT) <NEW_LINE> self.pin.value(0) <NEW_LINE> self.pin.value(1) <NEW_LINE> self.oled =... | Utility class to display data on SSD1306 display. | 62598eee5fdd1c0f98e5c745 |
class Singleton(type): <NEW_LINE> <INDENT> def __init__(cls, name, bases, *args,**kwargs): <NEW_LINE> <INDENT> super().__init__(name, bases, *args) <NEW_LINE> cls._instance = None <NEW_LINE> <DEDENT> def __call__(cls,*args,**kwargs): <NEW_LINE> <INDENT> if cls._instance is None: <NEW_LINE> <INDENT> cls._instance =super... | Singleton Class | 62598eeed7e4931a7ef3a844 |
class ComparisonExpr(Node): <NEW_LINE> <INDENT> operators = None <NEW_LINE> operands = None <NEW_LINE> method_types = None <NEW_LINE> def __init__(self, operators: List[str], operands: List[Node]) -> None: <NEW_LINE> <INDENT> self.operators = operators <NEW_LINE> self.operands = operands <NEW_LINE> self.method_types = ... | Comparison expression (e.g. a < b > c < d). | 62598eee7047854f4633db76 |
class Scroller: <NEW_LINE> <INDENT> def __init__(self, isCursorEnabled): <NEW_LINE> <INDENT> self.scrollLoc, self.cursorLoc = 0, 0 <NEW_LINE> self.cursorSelection = None <NEW_LINE> self.isCursorEnabled = isCursorEnabled <NEW_LINE> <DEDENT> def getScrollLoc(self, content, pageHeight): <NEW_LINE> <INDENT> if content and ... | Tracks the scrolling position when there might be a visible cursor. This
expects that there is a single line displayed per an entry in the contents. | 62598eee627d3e7fe0e0562e |
class WorkoutManagerEditTestCase(WorkoutManagerTestCase): <NEW_LINE> <INDENT> object_class = '' <NEW_LINE> url = '' <NEW_LINE> pk = None <NEW_LINE> data = {} <NEW_LINE> data_ignore = () <NEW_LINE> fileupload = None <NEW_LINE> def edit_object(self, fail=False): <NEW_LINE> <INDENT> if self.__class__.__name__ == 'WorkoutM... | Tests editing an object as an authorized user, a different one
and a logged out
one. | 62598eee21bff66bcd7213f9 |
class PlatformTile(games.Sprite): <NEW_LINE> <INDENT> IMAGE = games.load_image("images/platform.png") <NEW_LINE> def __init__(self, x, y, hrd): <NEW_LINE> <INDENT> super(PlatformTile, self).__init__( image = PlatformTile.IMAGE, x = x, y = y) <NEW_LINE> self.isHard = hrd <NEW_LINE> <DEDENT> def activate(self): <NEW_LINE... | A platform to stand on | 62598eee99cbb53fe682f651 |
class DeepResidualNetwork: <NEW_LINE> <INDENT> def __init__(self, input_shape, output_shape): <NEW_LINE> <INDENT> inputs = Input(shape=input_shape) <NEW_LINE> conv1 = Conv2D(64, (7, 7), strides=(2,2), padding='same')(inputs) <NEW_LINE> normalize = BatchNormalization()(conv1) <NEW_LINE> maxpool = MaxPooling2D((3, 3), st... | Builds 18 layer Deep Residual Network
This class only implements the 18-layer ResNet without bottlenecking
residual blocks. Initializing this class will create the full network
and the get_model() method should return the keras model.
Args:
input_shape (tuple): (width, height, channel)
output_shape (int): num... | 62598eeef548e778e5969d2f |
class VisualizationToolFactory(factory.django.DjangoModelFactory): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = "tool_manager.VisualizationTool" | Minimal representation of a VisualizationTool | 62598eee10dbd63aa1c6f31b |
class NetworkWatcherListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[NetworkWatcher]'}, } <NEW_LINE> def __init__( self, *, value: Optional[List["NetworkWatcher"]] = None, **kwargs ): <NEW_LINE> <INDENT> super(NetworkWatcherListResult, self).__init__(**k... | List of network watcher resources.
:param value:
:type value: list[~azure.mgmt.network.v2017_03_01.models.NetworkWatcher] | 62598eeeadb09d7d5dc08d6d |
class Spine: <NEW_LINE> <INDENT> def __init__(self, parent_axes, transform): <NEW_LINE> <INDENT> self.parent_axes = parent_axes <NEW_LINE> self.transform = transform <NEW_LINE> self.data = None <NEW_LINE> self.pixel = None <NEW_LINE> self.world = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def data(self): <NEW_LINE> ... | A single side of an axes.
This does not need to be a straight line, but represents a 'side' when
determining which part of the frame to put labels and ticks on. | 62598eeecc0a2c11144797a9 |
class DataFileElement (DataElement): <NEW_LINE> <INDENT> FILE_URI_RE = re.compile("^(?:file://)?(/?[^/]+(?:/[^/]+)*)$") <NEW_LINE> @classmethod <NEW_LINE> def is_usable(cls): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_uri(cls, uri): <NEW_LINE> <INDENT> path_match = cls.FILE_URI... | File-based data element | 62598eeecc0a2c11144797aa |
class MITCampus(Campus): <NEW_LINE> <INDENT> def __init__(self, center_loc, tent_loc = Location(0,0)): <NEW_LINE> <INDENT> self.center_loc = center_loc <NEW_LINE> self.tents = [] <NEW_LINE> self.tents.append(tent_loc) <NEW_LINE> <DEDENT> def add_tent(self, new_tent_loc): <NEW_LINE> <INDENT> for tent in self.tents: <NEW... | A MITCampus is a Campus that contains tents | 62598eee91f36d47f2230276 |
class AADC_DB(object): <NEW_LINE> <INDENT> def __init__(self, username=None, password=None): <NEW_LINE> <INDENT> config = load_config() <NEW_LINE> if username is None: <NEW_LINE> <INDENT> username = config.get('database', 'username', fallback=None) <NEW_LINE> if username is None: <NEW_LINE> <INDENT> default_username = ... | Connection to the central TASOC database.
Attributes:
conn (`psycopg2.Connection` object): Connection to PostgreSQL database.
cursor (`psycopg2.Cursor` object): Cursor to use in database. | 62598eee57b8e32f525074d6 |
class QMapPrinter: <NEW_LINE> <INDENT> class _iterator(Iterator): <NEW_LINE> <INDENT> def __init__(self, val): <NEW_LINE> <INDENT> self.val = val <NEW_LINE> self.ktype = self.val.type.template_argument(0) <NEW_LINE> self.vtype = self.val.type.template_argument(1) <NEW_LINE> self.data_node = self.val['e']['forward'][0] ... | Print a QMap | 62598eeea8370b77170eeb8a |
class AnnealingScheduler: <NEW_LINE> <INDENT> def __init__(self, epsilon_max, epsilon_min, stopping_step): <NEW_LINE> <INDENT> self.current_step = 0 <NEW_LINE> self.stopping_step = stopping_step <NEW_LINE> self.epsilon = epsilon_max <NEW_LINE> self.decay = (epsilon_max - epsilon_min) / (stopping_step) <NEW_LINE> <DEDEN... | Annealing (epsilon) scheduler | 62598eee1f5feb6acb1613f8 |
class LeafFilterSpecification(FilterSpecification): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> if self.__class__ is LeafFilterSpecification: <NEW_LINE> <INDENT> raise NotImplementedError('Abstract class') <NEW_LINE> <DEDENT> FilterSpecification.__init__(self) <NEW_LINE> <DEDENT> def accept(self, visito... | Abstract base class for specifications that represent leaves in a
specification tree. | 62598eee796e427e5384cf3d |
class ScapyArguments(ArgumentParser): <NEW_LINE> <INDENT> interface_args: list = ["--interface", "-I"] <NEW_LINE> interface_kwargs: dict = { "help": "Part of the IP, MAC or name of the interface", } <NEW_LINE> def __init__( self, *args, interface_args=interface_args, interface_kwargs=interface_kwargs, **kwargs, ): <NEW... | This class implements ArgumentsParser with
interface argument and iface research. | 62598eeef548e778e5969d30 |
class BertClassifier(nn.Module): <NEW_LINE> <INDENT> def __init__(self, config: SectionProxy, num_labels): <NEW_LINE> <INDENT> super(BertClassifier, self).__init__() <NEW_LINE> self.config = config <NEW_LINE> self.num_labels = num_labels <NEW_LINE> self.bert = BertModel.from_pretrained(config['PreTrainModelDir']) <NEW_... | BERT分类器 | 62598eeedd821e528d6d76e4 |
class SamCigar(object): <NEW_LINE> <INDENT> cigarStrings = [ protocol.CigarOperation.ALIGNMENT_MATCH, protocol.CigarOperation.INSERT, protocol.CigarOperation.DELETE, protocol.CigarOperation.SKIP, protocol.CigarOperation.CLIP_SOFT, protocol.CigarOperation.CLIP_HARD, protocol.CigarOperation.PAD, protocol.CigarOperation.S... | Utility class for working with SAM CIGAR strings | 62598eee71ff763f4b5e5f03 |
class SupportedQuery(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=MAX_NAME_LENGTH) <NEW_LINE> description = models.TextField(blank=True) <NEW_LINE> query_handler = models.ForeignKey('QueryHandler') <NEW_LINE> use_handler_scope = models.BooleanField(default=True) <NEW_LINE> preferred_scope = mod... | A SupportedQuery Object represents a QueryHandler plus
an (optional, user-configurable) scope restriction of that
QueryHandler. | 62598eeea219f33f346c4fe1 |
class IntegrationTestWorker(RabbitMQWorker): <NEW_LINE> <INDENT> def __init__(self, params=None): <NEW_LINE> <INDENT> super(IntegrationTestWorker, self).__init__(params) <NEW_LINE> app.init_app() <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def make_local_config(config): <NEW_LINE> <INDENT> s = [] <NEW_LINE> for k, v i... | Integration Test Worker
Executes integration tests on the build that was deployed. These tests are
currently fixed to being the ones found in adsrex:
http://github.com/adsabs/adsrex.git
Regardless of whether the tests pass, fail, or crash, the forwarding of the
messages should still go to after_delpoy. | 62598eee097d151d1a2bf7c3 |
class email_create(CreateView): <NEW_LINE> <INDENT> template_name = "core/email_data_create.html" <NEW_LINE> form_class = send_msg_form <NEW_LINE> queryset = email_data.objects.all() <NEW_LINE> r"""Display details of the form in the server log.""" <NEW_LINE> def form_valid(self, form): <NEW_LINE> <INDENT> print(form.cl... | Example of CreateView using ClassViews.
| 62598eee627d3e7fe0e05630 |
class Benchmark(models.Model): <NEW_LINE> <INDENT> instrument = models.ForeignKey(instrument, on_delete=models.CASCADE) <NEW_LINE> instrument_score = models.ForeignKey(InstrumentScore, on_delete=models.CASCADE) <NEW_LINE> percentile = models.IntegerField() <NEW_LINE> age = models.IntegerField() <NEW_LINE> raw_score = m... | Class to store benchmark data for each instrument and score.
Data is loaded from csv files held in /cdi_forms/form_data/benchmarking/ | 62598eee851cf427c66b6a6f |
class MILLoss(nn.Module): <NEW_LINE> <INDENT> def __init__(self, all_losses=False): <NEW_LINE> <INDENT> super(MILLoss, self).__init__() <NEW_LINE> self.all_losses = all_losses <NEW_LINE> <DEDENT> def forward(self, probas, labels, bag_ids, neg_weight=1, pos_weight=1): <NEW_LINE> <INDENT> neg_idx_select = labels == 0 <NE... | Multi-Instance Learning Loss | 62598eee66673b3332c2eb4f |
class RetrieveUpdateDestroyTipByID(RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> http_method_names = ['get', 'patch', 'delete'] <NEW_LINE> queryset = Tip.objects.all() <NEW_LINE> serializer_class = TipSerializer <NEW_LINE> lookup_field = 'id' <NEW_LINE> def get_queryset(self, **kwargs): <NEW_LINE> <INDENT> tip = T... | get:
Retrieve a Tip with the given id.
patch:
Update a Tip with the given id.
delete:
Delete a Tip with the given id. | 62598eee30dc7b766599e02f |
class BaseRegistry: <NEW_LINE> <INDENT> type = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> assert self.type <NEW_LINE> self._registry = {} <NEW_LINE> self._forced = [] <NEW_LINE> <DEDENT> def register(self, cls, force=False): <NEW_LINE> <INDENT> if not issubclass(cls, self.type): <NEW_LINE> <INDENT> raise I... | Registry of dash plugins.
It's essential, that class registered has the``uid`` property. | 62598eee5fdd1c0f98e5c747 |
class WaitingRoom(object): <NEW_LINE> <INDENT> def __init__(self, id): <NEW_LINE> <INDENT> super(WaitingRoom, self).__init__() <NEW_LINE> self.id = id <NEW_LINE> self.patients = [] <NEW_LINE> create_entities('hospital_ingreso', self.id) <NEW_LINE> <DEDENT> def assign_patient(self, patient): <NEW_LINE> <INDENT> self.pat... | docstring for WaitingRoom. | 62598eee10dbd63aa1c6f31d |
class SourceExtractorConfiguration(ExtractorConfiguration): <NEW_LINE> <INDENT> FILE_NAME = 'source.yaml' <NEW_LINE> FRESHNESS_THRESHOLD_DEFAULT = 365 <NEW_LINE> @classmethod <NEW_LINE> def _derive_init_kwargs(cls, configuration, extractor): <NEW_LINE> <INDENT> return super()._derive_init_kwargs(configuration, extracto... | SourceExtractorConfiguration is currently a subset of Multi... | 62598eeeeab8aa0e5d30a523 |
class ChoiceLoader(BaseLoader): <NEW_LINE> <INDENT> def __init__(self, loaders): <NEW_LINE> <INDENT> self.loaders = list(loaders) <NEW_LINE> <DEDENT> def get_source(self, environment, template): <NEW_LINE> <INDENT> for loader in self.loaders: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return loader.get_source(environ... | This loader works like the `PrefixLoader` just that no prefix is
specified. If a template could not be found by one loader the next one
is tried.
>>> loader = ChoiceLoader([
... FileSystemLoader('/path/to/user/templates'),
... FileSystemLoader('/path/to/system/templates')
... ])
This is useful if you want to... | 62598eee8e7ae83300ee7836 |
class Tester_Probability(ModifiedTestCase): <NEW_LINE> <INDENT> pass | probability testing functions. | 62598eee56ac1b37e6300992 |
class OutlinesMixin(ColorMixin): <NEW_LINE> <INDENT> def __init__(self, outline_color, line_width): <NEW_LINE> <INDENT> super(OutlinesMixin, self).__init__() <NEW_LINE> self._flush_outlines() <NEW_LINE> self.color = outline_color <NEW_LINE> self._line_width = line_width <NEW_LINE> <DEDENT> def _flush_outlines(self): <N... | Provides rendering of "labels" as outlines
Needs self.labels to return a sequence of labels matrices and needs
self._flush_outlines to be called when parameters change. | 62598eee460517430c430c2e |
class CloudError(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'code': {'readonly': True}, 'message': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, 'details': {'key'... | The error information object.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar code: Error code string.
:vartype code: str
:ivar message: Descriptive error information.
:vartype message: str
:param target: Error target.
:type target: str
:param details: More detailed error... | 62598eeeaad79263cf42cfb3 |
class Operations(ExtendedEnum): <NEW_LINE> <INDENT> SET_TAGS = "setTags" <NEW_LINE> UNSET_TAGS = "unsetTags" | An enumeration of valid operations | 62598eee4527f215b58e86a5 |
class DatoN1_Type (pyxb.binding.datatypes.string): <NEW_LINE> <INDENT> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'DatoN1_Type') <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location( '../data/common/typesDati_v3.xsd', 59, 1) <NEW_LINE> _Documentation = 'Tipo semplice che identifica i numeri naturali da 1 a... | Tipo semplice che identifica i numeri naturali da 1 a 9. | 62598eee379a373c97d9779c |
class PtrVariableTemplateHandler(HtmlTemplateHandler): <NEW_LINE> <INDENT> def __init__(self, var): <NEW_LINE> <INDENT> HtmlTemplateHandler.__init__(self, var, 'ptrvariableview.mako') <NEW_LINE> <DEDENT> @pyqtSlot() <NEW_LINE> def dereference(self): <NEW_LINE> <INDENT> self.var.dereference() <NEW_LINE> <DEDENT> @pyqtSl... | TemplateHandler for Pointer-Variables | 62598eeed268445f26638f62 |
class DelistWrapper(torch.nn.Module): <NEW_LINE> <INDENT> def __init__(self, mod): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.mod = mod <NEW_LINE> <DEDENT> def forward(self, ts: List[torch.Tensor]) -> torch.Tensor: <NEW_LINE> <INDENT> outs = self.mod(ts) <NEW_LINE> assert len(outs) == 1 <NEW_LINE> return ou... | NNAPI de-list-ifying wrapper.
NNAPI always provides a list of outputs. This module provides a
single-tensor output interface for models that want it. | 62598eee71ff763f4b5e5f05 |
class AbstractDispatchQueue(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.queue = [] <NEW_LINE> self.cond = threading.Condition() <NEW_LINE> <DEDENT> def dispatch_async(self, f): <NEW_LINE> <INDENT> self.cond.acquire() <NEW_LINE> self.queue.append(f) <NEW_LINE> self.notify() <NEW_LINE> self.... | Facilitates running a function on another thread.
Clients invoke dispatch_async() to run a function on the thread that pulls from this queue.
Owning threads invoke run_jobs() periodically. | 62598eee7d847024c075ab75 |
class ListCommentsForRepoInputSet(InputSet): <NEW_LINE> <INDENT> def set_AccessToken(self, value): <NEW_LINE> <INDENT> super(ListCommentsForRepoInputSet, self)._set_input('AccessToken', value) <NEW_LINE> <DEDENT> def set_Page(self, value): <NEW_LINE> <INDENT> super(ListCommentsForRepoInputSet, self)._set_input('Page', ... | An InputSet with methods appropriate for specifying the inputs to the ListCommentsForRepo
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 62598eee1b99ca400228e8e1 |
class SomaCover(SomaEntity, CoverEntity): <NEW_LINE> <INDENT> def close_cover(self, **kwargs): <NEW_LINE> <INDENT> response = self.api.set_shade_position(self.device["mac"], 100) <NEW_LINE> if response["result"] != "success": <NEW_LINE> <INDENT> _LOGGER.error( "Unable to reach device %s (%s)", self.device["name"], resp... | Representation of a Soma cover device. | 62598eeed58c6744b42db689 |
class SubgoalNode(Subgoal): <NEW_LINE> <INDENT> def __init__(self, state, radius=0.1): <NEW_LINE> <INDENT> super(SubgoalNode, self).__init__(state, radius) <NEW_LINE> self.connections = [] <NEW_LINE> self.root = False | A subgoal that contains a list connecting subgoals. Set root = True if this is the root of the graph. | 62598eee4f6381625f19888f |
class Box: <NEW_LINE> <INDENT> shape = "box" <NEW_LINE> def __init__(self, xc=None, yc=None, width=None, height=None, rotation=0.0): <NEW_LINE> <INDENT> if isinstance(xc, str): <NEW_LINE> <INDENT> self.parse(regstr=xc) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.xc = xc <NEW_LINE> self.yc = yc <NEW_LINE> self.wi... | Box region: box(xc,yc,width,height,rotation) | 62598eeed486a94d0ba2a774 |
class OUNoise: <NEW_LINE> <INDENT> def __init__(self, size, seed, mu=0., theta=0.15, sigma=0.5): <NEW_LINE> <INDENT> self.mu = mu * np.ones(size) <NEW_LINE> self.theta = theta <NEW_LINE> self.sigma = sigma <NEW_LINE> self.seed = random.seed(seed) <NEW_LINE> self.reset() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <... | Ornstein-Uhlenbeck process. | 62598eeed486a94d0ba2a775 |
class InitializeRegulatorsTestCase(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.df = _df.read_pickle(_df.REGULATORS_9500) <NEW_LINE> cls.regs = equipment.initialize_regulators(cls.df) <NEW_LINE> <DEDENT> def test_eighteen_tap_changers(self): <NEW_LINE> <IN... | Test initialize_regulators | 62598eee090684286d592ab6 |
class Decimal(ANSIType): <NEW_LINE> <INDENT> def __init__(self, precision=None, scale=None): <NEW_LINE> <INDENT> super(Decimal, self).__init__(name='DECIMAL') <NEW_LINE> self.precision = precision <NEW_LINE> self.scale = scale <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '{name}{params}'.format( na... | Represents the ANSI type DECIMAL. | 62598eee32920d7e50bc47d4 |
class Camino2Trackvis(CommandLine): <NEW_LINE> <INDENT> _cmd = 'camino_to_trackvis' <NEW_LINE> input_spec=Camino2TrackvisInputSpec <NEW_LINE> output_spec=Camino2TrackvisOutputSpec <NEW_LINE> def _list_outputs(self): <NEW_LINE> <INDENT> outputs = self.output_spec().get() <NEW_LINE> outputs['trackvis'] = os.path.abspath(... | Wraps camino_to_trackvis from Camino-Trackvis
Convert files from camino .Bfloat format to trackvis .trk format.
Example
-------
>>> import nipype.interfaces.camino2trackvis as cam2trk
>>> c2t = cam2trk.Camino2Trackvis()
>>> c2t.inputs.in_file = 'data.Bfloat'
>>> c2t.inputs.out_file = 'streamlines.trk'
>>> c2t.inputs... | 62598eee30dc7b766599e031 |
class AffineError(ValueError): <NEW_LINE> <INDENT> pass | Errors in calculating or using affines | 62598eee498bea3a75a562da |
class NAX11_04: <NEW_LINE> <INDENT> play = Buff(TARGET, "NAX11_04e") | Mutating Injection | 62598eee5fcc89381b2654fb |
class CreateUserSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> password2 = serializers.CharField(label="确认密码", write_only=True) <NEW_LINE> sms_code = serializers.CharField(label="验证码", write_only=True) <NEW_LINE> allow = serializers.CharField(label="是否同意协议", write_only=True) <NEW_LINE> token = serializers... | 提交字段
1. username
2. password
3. password2
4. mobile
5. sms_code
6. allow
返回字段
1.id
2. usrname
3. moble
4.jwt token | 62598eeeff9c53063f518e0c |
class Meta: <NEW_LINE> <INDENT> app_label = "mealing" <NEW_LINE> verbose_name = u"餐厅" <NEW_LINE> verbose_name_plural = u"餐厅" | meta class
| 62598eee01c39578d7f1154c |
class Solution: <NEW_LINE> <INDENT> def preorderTraversal(self, root): <NEW_LINE> <INDENT> self.ret =[] <NEW_LINE> self.pre_trav(root) <NEW_LINE> return self.ret <NEW_LINE> <DEDENT> def pre_trav(self,root): <NEW_LINE> <INDENT> if root is None: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> self.ret.append(root.val) <NE... | @param root: A Tree
@return: Preorder in ArrayList which contains node values.
recursive way first call root.left | 62598eeef548e778e5969d33 |
class DiscreteChainRecord(SimpleChainRecord, DiscreteRecord): <NEW_LINE> <INDENT> def indexes(self): <NEW_LINE> <INDENT> all_indexes = (index for record in self._records for index in _indexes(record) ) <NEW_LINE> return list(set(all_indexes)) <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return iter(self.... | Chain record of finite size. IE a ChainRecord, which also
implements __len__ and __iter__.
@todo: Consider using basics.indexes instead of local utiilty _indexes | 62598eeeeab8aa0e5d30a525 |
class _CatXMrCubeStdDev(_BaseCubeStdDev): <NEW_LINE> <INDENT> @lazyproperty <NEW_LINE> def stddev(self): <NEW_LINE> <INDENT> return self._stddev[:, :, 0] | StdDev cube-measure for a NOT_MR_X_MR slice.
Note that the rows-dimensions need not actually be CAT. | 62598eeebe7bc26dc9251236 |
class FileTarget (AbstractFileTarget): <NEW_LINE> <INDENT> def __init__ (self, name, type, project, action = None, path=None, exact=False): <NEW_LINE> <INDENT> AbstractFileTarget.__init__ (self, name, type, project, action, exact) <NEW_LINE> self.path_ = path <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> i... | File target with explicitly known location.
The file path is determined as
- value passed to the 'set_path' method, if any
- for derived files, project's build dir, joined with components
that describe action's properties. If the free properties
are not equal to the project's reference properties
... | 62598eee32920d7e50bc47d5 |
class message_router(gr.sync_block): <NEW_LINE> <INDENT> def __init__(self, output_index): <NEW_LINE> <INDENT> gr.sync_block.__init__(self, name="message_router", in_sig=None, out_sig=None) <NEW_LINE> self.message_port_register_in(pmt.intern("in")) <NEW_LINE> self.message_port_register_out(pmt.intern("out0")) <NEW_LINE... | This block routes PMTs received into one of two paths,
selected by `output_index`. | 62598eee2c8b7c6e89bd1f6a |
class ImageAberrationPipeline: <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self._config = config <NEW_LINE> self._vignette_gains = dict() <NEW_LINE> self._lock = threading.Lock() <NEW_LINE> <DEDENT> def process_image(self, image): <NEW_LINE> <INDENT> width, height = image.shape[1], image.shape[0... | Modifies every incoming image according to a fixed lens aberration profile. | 62598eee56ac1b37e6300994 |
class BaseTestCamrest: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setup_class(cls): <NEW_LINE> <INDENT> cls.usr_acts = [ { "inform": [ [ "food", "brazilian" ], [ "area", "north" ] ] }, { "inform": [ [ "food", "portuguese" ] ] }, { "inform": [ [ "food", "indian" ] ] }, { "request": [ [ "phone", "?" ], [ "address", ... | Base class for testing camrest. This class has attributes `usr_acts` and `sys_acts`. | 62598eee44b2445a339b5d3f |
@cassiopeia.type.core.common.inheritdocs <NEW_LINE> class Mastery(cassiopeia.type.dto.common.CassiopeiaDto): <NEW_LINE> <INDENT> def __init__(self, dictionary): <NEW_LINE> <INDENT> self.masteryId = dictionary.get("masteryId", 0) <NEW_LINE> self.rank = dictionary.get("rank", 0) | masteryId int mastery ID
rank int mastery rank | 62598eeed268445f26638f63 |
class AbstractSearchEngine(AbstractModel): <NEW_LINE> <INDENT> def __init__(self, configuration, instance_name): <NEW_LINE> <INDENT> super(AbstractSearchEngine, self).__init__(configuration, instance_name) <NEW_LINE> self.ids = None <NEW_LINE> self.docs = None <NEW_LINE> self.tfidf = None <NEW_LINE> self.term_document_... | an abstract search engine | 62598eee23849d37ff84f862 |
class ScrapeGutenberg(GetTextInfo): <NEW_LINE> <INDENT> _url = "https://www.gutenberg.org/ebooks/{}" <NEW_LINE> def __init__(self, id): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.url = self._url.format(id) <NEW_LINE> self.get_soup() <NEW_LINE> self.set_info() <NEW_LINE> pass <NEW_LINE> <DEDENT> def get_soup(self)... | Comprehensive object for finding all required information from Project Gutenberg pages | 62598eee56b00c62f0fb107b |
class DemoFileBlobField(ExtensionField, FileBlobField): <NEW_LINE> <INDENT> pass | Demo file blob field | 62598eee4a966d76dd5ed684 |
class InvalidShortcode(AbstractHttpException): <NEW_LINE> <INDENT> STATUS_CODE = 412 <NEW_LINE> MESSAGE = 'The provided shortcode is invalid' | This Exception should be used when the provided shortcode by the client has an invalid format | 62598eee2c8b7c6e89bd1f6b |
class SVG(FileOutputSubcommand): <NEW_LINE> <INDENT> name = "svg" <NEW_LINE> extension = "svg" <NEW_LINE> help = "Create standalone SVG files for one or more applications" <NEW_LINE> args = ( FileOutputSubcommand.files_arg("SVG"), ('--height', dict( metavar='HEIGHT', type=int, help="The desired height of the exported l... | Subcommand to output applications as standalone SVG files.
| 62598eee090684286d592ab7 |
class SORIRKAReductor(GenericIRKAReductor): <NEW_LINE> <INDENT> def __init__(self, fom, mu=None): <NEW_LINE> <INDENT> assert isinstance(fom, SecondOrderModel) <NEW_LINE> super().__init__(fom, mu=mu) <NEW_LINE> <DEDENT> def reduce(self, rom0_params, tol=1e-4, maxit=100, num_prev=1, force_sigma_in_rhp=False, projection='... | SOR-IRKA reductor.
Parameters
----------
fom
The full-order |SecondOrderModel| to reduce.
mu
|Parameter values|. | 62598eee2ae34c7f260a9891 |
class TrainingStatusView(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = TrainingStatus.objects.all().filter(is_deleted=False) <NEW_LINE> serializer_class = TrainingStatusSerializer <NEW_LINE> def list(self, request, *args, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> lang = request.GET.get('lang') <N... | list:获取所有培训状态 | 62598eee3346ee7daa336a3c |
class Point: <NEW_LINE> <INDENT> def __init__(self, x, y): <NEW_LINE> <INDENT> self.x, self.y = x, y | Sample model for testing fields. | 62598eee99fddb7c1ca621d9 |
class MissingModuleNamespace(YangsonException): <NEW_LINE> <INDENT> def __init__(self: "MissingModuleNamespace", ns: str): <NEW_LINE> <INDENT> self.ns = ns <NEW_LINE> <DEDENT> def __str__(self: "MissingModuleNamespace") -> str: <NEW_LINE> <INDENT> return self.ns | Abstract exception class – a module is missing. | 62598eeeeab8aa0e5d30a527 |
class distance_function_t(transformer.transformer_t): <NEW_LINE> <INDENT> def __init__(self, function, arg_distance_func, arg_userdata): <NEW_LINE> <INDENT> transformer.transformer_t.__init__( self, function ) <NEW_LINE> self.arg1 = self.get_argument( arg_distance_func ) <NEW_LINE> self.arg1_index = self.function.argum... | Handles a CvMouseCallback argument.
void do_something(CvMouseCallback on_mouse, void* param) -> do_something((Python function) on_mouse, (object) param) | 62598eee8e7ae83300ee783a |
class LocationExporter(object): <NEW_LINE> <INDENT> __urlRoot = "https://beta.meteocam.io" <NEW_LINE> __sys = None <NEW_LINE> __l = None <NEW_LINE> def __init__(self, location, server_url="https://beta.meteocam.io"): <NEW_LINE> <INDENT> self.__l = location <NEW_LINE> self.__sys = pisystem.PiSystem() <NEW_LINE> self... | classdocs | 62598eeeaad79263cf42cfb6 |
class AbstractMessage(models.Model): <NEW_LINE> <INDENT> sender = models.ForeignKey(settings.AUTH_USER_MODEL) <NEW_LINE> text = models.TextField() <NEW_LINE> datetime = models.DateTimeField(auto_now_add=True, db_index=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = True | Base class for all messages. | 62598eeeaad79263cf42cfb7 |
class UnbalancedHierarchy(_PELTTaskGroupsTest): <NEW_LINE> <INDENT> target_cpu = 0 <NEW_LINE> root_group = None <NEW_LINE> trace = None <NEW_LINE> @classmethod <NEW_LINE> def _getExperimentsConf(cls, test_env): <NEW_LINE> <INDENT> cls.target_cpu = min(test_env.calibration(), key=test_env.calibration().get) <NEW_LINE> c... | Test PELT utilization for task groups on the following hierarchy:
+-----+
| "/" |
+-----+
/ +------+ t0_1
|"... | 62598eee7b25080760ed5c45 |
class OperadorUnario(Expr): <NEW_LINE> <INDENT> def __init__(self,op,value,numeroLinea): <NEW_LINE> <INDENT> self.type = "OPERADOR_UNARIO" <NEW_LINE> self.op = op <NEW_LINE> self.value = value <NEW_LINE> self.numeroLinea = numeroLinea | Raiz del arbol de las expresiones unarias | 62598eee379a373c97d977a0 |
class Chat(TelegramObjectBase): <NEW_LINE> <INDENT> def __init__(self, id: int, type: str, title: str = None, username: str = None, first_name: str = None, last_name: str = None, all_members_are_administrators: bool = None, photo: 'ChatPhoto' = None, description: str = None, invite_link: str = None, pinned_message: 'Me... | This object represents a chat.
:param id: (int) Unique identifier for this chat. This number may be greater than 32 bits and some programming
languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit
integer or double-precision float type are safe for storing th... | 62598eee3539df3088ecaa5d |
class tm_disable_app_pool_color_drop_result: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRUCT, 'ouch', (InvalidTmOperation, InvalidTmOperation.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, ouch=None,): <NEW_LINE> <INDENT> self.ouch = ouch <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT>... | Attributes:
- ouch | 62598eeea8370b77170eeb8f |
class MP3Details(SongFileDetails): <NEW_LINE> <INDENT> title = ID3TagDescriptor("TIT2", "TIT2", "TT2", "title") <NEW_LINE> artist = ID3TagDescriptor("TPE1", "TPE1", "TP1", "artist") <NEW_LINE> album = ID3TagDescriptor("TALB", "TALB", "TAL", "album") <NEW_LINE> year = ID3TagDescriptor("TYER", "TYER", "TYE", "album", int... | MP3 details | 62598eee71ff763f4b5e5f09 |
class Cblas(Package): <NEW_LINE> <INDENT> homepage = "http://www.netlib.org/blas/_cblas/" <NEW_LINE> version('2015-06-06', '1e8830f622d2112239a4a8a83b84209a', url='http://www.netlib.org/blas/blast-forum/cblas.tgz') <NEW_LINE> depends_on('blas') <NEW_LINE> parallel = False <NEW_LINE> def patch(self): <NEW_LINE> <INDENT>... | The BLAS (Basic Linear Algebra Subprograms) are routines that
provide standard building blocks for performing basic vector and
matrix operations. | 62598eeed7e4931a7ef3a84a |
class IsActiveCircleMember(BasePermission): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> Membership.objects.get( user=request.user, circle=view.circle, is_active=True ) <NEW_LINE> <DEDENT> except Membership.DoesNotExist: <NEW_LINE> <INDENT> return False <NEW_... | Allow access only to circle memberbs
Expects that the views implementing this permission
have a circle attribute assigned. | 62598eee283ffb24f3cf205c |
class searchResultType (resultType): <NEW_LINE> <INDENT> _TypeDefinition = None <NEW_LINE> _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY <NEW_LINE> _Abstract = False <NEW_LINE> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'searchResultType') <NEW_LINE> _XSDLocation = pyxb.utils.u... | Complex type {urn:vpro:api:2013}searchResultType with content type ELEMENT_ONLY | 62598eee1b99ca400228e8e3 |
class Div(OperatorNode): <NEW_LINE> <INDENT> _arity = 2 <NEW_LINE> _def_output = "x_0 / x_1" | A node that devides its first by its second input. | 62598eeed486a94d0ba2a779 |
class AttributeBasedCachedMethod(CachedMethod): <NEW_LINE> <INDENT> def __init__(self, cached_method, attr_name_list, cache_size=1, results=None): <NEW_LINE> <INDENT> CachedMethod.__init__(self, cached_method) <NEW_LINE> if isinstance(attr_name_list, unicode): <NEW_LINE> <INDENT> self._attr_name_list = attr_name_list.s... | This cached method consider changes in object attributes | 62598eee498bea3a75a562de |
class CleanupConcurrencyWorkloadsTestCase(interface.DynamicTestCase): <NEW_LINE> <INDENT> def _find_same_db_name(self, dbs): <NEW_LINE> <INDENT> for db in dbs: <NEW_LINE> <INDENT> if db.endswith(self._hook.same_db_name): <NEW_LINE> <INDENT> return db <NEW_LINE> <DEDENT> <DEDENT> return None <NEW_LINE> <DEDENT> def run_... | DropDatabasesTestCase class. | 62598eee851cf427c66b6a75 |
class ServerParameter(common.SourceLocation): <NEW_LINE> <INDENT> def __init__(self, file_name, line, column): <NEW_LINE> <INDENT> self.name = None <NEW_LINE> self.set_at = None <NEW_LINE> self.description = None <NEW_LINE> self.cpp_class = None <NEW_LINE> self.cpp_vartype = None <NEW_LINE> self.cpp_varname = None <NEW... | IDL ServerParameter setting. | 62598eee66673b3332c2eb55 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.