code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class TestInterpolationSearch(unittest.TestCase): <NEW_LINE> <INDENT> def test_interpolationsearch(self): <NEW_LINE> <INDENT> self.seq = range(10) <NEW_LINE> rv1 = interpolation_search.interpolation_search(self.seq, 0) <NEW_LINE> rv2 = interpolation_search.interpolation_search(self.seq, 9) <NEW_LINE> rv3 = interpolatio...
Tests teranry search algorithm on unimodal functions
62598f0c167d2b6e312b5afc
class TypeFilteredResource(ModelResource): <NEW_LINE> <INDENT> count = fields.IntegerField() <NEW_LINE> type_filter = None <NEW_LINE> title_filter = None <NEW_LINE> def dehydrate_count(self, bundle): <NEW_LINE> <INDENT> raise Exception('dehydrate_count not implemented in the child class') <NEW_LINE> <DEDENT> def build_...
Common resource used to apply faceting to categories and keywords based on the type passed as query parameter in the form type:layer/map/document
62598f0c7b180e01f3e485f9
class GetDebug(request.Handler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> if not self.loadNation(): <NEW_LINE> <INDENT> self.writeLogoutJSON() <NEW_LINE> return <NEW_LINE> <DEDENT> request = self.getJSONRequest() <NEW_LINE> mapblock = MapBlock(Vect(request['bx'], request['by'])) <NEW_LINE> if mapblock.exi...
Handle Debug requests.
62598f0c283ffb24f3cf240f
class BiosVfMemoryInterleave(ManagedObject): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> ManagedObject.__init__(self, "BiosVfMemoryInterleave") <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def class_id(): <NEW_LINE> <INDENT> return "biosVfMemoryInterleave" <NEW_LINE> <DEDENT> DN = "Dn" <NEW_LINE> RN = "...
This class contains the relevant properties and constant supported by this MO.
62598f0cbf627c535bcaffd8
class SzMap(ConformalMap): <NEW_LINE> <INDENT> def __init__(self, range=None, conformalCenter=0, **kwargs): <NEW_LINE> <INDENT> if isinstance(range, ClosedCurve): <NEW_LINE> <INDENT> range = Region(range) <NEW_LINE> <DEDENT> if not range.issimplyconnected(): <NEW_LINE> <INDENT> raise Exception('Region must be simply co...
SzMap represents a Riemann map via the Szego kernel.
62598f0cfbf16365ca792c00
class Configuration(ModelSingleton, ModelSQL, ModelView): <NEW_LINE> <INDENT> __name__ = 'purchase.configuration' <NEW_LINE> purchase_sequence = fields.Property(fields.Many2One('ir.sequence', 'Purchase Sequence', domain=[ ('company', 'in', [Eval('context', {}).get('company', -1), None]), ('code', '=', 'purchase.purchas...
Purchase Configuration
62598f0c71ff763f4b5e62c7
class TaskPlug(Plug): <NEW_LINE> <INDENT> def __init__(self, slot, obj=None, default=None, **kwargs): <NEW_LINE> <INDENT> if default is not None: <NEW_LINE> <INDENT> default = ensure_processor(default, **kwargs) <NEW_LINE> <DEDENT> if obj is not None: <NEW_LINE> <INDENT> obj = ensure_processor(obj) <NEW_LINE> <DEDENT> ...
Plug to ensure all contained objects are Processors
62598f0cf548e778e596a0ed
class ScannedFile(object): <NEW_LINE> <INDENT> def __init__(self, row): <NEW_LINE> <INDENT> self.__state = row['state'] <NEW_LINE> self.__filename = row['filename'] <NEW_LINE> self.__id = row['id'] <NEW_LINE> self.__filetype = row['filetype'] <NEW_LINE> self.__creationDate = row['creationDate'] <NEW_LINE> <DEDENT> def ...
classdocs
62598f0c4a966d76dd5eda38
class B8Scraping: <NEW_LINE> <INDENT> def __init__(self, source): <NEW_LINE> <INDENT> self.soup = BeautifulSoup(source, 'html.parser') <NEW_LINE> <DEDENT> def sourcecode(self): <NEW_LINE> <INDENT> return self.soup.prettify() <NEW_LINE> <DEDENT> def find_all(self, tag): <NEW_LINE> <INDENT> return self.soup.find_all(tag)...
Website scraping pip install beautifulsoup4
62598f0c50812a4eaa62019e
class SourceFile(CodeSnippet): <NEW_LINE> <INDENT> def _getCode(self): <NEW_LINE> <INDENT> if self.code: <NEW_LINE> <INDENT> with open(self.code, "r") as openFile: <NEW_LINE> <INDENT> return openFile.read() <NEW_LINE> <DEDENT> <DEDENT> return "" <NEW_LINE> <DEDENT> def _getLexer(self): <NEW_LINE> <INDENT> if self.lexer...
Enables adding a formatted source file directly to a page.
62598f0cec188e330fdf7417
class _DiscogsSession(): <NEW_LINE> <INDENT> API_BASEURL: Final[str] = 'https://api.discogs.com' <NEW_LINE> API_FORMAT: Final[str] = 'application/vnd.discogs.v2.plaintext+json' <NEW_LINE> API_LIMIT: Final[int] = 100 <NEW_LINE> API_RATELIMIT: Final[int] = 60 <NEW_LINE> API_RATELIMIT_STATUS: Final[int] = 429 <NEW_LINE> A...
Discogs Session. This class will handle the requests made to the discogs API. Args: token (str): Discogs token. user_agent (str, optional): User agent description.
62598f0cad47b63b2c5a637e
class Taxii(CritsSchemaDocument, CritsDocument, Document): <NEW_LINE> <INDENT> meta = { "allow_inheritance": False, "collection": 'taxii', "crits_type": 'TAXII', "latest_schema_version": 1, "minify_defaults": [ 'runtime', 'end', 'feed' ], "schema_doc": { 'runtime': 'The last time we made a TAXII request.', 'end': 'End ...
TAXII Document Object
62598f0c7cff6e4e811b454e
class Circle(Arc): <NEW_LINE> <INDENT> CONFIG = { "color": RED, "close_new_points": True, "anchors_span_full_range": False } <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> Arc.__init__(self, 0, TAU, **kwargs) <NEW_LINE> <DEDENT> def surround(self, mobject, dim_to_match=0, stretch=False, buffer_factor=1.2)...
A full `Arc` CONFIG Parameters: ------------------ color close_new_points anchors_span_full_range
62598f0c283ffb24f3cf2413
class Key(models.Model): <NEW_LINE> <INDENT> CONFIG_TYPE_ANY = 0 <NEW_LINE> CONFIG_TYPE_STRICT = 1 <NEW_LINE> CONFIG_TYPE = { (CONFIG_TYPE_ANY, "ANY"), (CONFIG_TYPE_STRICT, "STRICT") } <NEW_LINE> value = models.CharField(max_length=128, unique=True) <NEW_LINE> config_type = models.IntegerField(choices=CONFIG_TYPE, defa...
Identifies an associated list of values. For example, the key product could have the values ipod, ipad and walkman. The set of values are stored in the Values table.
62598f0c9f2886367281735d
class ComputeDisksInsertRequest(_messages.Message): <NEW_LINE> <INDENT> disk = _messages.MessageField('Disk', 1) <NEW_LINE> project = _messages.StringField(2, required=True) <NEW_LINE> sourceImage = _messages.StringField(3) <NEW_LINE> zone = _messages.StringField(4, required=True)
A ComputeDisksInsertRequest object. Fields: disk: A Disk resource to be passed as the request body. project: Project ID for this request. sourceImage: Optional. Source image to restore onto a disk. zone: The name of the zone for this request.
62598f0c71ff763f4b5e62cb
class CleanAll(clean.CleanAll): <NEW_LINE> <INDENT> user_options = [ ("keep-build", None, "do not clean build directory"), ("keep-dist", None, "do not clean dist directory"), ("keep-egginfo", None, "do not clean egg info directory"), ("keep-extra", None, "do not clean extra files"), ("name", None, "name of the bundled ...
Distutils command to clean all temporary files, compiled Python files, PyInstaller temp files and spec.
62598f0c377c676e912f6319
class ResourcesFormatter(logging.Formatter): <NEW_LINE> <INDENT> def __init__(self, fmt=None, datefmt=None): <NEW_LINE> <INDENT> logging.Formatter.__init__(self, fmt, datefmt) <NEW_LINE> self.resources = [ ('ru_utime', 'User time'), ('ru_stime', 'System time'), ('ru_maxrss', 'Max. Resident Set Size'), ('ru_ixrss', 'Sha...
Custom logging formatter
62598f0c4527f215b58e8a62
class Remoteness(models.TextChoices): <NEW_LINE> <INDENT> REMOTE = 'REMOTE', _('Remoto') <NEW_LINE> OFFICE = 'IN_OFFICE', _('Presencial') <NEW_LINE> HYBRID = 'MIXED', _('Mixto')
Choices for Remoteness.
62598f0cec188e330fdf741b
class InvalidResponseCodeFromGitHubError(SecurityMonkeyException): <NEW_LINE> <INDENT> def __init__(self, organization, response_code): <NEW_LINE> <INDENT> self.organization = organization <NEW_LINE> self.response_code = response_code <NEW_LINE> app.logger.info(self) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <I...
Unable to fetch data from GitHub
62598f0cd8ef3951e32c7408
class UserProfile(models.Model): <NEW_LINE> <INDENT> username = models.CharField(max_length=255, default='', unique=True) <NEW_LINE> password = models.CharField(max_length=255, default='') <NEW_LINE> email = models.EmailField(unique=True, null=True) <NEW_LINE> image = models.ImageField( upload_to="profiles", default=''...
Each user gets a profile.
62598f0c851cf427c66b6e32
class SingleModelStateActionQFunction( chainer.Chain, StateActionQFunction, RecurrentChainMixin): <NEW_LINE> <INDENT> def __init__(self, model): <NEW_LINE> <INDENT> super().__init__(model=model) <NEW_LINE> <DEDENT> def __call__(self, x, a): <NEW_LINE> <INDENT> h = self.model(x, a) <NEW_LINE> return h
Q-function with discrete actions. Args: model (chainer.Link): Link that is callable and outputs action values.
62598f0c3d592f4c4edb9a4f
class Solution: <NEW_LINE> <INDENT> def minPathSum(self, grid): <NEW_LINE> <INDENT> if grid == []: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> height = len(grid) <NEW_LINE> width = len(grid[0]) <NEW_LINE> path=[[0 for col in range(width)] for row in range(height)] <NEW_LINE> path[0][0] = grid[0][0] <NEW_LINE> for ...
@param: grid: a list of lists of integers @return: An integer, minimizes the sum of all numbers along its path
62598f0c7c178a314d78c009
class CalcZeroDivisionError(CalcError): <NEW_LINE> <INDENT> pass
Indicates division by zero
62598f0ca219f33f346c5395
class CardInHand(Requirement): <NEW_LINE> <INDENT> def requirement_met(self, game_state): <NEW_LINE> <INDENT> return game_state.card_in_hand(self.card)
A Card must be in the Hand.
62598f0cbf627c535bcaffe0
class Sources(object): <NEW_LINE> <INDENT> def __init__(self, sources=None): <NEW_LINE> <INDENT> self.swagger_types = { 'sources': 'list[Source]' } <NEW_LINE> self.attribute_map = { 'sources': 'sources' } <NEW_LINE> self._sources = sources <NEW_LINE> <DEDENT> @property <NEW_LINE> def sources(self): <NEW_LINE> <INDENT> ...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598f0c3d592f4c4edb9a51
class BTOOLS_OT_add_roof(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "btools.add_roof" <NEW_LINE> bl_label = "Add Roof" <NEW_LINE> bl_options = {"REGISTER", "UNDO", "PRESET"} <NEW_LINE> props: bpy.props.PointerProperty(type=RoofProperty) <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <IN...
Create roof from selected upward facing faces
62598f0c7b180e01f3e485fe
class Banner(models.Model): <NEW_LINE> <INDENT> goods = models.ForeignKey(Goods, verbose_name="商品", on_delete=models.CASCADE) <NEW_LINE> image = models.ImageField(upload_to="banner/", verbose_name="轮播图") <NEW_LINE> index = models.IntegerField(default=0, verbose_name='轮播顺序') <NEW_LINE> create_at = models.DateTimeField(a...
轮播的商品
62598f0c167d2b6e312b5b07
class Mixture(Layer): <NEW_LINE> <INDENT> def __init__(self, output_dim, **kwargs): <NEW_LINE> <INDENT> self.output_dim = output_dim <NEW_LINE> super(Mixture, self).__init__(**kwargs) <NEW_LINE> <DEDENT> def call(self, x, mask=None): <NEW_LINE> <INDENT> ensemble_layer, densities = x[:,:,:-1], x[:,:,-1] <NEW_LINE> retur...
Mixture model
62598f0c9f28863672817364
class PingMiddleware(object): <NEW_LINE> <INDENT> def process_request(self, request): <NEW_LINE> <INDENT> if "/ping" != request.path_info: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> import urllib <NEW_LINE> result = urllib.urlopen('http://' + settings.SELF + '/twisted_ping').read() <NEW_LINE> if result.lower().stri...
Special handling for the ping call. This skips the rest of the middleware.
62598f0c3617ad0b5ee04c99
@_tag <NEW_LINE> class Textarea(HtmlFlow, HtmlInteractive, HtmlPalpable, HtmlPhrasing, HtmlTextContent): <NEW_LINE> <INDENT> pass
Represents a multi-line plain-text editing control, useful when you want to allow users to enter a sizeable amount of free-form text, for example a comment on a review or feedback form. Categories: Listed, labelable, submittable, resettable, and autocapitalize-inheriting form-associated element: None. Contexts for ...
62598f0c60cbc95b06362e9e
class DecrZero(BadEnding): <NEW_LINE> <INDENT> num = 22 <NEW_LINE> error_message = "Tried to decrement unpopulated species"
Tried to decrement unpopulated species.
62598f0cfbf16365ca792c0a
@AUTH_PROVIDERS.register("homeassistant") <NEW_LINE> class HassAuthProvider(AuthProvider): <NEW_LINE> <INDENT> DEFAULT_TITLE = "Home Assistant Local" <NEW_LINE> def __init__(self, *args: Any, **kwargs: Any) -> None: <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.data: Optional[Data] = None <NEW_L...
Auth provider based on a local storage of users in Home Assistant config dir.
62598f0cbf627c535bcaffe2
class MouseEvent(object): <NEW_LINE> <INDENT> def __init__(self, position, event_type): <NEW_LINE> <INDENT> self.position = position <NEW_LINE> self.event_type = event_type
Mouse event, sent to `UIControl.mouse_handler`. :param position: `Point` instance. :param event_type: `MouseEventType`.
62598f0c656771135c4881f8
class LogFormatter(logging.Formatter): <NEW_LINE> <INDENT> def format(self, record): <NEW_LINE> <INDENT> if hasattr(record, 'funcNameOverride'): <NEW_LINE> <INDENT> record.funcName = record.funcNameOverride <NEW_LINE> <DEDENT> return super(LogFormatter, self).format(record)
http://stackoverflow.com/a/7004565/469997
62598f0c8a349b6b43684db0
class EditBucket(Form): <NEW_LINE> <INDENT> name = StringField('Tags', [validators.Length(min=1, max=20)]) <NEW_LINE> newname = StringField('Tags', [validators.Length(min=1, max=20)])
Edit Form
62598f0cad47b63b2c5a6386
class CrpNPCCorporationDivisionViewSet(viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> queryset = CrpNPCCorporationDivision.objects.all() <NEW_LINE> serializer_class = CrpNPCCorporationDivisionSerializer
API endpoint that allows CrpNPCCorporationDivisions to be viewed.
62598f0c3346ee7daa336c1a
class GladeApp(SimpleGladeApp): <NEW_LINE> <INDENT> def __init__(self, root=None, path=None): <NEW_LINE> <INDENT> SimpleGladeApp.__init__(self, path=path, root=root, domain=None)
Classe base per i widget creati utilizzando Glade
62598f0cbe7bc26dc9251418
class GlobalMixin(object): <NEW_LINE> <INDENT> def set_globe(self, globe): <NEW_LINE> <INDENT> self.globe = globe <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> if name not in PROPERTIES: <NEW_LINE> <INDENT> raise AttributeError(name) <NEW_LINE> <DEDENT> return getattr(self.globe, name)
! @brief Mixin class for classes using the Global class, for easy access to the Global variables. The class member 'global' needs to be set to a Global instance for this mixin to work.
62598f0cab23a570cc2d4323
class ExtraDataBlock(ActiveStructuple): <NEW_LINE> <INDENT> _fields_ = ( "size", "sig", "data" ) <NEW_LINE> _takes_stream = True <NEW_LINE> @classmethod <NEW_LINE> def from_stream(cls, stream, offset=None): <NEW_LINE> <INDENT> if offset is not None: <NEW_LINE> <INDENT> stream.seek(offset, SEEK_SET) <NEW_LINE> <DEDENT> ...
Base class for :class:`ExtraDataBlock` subclasses. .. attribute:: size The size of the structure in bytes. .. attribute:: sig The signature field. .. attribute:: data An optional field that describes the data in the structure. .. note:: Subclasses set this to ``None``
62598f0c283ffb24f3cf241b
class TestRGB_to_CMY(unittest.TestCase): <NEW_LINE> <INDENT> def test_RGB_to_CMY(self): <NEW_LINE> <INDENT> np.testing.assert_almost_equal( RGB_to_CMY(np.array([0.25, 0.60, 0.05])), np.array([0.75, 0.40, 0.95]), decimal=7) <NEW_LINE> np.testing.assert_almost_equal( RGB_to_CMY(np.array([0, 0, 0])), np.array([1., 1., 1.]...
Defines :func:`colour.models.deprecated.RGB_to_CMY` definition unit tests methods.
62598f0cec188e330fdf7421
class Task(): <NEW_LINE> <INDENT> def __init__(self, init_pose=None, init_velocities=None, init_angle_velocities=None, runtime=5., target_pos=None): <NEW_LINE> <INDENT> self.sim = PhysicsSim(init_pose, init_velocities, init_angle_velocities, runtime) <NEW_LINE> self.action_repeat = 3 <NEW_LINE> self.state_size = self.a...
Task (environment) that defines the goal and provides feedback to the agent.
62598f0c5fcc89381b2656e4
class AbstractCoroutineOutputEndpoint: <NEW_LINE> <INDENT> async def put(self, task): <NEW_LINE> <INDENT> raise NotImplementedError
Abstract coroutine output endpoint
62598f0c956e5f7376df4c34
class SharedSetupTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> _, self.tmp_seq_filepath = mkstemp(prefix='GenericRepSetPickerTest_', suffix='.fasta') <NEW_LINE> close(_) <NEW_LINE> seq_file = open(self.tmp_seq_filepath, 'w') <NEW_LINE> seq_file.write(dna_seqs) <NEW_LINE> seq_file.close() ...
Wrapper for shared setup stuff
62598f0c71ff763f4b5e62d4
class PrediagInvalidPathError(PrediagError): <NEW_LINE> <INDENT> def __init__(self, path_str, *args): <NEW_LINE> <INDENT> message = "Invalid path. Not a file or directory: {}".format(path_str) <NEW_LINE> super(PrediagInvalidPathError, self).__init__(message, *args)
The given path is not a file or directory.
62598f0c4527f215b58e8a6a
class TextImage (GenericGameObject): <NEW_LINE> <INDENT> def __init__ (self, obj, fname, fsize, fgc, bgc=None, cmp_value=None): <NEW_LINE> <INDENT> if isinstance(obj, basestring): <NEW_LINE> <INDENT> self._text = obj <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._text = obj.text <NEW_LINE> <DEDENT> self._fname = f...
Create a game object for display text.
62598f0c9f28863672817368
class _SinglePropertyFilter(FilterPredicate): <NEW_LINE> <INDENT> def _get_prop_name(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def _apply_to_value(self, value): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def _get_prop_names(self): <NEW_LINE> <INDENT> return set([sel...
Base class for a filter that operates on a single property.
62598f0c167d2b6e312b5b0b
class TestFileStorage(unittest.TestCase): <NEW_LINE> <INDENT> def test_file_storage_all_method(self): <NEW_LINE> <INDENT> storage = FileStorage() <NEW_LINE> storage_dict = storage.all() <NEW_LINE> self.assertIsInstance(storage_dict, dict) <NEW_LINE> for obj in storage_dict.values(): <NEW_LINE> <INDENT> self.assertIsIns...
class TestFileStorage
62598f0c7b180e01f3e48600
class TestArtifacts(): <NEW_LINE> <INDENT> def test_artifacts_serialization(self): <NEW_LINE> <INDENT> artifact_model = {} <NEW_LINE> artifact_model['name'] = 'testString' <NEW_LINE> artifact_model['updated'] = '2020-01-28T18:40:40.123456Z' <NEW_LINE> artifact_model['url'] = 'testString' <NEW_LINE> artifact_model['etag...
Test Class for Artifacts
62598f0c60cbc95b06362ea2
class VideoDescriptorTest(object): <NEW_LINE> <INDENT> openapi_types = { 'descriptor_type': 'VideoDescriptorType', 'reject_on_error': 'bool', 'checked': 'bool' } <NEW_LINE> attribute_map = { 'descriptor_type': 'descriptor_type', 'reject_on_error': 'reject_on_error', 'checked': 'checked' } <NEW_LINE> def __init__(self, ...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62598f0cfbf16365ca792c0e
class PackageSpecification(object): <NEW_LINE> <INDENT> def __init__(self, identifier=None, description=None, includes=None, definitions=None, render_source=True, stable=False, public=False): <NEW_LINE> <INDENT> self.identifier = identifier <NEW_LINE> self.description = description <NEW_LINE> self.includes = includes o...
Package is a collection of messages and types to generate code for.
62598f0cd8ef3951e32c740c
class Interface: <NEW_LINE> <INDENT> def __init__(self, network_class): <NEW_LINE> <INDENT> self.queue = multiprocessing.Queue() <NEW_LINE> self.network = network_class(message_queue=self.queue) <NEW_LINE> <DEDENT> def train(self): <NEW_LINE> <INDENT> self.network.start() <NEW_LINE> while True: <NEW_LINE> <INDENT> user...
A class to help interact with the neural networks.
62598f0c8a349b6b43684db4
class MappingOutput(_BaseOutput): <NEW_LINE> <INDENT> def c_key(self): <NEW_LINE> <INDENT> return self._get_color_scheme()["elements"]["key"] <NEW_LINE> <DEDENT> def paint(self, obj, offset=""): <NEW_LINE> <INDENT> out = [] <NEW_LINE> for key, value in obj.items(): <NEW_LINE> <INDENT> out.append("{}{}{}{}:".format(offs...
Output dictionary.
62598f0c5fcc89381b2656e5
class UnknownUsersPillow(BulkPillow): <NEW_LINE> <INDENT> document_class = XFormInstance <NEW_LINE> couch_filter = "couchforms/xforms" <NEW_LINE> include_docs_when_preindexing = False <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(UnknownUsersPillow, self).__init__(**kwargs) <NEW_LINE> self.couch_db...
This pillow adds users from xform submissions that come in to the User Index if they don't exist in HQ
62598f0c3346ee7daa336c1c
class SensorMount(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.sensor_list = [] <NEW_LINE> self.location = (0, 0, 0) <NEW_LINE> self.rotation = 0 <NEW_LINE> <DEDENT> def add_new_sensor(self, sensor): <NEW_LINE> <INDENT> self.sensor_list.append(sensor) <NEW_LINE> <DEDENT> def move_to_positio...
Represent an apparatus on which sensors may be mounted such that as the SensorMount is moved, the attached sensors are also moved.
62598f0ca219f33f346c539d
class HistoryList(wx.ListCtrl, HistoryMixin, ListCtrlAutoWidthMixin): <NEW_LINE> <INDENT> def __init__(self, parent, id=-1, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.LC_ICON, validator=wx.DefaultValidator, name=wx.ListCtrlNameStr): <NEW_LINE> <INDENT> wx.ListCtrl.__init__(self, parent, id=id, pos=pos, size=...
List widget with history functions
62598f0c4a966d76dd5eda47
class AccountPage(DynamicConfigPageMixin, ConfigPage): <NEW_LINE> <INDENT> registry = AccountPageRegistry() <NEW_LINE> @classmethod <NEW_LINE> def get_absolute_url(cls): <NEW_LINE> <INDENT> assert cls.page_id <NEW_LINE> return ( '%s#%s' % (build_server_url(reverse('user-preferences')), cls.page_id) )
Base class for a page of forms in the My Account page. Each AccountPage is represented in the My Account page by an entry in the navigation sidebar. When the user has navigated to that page, any forms shown on the page will be displayed. Extensions can provide custom pages in order to offer per-user customization.
62598f0c656771135c4881fe
class CrossRegionRestoreRequest(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'cross_region_restore_access_details': {'key': 'crossRegionRestoreAccessDetails', 'type': 'CrrAccessToken'}, 'restore_request': {'key': 'restoreRequest', 'type': 'RestoreRequest'}, } <NEW_LINE> def __init__( self, *, cro...
CrossRegionRestoreRequest. :ivar cross_region_restore_access_details: Access details for cross region restore. :vartype cross_region_restore_access_details: ~azure.mgmt.recoveryservicesbackup.passivestamp.models.CrrAccessToken :ivar restore_request: Request object for triggering restore. :vartype restore_request: ~az...
62598f0c956e5f7376df4c36
class ServiceStatus(JinjaTemplateResource): <NEW_LINE> <INDENT> isLeaf = True <NEW_LINE> template = templates.get_template('appstatus.jinja2') <NEW_LINE> def render_GET(self, request): <NEW_LINE> <INDENT> d = service_status(request) <NEW_LINE> def go(data): <NEW_LINE> <INDENT> self._data = data <NEW_LINE> self.render_t...
Display useful status information about the print service
62598f0c5fcc89381b2656e6
class using(interface.resource): <NEW_LINE> <INDENT> path = "" <NEW_LINE> modul = "" <NEW_LINE> args = None <NEW_LINE> def _allow(self,context): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def _before(self,context): <NEW_LINE> <INDENT> self.path = res_utls.value(self.path) <NEW_LINE> if len(self.path) >...
!R.using path : "/usr/local/lib/rigger-ng/php.yaml" modul : "php-web" args : !R.args PHP_INI : "php.ini"
62598f0c3346ee7daa336c1d
class TwitterSource(ChannelParser): <NEW_LINE> <INDENT> name = 'Twitter' <NEW_LINE> slug = 'twitter' <NEW_LINE> def get_messages_user(self, screen_name, count=20): <NEW_LINE> <INDENT> return self.get_api().user_timeline( screen_name=screen_name, count=count, include_entities=True, include_rts=True, tweet_mode='extended...
Collect class for tweeter.
62598f0d3617ad0b5ee04ca1
class Meta(object): <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ('username', 'email', 'password')
additional fields
62598f0d7b180e01f3e48602
class AssessmentPartFactory(DjangoModelFactory): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = AssessmentPart <NEW_LINE> <DEDENT> assessment = factory.SubFactory(AssessmentFactory) <NEW_LINE> criterion = factory.SubFactory(CriterionFactory) <NEW_LINE> option = None <NEW_LINE> feedback = 'This is my helpfu...
Create mock AssessmentPart models.
62598f0d55399d3f0562509b
class LinksLinkSet: <NEW_LINE> <INDENT> def __init__(self, dbfrom, idurlset): <NEW_LINE> <INDENT> self.dbfrom = dbfrom <NEW_LINE> self.idurlset = idurlset <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return (self.dbfrom == other.dbfrom and self.idurlset == other.idurlset) <NEW_LINE> <DEDENT> def __n...
Results of an 'llink' (LinkOut) search Finds links from records in a given database to external resources. Fields are: dbfrom -- the database in which search started idurlset -- a list of IdUrlSet, one for each identifier
62598f0d5fdd1c0f98e5cb17
class TryLock: <NEW_LINE> <INDENT> def __init__(self, lock): <NEW_LINE> <INDENT> self._lock = lock <NEW_LINE> self._locked = False <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self._locked = self._lock.acquire(False) <NEW_LINE> return self._locked <NEW_LINE> <DEDENT> def __exit__(self, *args): <NEW_LINE...
Helper object for use with `with` statements
62598f0d31939e2706ed101d
class NotAnAtomLine(Exception): <NEW_LINE> <INDENT> pass
Raised if input line is not an atom line
62598f0ddc8b845886d5213e
class Drupal7Backend(BaseBackend): <NEW_LINE> <INDENT> name = "Drupal7" <NEW_LINE> examples = [ "https://www.drupal.org/project/pathauto", "https://www.drupal.org/project/wysiwyg", ] <NEW_LINE> more_info = ( "If the project exists for Drupal 6 and 7 and is " "monitored for both, you can prefix the name with `Drupal7:`,...
The custom class for projects hosted on ftp.debian.org. This backend allows to specify a version_url and a regex that will be used to retrieve the version information.
62598f0d7c178a314d78c017
class OpenNewAdmin(object): <NEW_LINE> <INDENT> list_display = ["id", "add_time"] <NEW_LINE> ordering = ["id"] <NEW_LINE> style_fields = {"desc": "ueditor"} <NEW_LINE> model_icon = 'fa fa-html5'
最新开奖
62598f0d4527f215b58e8a72
class TerminalZipStripper(ZipStripper): <NEW_LINE> <INDENT> pass
Represent a terminal level archive. This type of archive can not contain nested archives. It is used for formats like docx, which are basically ziped xml.
62598f0dfbf16365ca792c16
class TestDjangoContentUrls(unittest.TestCase): <NEW_LINE> <INDENT> def test_match_content_catalog_resource(self): <NEW_LINE> <INDENT> url = '/v2/content/catalog/mock-source/' <NEW_LINE> url_name = 'content_catalog_resource' <NEW_LINE> assert_url_match(url, url_name, source_id='mock-source') <NEW_LINE> <DEDENT> def tes...
Test the matching of the content urls
62598f0dad47b63b2c5a6392
class ChunkedWriterMixin(object): <NEW_LINE> <INDENT> def chunkify(self, data): <NEW_LINE> <INDENT> data = Binary.bytes(data) <NEW_LINE> if (data is None): _return = Binary.bytes("0\r\n\r\n") <NEW_LINE> elif (type(data) is type(ChunkedReaderMixin.BINARY_NEWLINE) and len(data) > 0 ): _return = Binary.bytes("{0:x}\r\n".f...
This response mixin provides the "chunkify()" method. :author: direct Netware Group et al. :copyright: (C) direct Netware Group - All rights reserved :package: pas.http :subpackage: core :since: v1.0.0 :license: https://www.direct-netware.de/redirect?licenses;mpl2 Mozilla Public License, v...
62598f0d9f28863672817371
class SourceDistribution(AbstractDistribution): <NEW_LINE> <INDENT> def get_pkg_resources_distribution(self): <NEW_LINE> <INDENT> return self.req.get_dist() <NEW_LINE> <DEDENT> def prepare_distribution_metadata(self, finder, build_isolation): <NEW_LINE> <INDENT> self.req.load_pyproject_toml() <NEW_LINE> should_isolate ...
Represents a source distribution. The preparation step for these needs metadata for the packages to be generated, either using PEP 517 or using the legacy `setup.py egg_info`. NOTE from @pradyunsg (14 June 2019) I expect SourceDistribution class will need to be split into `legacy_source` (setup.py based) and `source`...
62598f0d5fdd1c0f98e5cb1b
class JobConfig: <NEW_LINE> <INDENT> filesystemsuffix = ".ext2" <NEW_LINE> def __init__(self, singlejob_dict, parent_workload, index=0): <NEW_LINE> <INDENT> self.parent_workload = parent_workload <NEW_LINE> self.jobname = singlejob_dict.get("name", self.parent_workload.workload_name + str(index)) <NEW_LINE> joboutputs ...
A single job that runs on a simulation. E.g. one spec benchmark, one of the risc-v tests, etc. This is created by feeding in all of the top-level values in the workload json + ONE of the workload elements. This essentially describes the local pieces that need to be fed to simulations and the remote outputs that need ...
62598f0d9f28863672817372
class RhymeLoader(TaskLoader): <NEW_LINE> <INDENT> def __init__(self, data_dir, output_path=None, task_name="PhonoAwareness"): <NEW_LINE> <INDENT> self.load_from_directory(data_dir, task_name) <NEW_LINE> self.process_raw_data() <NEW_LINE> if not (output_path is None): <NEW_LINE> <INDENT> self.write_processed_data_to_fi...
Class to process files from the RED rhyme judgement task.
62598f0dff9c53063f5191d8
class FeatureVectorizer(base.BaseEstimator, base.TransformerMixin): <NEW_LINE> <INDENT> def __init__(self, colNames): <NEW_LINE> <INDENT> self.colNames = colNames <NEW_LINE> <DEDENT> def fit(self, X, *_): return self <NEW_LINE> def transform(self, X, *_): <NEW_LINE> <INDENT> return np.vstack(X.loc[:, self.colNames].val...
Takes as list of data frame column names and outputs a numpy array with only those columns.
62598f0dd8ef3951e32c7411
class Unit_Repairable_Base(Unit_Fighting_Base): <NEW_LINE> <INDENT> def __init__(self, game, type, hp, maxhp, effects=None, weapon1=None, attributes=None): <NEW_LINE> <INDENT> super().__init__(game=game, type=type, hp=hp, maxhp=maxhp, effects=effects, weapon1=weapon1, attributes=attributes) <NEW_LINE> <DEDENT> def repa...
The base class of all mechs and vek.
62598f0d8a349b6b43684dbe
class PublishCommand(Command): <NEW_LINE> <INDENT> description = 'Build and publish the package.' <NEW_LINE> user_options = [ ('test', None, 'publish to TestPyPI') ] <NEW_LINE> def initialize_options(self): <NEW_LINE> <INDENT> self.test = False <NEW_LINE> <DEDENT> def finalize_options(self): <NEW_LINE> <INDENT> pass <N...
Support setup.py publish [--test]
62598f0d283ffb24f3cf2428
class SessionLogger: <NEW_LINE> <INDENT> def __init__(self, file): <NEW_LINE> <INDENT> self._log_file = file <NEW_LINE> self._lock = threading.RLock() <NEW_LINE> self.original_stdout = sys.stdout <NEW_LINE> self.errors = sys.stdout.errors <NEW_LINE> self.encoding = sys.stdout.encoding <NEW_LINE> <DEDENT> def path(self)...
SessionLogger is used to intercept stdout content and duplicates it to a session log file. Inspired from prompt_toolkit.StdoutProxy but without the buffering.
62598f0dec188e330fdf742f
class oldConcurrentAndTaskset(Task): <NEW_LINE> <INDENT> def __init__(self, taskseq): <NEW_LINE> <INDENT> super(oldConcurrentAndTaskset, self).__init__() <NEW_LINE> self.taskseq = taskseq <NEW_LINE> self.ev_intr = threading.Event() <NEW_LINE> self.regcond = threading.Condition() <NEW_LINE> <DEDENT> def execute(self): <...
Compound task that runs a set of tasks concurrently, and does not return until they all terminate.
62598f0d50812a4eaa6201aa
class DAVNonCollection(_DAVResource): <NEW_LINE> <INDENT> def __init__(self, path, environ): <NEW_LINE> <INDENT> _DAVResource.__init__(self, path, False, environ) <NEW_LINE> <DEDENT> def get_content_length(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def get_content_type(self): <NEW_LINE> <I...
A DAVNonCollection is a _DAVResource, that has content (like a 'file' on a filesystem). A DAVNonCollecion is able to read and write file content. See also _DAVResource
62598f0da219f33f346c53a8
class PeriodicCallback(object): <NEW_LINE> <INDENT> def __init__(self, callback, callback_time, io_loop=None): <NEW_LINE> <INDENT> self.callback = callback <NEW_LINE> self.callback_time = callback_time <NEW_LINE> self.io_loop = io_loop or IOLoop.instance() <NEW_LINE> self._running = False <NEW_LINE> <DEDENT> def start(...
Schedules the given callback to be called periodically. The callback is called every callback_time milliseconds. `start` must be called after the PeriodicCallback is created.
62598f0d656771135c488208
class Screen( ): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.stdscr = curses.initscr( ) <NEW_LINE> curses.noecho( ) <NEW_LINE> curses.cbreak( ) <NEW_LINE> self.stdscr.keypad( 1 ) <NEW_LINE> self.logWin = curses.newwin(20, 50, 30, 50 ) <NEW_LINE> self.playerWin = curses.newwin( 20, 40, 0, 30 ) <NEW_...
docstring for Screen
62598f0da05bb46b384893f5
class RawISCSISR(BaseISCSI.BaseISCSISR): <NEW_LINE> <INDENT> def handles(type): <NEW_LINE> <INDENT> if type == "iscsi": <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> return False <NEW_LINE> <DEDENT> handles = staticmethod(handles) <NEW_LINE> def load(self, vdi_uuid): <NEW_LINE> <INDENT> super(RawISCSISR, self).lo...
Raw ISCSI storage repository
62598f0dcc40096d61619798
class Command(BaseCommand): <NEW_LINE> <INDENT> help = 'Process filters from settings/filters.py. Removes unused options for filters.' <NEW_LINE> def handle(self, *args, **options): <NEW_LINE> <INDENT> verbosity = int(options['verbosity']) <NEW_LINE> processor = FiltersProcessor( stdout=self.stdout, stderr=self.stderr,...
Verbosity levels (manage.py --verbosity 0): 0: print nothing (only errors) 1 or greater: print basic information 2 or greater: print as much information as possible (typically for debugging)
62598f0d3d592f4c4edb9a64
class TestMigrationState: <NEW_LINE> <INDENT> def test_marshal_empty(self): <NEW_LINE> <INDENT> state = step_state.MigrationState() <NEW_LINE> assert state.marshal() == { "files": set(), "directories": set(), } <NEW_LINE> <DEDENT> def test_marshal_data(self): <NEW_LINE> <INDENT> state = step_state.MigrationState( files...
Verify MigrationState handling.
62598f0d7c178a314d78c01d
class FDHessian: <NEW_LINE> <INDENT> def __init__(self, model, m0, h, misfit_only=False): <NEW_LINE> <INDENT> self.model = model <NEW_LINE> self.m0 = m0.copy() <NEW_LINE> self.h = h <NEW_LINE> self.misfit_only=misfit_only <NEW_LINE> self.ncalls = 0 <NEW_LINE> self.state_plus = model.generate_vector(STATE) <NEW_LINE> s...
This class implements matrix free application of the reduced Hessian operator. The constructor takes the following parameters: - :code:`model`: the object which contains the description of the problem. - :code:`m0`: the value of the parameter at which the Hessian needs to be evaluated. -...
62598f0d5fdd1c0f98e5cb1f
class GroupResource(ModelResource): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> queryset = Group.objects.all() <NEW_LINE> resource_name = 'group' <NEW_LINE> allowed_methods = ['get'] <NEW_LINE> fields = ['name'] <NEW_LINE> authentication = MultiAuthentication( SessionAuthentication(), HmacAuthentication()) <NEW...
RESTful resource for Django groups.
62598f0d4527f215b58e8a78
class Pipeline(list): <NEW_LINE> <INDENT> def __call__(self, stream): <NEW_LINE> <INDENT> for filt in self: <NEW_LINE> <INDENT> stream = filt(stream) <NEW_LINE> <DEDENT> if isinstance(stream, GeneratorType): <NEW_LINE> <INDENT> return list(stream) <NEW_LINE> <DEDENT> return stream
Pipe to content filters and process them sequentially This pipe allow to content filters inside it and process them sequentially using the output data of one of them as the input data of the next one. Having the same calling restrictions that the filters, it's easy to use it inside anothers pipeline objects as if it w...
62598f0d7b180e01f3e48607
class Project(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = 'Projeto' <NEW_LINE> verbose_name_plural = 'Projetos' <NEW_LINE> <DEDENT> STATUS_CHOICES = ( ('A', 'Em andamento'), ('F', 'Finalizado'), ) <NEW_LINE> title = models.CharField( max_length=20, null=False, blank=False, verbose_...
Model responsável por abstrair os projeto realizados pela fábrica.
62598f0d50812a4eaa6201ab
class DeleteVPNTunnelRequestSchema(schema.RequestSchema): <NEW_LINE> <INDENT> fields = { "ProjectId": fields.Str(required=True, dump_to="ProjectId"), "Region": fields.Str(required=True, dump_to="Region"), "VPNTunnelId": fields.Str(required=True, dump_to="VPNTunnelId"), }
DeleteVPNTunnel - 删除VPN隧道
62598f0d4a966d76dd5eda53
class EphemeralKey(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._key = RSA.generate(2048) <NEW_LINE> <DEDENT> @property <NEW_LINE> def public_key(self): <NEW_LINE> <INDENT> if not self._key: <NEW_LINE> <INDENT> raise Exception("Key already used up!") <NEW_LINE> <DEDENT> return self._key.publickey...
One-time asymetric encryption helper. Use it to get passhprase for the master key. This is provided, so that users of the SudoBroker/SudoProvider classes don't have to import Crypto themselves (making the cryptography backend more interchangeable)
62598f0d60cbc95b06362eb0
class SupportCoinStatisticList(viewsets.ModelViewSet): <NEW_LINE> <INDENT> serializer_class = SupportCoinSerializer <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> busker = self.kwargs['busker'] <NEW_LINE> start_date = self.kwargs['start_date'] <NEW_LINE> end_date = self.kwargs['end_date'] <NEW_LINE> queryset = ...
API endpoint that allows groups to be viewed or edited.
62598f0d167d2b6e312b5b19
class RDFStore(): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name + '.ttl' <NEW_LINE> self.store = Graph() <NEW_LINE> <DEDENT> def get_store(self): <NEW_LINE> <INDENT> return self.store <NEW_LINE> <DEDENT> def add(self, triple): <NEW_LINE> <INDENT> self.store.add(triple) <NEW_LINE> <D...
This class wraps the RDF store proposed by rdflib TODO Add more output formats in dump_store
62598f0d55399d3f056250a5
class helper: <NEW_LINE> <INDENT> def __init__(self, name, age, max_chores = 5): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.age = age <NEW_LINE> self.max_chores = max_chores
Defining the helper object
62598f0d7c178a314d78c01f
class UrlPathRecordMiddleware(object): <NEW_LINE> <INDENT> url = '/sysuser/mytask/' <NEW_LINE> def process_view(self, request, view_func, *view_args, **view_kwargs): <NEW_LINE> <INDENT> urlpath = request.path <NEW_LINE> if UrlPathRecordMiddleware.url in urlpath: <NEW_LINE> <INDENT> request.session['url_pre'] = request....
记录用户访问的url地址
62598f0d5fdd1c0f98e5cb21
class ProcedureDefinition(ASTNode): <NEW_LINE> <INDENT> _fields = ['parameters', 'result', 'statements'] <NEW_LINE> def __init__(self, parameters, result, statements, **kwargs): <NEW_LINE> <INDENT> super().__init__(parameters, result, statements, **kwargs) <NEW_LINE> self.parameters = parameters <NEW_LINE> self.result ...
:type parameters: list[FormalParameter] :type result: ResultSpec :type statements: list[Statement]
62598f0d9f28863672817378
class ShowUserList(ListView): <NEW_LINE> <INDENT> def get_paginate_by(self): <NEW_LINE> <INDENT> return 10 <NEW_LINE> <DEDENT> def get_queryset(self, **kwargs): <NEW_LINE> <INDENT> if self.request.user.is_superuser: <NEW_LINE> <INDENT> return User.objects.all() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise Http40...
Create Class-based View
62598f0d283ffb24f3cf242d
class TCPPacket(ReplyPacket): <NEW_LINE> <INDENT> def __init__(self, pkt, os_pattern): <NEW_LINE> <INDENT> ReplyPacket.__init__(self, pkt, os_pattern) <NEW_LINE> self.pkt = pkt <NEW_LINE> self.tcp = TCP() <NEW_LINE> self.tcp.sport = pkt[TCP].dport <NEW_LINE> self.tcp.dport = pkt[TCP].sport <NEW_LINE> <DEDENT> def set_T...
TCP packet ---------------------------------------------------------- setting the TCP fields
62598f0dfbf16365ca792c1e
class ECRGetLoginPassword(BasicCommand): <NEW_LINE> <INDENT> NAME = 'get-login-password' <NEW_LINE> DESCRIPTION = BasicCommand.FROM_FILE( 'ecr/get-login-password_description.rst') <NEW_LINE> def _run_main(self, parsed_args, parsed_globals): <NEW_LINE> <INDENT> ecr_client = create_client_from_parsed_globals( self._sessi...
Get a password to be used with container clients such as Docker
62598f0d851cf427c66b6e4a
class Colors: <NEW_LINE> <INDENT> color = 0 <NEW_LINE> @staticmethod <NEW_LINE> def concat_str(*args): <NEW_LINE> <INDENT> if Colors.color == 1 or Colors.color == 0 and stdout.isatty(): <NEW_LINE> <INDENT> return ''.join([str(arg) for arg in args]) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return ''.join([str(arg) ...
Class used for colored output
62598f0dd8ef3951e32c7414
class Stack(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._commands = [] <NEW_LINE> self._current_command = -1 <NEW_LINE> <DEDENT> def can_undo(self): <NEW_LINE> <INDENT> return self._current_command != -1 <NEW_LINE> <DEDENT> def can_redo(self): <NEW_LINE> <INDENT> return self._current_comma...
Stack of Undo and Redo Commands
62598f0d5fcc89381b2656ed