code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class ListOf(CompositeField): <NEW_LINE> <INDENT> default_error_messages = { 'invalid': "Must be a list of ``%r`` objects.", 'null': "List cannot contain null entries.", 'empty': "List cannot be empty", } <NEW_LINE> data_type_name = "List of" <NEW_LINE> def __init__(self, resource, empty=True, **options): <NEW_LINE> <I... | List of resources. | 62598ef876e4537e8c3ede89 |
class CharsetTokenizer(Tokenizer): <NEW_LINE> <INDENT> __inittype__ = dict(charmap=str) <NEW_LINE> def __init__(self, charmap): <NEW_LINE> <INDENT> self.charmap = charmap <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return (other and self.__class__ is other.__class__ and self.charmap == other.charma... | Tokenizes and translates text according to a character mapping object.
Characters that map to None are considered token break characters. For all
other characters the map is used to translate the character. This is useful
for case and accent folding.
This tokenizer loops character-by-character and so will likely be mu... | 62598ef8bf627c535bcafd43 |
class BikeShop(object): <NEW_LINE> <INDENT> def __init__(self, shop_name, inventory, margin, profit = 0.0): <NEW_LINE> <INDENT> self.shop_name = shop_name <NEW_LINE> self.inventory = inventory <NEW_LINE> self.margin = margin <NEW_LINE> self.profit = profit <NEW_LINE> <DEDENT> def print_inventory(self): <NEW_LINE> <INDE... | Bicycle shop object.
Args:
shop_name: string
inventory: dict
margin: float (percentage) | 62598ef84527f215b58e87d3 |
class With(ConfFactory): <NEW_LINE> <INDENT> __slots__ = _FACTORY_SLOTS <NEW_LINE> def __call__(self, *args): <NEW_LINE> <INDENT> self._these[self._this] = args[0] if len(args) == 1 else args <NEW_LINE> self._this = None <NEW_LINE> return self | Factory for two-level deep configuration. | 62598ef87b180e01f3e484af |
class SymbolsWidget(QWidget, Ui_SymbolsWidget): <NEW_LINE> <INDENT> insertSymbol = pyqtSignal(str) <NEW_LINE> def __init__(self, parent=None): <NEW_LINE> <INDENT> super(SymbolsWidget, self).__init__(parent) <NEW_LINE> self.setupUi(self) <NEW_LINE> self.setWindowIcon(UI.PixmapCache.getIcon("pymakr.png")) <NEW_LINE> self... | Class implementing a widget to select a symbol in various formats.
@signal insertSymbol(str) emitted after the user has selected a symbol | 62598ef8be7bc26dc92512cc |
class RedisServer(object): <NEW_LINE> <INDENT> def __init__(self, conf, master=None): <NEW_LINE> <INDENT> self.name = conf.get('name', 'Unnamed') <NEW_LINE> self.address = conf.get('address') <NEW_LINE> self.port = conf.get('port', DEFAULT_PORT) <NEW_LINE> self.password = conf.get('pass', "") <NEW_LINE> self.conn = Non... | Generic Redis Server object | 62598ef8627d3e7fe0e0575f |
class GlobusRedirectHandler(RedirectHandler): <NEW_LINE> <INDENT> def _handle_token_response(self, w, response): <NEW_LINE> <INDENT> body = json.loads(response.content.decode('utf-8')) <NEW_LINE> issuer = body['resource_server'] <NEW_LINE> scopes = [] <NEW_LINE> if is_str(body['scope']): <NEW_LINE> <INDENT> scopes.appe... | Almost everything is the same for Globus, except when user authorizes scopes which span
resource servers, there is an access token returned per-server, instead of one which
encompasses all of the scopes. | 62598ef87047854f4633dc9a |
class SaveSpec(object): <NEW_LINE> <INDENT> def __init__(self, tensor, slice_spec, name, dtype=None, device=None): <NEW_LINE> <INDENT> self._tensor = tensor <NEW_LINE> self.slice_spec = slice_spec <NEW_LINE> self.name = name <NEW_LINE> if callable(self._tensor): <NEW_LINE> <INDENT> if dtype is None or device is None: <... | Class used to describe tensor slices that need to be saved. | 62598ef844b2445a339b5dd6 |
class ColoredFormatter(logging.Formatter): <NEW_LINE> <INDENT> __COLOR_LEVELS = { 'WARNING': COLORS['YELLOW'], 'INFO': COLORS['WHITE'], 'DEBUG': COLORS['CYAN'], 'CRITICAL': COLORS['RED_BG'], 'ERROR': COLORS['RED'] } <NEW_LINE> use_color = True <NEW_LINE> def format(self, record): <NEW_LINE> <INDENT> if self.use_color: ... | A formatter with colors for the logging system.
Based on ideas from: <https://stackoverflow.com/questions/384076/how-can-i-color-python-logging-output> and <https://github.com/borntyping/python-colorlog>
Attributes:
use_color (Boolean): If True, use color on the output. If False, this formatters is the same than ... | 62598ef8f548e778e5969e5f |
class PerfectLensModel(Model): <NEW_LINE> <INDENT> theory_params = ['lens_angle'] <NEW_LINE> def __init__(self, scatterer, lens_angle=1.0, noise_sd=None, medium_index=None, illum_wavelen=None, theory='auto', illum_polarization=None, constraints=[]): <NEW_LINE> <INDENT> super().__init__(scatterer, noise_sd, medium_index... | Model of hologram image formation through a high-NA objective. | 62598ef8ec188e330fdf717b |
class CenterCrop(object): <NEW_LINE> <INDENT> def __init__(self, size): <NEW_LINE> <INDENT> if isinstance(size, numbers.Number): <NEW_LINE> <INDENT> self.size = (int(size), int(size)) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.size = size <NEW_LINE> <DEDENT> <DEDENT> def __call__(self, imgs): <NEW_LINE> <INDENT... | Crops the given seq Images at the center.
Args:
size (sequence or int): Desired output size of the crop. If size is an
int instead of sequence like (h, w), a square crop (size, size) is
made. | 62598ef830bbd72246468508 |
class TFDriver(driver.Driver): <NEW_LINE> <INDENT> def __init__( self, env: tf_environment.TFEnvironment, policy: tf_policy.TFPolicy, observers: Sequence[Callable[[trajectory.Trajectory], Any]], transition_observers: Optional[Sequence[Callable[[trajectory.Transition], Any]]] = None, max_steps: Optional[types.Int] = Non... | A driver that runs a TF policy in a TF environment. | 62598ef8aad79263cf42d0e1 |
class NameNotCharacterGuideError(bcrf.bcrf_lib.errors.ObjectTypeError): <NEW_LINE> <INDENT> pass | A name for a character guide was given, but it is either not a BCRF
Character Guide, or is not correctly formatted. | 62598ef8e1aae11d1e7cdcab |
@configurable(pickleable=True) <NEW_LINE> class DKittyWalkRandom(DKittyWalk): <NEW_LINE> <INDENT> def __init__( self, *args, target_distance_range: Tuple[float, float] = (1.0, 2.0), target_angle_range: Tuple[float, float] = (-np.pi / 3, np.pi / 3), **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_L... | Walk straight towards a random location. | 62598ef8e5267d203ee6a1d7 |
class Data(str): <NEW_LINE> <INDENT> pass | Wrapper around str types for representing Data values. | 62598ef8379a373c97d978cb |
class Beacon: <NEW_LINE> <INDENT> beacon_count = 0 <NEW_LINE> def __init__(self, beacon): <NEW_LINE> <INDENT> self.id = beacon['id'] <NEW_LINE> self.index = Beacon.beacon_count <NEW_LINE> self.price = beacon['price'] <NEW_LINE> self.stay_time = beacon['stay_time'] <NEW_LINE> self.preferences = beacon['preferences'] <NE... | A beacon | 62598ef8377c676e912f61cc |
@with_slots <NEW_LINE> class Site(object): <NEW_LINE> <INDENT> __slots__ = 'location vs30 vs30measured z1pt0 z2pt5 id'.split() <NEW_LINE> def __init__(self, location, vs30, vs30measured, z1pt0, z2pt5, id=None): <NEW_LINE> <INDENT> if not vs30 > 0: <NEW_LINE> <INDENT> raise ValueError('vs30 must be positive') <NEW_LINE>... | Site object represents a geographical location defined by its position
as well as its soil characteristics.
:param location:
Instance of :class:`~openquake.hazardlib.geo.point.Point` representing
where the site is located.
:param vs30:
Average shear wave velocity in the top 30 m, in m/s.
:param vs30measure... | 62598ef860cbc95b06362c09 |
class UndoableGripEditCommand(QUndoCommand): <NEW_LINE> <INDENT> def __init__(self, beforePoint, afterPoint, text, obj, v, parent=None): <NEW_LINE> <INDENT> super(UndoableGripEditCommand, self).__init__(parent) <NEW_LINE> self.gview = v <NEW_LINE> self.object = obj <NEW_LINE> self.setText(text) <NEW_LINE> self.before =... | Subclass of `QUndoCommand`_
TOWRITE
Grip Edit | 62598ef83d592f4c4edb97c0 |
class StorageSyncService(TrackedResource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, 'storage_sync_service_status': {'readonly': True}, 'storage_sync_service_uid': {'readonly': True}, 'provisioning_state': {'read... | Storage Sync Service object.
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: Fully qualified resource ID for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/pr... | 62598ef863d6d428bbee10a1 |
class BdbException(Exception): <NEW_LINE> <INDENT> pass | A bdb exception. | 62598ef8a219f33f346c5101 |
class ClippyRustCompiler(RustCompiler): <NEW_LINE> <INDENT> id = 'clippy-driver rustc' | Clippy is a linter that wraps Rustc.
This just provides us a different id | 62598ef856ac1b37e6300abf |
class Netcat: <NEW_LINE> <INDENT> def __init__(self, ip, port): <NEW_LINE> <INDENT> self.buff = "" <NEW_LINE> self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) <NEW_LINE> self.socket.connect((ip, port)) <NEW_LINE> <DEDENT> def read(self, length = 1024): <NEW_LINE> <INDENT> return self.socket.recv(length) ... | Python 'netcat like' module | 62598ef866673b3332c2ec82 |
class ErrorHolderTestsMixin: <NEW_LINE> <INDENT> exceptionForTests = ZeroDivisionError("integer division or modulo by zero") <NEW_LINE> class TestResultStub: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.errors = [] <NEW_LINE> <DEDENT> def startTest(self, test): <NEW_LINE> <INDENT> pass <NEW_LINE> <D... | This mixin defines test methods which can be applied to a
L{runner.ErrorHolder} constructed with either a L{Failure} or a
C{exc_info}-style tuple.
Subclass this and implement C{setUp} to create C{self.holder} referring to a
L{runner.ErrorHolder} instance and C{self.error} referring to a L{Failure}
which the holder hol... | 62598ef8498bea3a75a56407 |
class SwaggerView(APIView): <NEW_LINE> <INDENT> def get(self, request, format=None): <NEW_LINE> <INDENT> json_file = os.path.join(os.path.dirname(__file__), 'swagger.json') <NEW_LINE> f = open(json_file) <NEW_LINE> json_data = json.JSONDecoder().decode(f.read()) <NEW_LINE> f.close() <NEW_LINE> return Response(json_data... | Show rest api swagger. | 62598ef87d847024c075aca1 |
class Record: <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.recordTypeIdentifier = None <NEW_LINE> self.data = data <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "Generic Record (%d bytes)\n" % len(self.data) | A Generic Record Type containing data for a specific sensor | 62598ef84428ac0f6e656e21 |
class DataBitsType(object): <NEW_LINE> <INDENT> DATA_5: int = 5 <NEW_LINE> DATA_6: int = 6 <NEW_LINE> DATA_7: int = 7 <NEW_LINE> DATA_8: int = 8 | DataBitsType class. | 62598ef8adb09d7d5dc08e92 |
class CommandImplementationIncompleteError(ScimitarError): <NEW_LINE> <INDENT> pass | Raised when a command I had to remove is called. | 62598ef844b2445a339b5dd7 |
class _ScatterContext(_ScatterCurveHistoMixInContext): <NEW_LINE> <INDENT> def __init__(self, item, plot, onlimits, roi): <NEW_LINE> <INDENT> _ScatterCurveHistoMixInContext.__init__(self, kind='scatter', item=item, plot=plot, onlimits=onlimits, roi=roi) <NEW_LINE> <DEDENT> @docstring(_ScatterCurveHistoMixInContext) <NE... | StatsContext scatter plots.
It supports :class:`~silx.gui.plot.items.Scatter`.
:param item: the item for which we want to compute the context
:param plot: the plot containing the item
:param bool onlimits: True if we want to apply statistic only on
visible data.
:param roi: Region of interest fo... | 62598ef8ec188e330fdf717d |
class DebianSourceFormat(object): <NEW_LINE> <INDENT> format_file = 'debian/source/format' <NEW_LINE> def _parse(self, content): <NEW_LINE> <INDENT> parts = content.split() <NEW_LINE> self._version = parts[0] <NEW_LINE> if len(parts) == 2: <NEW_LINE> <INDENT> if (parts[1][0] == '(' and parts[1][-1] == ')'): <NEW_LINE> ... | Contents of debian/source/format
>>> d = DebianSourceFormat("3.0 (quilt)")
>>> d.type
'quilt'
>>> d.version
'3.0'
>>> d = DebianSourceFormat("3.0 (native)")
>>> d.type
'native'
>>> d = DebianSourceFormat("1.0")
>>> d.type
>>> d.version
'1.0'
>>> d = DebianSourceFormat("1.0 broken")
Traceback (most recent call last):
.... | 62598ef83539df3088ecab81 |
class ShortRepr(r.Repr): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.maxlevel = 1 <NEW_LINE> self.maxtuple = 4 <NEW_LINE> self.maxlist = 4 <NEW_LINE> self.maxarray = 4 <NEW_LINE> self.maxdict = 4 <NEW_LINE> self.maxset = 4 <NEW_LINE> self.maxfrozenset = 4 <NEW_LINE> self.maxdeque = 4 <NEW_LINE> sel... | Make shorter representations on multiple lines. | 62598ef8656771135c487f5e |
class GroupTable(object): <NEW_LINE> <INDENT> def __init__(self, seats): <NEW_LINE> <INDENT> self.seats = seats <NEW_LINE> self.barrier = Barrier(seats) <NEW_LINE> self.eating = Semaphore(1) <NEW_LINE> self.evensEating = Lightswitch() <NEW_LINE> self.oddsEating = Lightswitch() <NEW_LINE> if seats % 2 == 0: <NEW_LINE> <... | The table around which philosophers sit.
- To eat, each philosopher requires TWO forks. To get these
forks, they must ALL call ``get_forks()``
- When each philospher is done eating, they must call ``put_forks()``
This architecture scales to any number of seats at the table without
requiring additional semaphores. I... | 62598ef83617ad0b5ee049fc |
class ParserError(Exception): <NEW_LINE> <INDENT> pass | For tokenizer error exceptions; null operation -- nothing happens. | 62598ef8442bda511e95ad36 |
class StageJob(Job): <NEW_LINE> <INDENT> def __init__(self, cwlwf, cwljob, basedir): <NEW_LINE> <INDENT> Job.__init__(self) <NEW_LINE> self.cwlwf = cwlwf <NEW_LINE> self.cwljob = cwljob <NEW_LINE> self.basedir = basedir <NEW_LINE> <DEDENT> def run(self, fileStore): <NEW_LINE> <INDENT> cwljob = resolve_indirect(self.cwl... | File staging job to put local files into the global file store.
This currently will break if you try and run this on a cluster because the
main() method can't stage files before Job.Runner.startToil(), and the
staging job could run on a compute node where it doesn't have direct access
to the input files of the head no... | 62598ef8009cb60464cffe25 |
class PaymentData(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.date = 0 <NEW_LINE> self.paymentAfterTaxes = 0 <NEW_LINE> self.takedTaxesByCentralBank = 0 <NEW_LINE> self.paymentByOneStock = 0 <NEW_LINE> self.companyName = '' <NEW_LINE> self.count = 0 <NEW_LINE> self.description = '' <NEW_LINE> <D... | A class used to represent a data for tax reports at NDFL-3(Russia)
Attributes
-----------
date: int
Date of payment at unixtime
paymentAfterTaxes: float
Value of dollars which we had took after USA draw part of it
takedTaxesByCentralBank: float
Value of dollars which USA drawed part of it
paymentByOne... | 62598ef82c8b7c6e89bd2095 |
class VideoAPITestMarkDuplicate(ApiTestCase): <NEW_LINE> <INDENT> api_type = VideoAPI <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(VideoAPITestMarkDuplicate, self).setUp() <NEW_LINE> self.project = milkman.deliver(Project) <NEW_LINE> self.project.set_owner(self.admin) <NEW_LINE> self.video = self.create_video(... | Tests for :func:`greenday_api.video.video_api.VideoAPI.video_mark_duplicate <greenday_api.video.video_api.VideoAPI.video_mark_duplicate>` | 62598ef85fdd1c0f98e5c879 |
class TextElementModel(GeoformElement): <NEW_LINE> <INDENT> def save(self, *args, **kwargs): <NEW_LINE> <INDENT> self.element_type = 'text' <NEW_LINE> super(TextElementModel, self).save(*args, **kwargs) <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> proxy = True <NEW_LINE> verbose_name = _('text input') <NEW_LINE>... | This is a proxy model to handle text inputs
separately in the admin interface. | 62598ef85fdd1c0f98e5c87a |
class ImplausibleSpliceSiteWarning(AbgpWarning): <NEW_LINE> <INDENT> pass | A (annotated) gene or unigene contains implausible splice site(s) (non GT/GC/AG) | 62598ef899cbb53fe682f783 |
class CheckListItem(models.Model): <NEW_LINE> <INDENT> itemnaam = models.CharField( _("itemnaam"), max_length=30, help_text=_("De betekenisvolle benaming van het checklistitem"), ) <NEW_LINE> vraagstelling = models.CharField( _("vraagstelling"), max_length=255, help_text=_( "Een betekenisvolle vraag waaruit blijkt waar... | Te controleren aandachtspunt voorafgaand aan het bereiken van een status van het STATUSTYPE.
Door één of meer checklistitems op te nemen bij een status, wordt een checklist verkregen met
punten waaraan aandacht besteed moet worden teneinde die status te bereiken.
# TODO: wanneer sub attributeen op een StatusType word... | 62598ef897e22403b38397c5 |
class V1Endpoints(object): <NEW_LINE> <INDENT> def __init__(self, kind=None, apiVersion=None, metadata=None, subsets=None): <NEW_LINE> <INDENT> self.swagger_types = { 'kind': 'str', 'apiVersion': 'str', 'metadata': 'V1ObjectMeta', 'subsets': 'list[V1EndpointSubset]' } <NEW_LINE> self.attribute_map = { 'kind': 'kind', '... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598ef8f548e778e5969e62 |
class Bool(_BaseVar): <NEW_LINE> <INDENT> def convert(self, s): <NEW_LINE> <INDENT> s = s.lower() <NEW_LINE> if s not in ("yes", "no", "true", "false", "1", "0"): <NEW_LINE> <INDENT> raise ValueError("Unrecognized boolean value: %r" % (s,)) <NEW_LINE> <DEDENT> return s in ("yes", "true", "1") <NEW_LINE> <DEDENT> def __... | Converts 'yes|true|1|no|false|0' to the appropriate boolean value.
Case-insensitive. Throws a ``ValueError`` for any other value. | 62598ef84a966d76dd5ed7af |
@pytest.mark.usefixtures("database") <NEW_LINE> class TestSystemGroupStorage: <NEW_LINE> <INDENT> def test_has_any_group_true(self, test_system_user_group_storage: SystemUserGroupStorage, faker: Faker) -> None: <NEW_LINE> <INDENT> group = faker.word() <NEW_LINE> with db.create_session() as session: <NEW_LINE> <INDENT> ... | Integration tests for :class:`TestSystemGroupStorage`. | 62598ef856ac1b37e6300ac1 |
class RowDeletingIterator(BaseIterator): <NEW_LINE> <INDENT> def __init__(self, thrift, name="RowDeletingIterator", priority=10): <NEW_LINE> <INDENT> super(RowDeletingIterator, self).__init__( thrift=thrift, name=name, priority=priority, classname="org.apache.accumulo.core.iterators.user.RowDeletingIterator") | An iterator for deleting whole rows. After setting this iterator up for
your table, to delete a row insert a row with empty column family, empty
column qualifier, empty column visibility, and a value of DEL_ROW. Do not
use empty columns for anything else when using this iterator. When using
this iterator the locality g... | 62598ef8be383301e02520b5 |
class channelTerminalRepairOrderTest(Test,RepairOrderPage): <NEW_LINE> <INDENT> repair_list=[u'业务管理',u'渠道终端管理',u'维修管理',u'维修工单'] <NEW_LINE> def test_repair_order_search(self): <NEW_LINE> <INDENT> time_dict={u'开始日期':u'2019-12-05',u'结束日期':u'2020-12-31'} <NEW_LINE> self.open_repair_manage(self.repair_list) <NEW_LINE> searc... | 渠道终端管理维修管理测试 | 62598ef8a8370b77170eecb9 |
class FunctionExpression(Node): <NEW_LINE> <INDENT> def __init__(self, paramlist, block, sourceposition=None): <NEW_LINE> <INDENT> Node.__init__(self, sourceposition) <NEW_LINE> self.paramlist = paramlist <NEW_LINE> self.block = block <NEW_LINE> <DEDENT> def get_parameterlist(self): <NEW_LINE> <INDENT> return self.para... | A function expression: fn([paramlist]) { [block] } | 62598ef8498bea3a75a56409 |
class ResNet34(TTAFunction): <NEW_LINE> <INDENT> def __init__(self, num_classes=1, num_filters=32, pretrained=True, is_deconv = False, dropout_2d=0): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.num_classes = num_classes <NEW_LINE> self.dropout_2d = dropout_2d <NEW_LINE> self.pool = nn.MaxPool2d(2, 2) <NEW_LI... | Decoder ResNext34
SE blocks in decoder
+ Hypercolumn | 62598ef83346ee7daa336ad2 |
class StreetMapping(StringMapping): <NEW_LINE> <INDENT> def map(self): <NEW_LINE> <INDENT> address = getattr(self.instance, self.from_field, None) <NEW_LINE> if address: <NEW_LINE> <INDENT> new_value = u'{0} {1}'.format(getattr(address, 'line1'), getattr(address, 'line2')) <NEW_LINE> new_value = new_value.strip() <NEW_... | Gets the street (line1 + line2) of an address object or '' if it doesn't exist. | 62598ef867a9b606de5448a5 |
class TestPrincipalApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = openlattice.api.principal_api.PrincipalApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_get_all_users(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def ... | PrincipalApi unit test stubs | 62598ef84428ac0f6e656e23 |
class Organization: <NEW_LINE> <INDENT> def __init__(self, organization_data): <NEW_LINE> <INDENT> self.name = parse_name(organization_data) <NEW_LINE> self.guid = parse_guid(organization_data) <NEW_LINE> self.stam = parse_stam(organization_data) | Used to represent and organize information about an organization.
:ivar str name: name of organization
:ivar str guid: GUID of organization
:ivar str stam: stamnr of organization | 62598ef856ac1b37e6300ac2 |
class Dmraid(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): <NEW_LINE> <INDENT> plugin_name = 'dmraid' <NEW_LINE> profiles = ('hardware', 'storage') <NEW_LINE> option_list = [ ("metadata", "capture dmraid device metadata", "slow", False) ] <NEW_LINE> dmraid_options = ['V', 'b', 'r', 's', 'tay'] <NEW_LINE> def setup... | dmraid software RAID
| 62598ef832920d7e50bc4904 |
class CustomUserAgentsMiddleware(object): <NEW_LINE> <INDENT> def process_request(self, request, spider): <NEW_LINE> <INDENT> ua = random.choice(USER_AGENTS) <NEW_LINE> if ua: <NEW_LINE> <INDENT> request.headers.setdefault('User-Agent', ua) | 扩展原来的用户代理,采用多个用户代理,轮流使用 | 62598ef87d847024c075aca4 |
class JSONSerializer(BaseSerializer): <NEW_LINE> <INDENT> def unpack(dump: bytes): <NEW_LINE> <INDENT> def as_message(dct): <NEW_LINE> <INDENT> return Message(dct) <NEW_LINE> <DEDENT> return json.loads(dump, object_hook=as_message) <NEW_LINE> <DEDENT> def pack(msg: Message) -> bytes: <NEW_LINE> <INDENT> return json.dum... | Serializer using json as i/o format.
| 62598ef8ec188e330fdf717f |
class state(bee.worker): <NEW_LINE> <INDENT> trig = antenna("push", "trigger") <NEW_LINE> state = antenna("pull", "str") <NEW_LINE> guiparams = { "trig": {"name": "Trigger"}, "state": {"name": "State", "fold": True}, "_memberorder": ["trig", "state"], } <NEW_LINE> def place(self): <NEW_LINE> <INDENT> raise NotImplement... | The state actuator changes the state of the current hive | 62598ef8656771135c487f60 |
class FakeClass: <NEW_LINE> <INDENT> def __init__(self, fake_arg): <NEW_LINE> <INDENT> self.fake_arg = fake_arg <NEW_LINE> <DEDENT> def fake_method(self, name): <NEW_LINE> <INDENT> yield (name, name) | This is a fake docstring for invalid syntax purposes. | 62598ef8adb09d7d5dc08e95 |
class MyStromView(HomeAssistantView): <NEW_LINE> <INDENT> url = '/api/mystrom' <NEW_LINE> name = 'api:mystrom' <NEW_LINE> supported_actions = ['single', 'double', 'long', 'touch'] <NEW_LINE> def __init__(self, add_entities): <NEW_LINE> <INDENT> self.buttons = {} <NEW_LINE> self.add_entities = add_entities <NEW_LINE> <D... | View to handle requests from myStrom buttons. | 62598ef87cff6e4e811b42b8 |
class MemoryCache(Cache): <NEW_LINE> <INDENT> logger = get_logger(__name__) <NEW_LINE> def __init__(self, cache, event_ttl=None): <NEW_LINE> <INDENT> self._cache = cache <NEW_LINE> self._event_ttl = event_ttl <NEW_LINE> <DEDENT> def add_event(self, event): <NEW_LINE> <INDENT> event_id = uuid.uuid4() <NEW_LINE> self._ca... | Backend implementation for python-logstash-async. Keeps messages in a local, in-memory cache
while attempting to publish them to logstash. Does not persist through process restarts. Also,
does not write to disk.
:param cache: Usually just an empty dictionary
:param event_ttl: Optional parameter used to expire events i... | 62598ef87c178a314d78bd6f |
class World: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> cells = dict() <NEW_LINE> for row in range(WORLD_HEIGHT): <NEW_LINE> <INDENT> for col in range(WORLD_WIDTH): <NEW_LINE> <INDENT> coords = Coord(row, col) <NEW_LINE> cell = Cell() <NEW_LINE> cells[str(coords)] = cell <NEW_LINE> cell.set_state(INITI... | World is a 2D grid filled with Cells. | 62598ef855399d3f05624dfd |
class IdealDelay(TwoPortBModel): <NEW_LINE> <INDENT> def __init__(self, delay=0): <NEW_LINE> <INDENT> delay = ConstantDomainExpression(delay) <NEW_LINE> super(IdealDelay, self).__init__( BMatrix.voltage_amplifier(exp(-s * delay))) <NEW_LINE> self.args = (delay, ) | Ideal buffered delay | 62598ef876e4537e8c3ede8f |
class Folder(File): <NEW_LINE> <INDENT> elements = ("file", "folder") <NEW_LINE> def addEntry(self, entry): <NEW_LINE> <INDENT> self.node[entry.name] = entry.node | Handle the folder tag | 62598ef860cbc95b06362c0d |
class JsonData: <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> with open(path) as stream: <NEW_LINE> <INDENT> self.data = json.load(stream) <NEW_LINE> <DEDENT> <DEDENT> def dump(self): <NEW_LINE> <INDENT> with open(self.path, "w", encoding='utf-8') as gfp: <NEW_LINE> <INDE... | Class-wrapper for json data | 62598ef83317a56b869bd9d0 |
class object_(object): <NEW_LINE> <INDENT> metaguiparams = { "config": "Launch", "autocreate": {"config":{"bind_event": True, "bind_hivereg": True, "bind_io": True, "bind_sys": True, "bind_scene": True, "bind_time": True, "bind_entity": True, "bind_matrix": "relative"}}, "_memberorder": ["config"] } <NEW_LINE> @classm... | The object actuator creates a new 3D object of "object class" at "location".
If a process class of the same name as "object class" has been registered, launch it.
Output contains the name of the last spawned object. | 62598ef8379a373c97d978cf |
class Type3(System): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.data = self.decode(data) <NEW_LINE> self.cell_id = None <NEW_LINE> self.lai = None <NEW_LINE> self.gprs = None <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "Type3 system informa... | Type3 GSM System Information Packet.
Args:
data: the data to construct the packet with.
Attributes:
cell_id: The broadcasting base stations Cell ID (CID).
lai: Location Area Identity (LAI) this consists of the Mobile.
Country Code (MCC) the Mobile Network Code (MNC) and the
Location Area C... | 62598ef867a9b606de5448a6 |
class FilterByMapMixin: <NEW_LINE> <INDENT> def list(self, request, *args, **kwargs): <NEW_LINE> <INDENT> map_id = self.request.GET.get('map_id') <NEW_LINE> if map_id is not None: <NEW_LINE> <INDENT> qs = self.get_queryset().filter(map=map_id) <NEW_LINE> data = self.serializer_class(qs, many=True).data <NEW_LINE> retur... | Provides an override of the list() method of ModelViewSet
This can filter the given list by the map ID provided by a query param.
For example: used with Landmarks to only get landmarks associated with a given map | 62598ef863d6d428bbee10a5 |
class Init(Spec): <NEW_LINE> <INDENT> def dunder_version_info(self): <NEW_LINE> <INDENT> assert hasattr(invoke, '__version_info__') <NEW_LINE> ver = invoke.__version_info__ <NEW_LINE> assert isinstance(ver, tuple) <NEW_LINE> assert all(isinstance(x, int) for x in ver) <NEW_LINE> <DEDENT> def dunder_version(self): <NEW_... | __init__ | 62598ef8283ffb24f3cf2181 |
class NonbondedException(object): <NEW_LINE> <INDENT> def __init__(self, atom1, atom2, type=None): <NEW_LINE> <INDENT> self.atom1 = atom1 <NEW_LINE> self.atom2 = atom2 <NEW_LINE> self.type = type <NEW_LINE> <DEDENT> def __contains__(self, thing): <NEW_LINE> <INDENT> return thing is self.atom1 or thing is self.atom2 | The AMOEBA force field has complex exclusion and exception rules (referred
to as "adjustments" in the Amber-converted files). This class stores
per-particle exceptions.
Parameters
----------
atom1 : :class:`Atom`
One of the atoms in the exclusion pair
atom2 : :class:`Atom`
The other atom in the exclusion pair
... | 62598ef87d43ff2487426866 |
class UpdateGroupObjectView(LoginRequiredMixin, View): <NEW_LINE> <INDENT> login_url = '/RFID/login/' <NEW_LINE> redirect_field_name = '' <NEW_LINE> template_name = 'RFID/object.html' <NEW_LINE> def post(self, request): <NEW_LINE> <INDENT> form = GetGroupObject(request.POST) <NEW_LINE> name = form['name'].value() <NEW_... | Gets the object name, updates the group of objects
information or deletes them. Redirects the user to the
main objects page. | 62598ef866673b3332c2ec86 |
class Token(object): <NEW_LINE> <INDENT> def __init__(self, value, lineno=-1, charno=-1): <NEW_LINE> <INDENT> self.lineno = lineno <NEW_LINE> self.charno = charno <NEW_LINE> self.value = value <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return u'<%s token "%s" at (%d, %d)>' % (self.__class__.__name__, s... | Base token class | 62598ef8cc0a2c11144798d8 |
class MVPPortfolio: <NEW_LINE> <INDENT> def __init__(self, symbols, start, end, weights=None, source=None, logger=False): <NEW_LINE> <INDENT> self.symbols = symbols <NEW_LINE> self.nos = len(symbols) <NEW_LINE> self.start = start <NEW_LINE> self.end = end <NEW_LINE> if weights is None: <NEW_LINE> <INDENT> self.weights ... | Class to analyze and manage investment portfolios
according to the Mean-Variance Portfolio (MVP) approach. | 62598ef84a966d76dd5ed7b1 |
class ByteTest(Test): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.test_set = list(range(0,258,2)) | Class for testing int ping pong. | 62598ef8d486a94d0ba2a8a0 |
class IOBuf: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.buflist = [] <NEW_LINE> <DEDENT> def getvalue(self): <NEW_LINE> <INDENT> b = self.buflist <NEW_LINE> self.buflist = [] <NEW_LINE> return ''.join(b) <NEW_LINE> <DEDENT> def write(self, s): <NEW_LINE> <INDENT> self.buflist.append(s) <NEW_LINE> ... | This class works as a replacement for stdio and stderr.
It is a buffer and when its contents are requested, it will erase what
it has so far so that the next return will not return the same contents again. | 62598ef892d797404e387fe7 |
class GradeCrawler: <NEW_LINE> <INDENT> def __init__(self, username, password): <NEW_LINE> <INDENT> self.loginUrl = u'http://202.119.4.150/nstudent/login.aspx' <NEW_LINE> self.gradeUrl = u'http://202.119.4.150/nstudent/grgl/xskccjcx.aspx' <NEW_LINE> self.username = username <NEW_LINE> self.password = password <NEW_LINE... | 从信息门户获取成绩列表的爬虫
:param username: 用户名
:param password: 密码 | 62598ef81f5feb6acb16152b |
class UrlManager(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.new_urls = set() <NEW_LINE> self.old_urls = set() <NEW_LINE> <DEDENT> def add_new_url(self, url): <NEW_LINE> <INDENT> if url is None: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> if url not in self.new_urls and url not in self.... | URL 管理器 | 62598ef8460517430c430d60 |
class VIEW3D_PT_polycount_settings(Panel): <NEW_LINE> <INDENT> bl_label = "Settings" <NEW_LINE> bl_space_type = 'VIEW_3D' <NEW_LINE> bl_region_type = 'UI' <NEW_LINE> bl_category = "Polycount" <NEW_LINE> bl_options = {'DEFAULT_CLOSED'} <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> return... | Configures the drawing of the data in the 3DView | 62598ef84527f215b58e87da |
class TwilioMessage(SmsMessage): <NEW_LINE> <INDENT> def send(self): <NEW_LINE> <INDENT> from twilio.rest import Client as TwilioClient <NEW_LINE> tc = TwilioClient(config.account_sid, config.auth_token) <NEW_LINE> tc.api.account.messages.create(to='+1' + self.to, from_=self.from_, body=self.body) <NEW_LINE> return Non... | SMS Message sent via Twilio client | 62598ef8627d3e7fe0e05765 |
class TensorSliceDataset(DatasetSource): <NEW_LINE> <INDENT> def __init__(self, tensors): <NEW_LINE> <INDENT> tensors = structure_lib.normalize_tensors(tensors) <NEW_LINE> batched_structure = type_spec.type_spec_from_value(tensors) <NEW_LINE> self._tensors = batched_structure._to_batched_tensor_list(tensors) <NEW_LINE>... | A `Dataset` of slices from a nested structure of tensors. | 62598ef826068e7796d4b234 |
class IProductLayer(Interface): <NEW_LINE> <INDENT> pass | Custom interface for our layer | 62598ef866656f66f7d58cbd |
class SaltCacheLoader(BaseLoader): <NEW_LINE> <INDENT> def __init__(self, opts, saltenv='base', encoding='utf-8', env=None, pillar_rend=False): <NEW_LINE> <INDENT> if env is not None: <NEW_LINE> <INDENT> salt.utils.warn_until( 'Carbon', 'Passing a salt environment should be done using \'saltenv\' ' 'not \'env\'. This f... | A special jinja Template Loader for salt.
Requested templates are always fetched from the server
to guarantee that the file is up to date.
Templates are cached like regular salt states
and only loaded once per loader instance. | 62598ef801c39578d7f1167b |
class ShowInstallInactiveSummarySchema(MetaParser): <NEW_LINE> <INDENT> schema = { 'inactive_packages': Any(), Optional('num_inactive_packages'): int, Optional('sdr'): list, } | Schema for show install inactive summary | 62598ef863b5f9789fe83a37 |
class LocationAttachment(): <NEW_LINE> <INDENT> def __init__(self, lat, lng, name): <NEW_LINE> <INDENT> self.lng = lng <NEW_LINE> self.lat = lat <NEW_LINE> self.name = name <NEW_LINE> self.__type = 'location' <NEW_LINE> <DEDENT> def as_dict(self): <NEW_LINE> <INDENT> return { 'type': self.__type, 'lng': self.lng, 'lat'... | Models a group.me Location Attachment.
| 62598ef85fdd1c0f98e5c87d |
class SamplesTestMixin(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(SamplesTestMixin, self).__init__(self, *args, **kwargs) <NEW_LINE> self.addTypeEqualityFunc(sample.Sample, self.assertSamplesEqual) <NEW_LINE> <DEDENT> def assertSamplesEqualUpToTimestamp(self, a, b, msg=N... | A mixin for unittest.TestCase that adds a type-specific equality
predicate for samples. | 62598ef8bf627c535bcafd4b |
class Enemy(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, BG_WIDTH,BG_HEIGHT): <NEW_LINE> <INDENT> pygame.sprite.Sprite.__init__(self) <NEW_LINE> self.image = pygame.image.load("image/enemy1.png") <NEW_LINE> self.rect = self.image.get_rect() <NEW_LINE> self.speed = 2 <NEW_LINE> self.rect.left, self.rect... | Make enemy ships | 62598ef899cbb53fe682f787 |
class ExternalNode (practical.Node): <NEW_LINE> <INDENT> def __init__(self, messenger, my_uid, quorum_size, leader_uid=None): <NEW_LINE> <INDENT> super(ExternalNode, self).__init__(messenger, my_uid, quorum_size) <NEW_LINE> self.leader_uid = leader_uid <NEW_LINE> self.leader_proposal_id = ProposalID(1, leader... | This implementation is completely passive. An external entity must monitor peer nodes
for failure and call prepare() when the node should attempt to acquire leadership
of the Paxos instance. Continual polling of the prepare() function and prevention
of eternal leadership battles is also the responsibility of the caller... | 62598ef8fff4ab517ebcc0ac |
class BatchCreateAOIS(TemplateView): <NEW_LINE> <INDENT> template_name = 'core/job_batch_create_aois.html' <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> cv = super(BatchCreateAOIS, self).get_context_data(**kwargs) <NEW_LINE> cv['object'] = get_object_or_404(Job, pk=self.kwargs.get('job_pk')) <NEW... | Reads GeoJSON from post request and creates AOIS for each features. | 62598ef84527f215b58e87dc |
class SoggettoEmittenteType( pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin): <NEW_LINE> <INDENT> _ExpandedName = pyxb.namespace.ExpandedName( Namespace, 'SoggettoEmittenteType') <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location( SCHEMA_FILE, 500, 2) <NEW_LINE> _Documentation = None | An atomic simple type. | 62598ef87d847024c075aca8 |
class BackendAddressPoolPaged(Paged): <NEW_LINE> <INDENT> _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, 'current_page': {'key': 'value', 'type': '[BackendAddressPool]'} } <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(BackendAddressPoolPaged, self).__init__(*args, **kwar... | A paging container for iterating over a list of :class:`BackendAddressPool <azure.mgmt.network.v2018_08_01.models.BackendAddressPool>` object | 62598ef8d268445f26638ffc |
class GEI(InfillCriteria): <NEW_LINE> <INDENT> def __init__(self, model, plugin=None, minimize=True, g=1): <NEW_LINE> <INDENT> super(GEI, self).__init__(model, plugin, minimize) <NEW_LINE> self.g = g <NEW_LINE> <DEDENT> def __call__(self, X, dx=False): <NEW_LINE> <INDENT> pass | Generalized Expected Improvement | 62598ef8656771135c487f64 |
class Deq: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.array = [] <NEW_LINE> <DEDENT> def size(self): <NEW_LINE> <INDENT> return len(self.array) <NEW_LINE> <DEDENT> def push_last(self, c): <NEW_LINE> <INDENT> self.array.append(c) <NEW_LINE> <DEDENT> def push_first(self, c): <NEW_LINE> <INDENT> self... | Реализация дека на базе вектора
для языка Python она тривиальна) | 62598ef83617ad0b5ee04a02 |
class BaseInplaceCMFMigrator(BaseInplaceMigrator, BaseCMFMigrator): <NEW_LINE> <INDENT> def beforeChange_dc(self): <NEW_LINE> <INDENT> for accessor, mutator in METADATA_MAPPING: <NEW_LINE> <INDENT> self._checkLoadAttr(mutator) <NEW_LINE> oldAcc = getattr(self.old, accessor) <NEW_LINE> oldValue = oldAcc() <NEW_LINE> set... | Support for CMF migration that doesn't require renaming the old
object. | 62598ef8091ae356687034f3 |
class ShowRobot(object): <NEW_LINE> <INDENT> def __init__(self, test_maze): <NEW_LINE> <INDENT> self.test_maze = Maze(test_maze) <NEW_LINE> self.sq_size = 20 <NEW_LINE> self.origin = self.test_maze.dim * self.sq_size / -2 <NEW_LINE> self.window = turtle.Screen() <NEW_LINE> self.env = turtle.Turtle() <NEW_LINE> self.env... | Creates a Turtle maze object to display robot exploration during testing
the robot agent. | 62598ef88a349b6b43684b1c |
class Expression14(Expression): <NEW_LINE> <INDENT> def get(self, instance): <NEW_LINE> <INDENT> return instance.objectPlayer.value.lower() | Transform->Lowercase string
Return type: Int | 62598ef8ff9c53063f518f3c |
class UpdateRoleParametersAction(UpdateParametersAction): <NEW_LINE> <INDENT> def __init__(self, role, container=constants.DEFAULT_CONTAINER_NAME): <NEW_LINE> <INDENT> super(UpdateRoleParametersAction, self).__init__(parameters=None, container=container) <NEW_LINE> self.role = role <NEW_LINE> <DEDENT> def run(self, con... | Updates role related parameters in plan environment . | 62598ef860cbc95b06362c11 |
class VultrSensor(SensorEntity): <NEW_LINE> <INDENT> def __init__(self, vultr, subscription, condition, name): <NEW_LINE> <INDENT> self._vultr = vultr <NEW_LINE> self._condition = condition <NEW_LINE> self._name = name <NEW_LINE> self.subscription = subscription <NEW_LINE> self.data = None <NEW_LINE> condition_info = M... | Representation of a Vultr subscription sensor. | 62598ef891f36d47f2230311 |
@attr.s <NEW_LINE> class _PytestWrapper: <NEW_LINE> <INDENT> obj = attr.ib() | Dummy wrapper around a function object for internal use only.
Used to correctly unwrap the underlying function object
when we are creating fixtures, because we wrap the function object ourselves with a decorator
to issue warnings when the fixture function is called directly. | 62598ef82c8b7c6e89bd209b |
class TestXmlNs0ActivityCause(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 testXmlNs0ActivityCause(self): <NEW_LINE> <INDENT> pass | XmlNs0ActivityCause unit test stubs | 62598ef83346ee7daa336ad4 |
class UserAdmin(DjangoUserAdmin): <NEW_LINE> <INDENT> list_display = ('email', 'first_name', 'last_name', 'is_staff', ) <NEW_LINE> ordering = ('email', ) <NEW_LINE> fieldsets = ( (None, {'fields': ('email', 'password')}), ('Personal Information', {'fields': ('first_name', 'last_name', )}), ('Status/Access', {'fields': ... | user admin class compatable with AbstractEmailUser | 62598ef899cbb53fe682f789 |
class Documenter(object): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> raise NotImplemented <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> raise NotImplemented <NEW_LINE> <DEDENT> @property <NEW_LINE> def _packagesystemPath(self): <NEW_LINE> <INDENT> return '.'.join(( self.__class__.__module__, s... | Abstract base class for documenting classes. | 62598ef8a219f33f346c5109 |
class LVAPJoin(Module): <NEW_LINE> <INDENT> MODULE_NAME = "lvapjoin" <NEW_LINE> def handle_response(self, lvap): <NEW_LINE> <INDENT> lvaps = RUNTIME.tenants[self.tenant_id].lvaps <NEW_LINE> if lvap.addr not in lvaps: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> self.handle_callback(lvap) | LVAPJoin. | 62598ef871ff763f4b5e603c |
class HomeworkForm(forms.ModelForm): <NEW_LINE> <INDENT> subject = forms.ModelChoiceField(queryset=Subject.objects.all()) <NEW_LINE> short_description = forms.CharField(max_length=128) <NEW_LINE> long_description = forms.CharField(max_length=1024, widget=forms.Textarea) <NEW_LINE> date_ends = forms.DateField(widget=adm... | Form for creating/editing one homework. | 62598ef81f5feb6acb16152f |
class UpdateCacheMiddleware(object): <NEW_LINE> <INDENT> def __init__(self, patch_headers=False): <NEW_LINE> <INDENT> self.patch_headers = patch_headers <NEW_LINE> self.cache_timeout = settings.CACHE_MIDDLEWARE_SECONDS <NEW_LINE> self.key_prefix = settings.CACHE_MIDDLEWARE_KEY_PREFIX <NEW_LINE> self.cache_anonymous_onl... | Response-phase cache middleware that updates the cache if the response is
cacheable.
Must be used as part of the two-part update/fetch cache middleware.
UpdateCacheMiddleware must be the first piece of middleware in
MIDDLEWARE_CLASSES so that it'll get called last during the response phase. | 62598ef8a8370b77170eecbf |
class Exporter(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, queue_length: int = 1): <NEW_LINE> <INDENT> threading.Thread.__init__(self, args=(), kwargs=None) <NEW_LINE> self.queue = WorkQueue(queue_length) <NEW_LINE> self.setDaemon(True) <NEW_LINE> self.start() <NEW_LINE> self.spectrumCollection = [] <NEW_... | Exporter responsible for creating an output file that users can use for future spectrogram data.
Attributes:
- queue (WorkQueue): Queue for incoming spectrograms data
- spectrumCollection (list): Stores received spectrograms for export | 62598ef8aad79263cf42d0ea |
class chebyshevt_root(Function): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def eval(cls, n, k): <NEW_LINE> <INDENT> if not ((0 <= k) is (k < n) is True): <NEW_LINE> <INDENT> raise ValueError("must have 0 <= k < n, " "got k = %s and n = %s" % (k, n)) <NEW_LINE> <DEDENT> return C.cos(S.Pi*(2*k + 1)/(2*n)) | chebyshev_root(n, k) returns the kth root (indexed from zero) of
the nth Chebyshev polynomial of the first kind; that is, if
0 <= k < n, chebyshevt(n, chebyshevt_root(n, k)) == 0.
Examples
========
>>> from sympy import chebyshevt, chebyshevt_root
>>> chebyshevt_root(3, 2)
-sqrt(3)/2
>>> chebyshevt(3, chebyshevt_root... | 62598ef8460517430c430d64 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.