code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class TestIoK8sApiCoreV1FlexPersistentVolumeSource(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 testIoK8sApiCoreV1FlexPersistentVolumeSource(self): <NEW_LINE> <INDENT> pass | IoK8sApiCoreV1FlexPersistentVolumeSource unit test stubs | 6259904f7b25080760ed871c |
class WebServerStack(AppServerStack): <NEW_LINE> <INDENT> HEALTH_ENDPOINT = 'HTTP:443/' <NEW_LINE> STACK_NAME_PREFIX = 'Web' <NEW_LINE> INPUTS = dict(BASE_INPUTS, **{'AppServerAMI': ['global:WebServerAMI']}) | Web stack for Cac | 6259904f4e696a045264e85f |
class BaseMessage: <NEW_LINE> <INDENT> def __init__(self, channel: Optional[str] = None, text: Optional[str] = "", blocks: Optional[Union[List[Block], Block]] = None, attachments: Optional[List[Attachment]] = None, thread_ts: Optional[str] = None, mrkdwn: bool = True): <NEW_LINE> <INDENT> if isinstance(blocks, List): <... | Abstract class for shared functionality between Messages and
Acknowledgement responses. | 6259904f8e7ae83300eea510 |
class Edge: <NEW_LINE> <INDENT> def __init__(self, promptID, sourceID, targetID, data=None): <NEW_LINE> <INDENT> self.promptID = promptID <NEW_LINE> self.sourceID = sourceID <NEW_LINE> self.targetID = targetID <NEW_LINE> if data is not None: <NEW_LINE> <INDENT> for key in data.keys(): <NEW_LINE> <INDENT> setattr(self, ... | Graph Edge as defined by Ideagens | 6259904fdc8b845886d54a3c |
class A(Element): <NEW_LINE> <INDENT> tag = 'a' <NEW_LINE> indent = " " <NEW_LINE> def __init__(self, link, content): <NEW_LINE> <INDENT> super().__init__(content, href=link) | create the a tag for links, with a custom __init__ | 6259904f8a43f66fc4bf3616 |
class DateColumn(Column): <NEW_LINE> <INDENT> def __init__(self, *args, format='%Y-%m-%d', **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.format = format <NEW_LINE> <DEDENT> def to_python(self, value): <NEW_LINE> <INDENT> if isinstance(value, datetime.date): <NEW_LINE> <INDENT> return ... | A column that contains data in form of Python dates, represented in Python
by datetime.date
format
A strptime()-stype format string. | 6259904ff7d966606f7492f7 |
class Hook: <NEW_LINE> <INDENT> def __init__(self, module): <NEW_LINE> <INDENT> self.module = module <NEW_LINE> <DEDENT> def __getattr__(self, attr): <NEW_LINE> <INDENT> if attr == 'uniout': <NEW_LINE> <INDENT> if is_py2: <NEW_LINE> <INDENT> import uniout <NEW_LINE> <DEDENT> <DEDENT> else: <NEW_LINE> <INDENT> return ge... | 注入uniout模块,实现import时才触发
| 6259904fb57a9660fecd2efb |
class AASTex(Latex): <NEW_LINE> <INDENT> _format_name = 'aastex' <NEW_LINE> _io_registry_format_aliases = ['aastex'] <NEW_LINE> _io_registry_suffix = '' <NEW_LINE> _description = 'AASTeX deluxetable used for AAS journals' <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> Latex.__init__(self, **kwargs) <NEW_L... | Write and read AASTeX tables.
This class implements some AASTeX specific commands.
AASTeX is used for the AAS (American Astronomical Society)
publications like ApJ, ApJL and AJ.
It derives from the ``Latex`` reader and accepts the same
keywords. However, the keywords ``header_start``, ``header_end``,
``data_start`` ... | 6259904fa8ecb03325872691 |
class BackgroundAction(Protocol): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> async def __call__(self, conn: Redis, duration: float) -> None: <NEW_LINE> <INDENT> ... | An action to perform with the connection. | 6259904f0a50d4780f7067fc |
class _Line(object): <NEW_LINE> <INDENT> def __init__(self, subplot, cnvTimeFunc, wdg, **kargs): <NEW_LINE> <INDENT> self.subplot = subplot <NEW_LINE> self._cnvTimeFunc = cnvTimeFunc <NEW_LINE> self._wdg = wdg <NEW_LINE> self._tList = [] <NEW_LINE> self._yList = [] <NEW_LINE> self.line2d = matplotlib.lines.Line2D([], [... | A line (trace) on a strip chart representing some varying quantity
Attributes that might be useful:
- line2d: the matplotlib.lines.Line2D associated with this line
- subplot: the matplotlib Subplot instance displaying this line
- cnvTimeFunc: a function that takes a POSIX timestamp (e.g. time.time()) and returns matpl... | 6259904f8da39b475be04664 |
class ImageWithThumbnailsField(ImageField): <NEW_LINE> <INDENT> attr_class = ImageWithThumbnailsFieldFile <NEW_LINE> descriptor_class = FallbackFieldDescriptor <NEW_LINE> def __init__(self, thumbnails=None, fallback_path=None, *args, **kwargs): <NEW_LINE> <INDENT> super(ImageWithThumbnailsField, self).__init__(*args, *... | An ``ImageField`` subclass, extended with zero to many thumbnails.
| 6259904f462c4b4f79dbce7e |
class MedicationProductIngredient(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_name = "MedicationProductIngredient" <NEW_LINE> def __init__(self, jsondict=None, strict=True): <NEW_LINE> <INDENT> self.amount = None <NEW_LINE> self.item = None <NEW_LINE> super(MedicationProductIngredient, self).__init__... | Active or inactive ingredient.
Identifies a particular constituent of interest in the product. | 6259904f76e4537e8c3f0a05 |
class Routing(object): <NEW_LINE> <INDENT> def __init__(self, topo): <NEW_LINE> <INDENT> self.topo = topo <NEW_LINE> <DEDENT> def get_route(self, src, dst, pkt): <NEW_LINE> <INDENT> raise NotImplementedError | Base class for data center network routing.
Routing engines must implement the get_route() method. | 6259904f99cbb53fe6832364 |
class FeatureOfInterestList(Retriever): <NEW_LINE> <INDENT> _ID = 'foi_id' <NEW_LINE> _IDENTIFIER = 'foi_identifier' <NEW_LINE> _NAME = 'foi_name' <NEW_LINE> _DOMAIN = 'foi_domain' <NEW_LINE> _TYPE = 'foi_type' <NEW_LINE> @asyncio.coroutine <NEW_LINE> def before(self, request): <NEW_LINE> <INDENT> request['featureOfInt... | Query an SOS to retrieve observation data structured according to the
O&M specification. | 6259904f24f1403a9268630d |
class MatchCriteriaMailgunAllOf(object): <NEW_LINE> <INDENT> openapi_types = { 'type': 'str', 'address': 'str', 'subject': 'str' } <NEW_LINE> attribute_map = { 'type': 'type', 'address': 'address', 'subject': 'subject' } <NEW_LINE> nulls = set() <NEW_LINE> def __init__(self, type='mailgun', address=None, subject='New m... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 6259904fe64d504609df9e0e |
class Cache: <NEW_LINE> <INDENT> cache_dir = './.cache/' <NEW_LINE> date_format = '%Y-%m-%d' <NEW_LINE> today = dt.datetime.today() <NEW_LINE> def __init__(self, ticker:str, datatype:str, expiration=today, period=None, suffix='pkl'): <NEW_LINE> <INDENT> self._ticker = ticker <NEW_LINE> self._datatype = datatype... | Implementation of caching | 6259904fb7558d5895464967 |
class InlineResponse2004Result(object): <NEW_LINE> <INDENT> swagger_types = { 'data': 'InlineResponse2004ResultData' } <NEW_LINE> attribute_map = { 'data': 'data' } <NEW_LINE> def __init__(self, data=None): <NEW_LINE> <INDENT> self._data = None <NEW_LINE> self.discriminator = None <NEW_LINE> if data is not None: <NEW_L... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 6259904f3539df3088ecd721 |
class Application(Group, Task): <NEW_LINE> <INDENT> def __init__(self, command_line): <NEW_LINE> <INDENT> super(Application, self).__init__(parent=None, parser=None) <NEW_LINE> self._args = None <NEW_LINE> self._command_line = command_line <NEW_LINE> self._status = constant.TASK_RUNNING <NEW_LINE> self._result = None <... | Contract class for all the command line applications.
:ivar: commands: A list which contains (command, parser_name) tuples
::
Example:
::
class Example(CommandGroup):
commands = [
(ExampleOne, "main_parser"),
(ExampleTwo, "main_parser"),
(ExampleThree, "second_parser")... | 6259904f29b78933be26ab02 |
class UserLoginView(APIView): <NEW_LINE> <INDENT> def post(self, request): <NEW_LINE> <INDENT> username = request.data["email"] <NEW_LINE> password = request.data["password"] <NEW_LINE> if User.objects.filter(username=username, is_active=True).exists() is False: <NEW_LINE> <INDENT> error = { "error": "Sorry, user does ... | returns user token | 6259904f73bcbd0ca4bcb709 |
class TemperatureData(models.Model): <NEW_LINE> <INDENT> temp_type = models.ForeignKey(TemperatureType, on_delete=models.CASCADE) <NEW_LINE> created_at = models.DateTimeField(default=timezone.now) <NEW_LINE> Year = models.IntegerField(null=True, blank=True, default=None) <NEW_LINE> JAN = models.FloatField(null=True, bl... | docstring for Country | 6259904f23e79379d538d97c |
class KNearestNeighbor(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def train(self, X, y): <NEW_LINE> <INDENT> self.X_train = X <NEW_LINE> self.y_train = y <NEW_LINE> <DEDENT> def predict(self, X, k=1, num_loops=0): <NEW_LINE> <INDENT> if num_loops == 0: <NEW_LINE> <INDE... | a kNN classifier with L2 distance | 6259904fa219f33f346c7c81 |
class AntColony(object): <NEW_LINE> <INDENT> def __init__(self, strategy, hive, ant_types, create_places, food=4): <NEW_LINE> <INDENT> self.time = 0 <NEW_LINE> self.food = food <NEW_LINE> self.strategy = strategy <NEW_LINE> self.hive = hive <NEW_LINE> self.ant_types = OrderedDict((a.name, a) for a in ant_types) <NEW_LI... | An ant collective that manages global game state and simulates time.
Attributes:
time -- elapsed time
food -- the colony's available food total
queen -- the place where the queen resides
places -- A list of all places in the colony (including a Hive)
bee_entrances -- A list of places that bees can enter | 6259904f23849d37ff85253e |
@dataclass <NEW_LINE> class ImplementationGuideDependsOn(BackboneElement): <NEW_LINE> <INDENT> resource_type: ClassVar[str] = "ImplementationGuideDependsOn" <NEW_LINE> uri: str = None <NEW_LINE> packageId: Optional[str] = None <NEW_LINE> version: Optional[str] = None | Another Implementation guide this depends on.
Another implementation guide that this implementation depends on.
Typically, an implementation guide uses value sets, profiles etc.defined in
other implementation guides. | 6259904f15baa7234946340d |
class NewPost(Handler): <NEW_LINE> <INDENT> @login_required <NEW_LINE> def get(self): <NEW_LINE> <INDENT> self.render('newpost.html') <NEW_LINE> <DEDENT> @login_required <NEW_LINE> def post(self): <NEW_LINE> <INDENT> title = self.request.get('title') <NEW_LINE> blogpost = self.request.get('blogpost') <NEW_LINE> author ... | Handle the new post entry page. | 6259904f8a43f66fc4bf3618 |
class TaskImagesView(generics.ListAPIView): <NEW_LINE> <INDENT> serializer_class = ImagesSerializer <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> pk = self.kwargs.get('pk') <NEW_LINE> queryset = ImageTask.objects.filter(to_task=pk) <NEW_LINE> return queryset | Вывод списка изображений задания | 6259904f8e71fb1e983bcf45 |
class ShuffleConvExpansion(nn.Module): <NEW_LINE> <INDENT> def __init__(self, d_features, n_channel, n_depth): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.d_features = d_features <NEW_LINE> self.n_channel = n_channel <NEW_LINE> self.n_depth = n_depth <NEW_LINE> self.index = feature_shuffle_index(d_features, ... | expansion 1D -> 2D | 6259904f94891a1f408ba135 |
class TableError(PyLaTeXError): <NEW_LINE> <INDENT> pass | A Base class for all errors concerning tables. | 6259904f91af0d3eaad3b2a5 |
class UpsampleConv(nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_channels, out_channels, kernel_size, stride, padding): <NEW_LINE> <INDENT> super(UpsampleConv, self).__init__() <NEW_LINE> self.upsample = nn.Upsample(scale_factor=2, mode='bilinear') <NEW_LINE> self.conv = nn.Conv2d(in_channels, out_channels, ker... | Upsample tensor and then conv | 6259904fd53ae8145f9198e3 |
class DuckduckgoSelScrape(SelScrape): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> SelScrape.__init__(self, *args, **kwargs) <NEW_LINE> self.largest_id = 0 <NEW_LINE> <DEDENT> def _goto_next_page(self): <NEW_LINE> <INDENT> super().page_down() <NEW_LINE> return 'No more results' not in se... | Duckduckgo is a little special since new results are obtained by ajax.
next page thus is then to scroll down.
Furthermore duckduckgo.com doesn't seem to work with Phantomjs. Maybe they block it, but I
don't know how ??!
It cannot be the User-Agent, because I already tried this. | 6259904f55399d3f0562799b |
class InterfacesEdit(View): <NEW_LINE> <INDENT> def get(self, request, pk): <NEW_LINE> <INDENT> data = [i for i in models.Interfaces.objects.filter(id = pk).values()] <NEW_LINE> json_ = return_information(data, 200, "查询成功!") <NEW_LINE> return JsonResponse(json_, json_dumps_params = {'ensure_ascii': False}) <NEW_LINE> <... | 接口信息的编辑及单条获取 | 6259904f287bf620b627306b |
class Index(webapp2.RequestHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> self.redirect('/grass') | Redirects to grass (default) | 6259904f379a373c97d9a4ac |
class KRRCTypeA2DualElement(KRRCNonSimplyLacedElement): <NEW_LINE> <INDENT> def epsilon(self, a): <NEW_LINE> <INDENT> if a == self.parent()._cartan_type.special_node(): <NEW_LINE> <INDENT> return self.to_tensor_product_of_kirillov_reshetikhin_tableaux().epsilon(a) <NEW_LINE> <DEDENT> a = self.parent()._rc_index_inverse... | `U_q^{\prime}(\mathfrak{g})` rigged configurations in type
`A_{2n}^{(2)\dagger}`. | 6259904fac7a0e7691f7395c |
class RPCCoverage(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.dir = tempfile.mkdtemp(prefix="coverage") <NEW_LINE> self.flag = '--coveragedir=%s' % self.dir <NEW_LINE> <DEDENT> def report_rpc_coverage(self): <NEW_LINE> <INDENT> uncovered = self._get_uncovered_rpc_commands() <NEW_LINE> if uncover... | Coverage reporting utilities for test_runner.
Coverage calculation works by having each test script subprocess write
coverage files into a particular directory. These files contain the RPC
commands invoked during testing, as well as a complete listing of RPC
commands per `blessing-cli help` (`rpc_interface.txt`).
Aft... | 6259904f4428ac0f6e6599b4 |
class MonoGmm(GMM): <NEW_LINE> <INDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self.conf.get('mono_gmm', 'name') <NEW_LINE> <DEDENT> @property <NEW_LINE> def trainscript(self): <NEW_LINE> <INDENT> return 'steps/train_mono.sh' <NEW_LINE> <DEDENT> @property <NEW_LINE> def conf_file(self): <NEW_LI... | a class for the monophone GMM | 6259904f82261d6c52730907 |
class Age(NamedModel): <NEW_LINE> <INDENT> class Meta(NamedModel.Meta): <NEW_LINE> <INDENT> app_label = _app_label <NEW_LINE> db_table = db_table(_app_label, _age) <NEW_LINE> verbose_name = _(_age_verbose) <NEW_LINE> verbose_name_plural = _(pluralize(_age_verbose)) | Age demographics model class.
Sample name field values may include:
- age < 12
- 50 < age < 60 | 6259904f45492302aabfd955 |
class MailRead(default_cmds.MuxCommand): <NEW_LINE> <INDENT> key = "read" <NEW_LINE> aliases = [ "+read" ] <NEW_LINE> locks = "cmd:all()" <NEW_LINE> help_category = "Mail" <NEW_LINE> def func(self): <NEW_LINE> <INDENT> if len(self.caller.db.mailsystem) == 0: <NEW_LINE> <INDENT> self.caller.msg("SYSTEM: You don't have a... | Read a mail
Usage:
read #, +read #
Read a mail | 6259904f76d4e153a661dcb9 |
class IMedialogMTilesMgalleryLayer(IDefaultBrowserLayer): <NEW_LINE> <INDENT> pass | Marker interface that defines a browser layer. | 6259904f29b78933be26ab03 |
class CheckboxTreeview(ttk.Treeview): <NEW_LINE> <INDENT> def __init__(self, master=None, **kw): <NEW_LINE> <INDENT> ttk.Treeview.__init__(self, master, **kw) <NEW_LINE> self.im_checked = tk.PhotoImage(file='resources/checked.png') <NEW_LINE> self.im_unchecked = tk.PhotoImage(file='resources/unchecked.png') <NEW_LINE> ... | `ttk.Treeview` widget with checkboxes.
The checkboxes are done via the image attribute of the item,
so to keep the checkbox, you cannot add an image to the item. | 6259904f07d97122c4218126 |
class Message(collections.namedtuple('Message', ['header', 'data'])): <NEW_LINE> <INDENT> pass | Represents a message to be sent or received.
Instead of building this message directly, use the new_message function.
Fields:
header: instance of Header, represents the header received with each
message.
data: on MessageType.MSG messages, is the string to be sent to the
receiver. On MessageTyp... | 6259904f6fece00bbaccce3c |
class DatabaseConfiguration: <NEW_LINE> <INDENT> def __init__(self, engine: str): <NEW_LINE> <INDENT> self._engine = engine <NEW_LINE> <DEDENT> @property <NEW_LINE> def engine(self): <NEW_LINE> <INDENT> return self._engine | Configuration of the database access | 6259904f4e696a045264e861 |
class PerLengthSequenceImpedance(PerLengthImpedance): <NEW_LINE> <INDENT> r: Optional[float] = None <NEW_LINE> x: Optional[float] = None <NEW_LINE> bch: Optional[float] = None <NEW_LINE> gch: Optional[float] = None <NEW_LINE> r0: Optional[float] = None <NEW_LINE> x0: Optional[float] = None <NEW_LINE> b0ch: Optional[flo... | Sequence impedance and admittance parameters per unit length, for transposed lines of 1, 2, or 3 phases.
For 1-phase lines, define x=x0=xself. For 2-phase lines, define x=xs-xm and x0=xs+xm.
Typically, one PerLengthSequenceImpedance is used for many ACLineSegments. | 6259904f435de62698e9d280 |
class Test_Instancing(unittest.TestCase): <NEW_LINE> <INDENT> def test_instancing(self): <NEW_LINE> <INDENT> for i in dir(ac): <NEW_LINE> <INDENT> with self.subTest(i): <NEW_LINE> <INDENT> j = getattr(ac,i) <NEW_LINE> if isinstance(j,type): <NEW_LINE> <INDENT> j() <NEW_LINE> <DEDENT> <DEDENT> <DEDENT> <DEDENT> def test... | Test that ensures that digest of Acoular classes changes correctly on
changes of CArray and List attributes. | 6259904f30c21e258be99c87 |
class CancelTrade(Trade): <NEW_LINE> <INDENT> pass | The act of cancelling a `Sell`_, `Donate`_ or `Rent`_. | 6259904f63d6d428bbee3c4e |
class TagContrastTable(models.Model): <NEW_LINE> <INDENT> id = models.AutoField(primary_key=True) <NEW_LINE> tag = MyForeignKey(Tag, blank=True, null=True) <NEW_LINE> cat_name = models.CharField(max_length=32, blank=True, null=True) <NEW_LINE> is_deleted = models.BooleanField(blank=True, default=False) <NEW_LINE> def _... | 标签对照表 | 6259904f8da39b475be04668 |
class FullPathAction(argparse.Action): <NEW_LINE> <INDENT> def __call__(self, parser: argparse.ArgumentParser, namespace: argparse.Namespace, values: Any, option_string: str = None) -> None: <NEW_LINE> <INDENT> setattr(namespace, self.dest, os.path.abspath(str(values))) | An argparse.Action to ensure provided paths are absolute. | 6259904fd486a94d0ba2d447 |
class EventCallbackLog(Resource): <NEW_LINE> <INDENT> type = 'event_callback_logs' | Represents a request and response from single attempt to notify a callback
of an event. | 6259904f462c4b4f79dbce82 |
class geometric_mean: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.s=0. <NEW_LINE> self.N=0 <NEW_LINE> self.ret_value = -1 <NEW_LINE> <DEDENT> def step(self, value): <NEW_LINE> <INDENT> if isfloat(value): <NEW_LINE> <INDENT> v=float(value) <NEW_LINE> if not isnan(v): <NEW_LINE> <INDENT> if v<0: <NEW... | Takes the absolute value of the elements and
computes the mean. Modeled after scipy.stats.gmean.
If x contains any values < 0. return nan, if | 6259904fd7e4931a7ef3d4fb |
@python_2_unicode_compatible <NEW_LINE> class PreStepSource(models.Model): <NEW_LINE> <INDENT> recipe = models.ForeignKey(Recipe, related_name='prestepsources', on_delete=models.CASCADE) <NEW_LINE> filename = models.CharField(max_length=120, blank=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.file... | Since we use bash to execute our steps, we can just add some
files to be sourced to import variables, functions, etc, before
running the step. | 6259904f71ff763f4b5e8c2b |
class QuitFrame(Frame): <NEW_LINE> <INDENT> def __init__(self, master=None): <NEW_LINE> <INDENT> Frame.__init__(self, master) <NEW_LINE> self.root = master | Build quit frame | 6259904f507cdc57c63a6223 |
class TestTemplateManager(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self._manager = phishingpage.TemplateManager() <NEW_LINE> self._template_path = PHISHING_PAGES_DIR <NEW_LINE> <DEDENT> def test_get_templates(self): <NEW_LINE> <INDENT> actual = self._manager.get_templates() <NEW_LINE... | Test TemplateManager class. | 6259904f435de62698e9d281 |
class SerViviente: <NEW_LINE> <INDENT> def __init__(self, tipo, nombre, fuerza, arma): <NEW_LINE> <INDENT> self.tipo = tipo <NEW_LINE> self.nombre = nombre <NEW_LINE> self.fuerza = fuerza <NEW_LINE> self.arma = arma <NEW_LINE> self.describir_ser_viviente() <NEW_LINE> <DEDENT> def estado_ser_viviente(self): <NEW_LINE> <... | Clase para definir tanto héroes como mónstruos en nuestro juego | 6259904f3617ad0b5ee075c3 |
class HeunDeterministic(Integrator): <NEW_LINE> <INDENT> _ui_name = "Heun" <NEW_LINE> def scheme(self, X, dfun, coupling, local_coupling, stimulus): <NEW_LINE> <INDENT> m_dx_tn = dfun(X, coupling, local_coupling) <NEW_LINE> inter = X + self.dt * (m_dx_tn + stimulus) <NEW_LINE> if self.state_variable_boundaries is not N... | It is a simple example of a predictor-corrector method. It is also known as
modified trapezoidal method, which uses the Euler method as its predictor.
And it is also a implicit integration scheme. | 6259904fe76e3b2f99fd9e83 |
class RemovedIn20Warning(SADeprecationWarning): <NEW_LINE> <INDENT> deprecated_since = "1.4" <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return ( super(RemovedIn20Warning, self).__str__() + " (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)" ) | Issued for usage of APIs specifically deprecated in SQLAlchemy 2.0.
.. seealso::
:ref:`error_b8d9`.
:ref:`deprecation_20_mode` | 6259904f097d151d1a2c24f4 |
class CourseDetailView(DetailView): <NEW_LINE> <INDENT> model = Course <NEW_LINE> context_object_name = u"course" <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> kwargs = super(CourseDetailView, self).get_context_data() <NEW_LINE> kwargs['note_set'] = self.object.note_set.filter(is_hidden=False) <N... | Class-based view for the course html page | 6259904f4e696a045264e862 |
class Person: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.firstname = "John" <NEW_LINE> self.lastname = "Depp" <NEW_LINE> self.eyecolor = "grey" <NEW_LINE> self.age = 42 | This class provides information related to the Person | 6259904f07f4c71912bb08b9 |
class MyPandasStandardScaler(BaseEstimator, TransformerMixin): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.scaler = StandardScaler(**kwargs) <NEW_LINE> <DEDENT> def fit(self, X, y=None): <NEW_LINE> <INDENT> self.cont_cols = get_cont_cols(X) <NEW_LINE> self.scaler.fit(X[self.cont_cols]) <N... | Transform all numeric, non-categorical variables according to
StandardScaler. Return pandas DataFrame | 6259904f435de62698e9d282 |
class OpenBCISample(object): <NEW_LINE> <INDENT> def __init__(self, aux_data=None, board_time=0, channel_data=None, error=None, imp_data=None, packet_type=0, protocol='wifi', sample_number=0, start_byte=0, stop_byte=0, valid=True, accel_data=None): <NEW_LINE> <INDENT> self.aux_data = aux_data if aux_data is not None el... | Object encapulsating a single sample from the OpenBCI board. | 6259904f21a7993f00c673ed |
class OrderedDict(collections.OrderedDict): <NEW_LINE> <INDENT> def insert_before(self, existing_key, new_key, new_value): <NEW_LINE> <INDENT> if existing_key not in self or new_key in self: <NEW_LINE> <INDENT> self.update([(new_key, new_value)]) <NEW_LINE> return <NEW_LINE> <DEDENT> new_items = [] <NEW_LINE> for (k, v... | Adds more insertion functionality to OrderedDict. | 6259904f7d847024c075d858 |
class HDF5Reporter(_BaseReporter): <NEW_LINE> <INDENT> @property <NEW_LINE> def backend(self): <NEW_LINE> <INDENT> return HDF5TrajectoryFile <NEW_LINE> <DEDENT> def __init__(self, file, reportInterval, coordinates=True, time=True, cell=True, potentialEnergy=True, kineticEnergy=True, temperature=True, velocities=False, ... | HDF5Reporter stores a molecular dynamics trajectory in the HDF5 format.
This object supports saving all kinds of information from the simulation --
more than any other trajectory format. In addition to all of the options,
the topology of the system will also (of course) be stored in the file. All
of the information is... | 6259904f8da39b475be0466a |
class Dataset(object): <NEW_LINE> <INDENT> def __init__(self, ds_name, *views): <NEW_LINE> <INDENT> self.ds_name = ds_name <NEW_LINE> self.views = views <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> return self.views[key] <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_cache(cls, ds_name, vie... | The Dataset object represents a single named dataset with multiple views into it. | 6259904f596a897236128ff1 |
class ScrapeTable(QTableView): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> from visualscrape.ui.viewer.support import ScrapeModel, ScrapeItemDelegate <NEW_LINE> super(ScrapeTable, self).__init__(parent) <NEW_LINE> self.setModel(ScrapeModel()) <NEW_LINE> self.setItemDelegate(ScrapeItemDelega... | The table view approach to visualization | 6259904fd486a94d0ba2d449 |
class FabrikBlock(Block): <NEW_LINE> <INDENT> def __init__(self, vertex): <NEW_LINE> <INDENT> super(FabrikBlock, self).__init__(vertex) <NEW_LINE> self._node = vertex <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> string = "<Block vertex=" + str(self.vertex.name) + ", index=" + str(self.index... | A subclass of the Block: a visual representation of a Vertex | 6259904f004d5f362081fa2b |
class Game(models.Model): <NEW_LINE> <INDENT> SEMS = ( ("S", "Spring"), ("F", "Fall"), ) <NEW_LINE> semester = models.CharField(max_length=1, choices=SEMS) <NEW_LINE> year = models.PositiveIntegerField() <NEW_LINE> start_date = models.DateField() <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> if self.semester ==... | Games are the events that tie everything together | 6259904f45492302aabfd958 |
class ExecutionContextValueDoesNotExist(GenUtilsKeyError): <NEW_LINE> <INDENT> message = "Could not get key={key} from ExecutionContext." <NEW_LINE> key = None | Raised when attempting to get a value that does not exist in a backend | 6259904f71ff763f4b5e8c2d |
class TestException(Exception): <NEW_LINE> <INDENT> pass | Test exception | 6259904fe5267d203ee6cd70 |
class ServiceHttpColonyPlugin(colony.base.system.Plugin): <NEW_LINE> <INDENT> id = "pt.hive.colony.plugins.service.http.colony" <NEW_LINE> name = "Http Service Colony" <NEW_LINE> description = "The plugin that offers the http service colony" <NEW_LINE> version = "1.0.0" <NEW_LINE> author = "Hive Solutions Lda. <develop... | The main class for the Http Service Colony plugin. | 6259904f7b25080760ed8720 |
class _RealFFTBasis(_AbstractMicrostructureBasis): <NEW_LINE> <INDENT> def _fftn(self, X): <NEW_LINE> <INDENT> return rfftn(X, axes=self._axes, threads=self._n_jobs) <NEW_LINE> <DEDENT> def _ifftn(self, X): <NEW_LINE> <INDENT> return irfftn(X, axes_shape=self._axes_shape, axes=self._axes, threads=self._n_jobs).real | This class is used to make the bases that create real valued
microstructure functions use the real rFFT/irFFT algorithms and selects
the appropriate fft module depending on whether or not pyfftw is installed. | 6259904fbaa26c4b54d50730 |
class ComputeAtmosphericProperties(Group): <NEW_LINE> <INDENT> def initialize(self): <NEW_LINE> <INDENT> self.options.declare('num_nodes',default=1,desc="Number of mission analysis points to run") <NEW_LINE> self.options.declare('true_airspeed_in',default=False,desc="Number of mission analysis points to run") <NEW_LINE... | Computes pressure, density, temperature, dyn pressure, and true airspeed
Inputs
------
fltcond|h : float
Altitude (vector, km)
fltcond|Ueas : float
Equivalent airspeed (vector, m/s)
fltcond|TempIncrement : float
Temperature increment for non-standard day (vector, degC)
Outputs
-------
fltcond|p : float
... | 6259904fd53ae8145f9198e8 |
class RedisManagementClient: <NEW_LINE> <INDENT> def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, base_url: str = "https://management.azure.com", **kwargs: Any ) -> None: <NEW_LINE> <INDENT> self._config = RedisManagementClientConfiguration(credential=credential, subscription_id=subscriptio... | REST API for Azure Redis Cache Service.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.redis.aio.operations.Operations
:ivar redis: RedisOperations operations
:vartype redis: azure.mgmt.redis.aio.operations.RedisOperations
:ivar firewall_rules: FirewallRulesOperations operations
:vartype firew... | 6259904fdc8b845886d54a44 |
class TestPipeline(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.pipeline = MyPipeline() <NEW_LINE> self.pipeline.input_image = ["toto", "tutu"] <NEW_LINE> self.pipeline.dynamic_parameter = [3, 1] <NEW_LINE> self.pipeline.other_input = 5 <NEW_LINE> <DEDENT> def test_iterative_pipelin... | Class to test a pipeline with an iterative node
| 6259904f15baa72349463412 |
class CRUUnit(HybridBlock): <NEW_LINE> <INDENT> def __init__(self, in_channels, out_channels, strides, group_width, bn_use_global_stats, conv1_params=None, conv2_params=None, **kwargs): <NEW_LINE> <INDENT> super(CRUUnit, self).__init__(**kwargs) <NEW_LINE> assert (strides == 1) or ((conv1_params is None) and (conv2_par... | CRU-Net collective residual unit.
Parameters:
----------
in_channels : int
Number of input channels.
out_channels : int
Number of output channels.
strides : int or tuple/list of 2 int
Strides of the convolution.
group_width: int
Group width parameter.
bn_use_global_stats : bool
Whether global movin... | 6259904f21a7993f00c673ef |
class LinkAggregationStatus_TLV(TLV): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> TLV.__init__(self) <NEW_LINE> self.name = "Port Link Aggregation Enabled" <NEW_LINE> self.field = "switch_port_link_aggregation_enabled" <NEW_LINE> self.value = "%s" % str((data[0] & 0x02) != 0) | LinkAggregationStatus_TLV class | 6259904f8e7ae83300eea518 |
class Polyped(object): <NEW_LINE> <INDENT> def __init__(self,g,d,x,lda,eps=1e-10): <NEW_LINE> <INDENT> self.g = g <NEW_LINE> self.d = d <NEW_LINE> self.x = x <NEW_LINE> self.lda = lda <NEW_LINE> self.fon,self.foff,self.feet,self.events = footfallPattern(d,g,fullOutput=True) <NEW_LINE> <DEDENT> def footPositions(self,t)... | Represents the polyped locomotion system.
Compute limb configurations, polygons of support and stability margins of a
McGhee and Frank parametrized polyped. Requires the relative phases of the
limbs, the duty cycle of the limbs, the the touchdown positions of the feet
and the stride lengths.
TYPICAL USAGE
========... | 6259904ff7d966606f7492fb |
class modulation(s.str): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super().__init__(enum={"am", "fm", "lsb", "usb", "dmr", "dstar"}) | Signal modulation type. | 6259904fb57a9660fecd2f03 |
class LazyFailureArcTest(VoCRF): <NEW_LINE> <INDENT> def __init__(self, *args, **kw): <NEW_LINE> <INDENT> super(LazyFailureArcTest, self).__init__(*args, **kw) <NEW_LINE> self.H = len(self.states)*self.A <NEW_LINE> <DEDENT> def test_gradient(self, T): <NEW_LINE> <INDENT> D = 100 <NEW_LINE> sparse = LazyRegularizedAdagr... | Test model with the lazy weight updater. | 6259904fdd821e528d6da361 |
class Acoustic2ndOrder1D(fld.Field1D): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> if not (hasattr(kwargs['material'], 'd_rho_p') and hasattr(kwargs['material'], 'd_rho2_p')): <NEW_LINE> <INDENT> wn.warn('Material with properties d_rho_p and d_rho2_p is required for 2nd order ' 'nonline... | Class for simulation of one-dimensional nonlinear acoustic fields using second order
approximation. | 6259904fa8ecb03325872699 |
class diskstats(File): <NEW_LINE> <INDENT> __keys = ('read__completed', 'read__merged', 'read__sectors', 'read__milliseconds', 'write__completed', 'write__merged', 'write__sectors', 'write__milliseconds', 'io__in_progress', 'io__milliseconds', 'io__weighted_milliseconds') <NEW_LINE> def _parse(self, content): <NEW_LINE... | /proc/diskstats
| 6259904f91af0d3eaad3b2ab |
class Rule: <NEW_LINE> <INDENT> def __init__(self, target_state: str, signal: str, action: Callable, action_takes_parameter: bool): <NEW_LINE> <INDENT> self.target_state = target_state <NEW_LINE> self.signal = signal <NEW_LINE> self.action = action <NEW_LINE> self.action_takes_parameter = action_takes_parameter <NEW_LI... | Rule class | 6259904fd7e4931a7ef3d4ff |
class TestGetBrowserRedirectUrl(unittest.TestCase): <NEW_LINE> <INDENT> def test_valid_url_single_scope(self): <NEW_LINE> <INDENT> redirect_url = pypco.get_browser_redirect_url( 'abc123', 'https://nowhere.com?someurl', ['people'] ) <NEW_LINE> self.assertEqual( "https://api.planningcenteronline.com/oauth/authorize?" "cl... | Test pypco functionality for getting browser redirect URL. | 6259904fd53ae8145f9198e9 |
class SnowflakeQuery(Task): <NEW_LINE> <INDENT> def __init__( self, account: str, user: str, password: str, database: str = None, schema: str = None, role: str = None, warehouse: str = None, query: str = None, data: tuple = None, autocommit: bool = None, **kwargs ): <NEW_LINE> <INDENT> self.account = account <NEW_LINE>... | Task for executing a query against a snowflake database.
Args:
- account (str): snowflake account name, see snowflake connector
package documentation for details
- user (str): user name used to authenticate
- password (str): password used to authenticate
- database (str, optional): name of the ... | 6259904f23e79379d538d983 |
class ProductSeriesVocabulary(SQLObjectVocabularyBase): <NEW_LINE> <INDENT> implements(IHugeVocabulary) <NEW_LINE> displayname = 'Select a Release Series' <NEW_LINE> step_title = 'Search' <NEW_LINE> _table = ProductSeries <NEW_LINE> _order_by = [Product.name, ProductSeries.name] <NEW_LINE> _clauseTables = ['Product'] <... | All `IProductSeries` objects vocabulary. | 6259904f507cdc57c63a6227 |
class Review(core_models.TimeStampedModel): <NEW_LINE> <INDENT> review = models.TextField() <NEW_LINE> accuracy = models.IntegerField() <NEW_LINE> cleanliness = models.IntegerField() <NEW_LINE> communication = models.IntegerField() <NEW_LINE> location = models.IntegerField() <NEW_LINE> check_in = models.IntegerField() ... | Review Model Definition | 6259904f3c8af77a43b68981 |
class Protocol(serial.threaded.Protocol): <NEW_LINE> <INDENT> def data_received(self, data): <NEW_LINE> <INDENT> self.parser(data) | Serial protocol. | 6259904f26068e7796d4ddcb |
class PollingEmitter(EventEmitter): <NEW_LINE> <INDENT> def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT): <NEW_LINE> <INDENT> EventEmitter.__init__(self, event_queue, watch, timeout) <NEW_LINE> self._snapshot = DirectorySnapshot(watch.path, watch.is_recursive) <NEW_LINE> self._lock = threading.Lo... | Platform-independent emitter that polls a directory to detect file
system changes. | 6259904f07f4c71912bb08bc |
class StdInputHandler(EventHandler): <NEW_LINE> <INDENT> def __init__(self, worker): <NEW_LINE> <INDENT> EventHandler.__init__(self) <NEW_LINE> self.master_worker = worker <NEW_LINE> <DEDENT> def ev_msg(self, port, msg): <NEW_LINE> <INDENT> if not msg: <NEW_LINE> <INDENT> self.master_worker.set_write_eof() <NEW_LINE> r... | Standard input event handler class. | 6259904fb57a9660fecd2f04 |
class load(ao2mo.load): <NEW_LINE> <INDENT> def __init__(self, eri, dataname='j3c'): <NEW_LINE> <INDENT> ao2mo.load.__init__(self, eri, dataname) | load 3c2e integrals from hdf5 file. It can be used in the context
manager:
with load(cderifile) as eri:
print(eri.shape) | 6259904f3eb6a72ae038bae3 |
class GameForms(messages.Message): <NEW_LINE> <INDENT> items = messages.MessageField(GameForm2, 1, repeated=True) | Return multiple GameForms | 6259904f7cff6e4e811b6ec3 |
@admin.register(models.Photo) <NEW_LINE> class PhotoAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ( "__str__", "get_thumbnail", ) <NEW_LINE> def get_thumbnail(self, obj): <NEW_LINE> <INDENT> return mark_safe(f'<img height="50px" src="{obj.file.url}"/>') <NEW_LINE> <DEDENT> get_thumbnail.short_description ... | Photo Admin Definition | 6259904f435de62698e9d286 |
class ShibbolethUserBackend(ModelBackend): <NEW_LINE> <INDENT> create_unknown_user = True <NEW_LINE> def authenticate(self, shib_meta): <NEW_LINE> <INDENT> if not shib_meta: return <NEW_LINE> user = None <NEW_LINE> username = self.clean_username(shib_meta['eppn']) <NEW_LINE> UserModel = get_user_model() <NEW_LINE> if s... | This backend is to be used in conjunction with the ``ShibbolethUserMiddleware``
found in the middleware module of this package, and is used when the server
is handling authentication outside of Django.
By default, the ``authenticate`` method creates ``User`` objects for
usernames that don't already exist in the databa... | 6259904f8a43f66fc4bf3620 |
class AddBandwidthPackageResourcesRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ResourceIds = None <NEW_LINE> self.BandwidthPackageId = None <NEW_LINE> self.NetworkType = None <NEW_LINE> self.ResourceType = None <NEW_LINE> self.Protocol = None <NEW_LINE> <DEDENT> def _deserial... | AddBandwidthPackageResources request structure.
| 6259904f15baa72349463414 |
class SiteGenericMethod(BW2RegionalizationError): <NEW_LINE> <INDENT> pass | This ``Method`` doesn't have links to ``geocollections``, making it site-generic. | 6259904fb7558d589546496b |
class Settings(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.screen_width = 800 <NEW_LINE> self.screen_height = 600 <NEW_LINE> self.bg_color = (230, 230, 230) <NEW_LINE> """飞船设置""" <NEW_LINE> self.ship_speed_factor = 1.0 <NEW_LINE> self.ship_limit = 3 <NEW_LINE> """子弹设置""" <NEW_LINE> self.bullet_s... | "存储 所有设置信息的类 | 6259904f63d6d428bbee3c54 |
class ISL29125IROZ(PointHandler): <NEW_LINE> <INDENT> ADDRESS = 0x44 <NEW_LINE> REG_ID = 0x00 <NEW_LINE> REG_RESET = 0x00 <NEW_LINE> REG_CONFIG_1 = 0x01 <NEW_LINE> REG_CONFIG_2 = 0x02 <NEW_LINE> REG_CONFIG_3 = 0x03 <NEW_LINE> REG_LOW_THRESHOLD_LSB = 0x04 <NEW_LINE> REG_LOW_THRESHOLD_MSB = 0x05 <NEW_LINE> REG_HIGH_THRES... | http://www.intersil.com/content/dam/Intersil/documents/isl2/isl29125.pdf | 6259904f8da39b475be0466e |
class MyAdminIndexView(admin.AdminIndexView): <NEW_LINE> <INDENT> @expose('/') <NEW_LINE> @login_required <NEW_LINE> def index(self): <NEW_LINE> <INDENT> return super(MyAdminIndexView, self).index() | Custom admin class to force a user to be authenticated. | 6259904fdd821e528d6da363 |
class DailymotionExtractor(BaseFeedExtractor): <NEW_LINE> <INDENT> def flv_url_transform(self, flvurl): <NEW_LINE> <INDENT> return flvurl.replace('80x60', '320x240') | FLV extractor from a dailymotion Feed | 6259904f91af0d3eaad3b2ad |
class GscTests(GeneralTests): <NEW_LINE> <INDENT> def test_gsc(self): <NEW_LINE> <INDENT> err = 1e-3 <NEW_LINE> tree6_exp = {'A': 0.19025, 'B': 0.19025, 'C': 0.2717, 'D': 0.3478} <NEW_LINE> tree7_exp = {'A':.25, 'B':.25, 'C':.25, 'D':.25} <NEW_LINE> tree8_exp = dict(zip('ABCDEFGH',[.1,.1,.2,.06,.06,.16,.16,.16])) <NEW_... | Tests for GSC functionality | 6259904f94891a1f408ba139 |
class TakeOff_Task(): <NEW_LINE> <INDENT> def __init__(self, init_pose=None, init_velocities=None, init_angle_velocities=None, runtime=5., target_pos=None): <NEW_LINE> <INDENT> self.sim = PhysicsSim(init_pose, init_velocities, init_angle_velocities, runtime) <NEW_LINE> self.action_repeat = 3 <NEW_LINE> self.state_size ... | Task (environment) that defines the goal and provides feedback to the agent. | 6259904fa8ecb0332587269b |
class Hint(restful.Resource): <NEW_LINE> <INDENT> decorators = [utils.login_required, utils.team_required] <NEW_LINE> resource_fields = { 'hid': fields.Integer, 'challenge_cid': fields.Integer, 'hint': fields.String, 'cost': fields.Integer, } <NEW_LINE> @restful.marshal_with(resource_fields) <NEW_LINE> def post(self): ... | Wrap hint just for unlocking. | 6259904f45492302aabfd95c |
class Testcase_100_80_Table(base_tests.SimpleDataPlane): <NEW_LINE> <INDENT> @wireshark_capture <NEW_LINE> def runTest(self): <NEW_LINE> <INDENT> logging.info("Running Testcase 100.80 Table") <NEW_LINE> ports = openflow_ports(4) <NEW_LINE> in_port = ports[0] <NEW_LINE> out_port = ports[1] <NEW_LINE> actions=[ofp.action... | Purpose
Verify that a packet_out with output:table gets submitted to the flow table.
Methodology
Configure and connect DUT to controller. After control channel establishment, add a flow matching on the named field (under the given Pre-requisites for the match), action is output to a specific port. Generate a matching ... | 6259904f76e4537e8c3f0a0f |
class TestCompareXLSXFiles(base_test_class.XLSXBaseTest): <NEW_LINE> <INDENT> def test_date_1904_01(self): <NEW_LINE> <INDENT> self.run_lua_test('test_date_1904_01') <NEW_LINE> <DEDENT> def test_date_1904_02(self): <NEW_LINE> <INDENT> self.run_lua_test('test_date_1904_02') <NEW_LINE> <DEDENT> def test_date_1904_03(self... | Test file created with xlsxwriter.lua against a file created by Excel.
These tests check date writing functions. | 6259904fbe383301e0254ca5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.