code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class StageStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> NONE = "None" <NEW_LINE> IN_PROGRESS = "InProgress" <NEW_LINE> SUCCEEDED = "Succeeded" <NEW_LINE> FAILED = "Failed" <NEW_LINE> CANCELLED = "Cancelled" <NEW_LINE> CANCELLING = "Cancelling"
Stage status.
62598ee54f88993c371ef82a
class CustomCommonMiddleware(CommonMiddleware): <NEW_LINE> <INDENT> def process_response(self, request, response): <NEW_LINE> <INDENT> if response.status_code == 404: <NEW_LINE> <INDENT> if settings.SEND_BROKEN_LINK_EMAILS and not settings.DEBUG: <NEW_LINE> <INDENT> domain = request.get_host() <NEW_LINE> referer = requ...
Adds the current user to the 405 email.
62598ee5cad5886f8bdc3989
class Sectnum(Directive): <NEW_LINE> <INDENT> option_spec = {'depth': int, 'start': int, 'prefix': directives.unchanged_required, 'suffix': directives.unchanged_required} <NEW_LINE> def run(self): <NEW_LINE> <INDENT> pending = nodes.pending(SectNum) <NEW_LINE> pending.details.update(self.options) <NEW_LINE> self.state_...
Automatic section numbering.
62598ee526068e7796d4afe4
class TestPitch(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.new_user = User(name = "papi") <NEW_LINE> self.new_pitch = Pitch(title = "pitched", user = self.new_user) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> Pitch.query.delete() <NEW_LINE> User.query.delete() <NEW...
This is the class which we will use to do tests for the Pitch
62598ee53eb6a72ae0388ccb
class BinFormRecord(abc_resource_records.BinFormRecord, osid_records.OsidRecord): <NEW_LINE> <INDENT> pass
A record for a ``BinForm``. The methods specified by the record type are available through the underlying object.
62598ee521bff66bcd7212db
class BeamSearchOutput(NamedTuple( "BeamSearchOutput", [("last_search_step_output", SearchResults), ("last_dec_loop_state", NamedTuple), ("last_search_state", SearchState), ("attention_loop_states", List[Any])])): <NEW_LINE> <INDENT> pass
The final structure that is returned from the while loop. Attributes: last_search_step_output: A populated ``SearchResults`` object. last_dec_loop_state: Final loop state of the underlying decoder. last_search_state: Final loop state of the beam search decoder. attention_loop_states: The final loop sta...
62598ee5be8e80087fbbd6d6
class DiagonalModuleMorphism(ModuleMorphismByLinearity): <NEW_LINE> <INDENT> def __init__(self, diagonal, domain, codomain = None, category = None): <NEW_LINE> <INDENT> assert codomain is not None <NEW_LINE> assert domain.basis().keys() == codomain.basis().keys() <NEW_LINE> assert domain.base_ring() == codomain.base...
A class for diagonal module morphisms. See :meth:`ModulesWithBasis.ParentMethods.module_morphism`. INPUT: - ``domain``, ``codomain`` -- two modules with basis `F` and `G`, respectively - ``diagonal`` -- a function `d` Assumptions: - ``domain`` and ``codomain`` have the same base ring `R`, - their respective base...
62598ee5a17c0f6771d5a8dc
class Goal(base.APIBase): <NEW_LINE> <INDENT> uuid = types.uuid <NEW_LINE> name = wtypes.text <NEW_LINE> display_name = wtypes.text <NEW_LINE> efficacy_specification = wtypes.wsattr(types.jsontype, readonly=True) <NEW_LINE> links = wsme.wsattr([link.Link], readonly=True) <NEW_LINE> def __init__(self, **kwargs): <NEW_LI...
API representation of a goal. This class enforces type checking and value constraints, and converts between the internal object model and the API representation of a goal.
62598ee545492302aabfab35
class Solution: <NEW_LINE> <INDENT> def longestIncreasingSubsequence(self, nums): <NEW_LINE> <INDENT> ret = 0 <NEW_LINE> if nums: <NEW_LINE> <INDENT> caches = [0] * len(nums) <NEW_LINE> caches[0] = 1 <NEW_LINE> for i in xrange(1, len(nums)): <NEW_LINE> <INDENT> _len = 0 <NEW_LINE> for j in xrange(i): <NEW_LINE> <INDENT...
@param nums: The integer array @return: The length of LIS (longest increasing subsequence)
62598ee5f7d966606f746679
class UrlTarget: <NEW_LINE> <INDENT> def __init__(self, key: str, value: str) -> None: <NEW_LINE> <INDENT> if not isinstance(key, str): <NEW_LINE> <INDENT> raise TypeError('Key must be of type `str`') <NEW_LINE> <DEDENT> value = str(value) <NEW_LINE> self.key = key <NEW_LINE> self.value = value <NEW_LINE> return <NEW_L...
Internal class handling individual url parameter components
62598ee5498bea3a75a561bf
class ParentProperties(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'sync_properties': {'required': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'sync_properties': {'key': 'syncProperties', 'type': 'SyncProperties'}, } <NEW_LINE> def __init__( self, *, sync_properties: ...
The properties of the connected registry parent. All required parameters must be populated in order to send to Azure. :ivar id: The resource ID of the parent to which the connected registry will be associated. :vartype id: str :ivar sync_properties: Required. The sync properties of the connected registry with its par...
62598ee5e1aae11d1e7cdb83
class getLoginActorContext_result(object): <NEW_LINE> <INDENT> def __init__(self, success=None, e=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> self.e = e <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTran...
Attributes: - success - e
62598ee557b8e32f52507449
class TranslatableHtml(BaseTranslatableObject): <NEW_LINE> <INDENT> _value_key_name = 'html' <NEW_LINE> _value_schema = Html.get_schema() <NEW_LINE> default_value = { 'contentId': None, 'html': '', }
Class for translatable HTML strings.
62598ee5e5267d203ee69f8f
class CustomBackend(ModelBackend): <NEW_LINE> <INDENT> def authenticate(self, request, username=None, password=None, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> user = UserProfile.objects.get(Q(username=username) | Q(email=username) | Q(mobile=username)) <NEW_LINE> if user.check_password(password): <NEW_LIN...
自定义登录验证
62598ee5aad79263cf42ce93
class TestInterface(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> app.config['TESTING'] = True <NEW_LINE> app.config['WTF_CSRF_ENABLED'] = False <NEW_LINE> self.app = app.test_client() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_index_get(...
Unity tests for interface. Tests are covering all 3 resources: Hotel, City and Home.
62598ee544b2445a339b5cac
class Provider(with_metaclass(ABCMeta)): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def missing_env_vars_to_configure(self, requirement, environ, local_state_file): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def missing_env_vars_to_provide(self, requirement, environ, local_state_file): ...
A Provider can take some action to meet a Requirement.
62598ee5fff4ab517ebcbe61
class Food(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=200) <NEW_LINE> nutriscore = models.CharField(max_length=1) <NEW_LINE> url = models.URLField(max_length=250) <NEW_LINE> url_picture = models.URLField(max_length=250) <NEW_LINE> fat_100g = models.DecimalField(max_digits=5, decimal_places=2)...
Create Food model
62598ee5dd821e528d6d75ce
class CourseAdmin(object): <NEW_LINE> <INDENT> __courses = None <NEW_LINE> def __init__(self, teachers): <NEW_LINE> <INDENT> self.courses = [] <NEW_LINE> self.teachers = teachers <NEW_LINE> <DEDENT> def __fetch_name(self): <NEW_LINE> <INDENT> self.name = input('课程名称:').strip() <NEW_LINE> <DEDENT> def __fetch_for_pay(se...
课程信息管理
62598ee58e7ae83300ee7718
class Consumer(QThread): <NEW_LINE> <INDENT> def __init__(self, bucket, *args): <NEW_LINE> <INDENT> super().__init__(*args) <NEW_LINE> self.runs = 0 <NEW_LINE> self.bucket = bucket <NEW_LINE> self.consumption_list = [] <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> while self.runs < self.bucket.max_size: <NEW_L...
Consumer thread
62598ee56e29344779afecba
class TempSensorComponent(temp_sensor.TemperatureSensor): <NEW_LINE> <INDENT> def __init__(self, scale, clock, data, reset): <NEW_LINE> <INDENT> temp_sensor.TemperatureSensor.__init__(self, clock, data, reset) <NEW_LINE> self.scale = scale <NEW_LINE> self.__isPolling = False <NEW_LINE> self.__lastTemp = 0.0 <NEW_LINE> ...
A component that is an abstraction of a temperature sensor device.
62598ee57d847024c075aa58
class TestRateConversions(unittest.TestCase): <NEW_LINE> <INDENT> def test_size_change(self): <NEW_LINE> <INDENT> g = 100 <NEW_LINE> Ne = 1024 <NEW_LINE> new_size = 512 <NEW_LINE> event = msprime.PopulationParametersChange( time=g, initial_size=new_size) <NEW_LINE> ll_event = { "type": "population_parameters_change", "...
Tests for the demographic events interface.
62598ee556b00c62f0fb0f59
class AttemptMixin(object): <NEW_LINE> <INDENT> user_input = sa.Column(sa.Unicode(512), nullable=False) <NEW_LINE> datetime_utc = sa.Column(ArrowType, nullable=False, default=arrow.utcnow, server_default=dbutils.utcnow()) <NEW_LINE> attempt_type = sa.Column(AttemptType.db_type()) <NEW_LINE> is_during_lockout = sa.Colum...
Generic mixin for logging user login attempts.
62598ee5f9cc0f698b1c4613
class RequestOptions(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'x_ms_client_request_id': {'key': 'x-ms-client-request-id', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(RequestOptions, self).__init__(**kwargs) <NEW_LINE> self.x_ms_client_request_id = kw...
Parameter group. :ivar x_ms_client_request_id: The tracking ID sent with the request to help with debugging. :vartype x_ms_client_request_id: str
62598ee56fb2d068a7693168
class SharedComputeEnvironment(SimpleComputeEnvironment, ComputeEnvironment): <NEW_LINE> <INDENT> def __init__(self, job_io: JobIO, job: Job): <NEW_LINE> <INDENT> self.job_io = job_io <NEW_LINE> self.job = job <NEW_LINE> <DEDENT> def get_file_sources_dict(self): <NEW_LINE> <INDENT> return self.job_io.file_sources_dict ...
Default ComputeEnvironment for job and task wrapper to pass to ToolEvaluator - valid when Galaxy and compute share all the relevant file systems.
62598ee530bbd722464682c2
class Bootstrap4Collapse(CMSPlugin): <NEW_LINE> <INDENT> siblings = models.CharField( verbose_name=_('Siblings'), default='.card', max_length=255, help_text=_('Element to be used to create accordions.'), ) <NEW_LINE> tag_type = TagTypeField() <NEW_LINE> attributes = AttributesField( excluded_keys=['id'] ) <NEW_LINE> de...
Component > "Collapse" Plugin https://getbootstrap.com/docs/4.0/components/collapse/
62598ee5435de62698e9a460
class SetRemoteAddrMiddleware(object): <NEW_LINE> <INDENT> def process_request(self, request): <NEW_LINE> <INDENT> if 'HTTP_X_FORWARDED_FOR' in request.META: <NEW_LINE> <INDENT> request.META['REMOTE_ADDR'] = request.META['HTTP_X_FORWARDED_FOR'] <NEW_LINE> <DEDENT> elif 'HTTP_X_REAL_IP' in request.META: <NEW_LINE> <INDE...
Set REMOTE_ADDR behind proxy. Uses X-Forwarded-For and X-Real-IP, in that order.
62598ee5097d151d1a2bf6aa
class Engine(object): <NEW_LINE> <INDENT> ENGINE_PATH = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.opts = {} <NEW_LINE> self.type = False <NEW_LINE> self._set_base_options() <NEW_LINE> <DEDENT> def set_type(self, type): <NEW_LINE> <INDENT> self.type = type <NEW_LINE> <DEDENT> def _set_base_options(sel...
Generic Engine class for all engines to extend from, overloading wherever they need to
62598ee54e4d562566370aa3
class SentrySearchQuerySet(SearchQuerySet): <NEW_LINE> <INDENT> def __getitem__(self, k): <NEW_LINE> <INDENT> result = [] <NEW_LINE> for r in super(SentrySearchQuerySet, self).__getitem__(k): <NEW_LINE> <INDENT> inst = r.object <NEW_LINE> if not inst: <NEW_LINE> <INDENT> continue <NEW_LINE> <DEDENT> inst.score = r.scor...
Returns actual instances rather than search results.
62598ee532920d7e50bc46b7
@implementer(IProduct) <NEW_LINE> class Product(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=100)
DB model for single product.
62598ee5656771135c487d1e
class QLegendWidget(QtGui.QWidget): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> QtGui.QWidget.__init__(self, parent) <NEW_LINE> self.gridLayout = QtGui.QGridLayout(self) <NEW_LINE> self.gridLayout.setMargin(10) <NEW_LINE> self.gridLayout.setSpacing(10) <NEW_LINE> self.setFont(CurrentTheme.V...
QLegendWindow contains a list of QLegendBox and its description
62598ee599fddb7c1ca6214a
class AsyncOrSyncIterable(metaclass=_AsyncOrSyncIterableMeta): <NEW_LINE> <INDENT> pass
Allows bracketed choices of types to be given to the `Iterable` & `AsyncIterable` type hinters.
62598ee563b5f9789fe837e7
@EnableDebugWindow <NEW_LINE> class DrupalModulesScan(Transform): <NEW_LINE> <INDENT> input_type = NettackerScan <NEW_LINE> def do_transform(self, request, response, config): <NEW_LINE> <INDENT> scan_request = request.entity <NEW_LINE> scan_id = "".join(random.choice("0123456789abcdef") for x in range(32)) <NEW_LINE> s...
TODO: Your transform description.
62598ee5851cf427c66b695b
class ManualTrustStore(AbstractPKI, SignatureMixin): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def _aggregate_pem_string(f): <NEW_LINE> <INDENT> line = f.readline() <NEW_LINE> if line not in ACCEPTABLE_PREFIXES: <NEW_LINE> <INDENT> raise TrustStoreCreationException( 'Public key improperly formatted: no BEGIN PUBLIC ...
Uses a manually populated file to provide a static list of users and their keys.
62598ee5cc0a2c111447968d
class Orientation(messages.Message): <NEW_LINE> <INDENT> id = messages.StringField(1) <NEW_LINE> name = messages.StringField(2) <NEW_LINE> tags = messages.StringField(3, repeated=True)
A Orientation object. Fields: id: A string attribute. name: A string attribute. tags: A string attribute.
62598ee55166f23b2e241a61
class Channel(SubSystem): <NEW_LINE> <INDENT> CHANNEL_ID: ClassVar[str] = 'ch_id' <NEW_LINE> def __init__(self, parent: AbstractHasFeatures, id: Any, **kwargs) -> None: <NEW_LINE> <INDENT> super().__init__(parent, **kwargs) <NEW_LINE> self.id = id <NEW_LINE> <DEDENT> def default_get_feature(self, feat: AbstractFeature,...
Channels are used to represent instrument channels identified by a id (a number generally). They are similar to SubSystems in that they expose a part of the instrument capabilities but multiple instances of the same channel can exist at the same time under the condition that they have different ids. By default channe...
62598ee5090684286d592a25
class AsciiCastV2Event(AsciiCastV2Record, _AsciiCastV2Event): <NEW_LINE> <INDENT> types = { 'time': (int, float), 'event_type': (str,), 'event_data': (str,), 'duration': (type(None), int, float), } <NEW_LINE> def __new__(cls, *args, **kwargs): <NEW_LINE> <INDENT> self = super(AsciiCastV2Event, cls).__new__(cls, *args, ...
Event record time: Time elapsed since the beginning of the recording in seconds event_type: Type 'o' if the data was captured on the standard output of the terminal, type 'i' if it was captured on the standard input event_data: Data captured during the recording duration: Duration of the event in seconds (...
62598ee5be383301e0251e64
class DeviceChanel(object): <NEW_LINE> <INDENT> value_range = None <NEW_LINE> last_value = 0 <NEW_LINE> def __init__(self, value_range): <NEW_LINE> <INDENT> self.value_range = value_range <NEW_LINE> <DEDENT> def set_value(self, value): <NEW_LINE> <INDENT> if value < self.value_range[0]: <NEW_LINE> <INDENT> value = self...
Petite classe permettant de stocker en plus de la derniere valeur, l'interval de valeurs possibles.
62598ee576e4537e8c3edc43
class CompilerProxyManager(object): <NEW_LINE> <INDENT> def __init__(self, goma_ctl_path, port, kill=False, api_key_file=None, service_account_file=None): <NEW_LINE> <INDENT> mod_name, _ = os.path.splitext(_GOMA_CTL) <NEW_LINE> self._module = imp.load_source(mod_name, os.path.join(goma_ctl_path, _GOMA_CTL)) <NEW_LINE> ...
Compiler proxy management class. This class should be used with 'with' statement. This will automatically start compiler proxy when entering into with statement, and automatically kill the compiler proxy when exiting from with statement.
62598ee585dfad0860cbedad
@parsleyfy <NEW_LINE> class PatientAdmitForm(models.ModelForm): <NEW_LINE> <INDENT> model = AdmissionInfo <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(PatientAdmitForm, self).__init__(*args, **kwargs) <NEW_LINE> self.helper = FormHelper() <NEW_LINE> self.helper.form_class = 'form-horizontal...
Name: PatientAdmitForm AdmitPatient is the form for admitting a patient to a hospital. This form will only allow the user to chose the hospital and the reason why the patient is in the hospital. All other fields will be set in the view.
62598ee56aa9bd52df0d353b
class GPanelInset(GPanel): <NEW_LINE> <INDENT> def __init__(self, parent, width, height, color=0, x=0, y=0): <NEW_LINE> <INDENT> GPanel.__init__(self, parent, width, height, color=color, x=0, y=0) <NEW_LINE> <DEDENT> def _determineBaseImage(self, color): <NEW_LINE> <INDENT> if color == GPanel.BROWN: <NEW_LINE> <INDENT>...
Un encart, utile pour mettre à l'intérieur d'un panel
62598ee501c39578d7f11434
class PDFMixin(object): <NEW_LINE> <INDENT> def render_to_response(self, context, **response_kwargs): <NEW_LINE> <INDENT> import ho.pisa as pisa <NEW_LINE> response = super(PDFMixin, self).render_to_response(context, **response_kwargs) <NEW_LINE> response.render() <NEW_LINE> result = StringIO.StringIO() <NEW_LINE> pdf ...
Mixin that will change a class based view to render as PDF Dependencies: - reportlab - html5lib - pisa
62598ee592d797404e387ec0
class TableStruct(BaseStruct): <NEW_LINE> <INDENT> def __init__(self, curs, table_name): <NEW_LINE> <INDENT> BaseStruct.__init__(self, curs, table_name) <NEW_LINE> self.table_name = table_name <NEW_LINE> schema, name = skytools.fq_name_parts(table_name) <NEW_LINE> args = { 'schema': schema, 'table': name, 'fqname': sel...
Collects and manages all info about table. Allow to issue CREATE/DROP statements about any group of elements.
62598ee544b2445a339b5cad
class enable_grad(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.prev = torch.is_grad_enabled() <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> torch.set_grad_enabled(True) <NEW_LINE> <DEDENT> def __exit__(self, *args): <NEW_LINE> <INDENT> torch.set_grad_enabled(self.prev) <NEW_L...
Context-manager that enables gradient calculation. Enables gradient calculation inside a :class:`~no_grad` context. This has no effect outside of :class:`~no_grad`. Example:: >>> x = Variable(torch.Tensor([1]), requires_grad=True) >>> with torch.no_grad(): ... with torch.enable_grad(): ... y =...
62598ee57cff6e4e811b4078
class Poker(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.index = 0 <NEW_LINE> self.cards = [Card(suite, face) for suite in Suite for face in range(1, 14)] <NEW_LINE> <DEDENT> def shuffle(self): <NEW_LINE> <INDENT> self.index = 0 <NEW_LINE> random.shuffle(self.cards) <NEW_LINE> <DEDENT> def deal(s...
扑克
62598ee5e76e3b2f99fd70c3
class expandable_chain: <NEW_LINE> <INDENT> __slot__ = ("iterables", "__weakref__") <NEW_LINE> def __init__(self, *iterables): <NEW_LINE> <INDENT> self.iterables = deque() <NEW_LINE> self.extend(iterables) <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def __next__(self): <N...
chained iterables, with the ability to add new iterables to the chain as long as the instance hasn't raised StopIteration already. This is fairly useful for implementing queues of things that must be processed. >>> from snakeoil.iterables import expandable_chain >>> l = range(5) >>> i = expandable_chain(l) >>> print(...
62598ee5435de62698e9a461
class TestQuantityArrayCopy(object): <NEW_LINE> <INDENT> def test_copy_on_creation(self): <NEW_LINE> <INDENT> v = np.arange(1000.) <NEW_LINE> q_nocopy = u.Quantity(v, "km/s", copy=False) <NEW_LINE> q_copy = u.Quantity(v, "km/s", copy=True) <NEW_LINE> v[0] = -1. <NEW_LINE> assert q_nocopy[0].value == v[0] <NEW_LINE> ass...
Test whether arrays are properly copied/used in place
62598ee5fff4ab517ebcbe64
class FluNearYouSensor(CoordinatorEntity): <NEW_LINE> <INDENT> def __init__(self, coordinator, config_entry, sensor_type, name, icon, unit): <NEW_LINE> <INDENT> super().__init__(coordinator) <NEW_LINE> self._attrs = {ATTR_ATTRIBUTION: DEFAULT_ATTRIBUTION} <NEW_LINE> self._config_entry = config_entry <NEW_LINE> self._ic...
Define a base Flu Near You sensor.
62598ee58da39b475be01836
class Webinar(object): <NEW_LINE> <INDENT> swagger_types = { } <NEW_LINE> attribute_map = { } <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.discriminator = None <NEW_LINE> <DEDENT> def to_dict(self): <NEW_LINE> <INDENT> result = {} <NEW_LINE> for attr, _ in six.iteritems(self.swagger_types): <NEW_LINE> <INDEN...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598ee532920d7e50bc46b8
class BppPhylOmics(CMakePackage): <NEW_LINE> <INDENT> homepage = "http://biopp.univ-montp2.fr/wiki/index.php/Installation" <NEW_LINE> url = "https://github.com/BioPP/bpp-phyl-omics/archive/v2.4.1.tar.gz" <NEW_LINE> version('2.4.1', sha256='fb0908422e59c71065db874e68d5c71acddf66d8a51776f7e04a5f8d5f0f6577') <NEW_LIN...
Bio++ Phylogenetic Omics Library
62598ee5a79ad161977686a4
class LispError(Exception): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.msg = "Error in code"
Generic Lisp interpretation error
62598ee58e7ae83300ee771b
class SearchForm(forms.Form): <NEW_LINE> <INDENT> LIMITS = ( ('10', '10'), ('20', '20'), ('50', '50'), ('100', '100'), ) <NEW_LINE> q = forms.CharField(max_length=64) <NEW_LINE> anywhere = forms.BooleanField(required=False, initial=False) <NEW_LINE> limit = forms.TypedChoiceField(choices=LIMITS, coerce=int, required=Fa...
Generalized search-form
62598ee5462c4b4f79dba086
class Stats(models.Model): <NEW_LINE> <INDENT> backend = models.ForeignKey( "Backend", on_delete=models.PROTECT, related_name="stats" ) <NEW_LINE> api_last_seen = models.DateTimeField(null=True, blank=True) <NEW_LINE> url = models.TextField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> unique_together = ["backend", "url...
This holds per-Backend, per-URL API statistics.
62598ee53539df3088eca93e
class ExpectimaxAgent(MultiAgentSearchAgent): <NEW_LINE> <INDENT> def getAction(self, gameState): <NEW_LINE> <INDENT> return self.calcValue(gameState, 0, 0)[1] <NEW_LINE> <DEDENT> def calcValue(self, state, agent, depth): <NEW_LINE> <INDENT> isMaximizingAgent = False <NEW_LINE> if agent == 0: <NEW_LINE> <INDENT> isMaxi...
Your expectimax agent (question 4)
62598ee530bbd722464682c4
class SelectorCV(ModelSelector): <NEW_LINE> <INDENT> def select(self): <NEW_LINE> <INDENT> warnings.filterwarnings("ignore", category=DeprecationWarning) <NEW_LINE> score = float('-inf') <NEW_LINE> best_n = self.n_constant <NEW_LINE> if(len(self.sequences) > 1): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> fold = KFold...
select best model based on average log Likelihood of cross-validation folds
62598ee6a8ecb0332586f874
class UtmpxSessionFormatterTest(test_lib.EventFormatterTestCase): <NEW_LINE> <INDENT> def testInitialization(self): <NEW_LINE> <INDENT> event_formatter = utmpx.UtmpxSessionFormatter() <NEW_LINE> self.assertNotEqual(event_formatter, None) <NEW_LINE> <DEDENT> def testGetFormatStringAttributeNames(self): <NEW_LINE> <INDEN...
Tests for the UTMP session event formatter.
62598ee6a8370b77170eea6f
class DumbMockImporter(object): <NEW_LINE> <INDENT> json_to_db_id = {} <NEW_LINE> def resolve_json_id(self, json_id, allow_no_match=False): <NEW_LINE> <INDENT> return json_id
this is a mock importer that implements a resolve_json_id that is just a pass-through
62598ee6097d151d1a2bf6ac
class OsInterfaceFactory(BaseOsFactory): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__oses = {} <NEW_LINE> <DEDENT> def create(self, osname): <NEW_LINE> <INDENT> osname = self.intersect_and_solve(osname, self.get_platforms()) <NEW_LINE> return self.__oses.get(osname, None) <NEW_LINE> <DEDENT> def ...
Factory class that manages OsInterfaces.
62598ee62ae34c7f260a9773
class DeleteLinkPair(BaseSequence): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._controller_device = None <NEW_LINE> self._responder_device = None <NEW_LINE> self._controller_key = None <NEW_LINE> self._responder_key = None <NEW_LINE> <DEDENT> def set_controller_device...
Deletes the link pair from the devices
62598ee667a9b606de54465a
class SchemaNotFound(InspireSchemasException): <NEW_LINE> <INDENT> def __init__(self, schema): <NEW_LINE> <INDENT> message = 'Unable to find schema "{}"'.format( schema) <NEW_LINE> super(SchemaNotFound, self).__init__(message)
Exception raised on missing schema.
62598ee68c0ade5d55dc29c9
class ClientInformation(rdf_structs.RDFProtoStruct): <NEW_LINE> <INDENT> protobuf = jobs_pb2.ClientInformation
The GRR client information.
62598ee64e4d562566370aa5
class UserViewSet(mixins.CreateModelMixin, mixins.UpdateModelMixin, mixins.RetrieveModelMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> queryset = User.objects.all() <NEW_LINE> authentication_classes = (JSONWebTokenAuthentication, SessionAuthentication) <NEW_LINE> def get_serializer_class(self): <NEW_LINE> <INDENT...
用户
62598ee63d592f4c4edb9581
class Bond: <NEW_LINE> <INDENT> def __init__(self, at1, at2, r_ij, r_eq, k_b): <NEW_LINE> <INDENT> self.SetAt1(at1) <NEW_LINE> self.SetAt2(at2) <NEW_LINE> self.SetRij(r_ij) <NEW_LINE> self.SetReq(r_eq) <NEW_LINE> self.SetKb(k_b) <NEW_LINE> self.GetEnergy() <NEW_LINE> self.GetGradient() <NEW_LINE> <DEDENT> def SetAt1(se...
Bond class for bond geometry and parameter data. Initialize attributes to specified argument values. Change by calling appropriate 'Set[Param]' function. Args / Attributes: at1 (int): Atom1 atomic index in Molecule. at2 (int): Atom2 atomic index in Molecule. r_ij (float): Distance [Angstrom] between at1 and at2...
62598ee607f4c71912badae0
class ShortPathDirnameTest(unittest.TestCase): <NEW_LINE> <INDENT> def testShortPathDirname(self): <NEW_LINE> <INDENT> path = pkg_bzl._short_path_dirname(File('foo/bar/baz')) <NEW_LINE> self.assertEqual('foo/bar', path) <NEW_LINE> <DEDENT> def testTopLevel(self): <NEW_LINE> <INDENT> path = pkg_bzl._short_path_dirname(F...
Testing for _short_path_dirname.
62598ee6498bea3a75a561c2
class RSSCrawlCompare(object): <NEW_LINE> <INDENT> log = None <NEW_LINE> cfg = None <NEW_LINE> delta_time = None <NEW_LINE> database = None <NEW_LINE> conn = None <NEW_LINE> cursor = None <NEW_LINE> compare_versions = ("SELECT * FROM CurrentVersions WHERE url=%s") <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self...
Compares the item's age to the current version in the DB. If the difference is greater than delta_time, then save the newer version.
62598ee64f88993c371ef82c
class Programme(Named, Described): <NEW_LINE> <INDENT> def __init__(self, crid, shortcrid, recommendation=False, version=1): <NEW_LINE> <INDENT> Named.__init__(self) <NEW_LINE> Described.__init__(self) <NEW_LINE> self.crid = crid <NEW_LINE> self.shortcrid = int(shortcrid) <NEW_LINE> self.version = version <NEW_LINE> se...
Describes and locates a programme. :param crid: Full Crid :type crid: str :param shortcrid: Short Crid :type shortcrid: int :param onair: True to flag as a recommended programme :type onair: bool :param version: Programme metadata version :type version: int
62598ee6bd1bec0571e14411
class ElementQuad0(ElementH1): <NEW_LINE> <INDENT> interior_dofs = 1 <NEW_LINE> maxdeg = 0 <NEW_LINE> dofnames = ['u'] <NEW_LINE> doflocs = np.array([[.5, .5]]) <NEW_LINE> refdom = RefQuad <NEW_LINE> def lbasis(self, X, i): <NEW_LINE> <INDENT> if i == 0: <NEW_LINE> <INDENT> return np.ones(X.shape[1:]), np.zeros_like(X)...
Piecewise constant element.
62598ee601c39578d7f11435
class QMultipleChoiceWidget(QtWidgets.QWidget): <NEW_LINE> <INDENT> def __init__(self, buttonDictionary, parent=None): <NEW_LINE> <INDENT> super().__init__(parent) <NEW_LINE> if len(buttonDictionary) == 0: <NEW_LINE> <INDENT> raise Exception("The buttonDictionary argument can not be empty") <NEW_LINE> <DEDENT> self.set...
A dynamically populated widget with buttons that link to functions. Great if you need to provide the user with multiple choices that are unique to each other.
62598ee6a219f33f346c4ec5
class OptionWarning(Warning): <NEW_LINE> <INDENT> pass
Warning about option values
62598ee6236d856c2adc875a
class Audience(Base): <NEW_LINE> <INDENT> def __init__(self, id=None, **kwargs): <NEW_LINE> <INDENT> super(Audience, self).__init__(**kwargs) <NEW_LINE> self.id = id
Audience. https://developers.line.biz/en/reference/messaging-api/#update-upload-audience-group
62598ee67b25080760ed5b26
class Cwf: <NEW_LINE> <INDENT> def __init__(self,node=None,type='NAF'): <NEW_LINE> <INDENT> self.type = type <NEW_LINE> if node is None: <NEW_LINE> <INDENT> self.node = etree.Element('wf') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.node = node <NEW_LINE> <DEDENT> <DEDENT> def get_node(self): <NEW_LINE> <INDENT>...
This class represents a single token (NAF/KAF wf object)
62598ee6d486a94d0ba2a659
class AccountEndpoint(base_api.BaseAPI): <NEW_LINE> <INDENT> exposed = True <NEW_LINE> @tools.json_out() <NEW_LINE> def POST(self, **kwargs): <NEW_LINE> <INDENT> response = { "meta": { "status": True, "verbose": "Ok" }, "content": None } <NEW_LINE> username = kwargs.pop("username", None) <NEW_LINE> password = kwargs.po...
User EndPoint for AsciiPic.
62598ee6f548e778e5969c21
class BotoHttpConnection(Connection): <NEW_LINE> <INDENT> connection = None <NEW_LINE> def __init__(self, host='localhost', port=443, aws_access_key_id=None, aws_secret_access_key=None, region=None, **kwargs): <NEW_LINE> <INDENT> super(BotoHttpConnection, self).__init__(host=host, port=port, **kwargs) <NEW_LINE> connec...
Uses AWS configured connection to sign requests before they're sent to elasticsearch nodes.
62598ee6be383301e0251e66
class TableDetailAPI(Resource): <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> self.client = get_proxy_client() <NEW_LINE> <DEDENT> @swag_from('swagger_doc/table/detail_get.yml') <NEW_LINE> def get(self, table_uri: str) -> Iterable[Union[Mapping, int, None]]: <NEW_LINE> <INDENT> try: <NEW_LINE> <IN...
TableDetail API
62598ee6cc0a2c1114479690
@GlueDataCatalog.filter_registry.register('glue-security-config') <NEW_LINE> class GlueCatalogEncryptionFilter(GlueCatalogEncryptionEnabled): <NEW_LINE> <INDENT> pass
Filter glue catalog by its glue encryption status and KMS key :example: .. code-block:: yaml policies: - name: glue-catalog-security-config resource: aws.glue-catalog filters: - type: glue-security-config SseAwsKmsKeyId: alias/aws/glue
62598ee6627d3e7fe0e05515
class ClickGroup(click.Group): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.overflow = None <NEW_LINE> if 'help' in kwargs and kwargs['help'] and '\f' in kwargs['help']: <NEW_LINE> <INDENT> kwargs['help'] = kwargs['help'].split('\f', 1)[0] <NEW_LINE> <DEDENT> super(ClickGroup, self)...
Truncate docstrings at form-feed character and implement overflow arguments.
62598ee6009cb60464cffbdc
class ThreadedHTTPServer(ThreadingMixIn, HTTPServer): <NEW_LINE> <INDENT> pass
Handle requests in a separate thread. ******************************************* Note: that ThreadingMixIn must come before HTTPServer in the superclass list or this won't work as intended. *******************************************
62598ee62c8b7c6e89bd1e4d
class FakeRemoteClient(object): <NEW_LINE> <INDENT> missing_signal = "missing" <NEW_LINE> failing_signal = "failing" <NEW_LINE> random_exception = RandomException() <NEW_LINE> def callRemote(self, signal_name): <NEW_LINE> <INDENT> if signal_name == self.missing_signal: <NEW_LINE> <INDENT> return defer.fail(NoSuchMethod...
A fake RemoteClient.
62598ee6097d151d1a2bf6ad
class LimitExceededError(Exception): <NEW_LINE> <INDENT> pass
CPU has executed more instructions than allowed.
62598ee6d7e4931a7ef3a72b
class Registry(dict): <NEW_LINE> <INDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return super().__getitem__(key) <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> raise KeyError("Invalid store: {}".format(key)) <NEW_LINE> <DEDENT> <DEDENT> def __setitem__(self, key, value): <NEW...
Central registry for registration of functionality. Once a store (key) is defined, it cannot be overwritten or deleted (although its value may be manipulated).
62598ee656ac1b37e6300879
class WER_ModelCheckpoint(ModelCheckpoint): <NEW_LINE> <INDENT> def __init__(self, filepath, monitor='val_loss', verbose=0, save_best_only=False, save_weights_only=False, mode='auto', period=1, callback=None): <NEW_LINE> <INDENT> super().__init__(filepath=filepath, monitor=monitor, verbose=verbose, save_best_only=save_...
Ensures saving of training model is done every time the Word Error Rate (WER) improves. This allows the final saved model to be the best one according to the WER metric
62598ee699cbb53fe682f53e
class Codec(object): <NEW_LINE> <INDENT> def init(self, charset): <NEW_LINE> <INDENT> charset = sorted(list(set(charset))) <NEW_LINE> self.code2char = {} <NEW_LINE> self.char2code = {} <NEW_LINE> for code,char in enumerate(charset): <NEW_LINE> <INDENT> self.code2char[code] = char <NEW_LINE> self.char2code[char] = code ...
Translate between integer codes and characters.
62598ee6e5267d203ee69f93
class RESTTestCases(testing.BaseTestCase): <NEW_LINE> <INDENT> def test_untrusted_project_request_fails(self): <NEW_LINE> <INDENT> response = self.client.get( '/api/v1/ping', **{'HTTP_X_APPENGINE_INBOUND_APPID': 'some-other-app'}) <NEW_LINE> self.assertEquals(403, response.status_code) <NEW_LINE> <DEDENT> def test_trus...
Tests.
62598ee6dd821e528d6d75d2
@admin.register(models.ElvantoGroup) <NEW_LINE> class ElvantoGroupAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ( 'name', 'sync', 'e_id', 'last_synced', )
Admin class for apostello.models.ElvantoGroup.
62598ee66e29344779afecbe
class DescribeAssetWebLocationListResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Total = None <NEW_LINE> self.Locations = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Total = params.get("Total") <NEW_LINE> i...
DescribeAssetWebLocationList返回参数结构体
62598ee632920d7e50bc46ba
class DCRacksAPIView(ACLGateway, APIView): <NEW_LINE> <INDENT> def get_object(self, pk): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return DataCenter.objects.get(id=pk) <NEW_LINE> <DEDENT> except DataCenter.DoesNotExist: <NEW_LINE> <INDENT> raise Http404 <NEW_LINE> <DEDENT> <DEDENT> def get(self, request, data_center...
Return information of list rack in data center with their positions.
62598ee6f9cc0f698b1c4615
class MasteryLevel(models.Model): <NEW_LINE> <INDENT> level = models.PositiveIntegerField(null=True) <NEW_LINE> spell = models.ForeignKey(Spell, on_delete=models.CASCADE) <NEW_LINE> mastery = models.ForeignKey(Mastery, on_delete=models.CASCADE) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> unique_together = ('level', 'spe...
Generate the list of spelltables by domain|bloodline|etc / level
62598ee6d268445f26638ed5
class TestReportTestAction(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_type = Field("TestReportTestAction", const=True) <NEW_LINE> assert_fhir: fhirtypes.TestReportSetupActionAssertType = Field( None, alias="assert", title="The assertion performed", description="The results of the assertion performed...
Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. A test operation or assert that was performed. Action would contain either an operation or an assertion.
62598ee6462c4b4f79dba088
class Spam(Cog): <NEW_LINE> <INDENT> async def check(self, message): <NEW_LINE> <INDENT> async def check_rule(rule, func): <NEW_LINE> <INDENT> bucket = rule.get_bucket(self.redis, message.guild.id) <NEW_LINE> if not await bucket.check(message.author.id, func(message) if callable(func) else func): <NEW_LINE> <INDENT> ra...
Anti-spam plugin
62598ee6baa26c4b54d4d95c
class Pipeline(object): <NEW_LINE> <INDENT> def __init__(self, pipeline): <NEW_LINE> <INDENT> self.transforms = pipeline <NEW_LINE> names = [t.get_name() for t in self.transforms] <NEW_LINE> self.name = 'empty' if len(names) == 0 else '_'.join(names) <NEW_LINE> <DEDENT> def get_name(self): <NEW_LINE> <INDENT> return se...
A Pipeline is an object representing the data transformations to make on the input data, finally outputting extracted features. pipeline: List of transforms to apply one by one to the input data
62598ee666656f66f7d58a6e
class DaemonComponent(object): <NEW_LINE> <INDENT> def __init__(self, cls, cli_params=[], components_deps=[], debug_keys=[]): <NEW_LINE> <INDENT> self.cls = cls <NEW_LINE> self.cli_params = cli_params <NEW_LINE> self.components_deps = components_deps <NEW_LINE> lib.DEBUG_OPTIONS.update(debug_keys) <NEW_LINE> <DEDENT> d...
Top-level object that needs to be instantiated to create the daemon.
62598ee68e71fb1e983ba0f8
class ThesaurusKeyword(models.Model): <NEW_LINE> <INDENT> about = models.CharField(max_length=255, null=True, blank=True) <NEW_LINE> alt_label = models.CharField( max_length=255, default='', null=True, blank=True) <NEW_LINE> thesaurus = models.ForeignKey('Thesaurus', related_name='thesaurus') <NEW_LINE> def __unicode__...
Loadable thesaurus containing keywords in different languages
62598ee630bbd722464682c6
class ShotGun(Weapon): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Weapon.__init__(self) <NEW_LINE> self.ammo = 100 <NEW_LINE> self.rof = 25 <NEW_LINE> self.count = self.rof <NEW_LINE> <DEDENT> def fire(self,x,y,direction): <NEW_LINE> <INDENT> new_directions = [] <NEW_LINE> new_directions.append(addangl...
A shotgun. Has a much slower rate of fire and less ammo.
62598ee6a8370b77170eea71
class ConnectionCreateHandler(object): <NEW_LINE> <INDENT> generic_handlers = [] <NEW_LINE> unique_handlers = [] <NEW_LINE> def __call__(self, sender, connection, **kwargs): <NEW_LINE> <INDENT> handlers = set() <NEW_LINE> if len(self.unique_handlers) > 0: <NEW_LINE> <INDENT> handlers.update(self.unique_handlers) <NEW_L...
Generic connection handlers manager. Executes attached functions when connection is created. With possibility of attaching single execution methods.
62598ee6d58c6744b42db5fd
class WeakKey(SSLVulnerability): <NEW_LINE> <INDENT> DEFAULTS = SSLVulnerability.DEFAULTS.copy() <NEW_LINE> DEFAULTS["level"] = "high"
Weak SSL/TLS key detected.
62598ee64e4d562566370aa7
class UnitTestCase(TestCase): <NEW_LINE> <INDENT> def execute(self, command): <NEW_LINE> <INDENT> return main(command) <NEW_LINE> <DEDENT> def execute_wo_auth(self, command): <NEW_LINE> <INDENT> with mock.patch('fuelclient.client.Client.auth_required', new_callable=mock.PropertyMock) as auth: <NEW_LINE> <INDENT> auth.r...
Base test class which does not require nailgun server to run.
62598ee60a50d4780f703a38
class LinearSweepAlgorithm: <NEW_LINE> <INDENT> def get_instructions(self, cm, size, insn, idx): <NEW_LINE> <INDENT> self.odex = cm.get_odex_format() <NEW_LINE> max_idx = size * calcsize('H') <NEW_LINE> if max_idx > len(insn): <NEW_LINE> <INDENT> max_idx = len(insn) <NEW_LINE> <DEDENT> while idx < max_idx: <NEW_LINE> <...
This class is used to disassemble a method. The algorithm used by this class is linear sweep.
62598ee663b5f9789fe837eb
class Alert(base_frame_view.BaseFrameView): <NEW_LINE> <INDENT> alert_uiautomator = 'new UiSelector().resourceIdMatches(".+id/parentPanel")' <NEW_LINE> def __init__(self, parent, **kwargs): <NEW_LINE> <INDENT> super(Alert, self).__init__(parent) <NEW_LINE> if kwargs: <NEW_LINE> <INDENT> self._linear_layout = linear_lay...
Summary: 普通弹出框,比如退出登录时候的弹出框
62598ee607f4c71912badae2
class Level(object): <NEW_LINE> <INDENT> def __init__(self, map_image, viewport, player, mascara, playerCenter): <NEW_LINE> <INDENT> self.image = map_image <NEW_LINE> self.image = pygame.transform.scale(self.image, (ANCHO_PANTALLA*4, ALTO_PANTALLA*4)) <NEW_LINE> mascara = pygame.image.load(mascara).convert_alpha() <NEW...
A class for our map. Maps in this implementation are one image; not tile based. This makes collision detection simpler but can have performance implications.
62598ee6cb5e8a47e493b4c0
class SearchImage(BaseImage): <NEW_LINE> <INDENT> def matches(self, image): <NEW_LINE> <INDENT> for attr in ["release", "platform", "instance_type", "architecture", "region", "virtualization"]: <NEW_LINE> <INDENT> if getattr(self, attr) != getattr(image, attr): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> <DEDE...
An Image used to search for other images.
62598ee6eab8aa0e5d30a407
class ApiGetCronJobHandler(api_call_handler_base.ApiCallHandler): <NEW_LINE> <INDENT> args_type = ApiGetCronJobArgs <NEW_LINE> result_type = ApiCronJob <NEW_LINE> def Handle(self, args, token=None): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> cron_job = aff4_cronjobs.GetCronManager().ReadJob( str(args.cron_job_id), to...
Retrieves a specific cron job.
62598ee630bbd722464682c7