code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class BaseSourceManager(BaseManager): <NEW_LINE> <INDENT> SOURCE_CLASS = None <NEW_LINE> def __init__(self, job_manager, datasource_path="dataload.sources", *args, **kwargs): <NEW_LINE> <INDENT> super(BaseSourceManager,self).__init__(job_manager,*args,**kwargs) <NEW_LINE> self.conn = get_src_conn() <NEW_LINE> self.defa... | Base class to provide source management: discovery, registration
Actual launch of tasks must be defined in subclasses | 62599070cc0a2c111447c727 |
class MusicbrainzTrack(MusicbrainzResource): <NEW_LINE> <INDENT> __tablename__ = 'mbz_Tracks' <NEW_LINE> releases = Column('releases', String) <NEW_LINE> artist_credit = Column('artist_credit', String) <NEW_LINE> length = Column('length', Integer) <NEW_LINE> score = Column('score', String) <NEW_LINE> video = Column('vi... | [ Track resources in Musicbrainz ]
| 625990704e4d562566373cb3 |
class ClassDict: <NEW_LINE> <INDENT> def __init__(self, initdata=None): <NEW_LINE> <INDENT> self._dict = {} <NEW_LINE> if initdata is not None: <NEW_LINE> <INDENT> self._dict.update(initdata) <NEW_LINE> <DEDENT> <DEDENT> def __setattr__(self, key, value): <NEW_LINE> <INDENT> if key.startswith('_'): <NEW_LINE> <INDENT> ... | Dictionary like object accessible in class notation. | 62599070adb09d7d5dc0be18 |
class WhenSendingAnUnsupportedMethodToAttributeListView(TestCaseWithFixtureData): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpTestData(cls): <NEW_LINE> <INDENT> super(WhenSendingAnUnsupportedMethodToAttributeListView, cls).setUpTestData() <NEW_LINE> cls.client = APIClient() <NEW_LINE> cls.response = cls.client... | This class is to show that we expect to receive a bad request when trying to use an unsupported HTTP method | 62599070442bda511e95d9ae |
class DispatchTestHelperMixin(object): <NEW_LINE> <INDENT> def clear_message(self): <NEW_LINE> <INDENT> self.message = Message() <NEW_LINE> self.headers = [] <NEW_LINE> <DEDENT> def set_package_name(self, package_name): <NEW_LINE> <INDENT> self.package_name = package_name <NEW_LINE> self.add_header('To', '{package}@{pt... | A mixin containing methods to assist testing dispatch functionality. | 62599070be8e80087fbc093c |
@registry.register_model <NEW_LINE> class LSTMEncoder(t2t_model.T2TModel): <NEW_LINE> <INDENT> def body(self, features): <NEW_LINE> <INDENT> if self._hparams.initializer == "orthogonal": <NEW_LINE> <INDENT> raise ValueError("LSTM models fail with orthogonal initializer.") <NEW_LINE> <DEDENT> train = self._hparams.mode ... | LSTM encoder only. | 625990708da39b475be04a9b |
class Probe(Function): <NEW_LINE> <INDENT> title = "" <NEW_LINE> def __init__(self, title): <NEW_LINE> <INDENT> self.title = title <NEW_LINE> <DEDENT> def makeCircuit(self, circuit, port, vdd, slew, capa, config, polarity): <NEW_LINE> <INDENT> circuit.C("load_" + port, port, "gnd", capa * 1e-15) <NEW_LINE> circuit.R("l... | Identifies a port as output | 6259907023849d37ff852963 |
class CoerceExpr(Node): <NEW_LINE> <INDENT> expr = Undefined(Node) <NEW_LINE> target_type = Undefined('mypy.types.Type') <NEW_LINE> source_type = Undefined('mypy.types.Type') <NEW_LINE> is_wrapper_class = False <NEW_LINE> def __init__(self, expr: Node, target_type: 'mypy.types.Type', source_type: 'mypy.types.Type', is_... | Implicit coercion expression.
This is used only when compiling/transforming. These are inserted
after type checking. | 625990701f037a2d8b9e54c1 |
class Ethnicity(Field): <NEW_LINE> <INDENT> children = ('content', ) <NEW_LINE> def __init__(self, content=None, valid_since=None, inferred=None): <NEW_LINE> <INDENT> super(Ethnicity, self).__init__(valid_since, inferred) <NEW_LINE> self.content = content.lower() <NEW_LINE> <DEDENT> @property <NEW_LINE> def display(sel... | An ethnicity value.
The content will be a string with one of the following values (based on US census definitions):
'white', 'black', 'american_indian', 'alaska_native',
'chinese', 'filipino', 'other_asian', 'japanese',
'korean', 'viatnamese', 'native_hawaiian', 'guamanian',
'chamorro', 'samoan', 'other... | 6259907091f36d47f2231ae5 |
class SchedulePaged(Paged): <NEW_LINE> <INDENT> _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, 'current_page': {'key': 'value', 'type': '[Schedule]'} } <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(SchedulePaged, self).__init__(*args, **kwargs) | A paging container for iterating over a list of :class:`Schedule <azure.mgmt.devtestlabs.models.Schedule>` object | 6259907099fddb7c1ca63a29 |
class TryLink(Event): <NEW_LINE> <INDENT> def __init__(self,url,expectedTitle): <NEW_LINE> <INDENT> self.url = url <NEW_LINE> self.expectedTitle = expectedTitle | Used when trying an imdb (or any other source) link. This allows us to fetch the title | 625990705fc7496912d48ebf |
class DapricotConfig(SimpleDapricotConfig): <NEW_LINE> <INDENT> def ready(self): <NEW_LINE> <INDENT> super().ready() <NEW_LINE> self.module.autodiscover() | The default AppConfig for admin which does autodiscovery. | 62599070a8370b77170f1c77 |
class OrderedMultisetPartitionsIntoSets_n(OrderedMultisetPartitionsIntoSets): <NEW_LINE> <INDENT> def __init__(self, n): <NEW_LINE> <INDENT> self._n = n <NEW_LINE> OrderedMultisetPartitionsIntoSets.__init__(self, True) <NEW_LINE> <DEDENT> def _repr_(self): <NEW_LINE> <INDENT> return "Ordered Multiset Partitions into Se... | Ordered multiset partitions into sets of a fixed integer `n`. | 6259907099cbb53fe6832797 |
class TestModel_Resource(): <NEW_LINE> <INDENT> def test_resource_serialization(self): <NEW_LINE> <INDENT> resource_model_json = {} <NEW_LINE> resource_model_json['resource_id'] = 'testString' <NEW_LINE> resource_model_json['resource_type'] = 'testString' <NEW_LINE> resource_model = Resource.from_dict(resource_model_js... | Test Class for Resource | 625990700a50d4780f706a18 |
class DistributedSparseDispatcher(object): <NEW_LINE> <INDENT> def __init__(self, data_parallelism, expert_parallelism, gates): <NEW_LINE> <INDENT> self._gates = gates <NEW_LINE> self._dp = data_parallelism <NEW_LINE> self._ep = expert_parallelism <NEW_LINE> assert len(gates) == self._dp.n <NEW_LINE> self._dispatchers ... | A distributed version of SparseDispatcher.
Instead of one batch of input examples, we simultaneously process
a list of num_datashards batches of input examples. The per-expert
`Tensor`s contain a combination of examples from the different datashards.
Each datashard is associated with a particular device and each exp... | 62599070f548e778e596ce3b |
class Seasontology(Stream): <NEW_LINE> <INDENT> station_one = param.String(default=CMI, doc=STATION_ID) <NEW_LINE> station_two = param.String(default=MRY, doc=STATION_ID) <NEW_LINE> variable = param.ObjectSelector( default=list(VAR_RANGE.keys())[0], objects=list(VAR_RANGE.keys()), ) <NEW_LINE> data = param.Parameter(de... | Highest level function to run the interactivity
| 625990704a966d76dd5f0798 |
class B2MuMuMuMuLinesConf(LineBuilder) : <NEW_LINE> <INDENT> __configuration_keys__ = ('B2MuMuMuMuLinePrescale', 'B2MuMuMuMuLinePostscale', 'D2MuMuMuMuLinePrescale', 'D2MuMuMuMuLinePostscale' ) <NEW_LINE> config_default={ 'B2MuMuMuMuLinePrescale' : 1, 'B2MuMuMuMuLinePostscale' : 1, 'D2MuMuMuMuLinePrescale' : 1,... | Builder of:
...
Usage:
>>> config = { .... }
>>> bsConf = Bs2MuMuLinesConf('PrescaledBs2MuMuTest',config)
>>> bsLines = bsConf.lines
>>> for line in line :
>>> print line.name(), line.outputLocation()
The lines can be used directly to build a StrippingStream object.
Exports as instance data members:
selDefault ... | 62599070379a373c97d9a8ce |
class WorkerAvatar(ModuleAvatar, RSAAvatar): <NEW_LINE> <INDENT> popen = None <NEW_LINE> pid = None <NEW_LINE> key = None <NEW_LINE> version = None <NEW_LINE> args = None <NEW_LINE> workunits = None <NEW_LINE> main_worker = None <NEW_LINE> task_id = None <NEW_LINE> run_task_deferred = None <NEW_LINE> remote = None <NEW... | Class representing Workers for a Node. This class encapsulates everything
about a worker process and task. It also contains all functions that the
Worker is capable of calling | 6259907092d797404e3897b2 |
class VirtualWanVpnProfileParameters(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'vpn_server_configuration_resource_id': {'key': 'vpnServerConfigurationResourceId', 'type': 'str'}, 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, vpn_se... | Virtual Wan Vpn profile parameters Vpn profile generation.
:param vpn_server_configuration_resource_id: VpnServerConfiguration partial resource uri with
which VirtualWan is associated to.
:type vpn_server_configuration_resource_id: str
:param authentication_method: VPN client authentication method. Possible values in... | 62599070d268445f2663a7b4 |
class RetractCubeForTime(TimedCommand): <NEW_LINE> <INDENT> def __init__(self, timeoutInSeconds): <NEW_LINE> <INDENT> super().__init__('RetractCubeForTime', timeoutInSeconds) <NEW_LINE> self.requires(subsystems.claw) <NEW_LINE> <DEDENT> def initialize(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def execute(self... | Ejects a cube from the claw | 625990702ae34c7f260ac998 |
class DataModel: <NEW_LINE> <INDENT> def __init__( self, content="", language="", version="", knowledge=[], tokens=[], phrases=[], sentences=[], paragraphs=[], topics=[], main_sentences=[], main_phrases=[], main_lemmas=[], main_syncons=[], entities=[], categories=[], iptc={}, standard={}, ): <NEW_LINE> <INDENT> self._c... | This class can be considered the root of the data model structure.
All other classes are initialised from here. The ObjectMapper handles
the JSON contained in the API response to this class. Not all the
arguments might be valued. It depends on the type of document analysis
that was requested.
No intrigued logic is st... | 625990709c8ee82313040ddf |
class TestGitHubHandler(unittest.TestCase): <NEW_LINE> <INDENT> def test_init(self): <NEW_LINE> <INDENT> repo = GitHubHandler(url=TEST_REPO_BLOB_URL) <NEW_LINE> self.assertIsInstance(repo, GitHubHandler) <NEW_LINE> self.assertTrue(hasattr(repo, 'repository')) <NEW_LINE> self.assertTrue(hasattr(repo, 'user')) <NEW_LINE>... | Tests for GitHubHandler class. | 6259907038b623060ffaa4ab |
class Parameter(Component, sympy.Symbol): <NEW_LINE> <INDENT> def __new__(cls, name, value=0.0, _export=True): <NEW_LINE> <INDENT> return super(sympy.Symbol, cls).__new__(cls, name) <NEW_LINE> <DEDENT> def __getnewargs__(self): <NEW_LINE> <INDENT> return (self.name, self.value, False) <NEW_LINE> <DEDENT> def __init__(s... | Model component representing a named constant floating point number.
Parameters are used as reaction rate constants, compartment volumes and
initial (boundary) conditions for species.
Parameters
----------
value : number, optional
The numerical value of the parameter. Defaults to 0.0 if not specified.
The pro... | 6259907016aa5153ce401d88 |
class RecipeViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> serializer_class = serializers.RecipeSerializer <NEW_LINE> queryset = Recipe.objects.all() <NEW_LINE> authentication_classes = (TokenAuthentication,) <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> ... | Manage recipes in the database | 62599070796e427e53850027 |
class AvitoPhoneImgParser: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.num_img_list = dict() <NEW_LINE> logger.debug('Получаю список картинок цифр из папки "%s"', NUMBERS_DIR) <NEW_LINE> num_file_list = glob.glob("{}/*.png".format(NUMBERS_DIR)) <NEW_LINE> num_file_list = sorted(num_file_list) <NEW_... | Класс для разбора изображения номера телефона, который дает авито | 625990704c3428357761bb63 |
class Timeline(node.Node): <NEW_LINE> <INDENT> def __init__(self, attrs): <NEW_LINE> <INDENT> super(Timeline, self).__init__("Timeline") <NEW_LINE> self.fps = attrs.getValue("fps") <NEW_LINE> self.resources_acquisition = attrs.getValue("resources_acquisition") <NEW_LINE> self.size = attrs.getValue("size") <NEW_LINE> se... | Stores informations about Timeline in the xar format
| 62599070283ffb24f3cf5158 |
class StandardBars(BaseBars): <NEW_LINE> <INDENT> def __init__(self, metric: str, threshold: int = 50000, batch_size: int = 20000000): <NEW_LINE> <INDENT> BaseBars.__init__(self, metric, batch_size) <NEW_LINE> self.threshold = threshold <NEW_LINE> <DEDENT> def _reset_cache(self): <NEW_LINE> <INDENT> self.open_price = N... | Contains all of the logic to construct the standard bars from chapter 2. This class shouldn't be used directly.
We have added functions to the package such as get_dollar_bars which will create an instance of this
class and then construct the standard bars, to return to the user.
This is because we wanted to simplify t... | 62599070ac7a0e7691f73d97 |
class DeleteTopicRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TopicName = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.TopicName = params.get("TopicName") | DeleteTopic request structure.
| 62599070d486a94d0ba2d86e |
class Employee(object): <NEW_LINE> <INDENT> def __init__(self, fixed_wage): <NEW_LINE> <INDENT> self.fixed_wage = fixed_wage | Employee of a casino | 62599070be8e80087fbc093e |
class BoliChoice(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=50, verbose_name=_("name")) <NEW_LINE> request_choice = models.BooleanField(default=False, verbose_name=_("Request Choices")) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = _("Boli Choice") <NEW_LINE> verbose_name_plural =... | Boli choices so we can add and remove | 625990705fc7496912d48ec0 |
class ErrorListError(TAMError): <NEW_LINE> <INDENT> def __init__(self, errorList): <NEW_LINE> <INDENT> self.errorList = errorList <NEW_LINE> <DEDENT> def errors(self): <NEW_LINE> <INDENT> return self.errorList | Raised to indicate that one or more errors occurred when executing
TileSetTemplate.createTiles. It can be queried to retrieve that list. | 62599070627d3e7fe0e08737 |
class KeywordResult(): <NEW_LINE> <INDENT> def __init__(self, normalized_text: str, start_time: float, end_time: float, confidence: float) -> None: <NEW_LINE> <INDENT> self.normalized_text = normalized_text <NEW_LINE> self.start_time = start_time <NEW_LINE> self.end_time = end_time <NEW_LINE> self.confidence = confiden... | Information about a match for a keyword from speech recognition results.
:attr str normalized_text: A specified keyword normalized to the spoken phrase
that matched in the audio input.
:attr float start_time: The start time in seconds of the keyword match.
:attr float end_time: The end time in seconds of the key... | 62599070f548e778e596ce3d |
class network: <NEW_LINE> <INDENT> __slots__ = 'numHiddenNodes', 'inputNodes', 'outputNodes', 'hiddenNodes', 'biasNodes', 'v', 'layer', 'weights' <NEW_LINE> def __init__(self, numHiddenNodes): <NEW_LINE> <INDENT> self.inputNodes = [] <NEW_LINE> self.outputNodes = [1, 2, 3, 4] <NEW_LINE> self.hiddenNodes = [] <NEW_LINE>... | Class network to create nodes of the neural network | 625990707c178a314d78e843 |
class HeaderAction(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'header_action_type': {'required': True}, 'header_name': {'required': True}, } <NEW_LINE> _attribute_map = { 'header_action_type': {'key': 'headerActionType', 'type': 'str'}, 'header_name': {'key': 'headerName', 'type': 'str'}, 'value':... | An action that can manipulate an http header.
All required parameters must be populated in order to send to Azure.
:param header_action_type: Required. Which type of manipulation to apply to the header.
Possible values include: "Append", "Delete", "Overwrite".
:type header_action_type: str or ~azure.mgmt.frontdoor.m... | 62599070379a373c97d9a8d0 |
class Audio(_AudioBase): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> @staticmethod <NEW_LINE> def from_result(result): <NEW_LINE> <INDENT> if result is None: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> return Audio( file_id=result.get('file_id'), duration=result.get('duration'), mime_type=result.get('mime_typ... | This object represents a generic audio file (not voice note).
Attributes:
file_id (str) :Unique identifier for this file
duration (int) :Duration of the audio in seconds as defined by sender
performer (str) :*Optional.* Performer of the audio as defined by sender or by audio tags
title (s... | 625990702ae34c7f260ac99a |
class Row(object): <NEW_LINE> <INDENT> def __init__(self, state="start", symbol=">", write=">", direction=">", new_state="start"): <NEW_LINE> <INDENT> self.state = state <NEW_LINE> self.symbol = symbol <NEW_LINE> self.write = write <NEW_LINE> self.direction = direction <NEW_LINE> self.new_state = new_state <NEW_LINE> <... | A row in a Turing machine program | 62599070e5267d203ee6d015 |
class logger: <NEW_LINE> <INDENT> log_console = logging.getLogger('console') <NEW_LINE> log_fileout = logging.getLogger('fileout') <NEW_LINE> enableFileout = False <NEW_LINE> @staticmethod <NEW_LINE> def init(options): <NEW_LINE> <INDENT> log_format = '%(asctime)s - %(levelname)s: %(message)s' <NEW_LINE> log_handler_co... | Configure a simple logger for both console and file output | 625990707d847024c075dc89 |
class Ticumulator: <NEW_LINE> <INDENT> INPUT_FIELDS = ('time', 'bid', 'bidsize', 'ask', 'asksize', 'last', 'lastsize', 'lasttime', 'volume', 'open_interest') <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.time = float('NaN') <NEW_LINE> self.bid = float('NaN') <NEW_LINE> self.bidsize = float('NaN') <NEW_LINE> s... | Accumulates ticks (bid/ask/last/volume changes) into bars (open/high/low/close/vwap).
Bars contains the traditional OHLCV data, as well as bid/ask/last data and volume-weighted average price.
You can use the :class:`Bar` namedtuple to wrap the output of this class for convenient attribute access.
`bar()` will return ... | 625990701f5feb6acb1644a2 |
class _MemoryInfra(perf_benchmark.PerfBenchmark): <NEW_LINE> <INDENT> def CreateCoreTimelineBasedMeasurementOptions(self): <NEW_LINE> <INDENT> return CreateCoreTimelineBasedMemoryMeasurementOptions() <NEW_LINE> <DEDENT> def SetExtraBrowserOptions(self, options): <NEW_LINE> <INDENT> SetExtraBrowserOptionsForMemoryMeasur... | Base class for new-generation memory benchmarks based on memory-infra.
This benchmark records data using memory-infra (https://goo.gl/8tGc6O), which
is part of chrome tracing, and extracts it using timeline-based measurements. | 62599070cc0a2c111447c729 |
class Git: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.base_command = 'git' <NEW_LINE> self.meta_data_base_dir = '.git' <NEW_LINE> self.osx = Osx() <NEW_LINE> <DEDENT> def set_base_command(self, base_command): <NEW_LINE> <INDENT> self.base_command = base_command <NEW_LINE> <DEDENT> def set_redirect... | A git command wrapper. | 62599070097d151d1a2c2922 |
class DjangoFilterBackend(BaseFilterBackend): <NEW_LINE> <INDENT> default_filter_set = FilterSet <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> assert django_filters, 'Using DjangoFilterBackend, but django-filter is not installed' <NEW_LINE> <DEDENT> def get_filter_class(self, view): <NEW_LINE> <INDENT> filter_clas... | A filter backend that uses django-filter. | 625990707047854f46340c69 |
class CarouselsRequest: <NEW_LINE> <INDENT> url = "https://frontend.vh.yandex.ru/v23/carousels_videohub.json" <NEW_LINE> headers = { "Origin": "https://yandex.ru", "Accept-Encoding": "gzip, deflate, br", "Accept-Language": "ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit... | Ручка возвращает список каруселей, принадлежащих разделу
tag - название раздела
(limit - offset) число каруселей, который должен вернуть запрос
vitrina_limit - задаёт число документов, которые будут возвращаться в данных карусели
поскольку данная ручка в коде используется для получения id каруселей,
числу документов п... | 62599070b7558d5895464b8b |
class ChannelInfoResult(object): <NEW_LINE> <INDENT> pass | Object to hold channel info results | 62599070796e427e53850029 |
class Braintree(object): <NEW_LINE> <INDENT> def charge(self, params): <NEW_LINE> <INDENT> return braintree.Transaction.sale(params) | Sends data to Braintree.
| 6259907032920d7e50bc78f8 |
class TimerStats: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass | This class may be used to keep information on performance of your code | 625990704c3428357761bb65 |
class TestBasicsNoFileListStorage(TestBasics): <NEW_LINE> <INDENT> temporary_file_list = True | Repeat basic tests with temporary file list | 62599070aad79263cf430067 |
class MachineLearningComputeManagementClient(object): <NEW_LINE> <INDENT> def __init__( self, credentials, subscription_id, base_url=None): <NEW_LINE> <INDENT> self.config = MachineLearningComputeManagementClientConfiguration(credentials, subscription_id, base_url) <NEW_LINE> self._client = ServiceClient(self.config.cr... | These APIs allow end users to operate on Azure Machine Learning Compute resources. They support the following operations:<ul><li>Create or update a cluster</li><li>Get a cluster</li><li>Patch a cluster</li><li>Delete a cluster</li><li>Get keys for a cluster<... | 62599070d486a94d0ba2d870 |
class Meta: <NEW_LINE> <INDENT> series_name = 'fan_value' <NEW_LINE> fields = ['value'] <NEW_LINE> tags = ['host', 'type'] <NEW_LINE> autocommit = False | Meta class for the SeriesHelper. | 62599070f548e778e596ce3e |
class SpaceObjectBaseTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_clear_init(self): <NEW_LINE> <INDENT> test = SpaceObjectBase() <NEW_LINE> setters = ('x', 'y', 'velocity_x', 'velocity_y') <NEW_LINE> for item in setters: <NEW_LINE> <INDENT> self.assertEqual(getattr(test, item), 0) <NEW_LINE> <DEDENT> <DEDENT>... | Test case docstring | 62599070a8370b77170f1c7a |
class MillerRabin: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> print('Hello world, I am a MillerRabin object instance!') <NEW_LINE> <DEDENT> def is_prime(self, n, k=128): <NEW_LINE> <INDENT> if n == 2 or n == 3: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> if n <= 1 or n % 2 == 0: <NEW_LINE> <IND... | The Miller Rabin algorithm.
The algorithm.
1) Generate a prime candidate.
2) Test if the generated number is prime.
3) If the number is not prime, restart from beginning. | 62599070f9cc0f698b1c5f23 |
class Course: <NEW_LINE> <INDENT> def __init__(self, course_name, course_time, course_cost, teacher, admin): <NEW_LINE> <INDENT> self.course_name = course_name <NEW_LINE> self.course_time = course_time <NEW_LINE> self.course_cost = course_cost <NEW_LINE> self.create_time = time.strftime('%Y-%m-%d %H:%M:%S') <NEW_LINE> ... | 创建课程 | 625990701f037a2d8b9e54c3 |
class IdPSPForm(FormHandler): <NEW_LINE> <INDENT> form_type = 'idp' <NEW_LINE> signature = ['SAMLResponse', 'TARGET'] <NEW_LINE> def submit(self, opener, res): <NEW_LINE> <INDENT> log.info('Submitting IdP SAML form') <NEW_LINE> data = self.data <NEW_LINE> url = urlparse.urljoin(res.url, data['form']['action']) <NEW_LIN... | IDP Post-back Form Handler | 6259907091f36d47f2231ae7 |
class Albums: <NEW_LINE> <INDENT> def on_get(self, req, resp): <NEW_LINE> <INDENT> resp.body = json.dumps(list(_albums.values())) <NEW_LINE> resp.status = falcon.HTTP_200 <NEW_LINE> <DEDENT> def on_post(self, req, resp): <NEW_LINE> <INDENT> payload = req.stream.read().decode('utf-8') <NEW_LINE> if not payload: <NEW_LIN... | API resource for the collection of albums.
| 625990704f6381625f19a101 |
class IDPool(object): <NEW_LINE> <INDENT> def __init__(self, start = 0): <NEW_LINE> <INDENT> self.free_ids = [] <NEW_LINE> self.new_ids = itertools.count(start) <NEW_LINE> <DEDENT> def pop(self): <NEW_LINE> <INDENT> if self.free_ids: <NEW_LINE> <INDENT> return self.free_ids.pop() <NEW_LINE> <DEDENT> else: <NEW_LINE> <I... | Manage pool of IDs | 625990708e7ae83300eea942 |
class AnalysisFinder: <NEW_LINE> <INDENT> name = 'analysis' <NEW_LINE> def __init__(self, deployment, **args): <NEW_LINE> <INDENT> self.deployment = deployment <NEW_LINE> self.service_account_key = args.get('credentials') <NEW_LINE> with AnalysisAgent.ignore_logging_msg(): <NEW_LINE> <INDENT> self.analysis = AnalysisAg... | dcpdig @analysis workflow_uuid=<id>
dcpdig @analysis bundle_uuid=<id> | 6259907026068e7796d4e1ed |
class HourParser(Parser): <NEW_LINE> <INDENT> MIN_VALUE = 0 <NEW_LINE> MAX_VALUE = 23 | Custom parser for hours | 625990707c178a314d78e844 |
class Hooks(list): <NEW_LINE> <INDENT> def get_read_hooks(self): <NEW_LINE> <INDENT> return (h for h in self if isinstance(h, AbstractReadHook)) <NEW_LINE> <DEDENT> def get_inject_hooks(self): <NEW_LINE> <INDENT> return (h for h in self if isinstance(h, AbstractInjectHook)) | Runtime representation of registered pydov hooks, i.e. a list of
instances of AbstractReadHook and/or AbstractInjectHook. | 625990702ae34c7f260ac99c |
class ConvertWarp(FSLCommand): <NEW_LINE> <INDENT> input_spec = ConvertWarpInputSpec <NEW_LINE> output_spec = ConvertWarpOutputSpec <NEW_LINE> _cmd = 'convertwarp' | Use FSL `convertwarp <http://fsl.fmrib.ox.ac.uk/fsl/fsl-4.1.9/fnirt/warp_utils.html>`_
for combining multiple transforms into one.
Examples
--------
>>> from nipype.interfaces.fsl import ConvertWarp
>>> warputils = ConvertWarp()
>>> warputils.inputs.warp1 = "warpfield.nii"
>>> warputils.inputs.reference = "T1.nii"
>... | 62599070a17c0f6771d5d803 |
class AxonError(Exception): <NEW_LINE> <INDENT> def __init__(self, msg, exc): <NEW_LINE> <INDENT> self.msg = msg <NEW_LINE> self.exc = exc <NEW_LINE> super(AxonError, self).__init__(msg) | Pass. | 6259907016aa5153ce401d8c |
class DefaultActionLog(AbstractActionLog): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def is_error(e: Optional[Tuple[Exception, str]]): <NEW_LINE> <INDENT> return e is not None and not isinstance(e[0], ImmediateRedirectException) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def expand_error_desc(e: Tuple[Exception, s... | DefaultActionLog stores action logs via standard 'logging' package as initialized and configured
by KonText. Custom action arguments are stored in a nested dictionary under the 'args' key.
The plug-in stores also - date, user_id, action (name), proc_time and some request properties (client IP,
client user agent). | 625990704a966d76dd5f079d |
class _DummyVariantMergeStrategy(variant_merge_strategy.VariantMergeStrategy): <NEW_LINE> <INDENT> def modify_bigquery_schema(self, schema, info_keys): <NEW_LINE> <INDENT> schema.fields.append(bigquery.TableFieldSchema( name='ADDED_BY_MERGER', type=TableFieldConstants.TYPE_STRING, mode=TableFieldConstants.MODE_NULLABLE... | A dummy strategy. It just adds a new field to the schema. | 62599070e76e3b2f99fda2b5 |
class _dummySerial: <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self._read_num = 0 <NEW_LINE> self._data = {} <NEW_LINE> self._data[0] = [0x0D, 0x01, 0x00, 0x01, 0x02, 0x53, 0x45, 0x10, 0x0C, 0x2F, 0x01, 0x01, 0x00, 0x00] <NEW_LINE> self._data[1] = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0... | Dummy class for testing | 625990703539df3088ecdb4f |
class ProtocolTests(TestCase): <NEW_LINE> <INDENT> def test_interfaces(self): <NEW_LINE> <INDENT> proto = Protocol() <NEW_LINE> self.assertTrue(verifyObject(IProtocol, proto)) <NEW_LINE> self.assertTrue(verifyObject(ILoggingContext, proto)) <NEW_LINE> <DEDENT> def test_logPrefix(self): <NEW_LINE> <INDENT> class SomeThi... | Tests for L{twisted.internet.protocol.Protocol}. | 62599070d486a94d0ba2d871 |
class AncestorTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.a = TC.objects.create(name="a") <NEW_LINE> self.b = TC.objects.create(name="b") <NEW_LINE> self.c = TC.objects.create(name="c") <NEW_LINE> self.b.parent2 = self.a <NEW_LINE> self.b.save() <NEW_LINE> self.c.parent2 = self.b <... | Testing things to do with ancestors. | 62599070a8370b77170f1c7c |
class UpdateStudyMutation(graphene.Mutation): <NEW_LINE> <INDENT> class Arguments: <NEW_LINE> <INDENT> id = graphene.ID( required=True, description="The ID of the study to update" ) <NEW_LINE> input = StudyInput( required=True, description="Attributes for the new study" ) <NEW_LINE> <DEDENT> study = graphene.Field(Stud... | Mutation to update an existing study | 6259907023849d37ff852969 |
class Token(TreeDataItem): <NEW_LINE> <INDENT> def __init__(self, text, target_str=None, sentence=None, position=None): <NEW_LINE> <INDENT> data = { 'text': text } <NEW_LINE> super(Token, self).__init__( data=data, target_str=target_str, parent=sentence, position=position, children=None ) <NEW_LINE> <DEDENT> @property ... | A single word, symbol, or other minimal element of text. | 625990703d592f4c4edbc794 |
class Coord(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def add(arg1, arg2): <NEW_LINE> <INDENT> return (arg1[0] +arg2[0], arg1[1] +arg2[1]) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def subtract(arg1, arg2): <NEW_LINE> <INDENT> return (arg1[0] -arg2[0], arg1[1] -arg2[1]) <NEW_LINE> <DEDENT> @staticmethod ... | Helper class for coordinate objects. Discrete and two dimensions. (col,row) | 62599070a8370b77170f1c7d |
class DesignTeamFunctionLookup(ArchiveLookup): <NEW_LINE> <INDENT> model = DesignTeamFunction <NEW_LINE> @staticmethod <NEW_LINE> def get_query(request, term): <NEW_LINE> <INDENT> return DesignTeamFunction.objects.filter(title__icontains=term) | lookup with a search filed for the Design Team Function Model | 6259907056ac1b37e630393c |
class MMError(Exception): <NEW_LINE> <INDENT> def __init__(self, error_dict): <NEW_LINE> <INDENT> super(MMError, self).__init__() <NEW_LINE> self.error_code = error_dict.get('code', None) <NEW_LINE> self.error_message = error_dict.get('message', None) <NEW_LINE> logging.warn(self.to_result()) <NEW_LINE> <DEDENT> def to... | An error thrown by a request handler | 62599070009cb60464d02deb |
class BuildingBlockDeformable(link.Chain): <NEW_LINE> <INDENT> def __init__(self, n_layer, in_channels, mid_channels, out_channels, stride, initialW=None): <NEW_LINE> <INDENT> links = [ ('a', BottleneckA( in_channels, mid_channels, out_channels, stride, initialW)) ] <NEW_LINE> links.append(('b1', BottleneckB(out_channe... | A building block that consists of several Bottleneck layers.
Args:
n_layer (int): Number of layers used in the building block.
in_channels (int): Number of channels of input arrays.
mid_channels (int): Number of channels of intermediate arrays.
out_channels (int): Number of channels of output arrays.
... | 625990707b180e01f3e49cbe |
class SentimentRating(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.rating = 0.5 <NEW_LINE> <DEDENT> def update_rating(self, latest_score) -> None: <NEW_LINE> <INDENT> self.rating = (0.2*self.rating + 0.8*latest_score)/1 <NEW_LINE> <DEDENT> def get_rating(self) -> float: <NEW_LINE> <INDENT> return... | This will be the overarching container class for our sentiment ratings, we'll use
methods in here to return the current instance of sentiment rating, and also the overarching
average rating. The overarching rating weighs the current sentiment more than previous sentiment. | 6259907067a9b606de5476fd |
class SentinmentCalculator: <NEW_LINE> <INDENT> def __init__(self, tweets, sentiments): <NEW_LINE> <INDENT> self.tweets = tweets <NEW_LINE> self.sentiments = sentiments <NEW_LINE> <DEDENT> def analyze_tweet_sentiments(self): <NEW_LINE> <INDENT> total_sentiments = 0.0 <NEW_LINE> for tweet in self.tweets: <NEW_LINE> <IND... | Given a list of TWEETS and dictionary
of SENTIMENTS, performs operations to find
the average sentiment, etc. | 62599070dd821e528d6da5db |
class Appointment(EmbeddedDocument): <NEW_LINE> <INDENT> meta = {'collection': 'appointments'} <NEW_LINE> uid = IntField(min_value=1, unique=True, requied=True) <NEW_LINE> datetime = DateTimeField(required=True) <NEW_LINE> patient_id = IntField(min_value=1) <NEW_LINE> new_patient = BooleanField(required=True) <NEW_LINE... | Represents an appointment. | 6259907055399d3f05627dcc |
class ConnectionMonitorQueryResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'source_status': {'key': 'sourceStatus', 'type': 'str'}, 'states': {'key': 'states', 'type': '[ConnectionStateSnapshot]'}, } <NEW_LINE> def __init__( self, *, source_status: Optional[Union[str, "ConnectionMonitorSourc... | List of connection states snapshots.
:param source_status: Status of connection monitor source. Possible values include: "Unknown",
"Active", "Inactive".
:type source_status: str or
~azure.mgmt.network.v2019_04_01.models.ConnectionMonitorSourceStatus
:param states: Information about connection states.
:type states: ... | 625990707b25080760ed893d |
class BrokenTestException(RichSkipTestException): <NEW_LINE> <INDENT> def __init__(self, item_number, reason): <NEW_LINE> <INDENT> super(BrokenTestException, self).__init__(reason) <NEW_LINE> self.item_number = item_number <NEW_LINE> self.reason = reason <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> retur... | Skip a test because it is known to be broken.
This avoids constantly re-running tests that are known to fail or cause an
error, yet allows us to still mark them as failures.
In a perfect Test Driven Development world, all broken tests would be
fixed immediately by the developer that caused them to break.
However, te... | 625990705fcc89381b266db1 |
class Keyword(Cipher): <NEW_LINE> <INDENT> def __init__(self, key): <NEW_LINE> <INDENT> self.key = key <NEW_LINE> self.arr = Keyword.fill_array(self.key) <NEW_LINE> self.keyword_dict = {key_lttr: letter for letter, key_lttr in zip(list(string.ascii_uppercase), self.arr)} <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def... | keyword cipher encrypts the data by matching the letter with a letter in a special alphabet
which starts with the keyword that was given & for decryption vice versa. | 625990709c8ee82313040de2 |
class MoveWatchFolderTasksToDoneSignal: <NEW_LINE> <INDENT> def __init__(self, application_preferences): <NEW_LINE> <INDENT> self.application_preferences = application_preferences <NEW_LINE> <DEDENT> def on_move_watch_folder_tasks_to_done_switch_state_set(self, move_watch_folder_tasks_to_done_switch, user_data=None): <... | Handles the signal emitted when the Move Completed Watch Folder Tasks to the Done Folder option is changed in the
preferences dialog. | 62599070cc0a2c111447c72b |
class ReseekFile: <NEW_LINE> <INDENT> def __init__(self, file): <NEW_LINE> <INDENT> self.file = file <NEW_LINE> self.buffer_file = StringIO() <NEW_LINE> self.at_beginning = 1 <NEW_LINE> try: <NEW_LINE> <INDENT> self.beginning = file.tell() <NEW_LINE> <DEDENT> except (IOError, AttributeError): <NEW_LINE> <INDENT> self.b... | wrap a file handle to allow seeks back to the beginning
Takes a file handle in the constructor.
See the module docstring for more documentation. | 62599070baa26c4b54d50b5f |
class PaymentCharge: <NEW_LINE> <INDENT> QUALNAME = "pyrogram.raw.base.PaymentCharge" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> raise TypeError("Base types can only be used for type checking purposes: " "you tried to use a base type instance as argument, " "but you need to instantiate one of its constructors i... | This base type has 1 constructor available.
Constructors:
.. hlist::
:columns: 2
- :obj:`PaymentCharge <pyrogram.raw.types.PaymentCharge>` | 62599070e76e3b2f99fda2b7 |
class GpVarDiagMixinResponse(base_schemas.StrictMappingSchema): <NEW_LINE> <INDENT> var = base_schemas.ListOfFloats() | A mixin response colander schema for the variance of a gaussian process.
**Output fields**
:ivar var: (*list of float64*) variances of the GP at ``points_to_evaluate``; i.e., diagonal of the ``var`` response from gp_mean_var (:class:`moe.views.schemas.base_schemas.ListOfFloats`)
**Example Response**
.. sourcecode::... | 625990708da39b475be04aa3 |
class TicketNoteAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ["ticket_id", "created", "notes"] <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = TicketNote | Override the default Django Admin website display of Ticket Notes app | 62599070ac7a0e7691f73d9d |
class Tumblr(BlogBase): <NEW_LINE> <INDENT> def copy_relations(self, oldinstance): <NEW_LINE> <INDENT> super(Tumblr, self).copy_relations(oldinstance) <NEW_LINE> <DEDENT> def _regex_id(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> blogname = re.match(r'(http://)?([\w_-]+)(.tumblr.com)?(.*)', self.url).group(2) <N... | Tumblr posts | 62599070442bda511e95d9b2 |
class EditProductsView(APIView): <NEW_LINE> <INDENT> permission_classes = (permissions.IsAdminUser,) <NEW_LINE> def post(self, request): <NEW_LINE> <INDENT> data = request.data <NEW_LINE> return product_utils.add_product(data) <NEW_LINE> <DEDENT> def delete(self, request, pk): <NEW_LINE> <INDENT> return product_utils.d... | POST: To add a new product
DELETE: To delete an existing product
PATCH: To update an existing product | 6259907001c39578d7f1438f |
class tqdm_progress_bar(progress_bar): <NEW_LINE> <INDENT> def __init__(self, iterable, epoch=None, prefix=None): <NEW_LINE> <INDENT> super().__init__(iterable, epoch, prefix) <NEW_LINE> self.tqdm = tqdm( iterable, self.prefix, leave=False, ascii=True, dynamic_ncols=True ) <NEW_LINE> <DEDENT> def __iter__(self): <NEW_L... | Log to tqdm. | 62599070fff4ab517ebcf0cf |
class ModelContainer(object): <NEW_LINE> <INDENT> def __init__(self, model_num=None): <NEW_LINE> <INDENT> self.num = model_num <NEW_LINE> self.mol = MolList() <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> text = "Class containing the data for model %s.\n" % self.num <NEW_LINE> text = text + "\n" <NEW_LINE... | Class containing all the model specific data. | 6259907099cbb53fe683279e |
class PrintFormatCommand(GefUnitTestGeneric): <NEW_LINE> <INDENT> def test_cmd_print_format(self): <NEW_LINE> <INDENT> self.assertFailIfInactiveSession(gdb_run_cmd("print-format")) <NEW_LINE> res = gdb_start_silent_cmd("print-format $sp") <NEW_LINE> self.assertNoException(res) <NEW_LINE> self.assertTrue("buf = [" in re... | `print-format` command test module | 62599070009cb60464d02ded |
class SplitLinesToWordsFn(beam.DoFn): <NEW_LINE> <INDENT> OUTPUT_TAG_SHORT_WORDS = 'tag_short_words' <NEW_LINE> OUTPUT_TAG_CHARACTER_COUNT = 'tag_character_count' <NEW_LINE> def process(self, element): <NEW_LINE> <INDENT> yield pvalue.TaggedOutput( self.OUTPUT_TAG_CHARACTER_COUNT, len(element)) <NEW_LINE> words = re.fi... | A transform to split a line of text into individual words.
This transform will have 3 outputs:
- main output: all words that are longer than 3 characters.
- short words output: all other words.
- character count output: Number of characters in each processed line. | 6259907067a9b606de5476fe |
@dataclass <NEW_LINE> class TestConfig: <NEW_LINE> <INDENT> client_lang: str <NEW_LINE> server_lang: str <NEW_LINE> version: str <NEW_LINE> def version_ge(self, another: str) -> bool: <NEW_LINE> <INDENT> if self.version == 'master': <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> return _parse_version(self.version)... | Describes the config for the test suite. | 625990707b25080760ed893e |
class ServiceInstanceDescriptor(object): <NEW_LINE> <INDENT> def __init__(self, template='', parameterValues=None, descriptor=None, propertySet=Ice._struct_marker): <NEW_LINE> <INDENT> self.template = template <NEW_LINE> self.parameterValues = parameterValues <NEW_LINE> self.descriptor = descriptor <NEW_LINE> if proper... | A service template instance descriptor. | 625990707c178a314d78e846 |
class _ConsumedRequestBatch( namedtuple("_ConsumedRequestBatchBase", "batchID objects ack")): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def decodeMessage(cls, msg): <NEW_LINE> <INDENT> r = RequestMessagePackager.unmarshal(msg.body) <NEW_LINE> return cls(batchID=r.batchID, objects=BatchPackager.unmarshal(r.batchState)... | Container for a consumed request batch
batchID: UUID of the batch batch
objects: sequence of request objects (instances of ModelCommand,
ModelInputRow, etc.)
ack: function to call to ack the batch: NoneType ack(multiple=False);
recepient is responsible for ACK'ing each batch in order get more messages
and also f... | 625990703317a56b869bf19f |
class PedanticFileWrapper(object): <NEW_LINE> <INDENT> def __init__(self, stream): <NEW_LINE> <INDENT> self.__stream = stream <NEW_LINE> <DEDENT> def seek(self, offset, whence = 0): <NEW_LINE> <INDENT> pos = self.__stream.tell() <NEW_LINE> self.__stream.seek(0, 2) <NEW_LINE> length = self.__stream.tell() <NEW_LINE> if ... | Pedantic wrapper around a file object.
Is guaranteed to raise an IOError if an attempt is made to:
- seek to a location larger than the file
- read behind the file boundary
Only works for random access files that support seek() and tell(). | 62599070d268445f2663a7b8 |
class Screen(object): <NEW_LINE> <INDENT> def __init__(self, image_file=None): <NEW_LINE> <INDENT> self.size = SCREENSIZE <NEW_LINE> self.bgcolour = BACKGROUND <NEW_LINE> self.display = pygame.display.set_mode(self.size) <NEW_LINE> self.title = pygame.display.set_caption('Moby Dick') <NEW_LINE> if image_file: <NEW_LINE... | Starts a screen and displays background | 625990702ae34c7f260ac9a0 |
class ActivityLogAlertResourcePaged(Paged): <NEW_LINE> <INDENT> _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, 'current_page': {'key': 'value', 'type': '[ActivityLogAlertResource]'} } <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(ActivityLogAlertResourcePaged, self).__in... | A paging container for iterating over a list of :class:`ActivityLogAlertResource <azure.mgmt.monitor.models.ActivityLogAlertResource>` object | 625990708e7ae83300eea947 |
class WriteAccessRecord(BiffRecord): <NEW_LINE> <INDENT> _REC_ID = 0x005C <NEW_LINE> def __init__(self, owner): <NEW_LINE> <INDENT> uowner = owner[0:0x30] <NEW_LINE> uowner_len = len(uowner) <NEW_LINE> self._rec_data = pack(bytes('%ds%ds' % (uowner_len, 0x70 - uowner_len), encoding='utf8'), bytes(uowner, encoding='utf8... | This record is part of the file protection. It contains the name of the
user that has saved the file. The user name is always stored as an
equal-sized string. All unused characters after the name are filled
with space characters. It is not required to write the mentioned string
length. Every other length will ... | 625990705166f23b2e244c8a |
class SimRunError(StandardError): <NEW_LINE> <INDENT> pass | Generic error for model simulating run. Attributes include current results stack. | 62599070b7558d5895464b8e |
class DarwinKASLRMixin(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def args(cls, parser): <NEW_LINE> <INDENT> super(DarwinKASLRMixin, cls).args(parser) <NEW_LINE> parser.add_argument("--vm_kernel_slide", action=config.IntParser, help="OS X 10.8 and later: kernel ASLR slide.") <NEW_LINE> <DEDENT> def __init__(s... | Ensures that KASLR slide is computed and stored in the session. | 62599070097d151d1a2c2928 |
class HelloWorld(Resource): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> r = ResponseJson({"message": "hello, world"}) <NEW_LINE> return r.make_response() | hello, world! if this endpoint works then yaaay your code deploys correctly | 625990707d847024c075dc8f |
class LeadUpdateView(LoginRequiredMixin, generic.UpdateView): <NEW_LINE> <INDENT> template_name = "leads/lead_update.html" <NEW_LINE> queryset = Lead.objects.all() <NEW_LINE> form_class = LeadModelForm <NEW_LINE> def get_success_url(self): <NEW_LINE> <INDENT> return reverse('leads:lead-list') | Replaced lead_update with a django class based view | 625990704a966d76dd5f07a1 |
class Embed(Field): <NEW_LINE> <INDENT> def __init__(self, packet): <NEW_LINE> <INDENT> self.packet = packet <NEW_LINE> super(Embed, self).__init__() <NEW_LINE> <DEDENT> def value_to_bytes(self, obj, value, default_endianness=DEFAULT_ENDIANNESS): <NEW_LINE> <INDENT> return value.serialise(default_endianness=default_end... | Embeds another :class:`.PebblePacket`. Useful for implementing repetitive packets.
:param packet: The packet to embed.
:type packet: .PebblePacket | 625990703539df3088ecdb52 |
class TestLinearPositionListResult(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 testLinearPositionListResult(self): <NEW_LINE> <INDENT> pass | LinearPositionListResult unit test stubs | 625990701b99ca4002290191 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.