code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Todo(peewee.Model): <NEW_LINE> <INDENT> name = peewee.CharField() <NEW_LINE> completed = peewee.BooleanField(default=False) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> database = DATABASE | The Todo model holds the name of each todo in the database. | 62598f81fb3f5b602db47ed8 |
class TagFormNode(template.Node): <NEW_LINE> <INDENT> def render(self, context): <NEW_LINE> <INDENT> forms = context.get('suggestion_forms', {}) <NEW_LINE> forms['tag'] = TagSuggestionForm() <NEW_LINE> context['suggestion_forms'] = forms <NEW_LINE> return '' | Adds the tag suggestion into context | 62598f811f037a2d8b9e3b38 |
class task_new_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'access_token', None, None, ), (2, TType.STRUCT, 'task', (type.ttypes.Task, type.ttypes.Task.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, access_token=None, task=None,): <NEW_LINE> <INDENT> self.access_token = access_token <NEW_L... | Attributes:
- access_token
- task | 62598f8173bcbd0ca4bc9ca0 |
class TestSecretStoreWithTransportKey(str.SecretStoreBase): <NEW_LINE> <INDENT> def __init__(self, supported_alg_list): <NEW_LINE> <INDENT> super(TestSecretStoreWithTransportKey, self).__init__() <NEW_LINE> self.alg_list = supported_alg_list <NEW_LINE> <DEDENT> def get_plugin_name(self): <NEW_LINE> <INDENT> raise NotIm... | Secret store plugin for testing support.
This plugin will override the relevant methods for key wrapping. | 62598f81d10714528d69d91f |
class Solution: <NEW_LINE> <INDENT> def lowestCommonAncestor(self, root, A, B): <NEW_LINE> <INDENT> a = self.helper(root, A) <NEW_LINE> b = self.helper(root, B) <NEW_LINE> for i in a: <NEW_LINE> <INDENT> if i in b: <NEW_LINE> <INDENT> return i <NEW_LINE> <DEDENT> <DEDENT> return <NEW_LINE> <DEDENT> def helper(self, roo... | @param root: The root of the binary search tree.
@param A and B: two nodes in a Binary.
@return: Return the least common ancestor(LCA) of the two nodes. | 62598f815f7d997b871f9100 |
class printsentdata(Exception): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> super().__init__(*args) <NEW_LINE> self.msg = args[0] if args else None <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return print(f" oshibka: {self.msg}") | Пользовательский класс исключений | 62598f81be383301e025324a |
class JavaLexer(RegexLexer): <NEW_LINE> <INDENT> name = 'Java' <NEW_LINE> aliases = ['java'] <NEW_LINE> filenames = ['*.java'] <NEW_LINE> mimetypes = ['text/x-java'] <NEW_LINE> flags = re.MULTILINE | re.DOTALL <NEW_LINE> _ws = r'(?:\s|//.*?\n|/[*].*?[*]/)+' <NEW_LINE> tokens = { 'root': [ (r'^(\s*(?:[a-zA-Z_][a-zA-Z0-9... | For `Java <http://www.sun.com/java/>`_ source code. | 62598f817c178a314d78cefb |
class Ephemeral(Terminal): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Terminal.__init__(self, self.func(), symbolic=False, ret=self.ret) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def func(): <NEW_LINE> <INDENT> raise NotImplementedError | Class that encapsulates a terminal which value is set when the
object is created. To mutate the value, a new object has to be
generated. This is an abstract base class. When subclassing, a
staticmethod 'func' must be defined. | 62598f81fbf16365ca793af9 |
class Kind(Command): <NEW_LINE> <INDENT> def __init__(self, vim): <NEW_LINE> <INDENT> super().__init__(vim) <NEW_LINE> self.vim = vim <NEW_LINE> self.default_action = 'replace_misspelled' <NEW_LINE> <DEDENT> def action_replace_misspelled(self, context): <NEW_LINE> <INDENT> index = context['targets'][0]['index'] <NEW_LI... | Denite kind that defines actions for spell_suggest source. | 62598f814e696a045264db29 |
class PaymentResult: <NEW_LINE> <INDENT> pass | Payment Result | 62598f818a43f66fc4bf1bd2 |
class wishart_frozen(multi_rv_frozen): <NEW_LINE> <INDENT> def __init__(self, df, scale, seed=None): <NEW_LINE> <INDENT> self._dist = wishart_gen(seed) <NEW_LINE> self.dim, self.df, self.scale = self._dist._process_parameters( df, scale) <NEW_LINE> self.C, self.log_det_scale = self._dist._cholesky_logdet(self.scale) <N... | Create a frozen Wishart distribution.
Parameters
----------
df : array_like
Degrees of freedom of the distribution
scale : array_like
Scale matrix of the distribution
seed : None or int or np.random.RandomState instance, optional
This parameter defines the RandomState object to use for drawing
random v... | 62598f81baa26c4b54d4ed03 |
class TFRobertaLMHead(tf.keras.layers.Layer): <NEW_LINE> <INDENT> def __init__(self, config, input_embeddings, **kwargs): <NEW_LINE> <INDENT> super(TFRobertaLMHead, self).__init__(**kwargs) <NEW_LINE> self.vocab_size = config.vocab_size <NEW_LINE> self.dense = tf.keras.layers.Dense(config.hidden_size, kernel_initialize... | Roberta Head for masked language modeling. | 62598f81379a373c97d98a62 |
class Hamiltonian(object): <NEW_LINE> <INDENT> def __init__(self, mu=1.0, order=1, r_earth=1.0): <NEW_LINE> <INDENT> self.mu = mu <NEW_LINE> self.order = order <NEW_LINE> self.r_earth = r_earth <NEW_LINE> <DEDENT> def __call__(self, T, X): <NEW_LINE> <INDENT> z = X[:, 2:3] <NEW_LINE> r = np.linalg.norm(X[0:, 0:3], ord=... | Hamiltonian for position-velocity elements.
Attributes:
mu: float, optional
Standard Gravitational Parameter. Defaults to 1.0, the standard
value in canonical units.
order: int, optional
Zonal gravity order. Order of 1 corresponds to two body dynamics.
Higher orders include pret... | 62598f81b57a9660fecd14ce |
class FileStorage(): <NEW_LINE> <INDENT> __file_path = 'file.json' <NEW_LINE> __objects = {} <NEW_LINE> def all(self): <NEW_LINE> <INDENT> return FileStorage.__objects <NEW_LINE> <DEDENT> def new(self, obj): <NEW_LINE> <INDENT> key = "{}.{}".format(obj.__class__.__name__, obj.id) <NEW_LINE> FileStorage.__objects[key] =... | Private class attributes for Class FileStorage | 62598f8138b623060ffa8ae7 |
class Results: <NEW_LINE> <INDENT> def __init__(self, extractor: Extractor) -> None: <NEW_LINE> <INDENT> self._extractor: Extractor = extractor <NEW_LINE> self.summary: pd.DataFrame = pd.DataFrame() <NEW_LINE> <DEDENT> @property <NEW_LINE> def extractor(self) -> Extractor: <NEW_LINE> <INDENT> return self._extractor <NE... | Show and allow investigation of HANDE QMC results.
Extraction has already happened.
This is a base class, used for now for all non CCMC and non
FCIQMC calculations who use a more specific class. | 62598f8115baa723494619cf |
class MarginTest(TestCase): <NEW_LINE> <INDENT> def test_one_margin_value(self): <NEW_LINE> <INDENT> func_in = [("margin", ("11", "px"), None)] <NEW_LINE> func_out = parseSpecialRules(func_in) <NEW_LINE> expected = [ ("margin-left", ("11", "px"), None), ("margin-right", ("11", "px"), None), ("margin-top", ("11", "px"),... | Tests if the CSS margin property gets split up properly into
left, right, top, bottom - depending on the amount of given values (1 to 4) | 62598f8130dc7b766599f2aa |
class SourceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> VSO_GIT = "VsoGit" <NEW_LINE> VSO_TFVC = "VsoTfvc" <NEW_LINE> GIT_HUB = "GitHub" | The source type. Must be one of VsoGit, VsoTfvc, GitHub.
| 62598f8194891a1f408b9417 |
class _g(object): <NEW_LINE> <INDENT> script_run = None <NEW_LINE> overall_run = None <NEW_LINE> clargs = None <NEW_LINE> verbosity = 2 <NEW_LINE> multi = False | Stores globals, e.g. _g.clargs | 62598f811f037a2d8b9e3b3a |
class Contingency(Spell): <NEW_LINE> <INDENT> name = "Contingency" <NEW_LINE> level = 6 <NEW_LINE> casting_time = "10 minutes" <NEW_LINE> casting_range = "Self" <NEW_LINE> components = ('V', 'S', 'M') <NEW_LINE> materials = """A statuette of yourself carved from ivory and decorated with gems worth at least 1,500 gp""" ... | Choose a spell of 5th level or lower that you can cast, that has a casting time
of 1 action, and that can target you.
You cast that spell called the
contingent spell as part of casting contingency, expending spell slots for
both, but the contingent spell doesn’t come into effect. Instead, it takes
effect when a ... | 62598f81d10714528d69d921 |
class TXTBase(dns.rdata.Rdata): <NEW_LINE> <INDENT> __slots__ = ['strings'] <NEW_LINE> def __init__(self, rdclass, rdtype, strings): <NEW_LINE> <INDENT> super(TXTBase, self).__init__(rdclass, rdtype) <NEW_LINE> if isinstance(strings, str): <NEW_LINE> <INDENT> strings = [ strings ] <NEW_LINE> <DEDENT> self.strings = str... | Base class for rdata that is like a TXT record
@ivar strings: the text strings
@type strings: list of string
@see: RFC 1035 | 62598f8176d4e153a661c665 |
class ThirtyThreeKrSpider(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.url = "http://36kr.com/" <NEW_LINE> self.headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36', } <NEW_LINE> <DEDENT> def get_page_from... | 获取36氪网的首页信息 | 62598f81507cdc57c63a47de |
class ILeftProjectEvent(IObjectModifiedEvent): <NEW_LINE> <INDENT> pass | When a user is deactivated from a project | 62598f8107f4c71912baee96 |
@CWCTL.register <NEW_LINE> class ReloadJsonMap(Command): <NEW_LINE> <INDENT> name = "reload-map" <NEW_LINE> arguments = "<instance>" <NEW_LINE> max_args = min_args = 1 <NEW_LINE> def run(self, args): <NEW_LINE> <INDENT> appid = args.pop() <NEW_LINE> with admincnx(appid) as cnx: <NEW_LINE> <INDENT> load_leaflet_json(cnx... | reload IR map data | 62598f8110dbd63aa1c70604 |
class List(Field): <NEW_LINE> <INDENT> default_error_messages = {'invalid': 'Not a valid list.'} <NEW_LINE> def __init__(self, cls_or_instance, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> try: <NEW_LINE> <INDENT> self.container = resolve_field_instance(cls_or_instance) <NEW_LINE> <DEDENT> excep... | A list field, composed with another `Field` class or
instance.
Example: ::
numbers = fields.List(fields.Float())
:param Field cls_or_instance: A field class or instance.
:param bool default: Default value for serialization.
:param kwargs: The same keyword arguments that :class:`Field` receives.
.. versionchange... | 62598f8150485f2cf55da9c4 |
class NotificationLevel(enum.IntEnum): <NEW_LINE> <INDENT> ALL_MESSAGES = 0 <NEW_LINE> ONLY_MENTIONS = 1 | Represents the default notification level for a :class:`.Guild`. | 62598f819b70327d1c57e7f1 |
class ScoreBoard: <NEW_LINE> <INDENT> def __init__(self, seek: int = 10): <NEW_LINE> <INDENT> self.seek = seek <NEW_LINE> self.scores = [3, 7] <NEW_LINE> self.player1 = 0 <NEW_LINE> self.player2 = 1 <NEW_LINE> <DEDENT> def step(self): <NEW_LINE> <INDENT> scores = self.scores <NEW_LINE> score = scores[self.player1] + sc... | Track the scores over time for 2 players. | 62598f8150485f2cf55da9c5 |
class Keyboard(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._sequence_to_name = { '\x1b': 'esc', ' ': 'space', '\x1b[A': 'up', '\x1b[B': 'down', '\x1b[C': 'left', '\x1b[D': 'right', '\x1b[E': 'keypad5', '\x1b[F': 'end', '\x1b[G': 'keypad5', '\x1b[H': 'home', '\x1b[1~': 'home', '\x1b[2~': 'i... | Utility class for turning key escape sequences into human parsable key
names. | 62598f81004d5f362081ed24 |
class Bandpass(AFNICommand): <NEW_LINE> <INDENT> _cmd = '3dBandpass' <NEW_LINE> input_spec = BandpassInputSpec <NEW_LINE> output_spec = AFNICommandOutputSpec | Program to lowpass and/or highpass each voxel time series in a
dataset, offering more/different options than Fourier
For complete details, see the `3dBandpass Documentation.
<https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dBandpass.html>`_
Examples
========
>>> from nipype.interfaces import afni
>>> from nipyp... | 62598f81d6c5a102081e1b9b |
class DeleteAttributeOnSet(Exception): <NEW_LINE> <INDENT> pass | When rised on fset, the attribute will be deleted and no data will
be stored for that variable, useful to allow further computation,
in order to prevent unecessary settings... | 62598f81d4950a0f3b110b5e |
class MAVLink_gps_global_origin_message(MAVLink_message): <NEW_LINE> <INDENT> id = MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN <NEW_LINE> name = 'GPS_GLOBAL_ORIGIN' <NEW_LINE> fieldnames = ['latitude', 'longitude', 'altitude', 'time_usec'] <NEW_LINE> ordered_fieldnames = ['latitude', 'longitude', 'altitude', 'time_usec'] <NEW_LIN... | Once the MAV sets a new GPS-Local correspondence, this message
announces the origin (0,0,0) position | 62598f81287bf620b6271606 |
class E24(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> ejercicio_anterior = E23 <NEW_LINE> ejercicio_anterior().funcion1() <NEW_LINE> temp = ejercicio_anterior().funcion2(4, 3) <NEW_LINE> print(temp) | modulos
cuando tenemos un proyecto grande, hay que modularizar el proyecto
Separar el código | 62598f818c3a8732951f5f9a |
class LoginView(NextPageMixin, FormView): <NEW_LINE> <INDENT> form_class = SignInForm <NEW_LINE> template_name = 'accounts/sign_in.html' <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> if request.user.is_authenticated(): <NEW_LINE> <INDENT> return redirect(self.get_success_url()) <NEW_LINE> <DED... | Представление отвечающее ща вторизацию | 62598f8115fb5d323ce7e77d |
class EntityState(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.p_pos = None <NEW_LINE> self.p_vel = None | Physical/external base state of all entities | 62598f81379a373c97d98a64 |
class RobertaConfig(BertConfig): <NEW_LINE> <INDENT> model_type = "roberta" <NEW_LINE> def __init__(self, pad_token_id=1, bos_token_id=0, eos_token_id=2, **kwargs): <NEW_LINE> <INDENT> super().__init__(pad_token_id=pad_token_id, bos_token_id=bos_token_id, eos_token_id=eos_token_id, **kwargs) | This is the configuration class to store the configuration of a :class:`~transformers.RobertaModel`.
It is used to instantiate an RoBERTa model according to the specified arguments, defining the model
architecture. Instantiating a configuration with the defaults will yield a similar configuration to that of
the BERT `b... | 62598f811d351010ab8f3590 |
class Position(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=20,verbose_name=u'职位',null=False,unique=True) <NEW_LINE> description = models.TextField(verbose_name=u'职责说明',null=True,blank=True) <NEW_LINE> requirements = models.TextField(verbose_name=u'岗位要求', null=True, blank=True) <NEW_LINE> def _... | 职位 | 62598f81d99f1b3c44d05100 |
class plot(mplCanvas): <NEW_LINE> <INDENT> def __init__(self, parent, width, height, dpi): <NEW_LINE> <INDENT> self.folders = [] <NEW_LINE> self.ax1 = 0 <NEW_LINE> self.in_or_out = 'IN' <NEW_LINE> super(plot, self).__init__(parent, width, height, dpi) <NEW_LINE> <DEDENT> def compute_initial_figure(self): <NEW_LINE> <IN... | Simple canvas with a sine plot. | 62598f8115baa723494619d1 |
class Tremolo(Item): <NEW_LINE> <INDENT> duration = 0, 1 | A tremolo item ":". The duration attribute is a tuple (base, scaling). | 62598f81f8510a7c17d7dea1 |
class NetworkError(Exception): <NEW_LINE> <INDENT> pass | Common network error | 62598f81009cb60464d00f80 |
class DescribeCertificateDetailResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.CertificateDetail = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("CertificateDetail") is not None: <NEW_LINE> <INDENT> s... | DescribeCertificateDetail返回参数结构体
| 62598f810383005118f6d155 |
class Data: <NEW_LINE> <INDENT> def __init__(self, name: str, root_dir: str): <NEW_LINE> <INDENT> self.dependencies = [] <NEW_LINE> self.name = name <NEW_LINE> self.root_dir = root_dir <NEW_LINE> self.build_base_dir = os.path.join(root_dir, "build") <NEW_LINE> self.build_dir = os.path.join(root_dir, "build", name) <NEW... | data for the build | 62598f8126238365f5fac5c2 |
class InvalidRomanNumeralError(ValueError): <NEW_LINE> <INDENT> pass | Exception class for invalid values | 62598f8115baa723494619d2 |
class ValidationError(ValueError): <NEW_LINE> <INDENT> def __init__(self, *args, hint=None, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.hint = hint | Special ``ValueError`` used to signal failed validation of user-provided values. | 62598f818e05c05ec3f6eb71 |
class Process(object): <NEW_LINE> <INDENT> _id_gen = 0 <NEW_LINE> def __init__(self, pid, run, parent, timestamp, thread, acted, binary, argv, created): <NEW_LINE> <INDENT> self.id = Process._id_gen <NEW_LINE> Process._id_gen += 1 <NEW_LINE> self.pid = pid <NEW_LINE> self.run = run <NEW_LINE> self.parent = parent <NEW_... | Structure representing a process in the experiment.
| 62598f81f7d966606f747a3b |
class CLI(mozrunner.CLI): <NEW_LINE> <INDENT> module = "jsbridge" <NEW_LINE> def add_options(self, parser): <NEW_LINE> <INDENT> mozrunner.CLI.add_options(self, parser) <NEW_LINE> parser.add_option('-D', '--debug', dest="debug", action="store_true", help="Install debugging addons.", metavar="JSBRIDGE_DEBUG", default=Fal... | Command line interface. | 62598f8123e79379d538bf4d |
class Base(object): <NEW_LINE> <INDENT> name = 'Null edit' <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> def undo(self): <NEW_LINE> <INDENT> raise NotImplementedError('undo should be implemented properly') <NEW_LINE> <DEDENT> def redo(self): <NEW_LINE> <INDENT> raise NotImplemen... | Base Undo class (this one raises exceptions) | 62598f81c432627299fa2a22 |
class ProfileOptionsAPIView(APIView): <NEW_LINE> <INDENT> permission_classes = (AllowAny,) <NEW_LINE> serializer_class = serializers.ProfileUpdateSerializer <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> genders = get_user_model()._meta.get_field("gender").choices <NEW_LINE> timezones = get_use... | Responses list of options for choicefields.
| 62598f81596a8972361276c5 |
class Signin(Resource): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> data = request.get_json(force=True) <NEW_LINE> username = data["username"] <NEW_LINE> email = data["email"] <NEW_LINE> password = data["password"] <NEW_LINE> validusername = Validator.username_valid(username) <NEW_LINE> validemail = Validat... | Allows the user to log into the system | 62598f81fbf16365ca793afd |
class Reader: <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> rfid = RFID() <NEW_LINE> self._RFID = rfid <NEW_LINE> self._RFID_util = rfid.util() <NEW_LINE> self._uuid = "" <NEW_LINE> self._huidige_uuid = "" <NEW_LINE> self._fake_scanned = False <NEW_LINE> <DEDENT> def read(self) -> bool: <NEW_LINE>... | Klasse om RFID stickers of tags uit te lezen op de Raspberry. | 62598f81e76e3b2f99fd8489 |
class Solution: <NEW_LINE> <INDENT> def build(self, A): <NEW_LINE> <INDENT> n = len(A) <NEW_LINE> return self.helper(A, 0, n-1) <NEW_LINE> <DEDENT> def helper(self, A, start, end): <NEW_LINE> <INDENT> if start > end: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> if start == end: <NEW_LINE> <INDENT> return Segment... | @param A: a list of integer
@return: The root of Segment Tree | 62598f8121a7993f00c659c6 |
class Processor(AwardProcessor): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> AwardProcessor.__init__(self, 'Evasive Action', 'Most Vehicle Countermeasures', [PLAYER_COL, Column('Counters', Column.NUMBER, Column.DESC)]) <NEW_LINE> <DEDENT> def on_accuracy(self, e): <NEW_LINE> <INDENT> if e.weapon.weapon_... | Overview
This processor is awarded to the player with the least ammo used.
Implementation
Get bullets fired from player stats
Notes | 62598f81d53ae8145f917ee2 |
class getEvents_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.I32, 'missionId', None, None, ), (2, TType.I64, 'timeReference', None, None, ), ) <NEW_LINE> def __init__(self, missionId=None, timeReference=None,): <NEW_LINE> <INDENT> self.missionId = missionId <NEW_LINE> self.timeReference = timeReference <NE... | Attributes:
- missionId
- timeReference | 62598f8150485f2cf55da9c6 |
class multiplyNode: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.returnType = 'number' <NEW_LINE> self.branchTypes = ['number', 'number'] <NEW_LINE> self.branches = [None, None] <NEW_LINE> self.isTerminal = False <NEW_LINE> self.parent = None <NEW_LINE> self.parentBranchIndex = -1 <NEW_LINE> self.op... | Represents multiplication operator in the decision tree | 62598f8196565a6dacd2cca2 |
class YTestData(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> with open('data\\'+'y_test.pickle', 'rb') as f: <NEW_LINE> <INDENT> self.data = pickle.load(f) | YTestData loads y_test pickle
This is needed for accuracy score and
confusion matrix.
Current way to load is to do it on __init__
so the object becomes the depickled pickle
and is available to use straight away. | 62598f8123849d37ff850b12 |
class Location(FolioApi): <NEW_LINE> <INDENT> def get_locations(self, **kwargs): <NEW_LINE> <INDENT> return self.call("GET", "/locations", query=kwargs) <NEW_LINE> <DEDENT> def set_location(self, location: dict): <NEW_LINE> <INDENT> return self.call("POST", "/locations", data=location) <NEW_LINE> <DEDENT> def delete_lo... | Locations API
This documents the API calls that can be made to query and manage (shelf) locations of the system | 62598f81287bf620b6271608 |
class MyMplCanvas(FigureCanvas): <NEW_LINE> <INDENT> def __init__(self, parent=None, width=5, height=4, dpi=100): <NEW_LINE> <INDENT> fig = Figure(figsize=(width, height), dpi=dpi) <NEW_LINE> self.axes = fig.add_subplot(111) <NEW_LINE> self.axes.hold = False <NEW_LINE> self.compute_initial_figure() <NEW_LINE> FigureCan... | Ultimately, this is a QWidget (as well as a FigureCanvasAgg, etc.). | 62598f81baa26c4b54d4ed07 |
class BlameReportMetaData(): <NEW_LINE> <INDENT> def __init__( self, num_functions: int, num_instructions: int, num_phasar_empty_tracked_vars: tp.Optional[int], num_phasar_total_tracked_vars: tp.Optional[int] ) -> None: <NEW_LINE> <INDENT> self.__number_of_functions_in_module = num_functions <NEW_LINE> self.__number_of... | Provides extra meta data about llvm::Module, which was analyzed to
generate this ``BlameReport``. | 62598f8130c21e258be9825e |
class CommentsListView(ListView): <NEW_LINE> <INDENT> context_object_name = 'comments' <NEW_LINE> template_name = 'dillo/comments_list.pug' <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return ( Comment.objects.filter( post__hash_id=self.kwargs['hash_id'], parent_comment_id__isnull=True, ) .prefetch_related('l... | List of all published comments. | 62598f81442bda511e95beb0 |
class DebugTensorDatum(object): <NEW_LINE> <INDENT> def __init__(self, dump_root, debug_dump_rel_path): <NEW_LINE> <INDENT> base = os.path.basename(debug_dump_rel_path) <NEW_LINE> if base.count("_") < 3: <NEW_LINE> <INDENT> raise ValueError( "Dump file path does not conform to the naming pattern: %s" % base) <NEW_LINE>... | A single tensor dumped by TensorFlow Debugger (tfdbg).
Contains metadata about the dumped tensor, including `timestamp`,
`node_name`, `output_slot`, `debug_op`, and path to the dump file
(`file_path`).
This type does not hold the generally space-expensive tensor value (numpy
array). Instead, it points to the file fro... | 62598f81b5575c28eb7129f1 |
class ModifyProxyGroupAttributeRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.GroupId = None <NEW_LINE> self.GroupName = None <NEW_LINE> self.ProjectId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.GroupId = params.get("GroupId") <NEW_LINE>... | ModifyProxyGroupAttribute request structure.
| 62598f818e71fb1e983bb50f |
class Tag(models.Model): <NEW_LINE> <INDENT> name = models.CharField(_('name'), max_length=50, unique=True, db_index=True) <NEW_LINE> parent = models.ForeignKey('self', null=True, blank=True) <NEW_LINE> skill_picture = models.ImageField(upload_to=content_file_name, null=True, blank=True) <NEW_LINE> description = models... | A tag. | 62598f81a79ad16197769ab6 |
class SelectorDIC(ModelSelector): <NEW_LINE> <INDENT> def select(self): <NEW_LINE> <INDENT> warnings.filterwarnings("ignore", category=DeprecationWarning) <NEW_LINE> other_words = list(self.words.keys()) <NEW_LINE> other_words.remove(self.this_word) <NEW_LINE> highest_DIC = float('-inf') <NEW_LINE> best_n = self.min_n_... | select best model based on Discriminative Information Criterion
Biem, Alain. "A model selection criterion for classification: Application to hmm topology optimization."
Document Analysis and Recognition, 2003. Proceedings. Seventh International Conference on. IEEE, 2003.
http://citeseerx.ist.psu.edu/viewdoc/download?d... | 62598f81a17c0f6771d5bc99 |
class PollRequestPayload(base.RequestPayload): <NEW_LINE> <INDENT> def __init__(self, asynchronous_correlation_value=None): <NEW_LINE> <INDENT> super(PollRequestPayload, self).__init__() <NEW_LINE> self._asynchronous_correlation_value = None <NEW_LINE> self.asynchronous_correlation_value = asynchronous_correlation_valu... | A request payload for the Poll operation.
Attributes:
asynchronous_correlation_value: The unique ID, in bytes, of the
operation to poll. | 62598f8126238365f5fac5c4 |
class ActionRevertFallbackEvents(Action): <NEW_LINE> <INDENT> def name(self) -> Text: <NEW_LINE> <INDENT> return ACTION_REVERT_FALLBACK_EVENTS_NAME <NEW_LINE> <DEDENT> async def run( self, output_channel: "OutputChannel", nlg: "NaturalLanguageGenerator", tracker: "DialogueStateTracker", domain: "Domain", ) -> List[Even... | Reverts events which were done during the `TwoStageFallbackPolicy`.
This reverts user messages and bot utterances done during a fallback
of the `TwoStageFallbackPolicy`. By doing so it is not necessary to
write custom stories for the different paths, but only of the happy
path. | 62598f816fece00bbaccb3dd |
class ArgumentsMixin: <NEW_LINE> <INDENT> arguments_spec = None <NEW_LINE> arguments_parser = ArgumentsParser <NEW_LINE> def __init__(self, *args, arguments_spec=None, **kwargs): <NEW_LINE> <INDENT> if arguments_spec is not None: <NEW_LINE> <INDENT> self.arguments_spec = arguments_spec <NEW_LINE> <DEDENT> if self.argum... | Route mixin, that builds the argument combination list when
instantiating, and that yields (in :func:`get_url_specs`) another URL
specification for each argument in resulting list.
Should be a list that, if needed, contains argument
specifications. An argument specification is a 2-tuple, contaning
a boolean indicating... | 62598f81c432627299fa2a24 |
class CMSearchMatch: <NEW_LINE> <INDENT> def __init__(self, type, rfam_acc, description, start, end, forward_strand, feature_coordinates): <NEW_LINE> <INDENT> self.type = type <NEW_LINE> self.rfam_acc = rfam_acc <NEW_LINE> self.description = description <NEW_LINE> self.start = start <NEW_LINE> self.end = end <NEW_LINE>... | Describes a function annotation for instance InterPro:IPR004361 or GO:0004462. | 62598f81d53ae8145f917ee4 |
class InstanceViewStatus(Model): <NEW_LINE> <INDENT> _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'level': {'key': 'level', 'type': 'StatusLevelTypes'}, 'display_status': {'key': 'displayStatus', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'time': {'key': 'time', 'type': 'iso-8601'}, } <... | Instance view status.
:param code: The status code.
:type code: str
:param level: The level code. Possible values include: 'Info', 'Warning',
'Error'
:type level: str or
~azure.mgmt.compute.v2015_06_15.models.StatusLevelTypes
:param display_status: The short localizable label for the status.
:type display_status: st... | 62598f8150485f2cf55da9c8 |
class StackTrace(_messages.Message): <NEW_LINE> <INDENT> clusterId = _messages.StringField(1) <NEW_LINE> exception = _messages.StringField(2) <NEW_LINE> reportId = _messages.StringField(3) | A stacktrace.
Fields:
clusterId: Exception cluster ID
exception: The stack trace message. Required
reportId: Exception report ID | 62598f819b70327d1c57e7f5 |
class ContinuityEquation(Equation): <NEW_LINE> <INDENT> def initialize(self, d_idx, d_arho): <NEW_LINE> <INDENT> d_arho[d_idx] = 0.0 <NEW_LINE> <DEDENT> def loop(self, d_idx, s_idx, d_arho, s_V, d_rho, VIJ, DWIJ): <NEW_LINE> <INDENT> vijdotdwij = VIJ[0] * DWIJ[0] + VIJ[1] * DWIJ[1] + VIJ[2] * DWIJ[2] <NEW_LINE> d_arho[... | **Conservation of mass equation**
Eq (6) in [Adami2012]:
.. math::
\frac{d\rho_a}{dt} = \rho_a \sum_b \frac{m_b}{\rho_b}
\boldsymbol{v}_{ab} \cdot \nabla_a W_{ab} | 62598f81287bf620b627160a |
class StravaData: <NEW_LINE> <INDENT> def __init__(self, folder): <NEW_LINE> <INDENT> self.folder = folder <NEW_LINE> self.fls = glob('{}/*.gpx'.format(self.folder)) <NEW_LINE> self.file_count = len(self.fls) <NEW_LINE> self.activity_types = list(set([f.split('-')[-1].split('.')[0] for f in self.fls])) <NEW_LINE> dates... | The set of files generated from a Strava data dump.
Assumes naming conventions has not been changed by the user. | 62598f8150485f2cf55da9c9 |
class Controller(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.console_api = console_api.API() <NEW_LINE> <DEDENT> @wsgi.serializers(xml=ConsolesTemplate) <NEW_LINE> def index(self, req, server_id): <NEW_LINE> <INDENT> consoles = self.console_api.get_consoles( req.environ['nova.context'], se... | The Consoles controller for the OpenStack API. | 62598f810383005118f6d158 |
class Params(bpy.types.PropertyGroup): <NEW_LINE> <INDENT> RemoveDoubles: bpy.props.BoolProperty( name="Remove doubles", description="Removes doubles after generating fractal (increases calculation time)") <NEW_LINE> Variables: bpy.props.StringProperty( name="Variables", description="These will be updated according to ... | Parameters for the Fractal | 62598f8121bff66bcd7226c0 |
class ContextBlock(Block): <NEW_LINE> <INDENT> def __init__(self, storage_space = None, block=None): <NEW_LINE> <INDENT> if block: <NEW_LINE> <INDENT> Block.__init__(self, storage_space= block.storage_space, header=block.header, transaction_skeleton=block.transaction_skeleton) <NEW_LINE> if block.tx: <NEW_LINE> <INDENT... | Wrapper of Block for inner storage. It contains contextual info about block: for instance is it valid in chain or not. | 62598f8130c21e258be98260 |
class CompilationThread(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, semaphore, particle_position, particle_id, robots_src_path): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.semaphore = semaphore <NEW_LINE> self.particle_id = particle_id <NEW_LINE> self.particle_position = particle_... | Compilation class.
| 62598f8166673b3332c2fe1c |
class RecordDigestMismatchError(RecordValidationError): <NEW_LINE> <INDENT> def __init__(self, path, algorithm, record_digest, actual_digest): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.algorithm = algorithm <NEW_LINE> self.record_digest = record_digest <NEW_LINE> self.actual_digest = actual_digest <NEW_LINE>... | Raised when a file's digest as declared in a wheel's :file:`RECORD` does
not match the file's actual digest | 62598f8163d6d428bbee220f |
class FormhubApi(api_views.APIView): <NEW_LINE> <INDENT> _ignore_model_permissions = True <NEW_LINE> def get(self, request, format=None): <NEW_LINE> <INDENT> ret = {} <NEW_LINE> for key, url_name in api_root_dict.items(): <NEW_LINE> <INDENT> ret[key] = reverse( url_name, request=request, format=format) <NEW_LINE> <DEDE... | ## JSON Rest API
Formhub provides the following JSON api endpoints:
* [/api/v1/users](/api/v1/users) - List, Retrieve username, first
and last name
* [/api/v1/profiles](/api/v1/profiles) - List, Create,
Update, user information
* [/api/v1/orgs](/api/v1/orgs) - List, Retrieve, Create,
Update organization and organizat... | 62598f81d99f1b3c44d05104 |
class ServerData: <NEW_LINE> <INDENT> def __init__(self, title: str, status_cmd: str, sub_cmds: List[CmdData]): <NEW_LINE> <INDENT> self.title = title <NEW_LINE> self.status_cmd = status_cmd <NEW_LINE> self.sub_cmds = sub_cmds <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return json.dumps(self, ensure_asc... | 服务对象 | 62598f816fece00bbaccb3df |
class Job(object): <NEW_LINE> <INDENT> priority = 1 <NEW_LINE> task = None <NEW_LINE> options = None <NEW_LINE> output = None <NEW_LINE> _counter = itertools.count() <NEW_LINE> def __init__(self, task, options=None, output=None, priority=1, trigger_id=None): <NEW_LINE> <INDENT> self.task = task <NEW_LINE> self.options ... | A job for the scheduler to execute. | 62598f81b830903b9686e19d |
class ExternalStorageNotInstalled(RenkuException, click.ClickException): <NEW_LINE> <INDENT> def __init__(self, repo): <NEW_LINE> <INDENT> msg = ( 'Git-LFS is either not installed or not configured ' 'for this repo.\n' 'By running this command without LFS you could be committing\n' 'large files directly to the git repo... | Raise when LFS is required but not found or installed in the repo. | 62598f8194891a1f408b941a |
class Airport(models.Model): <NEW_LINE> <INDENT> airport_code = models.CharField(max_length=10) <NEW_LINE> name = models.CharField(max_length=100) <NEW_LINE> city = models.CharField(max_length=100) | Airport models related info | 62598f8145492302aabfbf35 |
class BaseConfig(borg.Borg): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(BaseConfig, self).__init__() <NEW_LINE> if not hasattr(self, 'loaded'): <NEW_LINE> <INDENT> self.loaded = False <NEW_LINE> <DEDENT> <DEDENT> def load(self, config_file=''): <NEW_LINE> <INDENT> file_desc = filepath.FilePath(co... | Base Configuration object | 62598f81a4f1c619b294e044 |
class EmailMsg(BaseModel): <NEW_LINE> <INDENT> detail: str = Field(example="Email sent") | Email message schema. | 62598f81d10714528d69d927 |
class ToTensor(object): <NEW_LINE> <INDENT> def __call__(self,image): <NEW_LINE> <INDENT> image = torch.from_numpy(image) <NEW_LINE> return image <NEW_LINE> return input | Convert np arrays in sample to Tensors. | 62598f8129b78933be269e06 |
class SeparableConv2dLayer(Layer): <NEW_LINE> <INDENT> def __init__( self, layer = None, depthwise_filter = None, pointwise_filter = None, rate = 2, padding = 'SAME', name = 'atrou2d' ): <NEW_LINE> <INDENT> Layer.__init__(self, name=name) <NEW_LINE> self.inputs = layer.outputs | The :class:`SeparableConv2dLayer` class is 2-D convolution with separable filters., see ``tf.nn.separable_conv2d``.
Parameters
-----------
layer: a layer class with 4-D Tensor of shape [batch, height, width, channels].
depthwise_filter : 4-D Tensor with shape [filter_height, filter_width, in_channels, channel_multipli... | 62598f819b70327d1c57e7f7 |
class MemoriasAsignadasTableView(LoginRequiredMixin, UserPassesTestMixin, SingleTableView): <NEW_LINE> <INDENT> permission_denied_message = _('Sólo los correctores pueden acceder a esta página.') <NEW_LINE> table_class = MemoriasAsignadasTable <NEW_LINE> template_name = 'corrector/mis_memorias.html' <NEW_LINE> def get_... | Lista las memorias asignadas al usuario (corrector) actual. | 62598f8107d97122c42166fb |
class ChainDBDefaultType: <NEW_LINE> <INDENT> __inst: tp.Optional["ChainDBDefaultType"] = None <NEW_LINE> def __new__(cls): <NEW_LINE> <INDENT> if ChainDBDefaultType.__inst is None: <NEW_LINE> <INDENT> ChainDBDefaultType.__inst = object.__new__(cls) <NEW_LINE> <DEDENT> return ChainDBDefaultType.__inst | Singleton for representing when no default value is given. | 62598f81bde94217f3707392 |
class InputPipelineConfig(object): <NEW_LINE> <INDENT> PER_SHARD_V1 = 1 <NEW_LINE> PER_HOST_V1 = 2 <NEW_LINE> PER_HOST_V2 = 3 | Please see the definition of these values in TPUConfig. | 62598f810383005118f6d15a |
class QRegExpWizardRepeatDialog(QDialog, Ui_QRegExpWizardRepeatDialog): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> super(QRegExpWizardRepeatDialog, self).__init__(parent) <NEW_LINE> self.setupUi(self) <NEW_LINE> self.unlimitedButton.setChecked(True) <NEW_LINE> msh = self.minimumSizeHint() ... | Class implementing a dialog for entering repeat counts. | 62598f8130c21e258be98262 |
class InsertionSort(object): <NEW_LINE> <INDENT> def __init__(self,arr): <NEW_LINE> <INDENT> self.arr=arr <NEW_LINE> <DEDENT> def insertionsort(self): <NEW_LINE> <INDENT> arr=self.arr <NEW_LINE> for i in range (1,arr.__len__()): <NEW_LINE> <INDENT> key=arr[i] <NEW_LINE> j=i-1 <NEW_LINE> while (j>=0 and arr[j]>key): <NE... | classdocs | 62598f81379a373c97d98a6a |
class MainSection(PulpCliSection): <NEW_LINE> <INDENT> NAME = 'content' <NEW_LINE> DESCRIPTION = _('manage content') <NEW_LINE> def __init__(self, context): <NEW_LINE> <INDENT> super(MainSection, self).__init__(self.NAME, self.DESCRIPTION) <NEW_LINE> self.add_subsection(SourcesSection(context)) | The *content* main section. | 62598f8182261d6c5272fc00 |
class FrankCopula(Copula): <NEW_LINE> <INDENT> def _logpdf(self, samples): <NEW_LINE> <INDENT> if self.theta == 0: <NEW_LINE> <INDENT> vals = np.zeros(samples.shape[0]) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> vals = np.log(-self.theta * np.expm1(-self.theta) * np.exp(-self.theta * (samples[:, 0] + samples[:, 1]))... | This class represents a copula from the Frank family. | 62598f81442bda511e95beb4 |
class GenericRendererElementInfo(_object): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, GenericRendererElementInfo, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, GenericRendererEleme... | Proxy of C++ FIFE::GenericRendererElementInfo class | 62598f8115baa723494619d7 |
class SlidesContext(SimpleItem): <NEW_LINE> <INDENT> implements(ISlidesContext, IBrowserPublisher) <NEW_LINE> def __init__(self, context, request): <NEW_LINE> <INDENT> super(SlidesContext, self).__init__(context, request) <NEW_LINE> <DEDENT> def publishTraverse(self, traverse, uuid): <NEW_LINE> <INDENT> return SlideCon... | This is a transient item that allows us to traverse through (a wrapper of)
a slides list on an object | 62598f811d351010ab8f3596 |
class OptimizerSwitcher(callbacks.Callback): <NEW_LINE> <INDENT> def __init__(self, switch_epochs, verbose=0): <NEW_LINE> <INDENT> super(OptimizerSwitcher, self).__init__() <NEW_LINE> if isinstance(switch_epochs, (list, tuple)): <NEW_LINE> <INDENT> if all(type(i)==int for i in switch_epochs): <NEW_LINE> <INDENT> self.s... | Optimizer switcher
Need to use with MDNT optimizers that support mannual phase-switching
method `optimizer.switch()`.
Now such optimizers include:
mdnt.optimizers.Adam2SGD
mdnt.optimizers.NAdam2NSGD
Arguments:
switch_epochs: an int or an int list which determines when to switch
the optimizer phase.... | 62598f82ec188e330fdf82f8 |
class Builder(object): <NEW_LINE> <INDENT> def __call__(self, name, url, address, options): <NEW_LINE> <INDENT> stub = classobj(name, (Stub,), {}) <NEW_LINE> inst = stub(url, address, options) <NEW_LINE> return inst | Stub builder. | 62598f8207f4c71912baee9d |
class Vector2D(object): <NEW_LINE> <INDENT> def __init__(self, x, y): <NEW_LINE> <INDENT> super(Vector2D, self).__init__() <NEW_LINE> self.x = x <NEW_LINE> self.y = y <NEW_LINE> logger.debug("{0} initialized".format(str(self))) <NEW_LINE> <DEDENT> def draw(self, screen, pos, color=(255,0,0)): <NEW_LINE> <INDENT> pos_fi... | docstring for Vector2D. | 62598f82a79ad16197769aba |
class Log_Skeleton: <NEW_LINE> <INDENT> def __init__(self, log, all_activities, noise_threshold, include_trace_extensions=False): <NEW_LINE> <INDENT> self.relationships = { 'always_before': rel.Always_Before, 'always_after': rel.AlwaysAfter, 'equivalence': rel.Equivalence, 'never_together': rel.Never_Together, 'next_bo... | Class that combines all relationships and generates a log skeleton. | 62598f821f037a2d8b9e3b42 |
class LoggerWrapper(logging.Logger): <NEW_LINE> <INDENT> LOG_NAME_ATTR = "log_name" <NEW_LINE> def __setstate__(self, state_dict): <NEW_LINE> <INDENT> logger = logging.getLogger(state_dict[self.LOG_NAME_ATTR]) <NEW_LINE> self.__dict__.update(logger.__dict__) <NEW_LINE> <DEDENT> def __getstate__(self): <NEW_LINE> <INDEN... | Picklable logger class.
Since when running multiprocess on windows all objects are pickled (to be
copied to the subprocess), and loggers aren't picklable, this wrapper is
needed so that workers can recreate the various loggers when they run. | 62598f82d10714528d69d929 |
class PingBinarySensor(BinarySensorEntity): <NEW_LINE> <INDENT> def __init__(self, name: str, ping) -> None: <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._ping = ping <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self) -> str: <NEW_LINE> <INDENT> return self._name <NEW_LINE> <DEDENT> @property <NEW_LINE> d... | Representation of a Ping Binary sensor. | 62598f82c432627299fa2a28 |
class AuthRegister(APIView): <NEW_LINE> <INDENT> serializer_class = AccountSerializer <NEW_LINE> permission_classes = (AllowAny,) <NEW_LINE> def post(self, request, format=None): <NEW_LINE> <INDENT> serializer = self.serializer_class(data=request.data) <NEW_LINE> if serializer.is_valid(): <NEW_LINE> <INDENT> serializer... | Register a new user. | 62598f824e696a045264db2e |
class CreateRequestException(CloudFilesException): <NEW_LINE> <INDENT> pass | Request could not be created, required parameters missing. | 62598f82711fe17d825e0143 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.