code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class TreeDynamicsSystem(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(TreeDynamicsSystem, self).__init__() <NEW_LINE> self._initInternalData() <NEW_LINE> <DEDENT> def _initInternalData(self): <NEW_LINE> <INDENT> self._nodes = {} <NEW_LINE> self._root_node_name = None <NEW_LINE> self._primi... | Tree-structured dynamics system. | 62599055be383301e0254d25 |
class Display3DImage: <NEW_LINE> <INDENT> def __init__(self,image): <NEW_LINE> <INDENT> self.image = image <NEW_LINE> self.nx = np.shape(self.image)[0] <NEW_LINE> self.ny = np.shape(self.image)[1] <NEW_LINE> self.nz = np.shape(self.image)[2] <NEW_LINE> self.slice_direction = 2 <NEW_LINE> self.slice_number = int(self.nz... | <Arguments> image : 3D image, nx, ny, nz: dimensions of image | 6259905521bff66bcd724196 |
class MissingRequiredParameterError(FSMException): <NEW_LINE> <INDENT> pass | Exception raised when required parameter is missing. | 62599055a17c0f6771d5d63a |
class VirtualMachineScaleSetVMExtensionsSummary(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'name': {'readonly': True}, 'statuses_summary': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'statuses_summary': {'key': 'statusesSummary', 'type': '[VirtualMac... | Extensions summary for virtual machines of a virtual machine scale set.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar name: The extension name.
:vartype name: str
:ivar statuses_summary: The extensions information.
:vartype statuses_summary:
list[~azure.mgmt.compute.v2... | 6259905555399d3f05627a51 |
class Rate: <NEW_LINE> <INDENT> def user_select_rate(self): <NEW_LINE> <INDENT> print ('lets rate something!\n' 'what category would you like to view?\n') <NEW_LINE> i = 0 <NEW_LINE> for each in categories: <NEW_LINE> <INDENT> i += 1 <NEW_LINE> print (i,'=',each) <NEW_LINE> <DEDENT> self.user_input = int(input('\noptio... | Responisble for collection of user input | 625990558da39b475be0471d |
class FilePaths: <NEW_LINE> <INDENT> fnCharList = '../model/charList.txt' <NEW_LINE> fnSummary = '../model/summary.json' <NEW_LINE> fnInfer = '../data/img3.jpg' <NEW_LINE> fnCorpus = '../data/corpus.txt' | filenames and paths to data | 6259905573bcbd0ca4bcb7c3 |
class CircuitSearchProvider(SearchProvider): <NEW_LINE> <INDENT> name = "Circuits" <NEW_LINE> headers = [ ('Circuit', 'Circuit'), ('Alias', 'Reference') ] <NEW_LINE> link = 'Circuit' <NEW_LINE> def fetch_results(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> results = services.session.query(Circuit).filter( or_(Ci... | Searchprovider for circuits | 625990557b25080760ed8778 |
class CLIHandler: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def out(data_to_print, args): <NEW_LINE> <INDENT> if isinstance(data_to_print, list): <NEW_LINE> <INDENT> for i, list_item in enumerate(data_to_print): <NEW_LINE> <INDENT> if not args.no_numbers: <NEW_LINE> <INDENT> print(f"{Fore.GREEN}{i+1}.{Fore.RESET}") ... | Common class for printing output to and acquiring input from CLI | 62599055009cb60464d02a69 |
class VppGbpAcl(VppObject): <NEW_LINE> <INDENT> def __init__(self, test): <NEW_LINE> <INDENT> self._test = test <NEW_LINE> self.acl_index = 4294967295 <NEW_LINE> <DEDENT> def create_rule(self, is_ipv6=0, permit_deny=0, proto=-1, s_prefix=0, s_ip='\x00\x00\x00\x00', sport_from=0, sport_to=65535, d_prefix=0, d_ip='\x00\x... | GBP Acl | 625990558e71fb1e983bcffb |
class PermanentRedirectRouteHandler(BaseHandler): <NEW_LINE> <INDENT> def __init__(self, request, route_name, **route_args): <NEW_LINE> <INDENT> self.route_name = route_name <NEW_LINE> self.route_args = route_args <NEW_LINE> super(PermanentRedirectRouteHandler, self).__init__(request) <NEW_LINE> <DEDENT> def get(self):... | Performs permanent redirect (HTTP status code 301) to given route
name. | 6259905507f4c71912bb096d |
class Normalize(object): <NEW_LINE> <INDENT> def __init__(self, mean, std): <NEW_LINE> <INDENT> self.mean = mean <NEW_LINE> self.std = std <NEW_LINE> <DEDENT> def __call__(self, sample): <NEW_LINE> <INDENT> image = sample <NEW_LINE> img = sample <NEW_LINE> sample = {'image': img, 'class1': class1,'class2': class2} <NEW... | Rescale the image in a sample to a given size.
Args:
output_size (tuple or tuple): Desired output size. If tuple, output is
matched to output_size. If int, smaller of image edges is matched
to output_size keeping aspect ratio the same. | 62599055a219f33f346c7d37 |
class PathReader(object): <NEW_LINE> <INDENT> field_names = ['x_position', 'y_position', 'speed', 'marker'] <NEW_LINE> def __init__(self, filename: str): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> <DEDENT> def write_path(self, waypoints: List[Waypoint]): <NEW_LINE> <INDENT> with open(self.filename, 'wb+') ... | classdocs | 62599055e76e3b2f99fd9f31 |
class SentenceEmbeddingRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Text = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Text = params.get("Text") | SentenceEmbedding请求参数结构体
| 625990553c8af77a43b689d9 |
class Mean(Moment): <NEW_LINE> <INDENT> name = 'mean' <NEW_LINE> order = 1 | Calculates mean. | 62599055b57a9660fecd2fae |
class S3Uploader(object): <NEW_LINE> <INDENT> def __init__(self, boto3_factory, s3_bucket, default_folder=""): <NEW_LINE> <INDENT> self.s3_client = boto3_factory.get_client("s3") <NEW_LINE> self.s3_bucket = s3_bucket <NEW_LINE> self.default_folder = default_folder <NEW_LINE> if default_folder: <NEW_LINE> <INDENT> self.... | S3 uploader. | 62599055dd821e528d6da412 |
class ConfigError(NameError): <NEW_LINE> <INDENT> pass | Invalid name | 62599055b5575c28eb713765 |
class Variable: <NEW_LINE> <INDENT> def __init__(self, name=""): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.domain = OrderedSet() <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return self.name == other.name <NEW_LIN... | Represent a variable in a DAG or a CPT. A variable depends almost completly on its name (a string). A variable is equal to another if they have the same name and it is hashable by the hash of its name (a hash of a string). | 62599055b830903b9686ef17 |
class TestApiProject(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 testApiProject(self): <NEW_LINE> <INDENT> pass | ApiProject unit test stubs | 62599055460517430c432aeb |
class Dealer(TimeStampedModel): <NEW_LINE> <INDENT> name = models.CharField(max_length=25) <NEW_LINE> address = models.CharField(max_length=50, blank=True, default='') <NEW_LINE> phone_number = models.CharField(max_length=12) <NEW_LINE> email = models.EmailField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> ordering = (... | Dealer Model | 6259905521bff66bcd724198 |
class ApiResponse(object): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> for k, v in kwargs.items(): <NEW_LINE> <INDENT> setattr(self, k, v) | Base class for all API responses.
.. note::
All keyword arguments become properties. | 62599055e5267d203ee6ce22 |
class KintoChangesListener(ListenerBase): <NEW_LINE> <INDENT> def __init__( self, client, broadcaster_id, included_resources, excluded_resources, resources=None ): <NEW_LINE> <INDENT> self.client = client <NEW_LINE> self.broadcaster_id = broadcaster_id <NEW_LINE> self.included_resources_uris = included_resources <NEW_L... | An event listener that's specialized for handling kinto-changes feeds.
We have a plan to allow customizing event listeners to listen for
updates on certain buckets, collections, or records. However, we
don't have a plan to allow filtering out impacted records from events.
This listener understands the structure of th... | 6259905516aa5153ce401a18 |
class CloudBackupUploaderBarman(CloudBackupUploader): <NEW_LINE> <INDENT> def __init__( self, server_name, cloud_interface, max_archive_size, backup_dir, backup_id, compression=None, ): <NEW_LINE> <INDENT> super(CloudBackupUploaderBarman, self).__init__( server_name, cloud_interface, max_archive_size, compression=compr... | A cloud storage upload client for a pre-existing backup on the Barman server. | 62599055d7e4931a7ef3d5b2 |
class PrivateTopic(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = 'Message privé' <NEW_LINE> verbose_name_plural = 'Messages privés' <NEW_LINE> <DEDENT> title = models.CharField('Titre', max_length=80) <NEW_LINE> subtitle = models.CharField('Sous-titre', max_length=200) <NEW_LINE> aut... | Topic private, containing private posts. | 6259905576d4e153a661dd15 |
class square(OpenSCADObject): <NEW_LINE> <INDENT> def __init__(self, size=None, center=None): <NEW_LINE> <INDENT> OpenSCADObject.__init__(self, 'square', {'size': size, 'center': center}) | Creates a square at the origin of the coordinate system. When center is
True the square will be centered on the origin, otherwise it is created
in the first quadrant. The argument names are optional if the arguments
are given in the same order as specified in the parameters
:param size: If a single number is given, th... | 625990553eb6a72ae038bb94 |
class PBClient(object): <NEW_LINE> <INDENT> NAME = 'PB Server' <NEW_LINE> def __init__(self, address): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.address = address <NEW_LINE> self.name = self.NAME <NEW_LINE> self.connection = None <NEW_LINE> self.factory = None <NEW_LINE> self.service_data = {} <NEW_LINE> s... | A Perspective Broker Client
:param address: string representing the <address>:<port> of the server | 625990558da39b475be0471f |
class LastResult(BasePacmanRunner): <NEW_LINE> <INDENT> def pacman_process(self, package_name): <NEW_LINE> <INDENT> result = open('/tmp/pacman.res').read() <NEW_LINE> if len(result) == 0: <NEW_LINE> <INDENT> result = False <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> result = int(result) == 0 <NEW_LINE> <DEDENT> retur... | Since the pacman may block execution for a very long time,
this handler provides a method for browser to know the result of
the last pacman execution once it has ended, so that it can recover from
an HTTP timeout.
Returns boolean json | 6259905538b623060ffaa2e9 |
class BadReferalError(Exception): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> self.message = message | Raised when the information provide is insufficiant to identify a key piece of reference data | 62599055097d151d1a2c259f |
class TestHzToErb(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.convert = lambda frq: 21.4 * np.log(1 + 0.00437 * frq) <NEW_LINE> <DEDENT> def test_hz_to_erb_number(self): <NEW_LINE> <INDENT> data = np.random.randn(1)[0] <NEW_LINE> expected = self.convert(data) <NEW_LINE> actual = hz... | Test the hz_to_erb function. | 6259905523849d37ff8525f8 |
class SearchView(generic.ListView): <NEW_LINE> <INDENT> context_object_name = 'results' <NEW_LINE> template_name = 'blogs/search.html' <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> query = self.request.GET.get('search') <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> query = '' <NEW_LI... | This will display the search the user has provided from the search bar on any other page. | 62599055d99f1b3c44d06bd4 |
class ProgressBar(): <NEW_LINE> <INDENT> def __init__(self, epoch, total_epochs, data_loader): <NEW_LINE> <INDENT> self.epoch = epoch <NEW_LINE> self.total_epochs = total_epochs <NEW_LINE> self.loss = 0 <NEW_LINE> self.progress = tqdm( iterable=iter(data_loader), leave=False, desc=f'epoch {epoch + 1} / {total_epochs}',... | Pretty progress bar for training | 625990553539df3088ecd7da |
class TrainStrategy(_object): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, TrainStrategy, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, TrainStrategy, name) <NEW_LINE> __repr__ = _sw... | Proxy of C++ TrainStrategy class | 625990552ae34c7f260ac61b |
class PSF_Interpolator(object): <NEW_LINE> <INDENT> def __init__(self, y_keys=[], x_keys=[], **kwargs): <NEW_LINE> <INDENT> self.y_keys = y_keys <NEW_LINE> self.x_keys = x_keys <NEW_LINE> <DEDENT> def check_data_for_keys(self, data): <NEW_LINE> <INDENT> can_do_x = True <NEW_LINE> for key in self.x_keys: <NEW_LINE> <IND... | Class that returns some sort of PSF representation.
Attributes
----------
x_keys : list of strings
Keys that an interpolator takes to create output
y_keys : list of strings
Names of output keys
Methods
-------
interpolate
Returns the psf at some location. | 62599055009cb60464d02a6a |
class Link(Button, ClickMixin, TextMixin): <NEW_LINE> <INDENT> pass | The Link implementation
**Example Use:**
Let's take the following example:
.. code-block:: html
<a id="someClassId" class="someClass" href="/some/link/path">Click Me</a>
If the user wants to make the code above recognizable to the testing framework, they would add the attribute
"data-qa-id" with a unique val... | 625990558e71fb1e983bcffd |
class VariableAssignment(object): <NEW_LINE> <INDENT> openapi_types = { 'type': 'str', 'id': 'Identifier', 'init': 'Expression' } <NEW_LINE> attribute_map = { 'type': 'type', 'id': 'id', 'init': 'init' } <NEW_LINE> def __init__(self, type=None, id=None, init=None): <NEW_LINE> <INDENT> self._type = None <NEW_LINE> self.... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62599055097d151d1a2c25a0 |
class FloatSlider(qt.QWidget): <NEW_LINE> <INDENT> sigSettingChanged = qt.pyqtSignal(qt.QObject, object, object) <NEW_LINE> def __init__(self, setting, parent): <NEW_LINE> <INDENT> qt.QWidget.__init__(self, parent) <NEW_LINE> self.setting = setting <NEW_LINE> self.setting.setOnModified(self.onModified) <NEW_LINE> layou... | A slider control for a numerical value.
Note: QSlider is integer only, so dragging slider makes values integers | 62599055adb09d7d5dc0ba9e |
class AcceptError(Exception): <NEW_LINE> <INDENT> def __init__(self, code, message): <NEW_LINE> <INDENT> self.code = code <NEW_LINE> self.message = message <NEW_LINE> super(AcceptError, self).__init__(code, message) | Exception thrown on incompatiblity with acceptable response
characteristics. | 62599055a219f33f346c7d39 |
class MultidropIMAPSSLRetriever(MultidropIMAPRetrieverBase, IMAPSSLinitMixIn): <NEW_LINE> <INDENT> _confitems = ( ConfInstance(name='configparser', required=False), ConfDirectory(name='getmaildir', required=False, default='~/.getmail/'), ConfInt(name='timeout', required=False, default=180), ConfString(name='server'), C... | Retriever class for multi-drop IMAPv4-over-SSL mailboxes.
| 625990554428ac0f6e659a6e |
class ActorCannotTalk(ActorException): <NEW_LINE> <INDENT> pass | When an actor cannot talk.
See Also:
:class:`Actor`
:meth:`Actor.say()` | 6259905501c39578d7f141d2 |
class IndividualViewSet(AccessView): <NEW_LINE> <INDENT> document = IndividualDocument <NEW_LINE> serializer_class = IndividualElasticSerializer <NEW_LINE> lookup_field = 'id' <NEW_LINE> ignore = [404] <NEW_LINE> filter_backends = [FilteringFilterBackend, IdsFilterBackend, OrderingFilterBackend, MultiMatchSearchFilterB... | Endpoint to query individuals
The individual endpoint gives access to the individual subjects data. | 625990550a50d4780f706859 |
class HelpWidget(RichJupyterWidget): <NEW_LINE> <INDENT> def clean_invalid_var_chars(self, var): <NEW_LINE> <INDENT> return re.sub(r'\W|^(?=\d)', '_', var) <NEW_LINE> <DEDENT> def get_signature(self, content): <NEW_LINE> <INDENT> data = content.get('data', {}) <NEW_LINE> text = data.get('text/plain', '') <NEW_LINE> if ... | Widget with the necessary attributes and methods to handle communications
between the IPython Console and the Help plugin | 62599055460517430c432aec |
class StackedDAE(Model): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(StackedDAE, self).__init__() <NEW_LINE> log.error("StackedDAE not implemented yet!") <NEW_LINE> raise NotImplementedError("StackedDAE not implemented yet!") | A stacked Denoising Autoencoder stacks multiple layers of DAE's | 625990558e7ae83300eea5c9 |
class Location(object): <NEW_LINE> <INDENT> def __init__(self, name, description): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.description = description <NEW_LINE> self.neighbors = {} <NEW_LINE> self.items = {} <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "<Location: %s>" % self.name <NEW_... | The base class for every location in the game. To make a new Location, simply call
the constructor: Location(name, description, *items) and a new Location with the
specified information will be created.
You may subclass Location to create other types of locations, such as DungeonLocation
or something. | 62599055596a89723612904a |
class PI(object): <NEW_LINE> <INDENT> def __init__(self, setPoint, kp=0, ki=0): <NEW_LINE> <INDENT> self._kp = kp <NEW_LINE> self._ki = ki <NEW_LINE> self._setPoint = setPoint <NEW_LINE> self.error = 0.0 <NEW_LINE> self._started = False <NEW_LINE> <DEDENT> def update(self, currentValue): <NEW_LINE> <INDENT> self.error ... | Discrete PI control | 62599055fff4ab517ebced58 |
@description("Upgrades given volume") <NEW_LINE> class UpgradeVolumeCommand(Command): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> self.parent = parent <NEW_LINE> <DEDENT> def run(self, context, args, kwargs, opargs): <NEW_LINE> <INDENT> tid = context.submit_task('volume.upgrade', self.parent.en... | Usage: upgrade
Examples: upgrade
Upgrades a volume. | 6259905510dbd63aa1c72113 |
class PastDeadline(commands.CommandError): <NEW_LINE> <INDENT> def __init__(self, reschedule_deadline_hours, referees_mentions, match_id): <NEW_LINE> <INDENT> self.reschedule_deadline_hours = reschedule_deadline_hours <NEW_LINE> self.referees_mentions = referees_mentions <NEW_LINE> self.match_id = match_id | Special exception in case the deadline is passed. | 62599055d6c5a102081e3653 |
class ParseError(Exception): <NEW_LINE> <INDENT> def __init__(self, message, lineno=None): <NEW_LINE> <INDENT> Exception.__init__(self) <NEW_LINE> self.message = message <NEW_LINE> self.lineno = lineno | Exception to signal parsing error
| 62599055baa26c4b54d507d9 |
class TestBaseModels(object): <NEW_LINE> <INDENT> def test_state(self): <NEW_LINE> <INDENT> state = mixer.blend("base.State") <NEW_LINE> assert state is not None, "Should create a State model" <NEW_LINE> assert type(str(state)) == str, "State should be a str object" <NEW_LINE> <DEDENT> def test_event_type(self): <NEW_L... | Test class for core models | 6259905545492302aabfda0d |
class ChromeMiddlewware(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ChromeMiddlewware, self).__init__() <NEW_LINE> <DEDENT> def process_request(self, request, spider): <NEW_LINE> <INDENT> if spider.name.find("chrome") >= 0: <NEW_LINE> <INDENT> spider.browser.get(url=request.url) <NEW_LINE... | 使用chrome去打开网页的中间件
打开网页后获取页面的源码
需要配置在scrapyProject.settings.py的DOWNLOADER_MIDDLEWARES中 | 625990558a43f66fc4bf36c3 |
class MenuBorderStyleFactory(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.logger = logging.getLogger(type(self).__name__) <NEW_LINE> <DEDENT> def create_border(self, border_style_type): <NEW_LINE> <INDENT> if border_style_type == MenuBorderStyleType.ASCII_BORDER: <NEW_LINE> <INDENT> return ... | Factory class for creating MenuBorderStyle instances. | 6259905594891a1f408ba191 |
class Chromium(recipe_util.Recipe): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def fetch_spec(props): <NEW_LINE> <INDENT> url = 'https://chromium.googlesource.com/chromium/src.git' <NEW_LINE> solution = { 'name' :'src', 'url' : url, 'deps_file': '.DEPS.git', 'managed' : False, 'custom_deps': {}, 'safesync_url'... | Basic Recipe class for Chromium. | 62599055d53ae8145f919998 |
class CsvGenerator(MapReduceBase): <NEW_LINE> <INDENT> WRITER_CLASS = CsvWriter <NEW_LINE> @classmethod <NEW_LINE> def _flatten_json(cls, _dict, prefix=''): <NEW_LINE> <INDENT> for key in _dict.keys(): <NEW_LINE> <INDENT> value = _dict.pop(key) <NEW_LINE> _nested = None <NEW_LINE> if type(value) == dict: <NEW_LINE> <IN... | Generates a CSV file from a JSON formatted input file. | 625990553539df3088ecd7dc |
class ItemMedia(_BaseItemMedia): <NEW_LINE> <INDENT> def __init__(self, root, item): <NEW_LINE> <INDENT> _BaseItemMedia.__init__(self, root) <NEW_LINE> self.item = item <NEW_LINE> self.identifier = item.identifier <NEW_LINE> <DEDENT> def sprite(self, version=None): <NEW_LINE> <INDENT> identifier = self.identifier <NEW_... | Media related to an item
| 62599055097d151d1a2c25a2 |
class DownloadError(Exception): <NEW_LINE> <INDENT> pass | Error happened during download or when processing the file | 625990554e4d56256637393e |
class LoadoutData(RESTPayload): <NEW_LINE> <INDENT> loadout_id: int <NEW_LINE> profile_id: int <NEW_LINE> faction_id: int <NEW_LINE> code_name: str | Data class for :class:`auraxium.ps2.Loadout`.
This class mirrors the payload data returned by the API, you may
use its attributes as keys in filters or queries. | 62599055b5575c28eb713767 |
class EventDispatcher(Thread): <NEW_LINE> <INDENT> RESPONSE_HEADER = {'Content-Type': 'application/json'} <NEW_LINE> def __init__(self, event, subscription, retry_attempts, retry_interval): <NEW_LINE> <INDENT> Thread.__init__(self) <NEW_LINE> self.event = event <NEW_LINE> self.subscription = subscription <NEW_LINE> sel... | Dispatches an event to its subscribers | 6259905501c39578d7f141d3 |
class GraphWatershedAssignmentsLSF(GraphWatershedAssignmentsBase, LSFTask): <NEW_LINE> <INDENT> pass | GraphWatershedAssignments on lsf cluster
| 62599055379a373c97d9a55b |
class ModuleDataGo1_10_15_64(ctypes.Structure): <NEW_LINE> <INDENT> _fields_ = [ ("pclntable", ctypes.c_uint64), ("pclntable_len", ctypes.c_uint64), ("pclntable_cap", ctypes.c_uint64), ("ftab", ctypes.c_uint64), ("ftab_len", ctypes.c_uint64), ("ftab_cap", ctypes.c_uint64), ("filetab", ctypes.c_uint64), ("filetab_len",... | parse 64-bit Go1.10 through Go1.15 | 625990550c0af96317c577fb |
class YandexMailLogin(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.driver = webdriver.Chrome() <NEW_LINE> self.driver.implicitly_wait(15) <NEW_LINE> self.driver.get('https://yandex.ru/') <NEW_LINE> <DEDENT> def test_login_yandex_mail(self): <NEW_LINE> <INDENT> driver = self.driver <... | Открываем главную страницу Яндекс, логинимся в почте | 6259905521bff66bcd72419c |
class RandomThreeParentsComposableTechnique(ComposableEvolutionaryTechnique): <NEW_LINE> <INDENT> def __init__(self, cr = 0.9, must_mutate_count=1, information_sharing=1, *pargs, **kwargs): <NEW_LINE> <INDENT> super(RandomThreeParentsComposableTechnique, self).__init__(*pargs, **kwargs) <NEW_LINE> self.cr = cr <NEW_LIN... | based on DifferentialEvolution | 62599055a17c0f6771d5d63d |
class BaseModel(pw.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> database = cc.model_setup() | Base class for all database models | 62599055e5267d203ee6ce26 |
class Image(Resource): <NEW_LINE> <INDENT> def __init__(self, data, mime_type, title=None, inline=False): <NEW_LINE> <INDENT> super(Image, self).__init__(data=data, mime_type=mime_type, title=title) <NEW_LINE> self._inline = inline <NEW_LINE> <DEDENT> @property <NEW_LINE> def inline(self): <NEW_LINE> <INDENT> return se... | Subclass of :class:`Resource`, rendered as an image. | 62599055435de62698e9d33a |
@six.add_metaclass(abc.ABCMeta) <NEW_LINE> class ProxyObjectBase(object): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def resolve(self, session): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def relative_to_timestep_i... | A proxy for an object (i.e. halo, group, BH etc) in the database | 625990553cc13d1c6d466c75 |
class Metric(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=50) <NEW_LINE> slug = models.SlugField(unique=True, max_length=60, db_index=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = 'Metric' <NEW_LINE> verbose_name_plural = 'Metrics' <NEW_LINE> <DEDENT> def __unicode__(self): <N... | The type of metric we want to store | 62599055379a373c97d9a55c |
class Quick: <NEW_LINE> <INDENT> def __init__(self, array): <NEW_LINE> <INDENT> self.array = array <NEW_LINE> pass <NEW_LINE> <DEDENT> def sort(self, lo=None, hi=None): <NEW_LINE> <INDENT> if lo == None: <NEW_LINE> <INDENT> lo = 0 <NEW_LINE> <DEDENT> if hi == None: <NEW_LINE> <INDENT> hi = len(self.array)-1 <NEW_LINE> ... | Quick sorting implementation | 62599055fff4ab517ebced5a |
class TestValidate(unittest.TestCase): <NEW_LINE> <INDENT> def test_validate_pass(self): <NEW_LINE> <INDENT> response = {'snippet': {'channelTitle': 'paramount picture', 'title': 'Trailer'}, 'duration': 'PT04M15S'} <NEW_LINE> self.assertTrue(Validate.validate(response)) <NEW_LINE> <DEDENT> def test_validate_fail_title(... | Testing the class ValidateVideo | 62599055d6c5a102081e3655 |
@command(user_commands) <NEW_LINE> class user_uuid2name(_init_synnefo_astakosclient, _optional_json): <NEW_LINE> <INDENT> def _run(self, uuids): <NEW_LINE> <INDENT> r = self.client.get_usernames(uuids) <NEW_LINE> self._print(r, self.print_dict) <NEW_LINE> unresolved = set(uuids).difference(r) <NEW_LINE> if unresolved: ... | Get user name(s) from uuid(s) | 62599055a79ad1619776b559 |
class SectionCompositeImage: <NEW_LINE> <INDENT> def __init__(self, raw): <NEW_LINE> <INDENT> self.columns, = struct.unpack('>H', raw[0:2]) <NEW_LINE> self.rows, = struct.unpack('>H', raw[2:4]) <NEW_LINE> self.layout = [] <NEW_LINE> offset = 4 <NEW_LINE> for i in range(self.rows): <NEW_LINE> <INDENT> col = [] <NEW_LINE... | A composite image consists of a 2D array
of rows and columns. The entries in the array
are uid's. | 625990553617ad0b5ee0767f |
class MarkupTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> copy = copytext.Copy('examples/test_copy.xlsx') <NEW_LINE> self.sheet = copy['content'] <NEW_LINE> <DEDENT> def test_markup_row(self): <NEW_LINE> <INDENT> row = self.sheet['footer_title'] <NEW_LINE> self.assertTrue(isinsta... | Test strings get Markup'd. | 62599055dc8b845886d54afc |
class MemberViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Member.objects.all() <NEW_LINE> serializer_class = MemberSerializer <NEW_LINE> permission_classes = [APIPermission] <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> allowed_query_params = [ 'id', 'account_id', 'phone_number', 'client_membe... | A model ViewSet for viewing, creating and deleting Member objects. | 6259905576d4e153a661dd17 |
class ContextEnd(RuntimeError): <NEW_LINE> <INDENT> pass | Context has been explicitly ended.
| 62599055baa26c4b54d507db |
class FindDuplicateBlogPostSummaryTitlesJob(base_jobs.JobBase): <NEW_LINE> <INDENT> def run( self ) -> beam.PCollection[blog_validation_errors.DuplicateBlogTitleError]: <NEW_LINE> <INDENT> return ( self.pipeline | 'Get every Blog Summary Model' >> ( ndb_io.GetModels(blog_models.BlogPostSummaryModel.query())) | GetModel... | Validates that all the Blog Post Summary Model have unique title. | 625990554e696a045264e8be |
@pwchecker('number_of_digits') <NEW_LINE> class CheckNumberOfDigits(PasswordChecker): <NEW_LINE> <INDENT> def __init__(self, digits=1): <NEW_LINE> <INDENT> self._requirement = _( "Must contain at least {digits} digits").format(digits=digits) <NEW_LINE> self.digits = digits <NEW_LINE> <DEDENT> def check_password(self, p... | Require a minimum number of digits in the password. | 62599055097d151d1a2c25a3 |
class Solution: <NEW_LINE> <INDENT> @timeit <NEW_LINE> def shortestPathLength(self, graph: List[List[int]]) -> int: <NEW_LINE> <INDENT> from collections import deque, defaultdict <NEW_LINE> n = len(graph) <NEW_LINE> stk = deque() <NEW_LINE> dist = defaultdict(lambda: n*n) <NEW_LINE> for i in range(n): <NEW_LINE> <INDEN... | [847. 访问所有节点的最短路径](https://leetcode-cn.com/problems/shortest-path-visiting-all-nodes/) | 6259905571ff763f4b5e8ce7 |
class BaseApp(GenericWSGIApplication): <NEW_LINE> <INDENT> def service(self, req): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return GenericWSGIApplication.service(self, req) <NEW_LINE> <DEDENT> except exc.HTTPException as error: <NEW_LINE> <INDENT> raise <NEW_LINE> <DEDENT> except StandardError as error: <NEW_LINE> ... | Base class for all licensing WSGI application. | 62599055d53ae8145f91999a |
@functools.total_ordering <NEW_LINE> class Temp: <NEW_LINE> <INDENT> def __init__(self, temp_value: T.Any) -> None: <NEW_LINE> <INDENT> if isinstance(temp_value, Temp): <NEW_LINE> <INDENT> parsed = self.parse_temp(temp_value.value) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> parsed = self.parse_temp(temp_value) <NEW_... | A class holding a temperature value. | 6259905573bcbd0ca4bcb7c9 |
class WithDirective(Directive): <NEW_LINE> <INDENT> __slots__ = ['vars'] <NEW_LINE> def __init__(self, value, template, namespaces=None, lineno=-1, offset=-1): <NEW_LINE> <INDENT> Directive.__init__(self, None, template, namespaces, lineno, offset) <NEW_LINE> self.vars = [] <NEW_LINE> value = value.strip() <NEW_LINE> t... | Implementation of the ``py:with`` template directive, which allows
shorthand access to variables and expressions.
>>> from genshi.template import MarkupTemplate
>>> tmpl = MarkupTemplate('''<div xmlns:py="http://genshi.edgewall.org/">
... <span py:with="y=7; z=x+10">$x $y $z</span>
... </div>''')
>>> print(tmpl.gene... | 625990558da39b475be04724 |
class Preview(JAMediaButton): <NEW_LINE> <INDENT> def __init__(self, pagina): <NEW_LINE> <INDENT> JAMediaButton.__init__(self) <NEW_LINE> self.color = Gdk.Color(65000,65000,50000) <NEW_LINE> for child in self.get_children(): <NEW_LINE> <INDENT> self.remove(child) <NEW_LINE> child.destroy() <NEW_LINE> <DEDENT> self.pagi... | Preview para las paginas del documento pdf. | 62599055009cb60464d02a6e |
class Peer(object): <NEW_LINE> <INDENT> __slots__ = ( 'tchannel', 'state', 'host', 'port', '_out_conns', '_in_conns', '_connecting', ) <NEW_LINE> connection_class = StreamConnection <NEW_LINE> def __init__(self, tchannel, hostport, state=None): <NEW_LINE> <INDENT> state = state or PeerHealthyState(self) <NEW_LINE> asse... | A Peer manages connections to or from a specific host-port. | 62599055cb5e8a47e493cc23 |
class Preferences: <NEW_LINE> <INDENT> def __init__(self, known_roles="ON", reveal_on_death="ON", kick_on_death="OFF", know_if_saved="ON", start_night="EVEN", standard_roles="OFF"): <NEW_LINE> <INDENT> self.book = {} <NEW_LINE> self.book["known_roles"] = known_roles <NEW_LINE> self.book["reveal_on_death"] = reveal_on_d... | Holds all of the preference variables for how the game is played | 6259905563b5f9789fe866aa |
class Humain(object): <NEW_LINE> <INDENT> def __init__(self,x,y): <NEW_LINE> <INDENT> self.x=x <NEW_LINE> self.y=y <NEW_LINE> <DEDENT> def maj(self, field, nature_case): <NEW_LINE> <INDENT> Lx=[] <NEW_LINE> Ly=[] <NEW_LINE> L_krank=[] <NEW_LINE> min=[] <NEW_LINE> min_choix=[] <NEW_LINE> dist_min=0 <NEW_LINE> for i in [... | superclass which contains the AI moving on the map
:param x,y : position of the case where is the element | 6259905524f1403a9268636b |
class GetPageRevisionInfos(QueryOperation): <NEW_LINE> <INDENT> field_prefix = 'rv' <NEW_LINE> input_field = MultiParam('titles', key_prefix=False) <NEW_LINE> fields = [StaticParam('prop', 'revisions'), MultiParam('prop', DEFAULT_PROPS)] <NEW_LINE> output_type = [RevisionInfo] <NEW_LINE> examples = [OperationExample('C... | Fetch revisions for pages. | 625990558e71fb1e983bd002 |
class MultilabelDiceMeter(Meter): <NEW_LINE> <INDENT> def __init__(self, n_labels=2, prefix="", parse_output=None, parse_target=None, cond=None): <NEW_LINE> <INDENT> super(MultilabelDiceMeter, self).__init__(name='dice', prefix=prefix, desc_name=None) <NEW_LINE> self.__parse_output = parse_output <NEW_LINE> self.__pars... | Implements device-invariant image-Wise Jaccard and Dice Meter for binary multilabel sigementation problems.
Parameters
----------
n_labels: int
Number of outputs in the segmentation model
prefix: str
Prefix to be displayed in the progressbar and tensorboard
parse_output: Callable
Function to parse the outp... | 625990551f037a2d8b9e5308 |
class FlattenDictTransformer(BaseEstimator, TransformerMixin): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def fit(self, X, y=None): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def transform(self, X, y=None, parent_key='', sep='_'): <NEW_LINE> <INDENT> if not X: <NEW_LIN... | Flatten nested dicts for use in DictVectorizer. | 62599055adb09d7d5dc0baa3 |
class UVFitsError(Exception): <NEW_LINE> <INDENT> def __init__(self, message, file_name): <NEW_LINE> <INDENT> self.file_name = file_name <NEW_LINE> self.message = message <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return f"{self.message}: {self.file_name}" | Base class for exceptions in this module. | 6259905591af0d3eaad3b360 |
class IpCommand(DeviceCtrl): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(self, *args, **kwargs) <NEW_LINE> self.cmdSocket = IpCmdIf.IpCmdSocket(self, *args, **kwargs ) <NEW_LINE> self.sendCmds = { "targ": kwargs.get("target", "FF:FF:FF:FF:FF:FF"), "cmd": kwargs.get("co... | demonstration class only
- coded for clarity, not efficiency | 6259905532920d7e50bc7589 |
class Snippet: <NEW_LINE> <INDENT> def __init__(self, name: str, content: str): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.interpreter_type = "python" <NEW_LINE> ca = content.split('\n') <NEW_LINE> if ca[0].startswith('#!'): <NEW_LINE> <INDENT> self.interpreter_type = ca.pop(0)[2:] <NEW_LINE> <DEDENT> self.co... | Represents a code snippet and is stringy. | 62599055b57a9660fecd2fb4 |
class PullContainer: <NEW_LINE> <INDENT> request_id: str <NEW_LINE> received_count: int <NEW_LINE> request_count: int <NEW_LINE> status: PullProcess <NEW_LINE> last_received: datetime <NEW_LINE> messages: List[HorseMessage] <NEW_LINE> future: asyncio.Future <NEW_LINE> each_msg_func: Callable[[int, HorseMessage], None] | Response container of pull request | 62599055dd821e528d6da418 |
class StrandCommunicationException(SLAException): <NEW_LINE> <INDENT> pass | Raise when there's an over-the-wire issue receiving a request/response from Strand | 6259905582261d6c52730966 |
class Scheduler(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.nodes = OrderedDict() <NEW_LINE> self.ready = OrderedDict() <NEW_LINE> <DEDENT> def initialize(self): <NEW_LINE> <INDENT> visited = {} <NEW_LINE> for node in self.nodes.values(): <NEW_LINE> <INDENT> for leaf in get_leaves(node, vi... | the design of this scheduler is that it should be invoked
iteratively to obtain a list of nodes that are "ready" to process.
each node that is ready should either:
- be submitted: node.submitted()
- be marked as done: node.done()
- be cancelled: node.cancelled() | 62599055b7558d58954649c7 |
class SubscriberSendSMS(ProtectedView): <NEW_LINE> <INDENT> permission_required = ['send_sms', 'view_subscriber'] <NEW_LINE> def get(self, request, imsi=None): <NEW_LINE> <INDENT> user_profile = UserProfile.objects.get(user=request.user) <NEW_LINE> network = user_profile.network <NEW_LINE> try: <NEW_LINE> <INDENT> subs... | Send an SMS to a single subscriber. | 62599055be383301e0254d29 |
class RemoteServiceError(MaybeRecoverableError): <NEW_LINE> <INDENT> pass | E.g. google | 625990553cc13d1c6d466c77 |
class Translation(object): <NEW_LINE> <INDENT> __instance = None <NEW_LINE> def __new__(cls): <NEW_LINE> <INDENT> if cls.__instance == None: <NEW_LINE> <INDENT> cls.__instance = super().__new__(cls) <NEW_LINE> <DEDENT> return cls.__instance <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_instance(cls): <NEW_LINE> <... | This singleton handles the translation.
The object is created by calling the get_instance() method.
The language is defined in the ini file's [languages] section as "language" key
The _() method is to get back the translated string.
If the translation file or the translation in the file is not there then the
string in... | 62599055004d5f362081fa89 |
class StoneCell(gtk.Button): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> gtk.Button.__init__(self, None) <NEW_LINE> self.set_size_request(40,40) <NEW_LINE> self.image = gtk.Image() <NEW_LINE> self.add(self.image) <NEW_LINE> <DEDENT> def set_value(self, value): <NEW_LINE> <INDENT> pixbuf=pixbufs[value] <... | Il widget che mostra le pedine in attesa di inserimento | 62599055379a373c97d9a55e |
class LegacyAssessmentAdapterMixin: <NEW_LINE> <INDENT> def set_legacy_attr(self, pk): <NEW_LINE> <INDENT> self.parent = get_object_or_404(self.parent_model, pk=pk) <NEW_LINE> self.assessment = self.parent.get_assessment() | A mixin that allows API viewsets to interact with legacy methods. | 62599055dc8b845886d54afe |
class TestFaultCohesive(TestAbstractComponent): <NEW_LINE> <INDENT> _class = FaultCohesive | Unit testing of FaultCohesive object.
| 6259905516aa5153ce401a1e |
class WebMusicSong(WebMusicSong): <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> self.copyright = False <NEW_LINE> self.duration = None <NEW_LINE> self.is_original = False <NEW_LINE> self.labels = [] <NEW_LINE> self.name = "" <NEW_LINE> self.other_sites = [] <NEW_LINE> self.poster = "" <NEW_LINE> s... | 网页搜索音乐歌曲信息搜索结果结果模型
这是一个遵照BaiduSpider网页搜索音乐歌曲信息搜索结果结果模型创建的返回模型类。
Attributes:
copyright (bool): 歌曲是否有版权限制
duration (datetime.time): 歌曲时长
is_original (bool): 歌曲是否为原唱
labels (List[str]): 歌曲标签
name (str): 歌曲名称
other_sites (List[str]): 歌曲其他网站链接
poster (str): 歌曲海报图片链接
pub_company (str | None)... | 62599055d99f1b3c44d06bda |
@singleton <NEW_LINE> class DbHelper(object): <NEW_LINE> <INDENT> TAG = "DbHelper" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.connect() <NEW_LINE> self.logger = Logger() <NEW_LINE> <DEDENT> def connect(self): <NEW_LINE> <INDENT> self.conn = MySQLdb.connect( host=Config.HOST, port=Config.PORT, user=Config.U... | Encapsulate basic operations of database | 62599055d53ae8145f91999c |
class MaxLeverage(object): <NEW_LINE> <INDENT> def start_of_simulation(self, *args): <NEW_LINE> <INDENT> self._max_leverage = 0.0 <NEW_LINE> <DEDENT> def end_of_bar(self, packet, ledger, dt, session_ix, data_portal): <NEW_LINE> <INDENT> self._max_leverage = max(self._max_leverage, ledger.account.leverage) <NEW_LINE> pa... | Tracks the maximum account leverage.
| 6259905521a7993f00c674a8 |
class KubernetesRole(Role): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'kind': {'required': True}, 'system_data': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'host_platform_type': {'readonly': True}, } <NEW_LINE> _attribute_map... | Kubernetes role.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: The path ID that uniquely identifies the object.
:vartype id: str
:ivar name: The object name.
:vartype name: str
:ivar type: The hie... | 6259905563b5f9789fe866ac |
class ServiceSerializer(BaseSerializer, serializers.ServiceSerializer, RelatedSerializerMixin): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Service <NEW_LINE> fields = ('name', 'db_version', 'description', 'short_description', 'runner', 'srv_run_params', 'submissions', 'service_outputs', 'exit_codes') <... | Service export / import | 6259905524f1403a9268636c |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.