code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class ContentProvider(Base): <NEW_LINE> <INDENT> def __init__(self, type=None, original_content_url=None, preview_image_url=None, **kwargs): <NEW_LINE> <INDENT> super(ContentProvider, self).__init__(**kwargs) <NEW_LINE> self.type = type <NEW_LINE> self.original_content_url = original_content_url <NEW_LINE> self.preview... | Content provider. | 6259904c4428ac0f6e659951 |
class _BaseDiff(object): <NEW_LINE> <INDENT> def __init__(self, a, b): <NEW_LINE> <INDENT> self.a = a <NEW_LINE> self.b = b <NEW_LINE> self._fileobj = None <NEW_LINE> self._indent = 0 <NEW_LINE> self._diff() <NEW_LINE> <DEDENT> def __nonzero__(self): <NEW_LINE> <INDENT> return not self.identical <NEW_LINE> <DEDENT> if ... | Base class for all FITS diff objects.
When instantiating a FITS diff object, the first two arguments are always
the two objects to diff (two FITS files, two FITS headers, etc.).
Instantiating a ``_BaseDiff`` also causes the diff itself to be executed.
The returned ``_BaseDiff`` instance has a number of attribute that ... | 6259904cd53ae8145f919881 |
class VolumeBackupPolicyTests(base.TestCase): <NEW_LINE> <INDENT> NAME = uuid.uuid4().hex <NEW_LINE> OTHER_NAME = uuid.uuid4().hex <NEW_LINE> def tearDown(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.openstack( DELETE_COMMAND % {'id': self.policy_id} ) <NEW_LINE> <DEDENT> finally: <NEW_LINE> <INDENT> super(... | Functional tests for vbs. | 6259904c507cdc57c63a61c0 |
class ProjectsFinishedLib(KPIBase): <NEW_LINE> <INDENT> def __call__(self, doc): <NEW_LINE> <INDENT> details = doc.get("details", {}) <NEW_LINE> if details.get("sample_type") == "Finished Library" and _is_ongoing(doc): <NEW_LINE> <INDENT> self.state += 1 | Projects open which are sequenced as finished libraries | 6259904c1f5feb6acb164016 |
class PypiDownloader(PackageGetter): <NEW_LINE> <INDENT> def __init__(self, client, name, version=None, save_dir=None): <NEW_LINE> <INDENT> self.client = client <NEW_LINE> self.name = name <NEW_LINE> self.versions = self.client.package_releases(self.name) <NEW_LINE> if not self.versions: <NEW_LINE> <INDENT> raise excep... | Class for downloading the package from PyPI. | 6259904c8da39b475be04611 |
class Event(object): <NEW_LINE> <INDENT> def __init__(self, supports_channels=True): <NEW_LINE> <INDENT> self.supports_channels = supports_channels <NEW_LINE> self.handlers = [] <NEW_LINE> <DEDENT> def __call__(self, handler=None, channel=None): <NEW_LINE> <INDENT> if handler is None: <NEW_LINE> <INDENT> def handler_wi... | Signal-like object for Socket.IO events that supports
filtering on channels. Registering event handlers is
performed by using the Event instance as a decorator::
@on_message
def message(request, socket, message):
...
Event handlers can also be registered for particular
channels using the channel keywo... | 6259904c63d6d428bbee3bec |
class Report(object): <NEW_LINE> <INDENT> sender = '' <NEW_LINE> message = '' <NEW_LINE> def __init__(self, sender=None, message=None, *args, **kwargs): <NEW_LINE> <INDENT> self.sender = sender <NEW_LINE> self.message = message <NEW_LINE> super(Report, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def notify(self... | Report to be given to another service | 6259904c711fe17d825e16ae |
class GroveGpio(GPIO): <NEW_LINE> <INDENT> def __init__(self, pin): <NEW_LINE> <INDENT> super(GroveGpio, self).__init__(pin, GPIO.OUT) <NEW_LINE> <DEDENT> def on(self): <NEW_LINE> <INDENT> self.write(1) <NEW_LINE> <DEDENT> def off(self): <NEW_LINE> <INDENT> self.write(0) | Class for Grove - Relay
Args:
pin(int): number of digital pin the relay connected. | 6259904c26068e7796d4dd65 |
class Rectangle: <NEW_LINE> <INDENT> number_of_instances = 0 <NEW_LINE> print_symbol = "#" <NEW_LINE> def __init__(self, width=0, height=0): <NEW_LINE> <INDENT> self.width = width <NEW_LINE> self.height = height <NEW_LINE> Rectangle.number_of_instances += 1 <NEW_LINE> <DEDENT> @property <NEW_LINE> def width(self): <NEW... | Class Rectangle | 6259904cd99f1b3c44d06abb |
class ConservativeUnpickler (pickle.Unpickler): <NEW_LINE> <INDENT> safe_modules = { "builtins" : set(["set", "sum", "object"]), "copy_reg" : set(["_reconstructor"]), "kupfer.*" : universalset(), } <NEW_LINE> @classmethod <NEW_LINE> def is_safe_symbol(cls, module, name): <NEW_LINE> <INDENT> for pattern in cls.safe_modu... | An Unpickler that refuses to import new modules
>>> import pickle
>>> import kupfer.objects
>>> ConservativeUnpickler.loads(pickle.dumps(kupfer.objects.FileLeaf("A")))
<builtin.FileLeaf A>
>>> ConservativeUnpickler.loads(pickle.dumps(eval))
Traceback (most recent call last):
...
UnpicklingError: Refusing unsafe ... | 6259904c24f1403a926862de |
class BinaryStatistics(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.reset() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self.nr_pos = 0 <NEW_LINE> self.nr_neg = 0 <NEW_LINE> self.nr_pred_pos = 0 <NEW_LINE> self.nr_pred_neg = 0 <NEW_LINE> self.corr_pos = 0 <NEW_LINE> self.corr_n... | Statistics for binary decision,
including precision, recall, false positive, false negative | 6259904cd6c5a102081e353e |
class ThumbModel(MongoDBModel): <NEW_LINE> <INDENT> coll_name = "thumb_doc" <NEW_LINE> fields = ["praise_person_id", "article_id", "create_time", "is_praise"] <NEW_LINE> async def find_or_insert(self, valid_obj): <NEW_LINE> <INDENT> count_docs = await self.collection.count_documents({"praise_person_id": valid_obj["prai... | 点赞
concern_person_id: 点赞人id
article_id: 文章id
create_time: 创建时间
is_praise: 是否点赞 | 6259904ce76e3b2f99fd9e2c |
class LinkedList(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.head = None <NEW_LINE> <DEDENT> def inserthead(self, newNode): <NEW_LINE> <INDENT> temp = self.head <NEW_LINE> self.head = newNode <NEW_LINE> self.head.next = temp <NEW_LINE> del temp <NEW_LINE> <DEDENT> def insertEnd(self, newNode): <... | Creating a LinkedList. | 6259904c76e4537e8c3f09a7 |
class GetAuthors(AuthenticatedMethod): <NEW_LINE> <INDENT> method_name = 'wp.getAuthors' <NEW_LINE> results_class = WordPressAuthor | Retrieve list of authors in the blog.
Parameters:
None
Returns: `list` of :class:`WordPressAuthor` instances. | 6259904c07d97122c42180c5 |
class VerletListHadressLennardJonesAutoBondsLocal(InteractionLocal, interaction_VerletListHadressLennardJonesAutoBonds): <NEW_LINE> <INDENT> def __init__(self, vl, fixedtupleList): <NEW_LINE> <INDENT> if not (pmi._PMIComm and pmi._PMIComm.isActive()) or pmi._MPIcomm.rank in pmi._PMIComm.getMPIcpugroup(): <NEW_LINE> <IN... | The (local) Lennard Jones auto bonds interaction using Verlet lists. | 6259904c94891a1f408ba106 |
class POPM(FrameOpt): <NEW_LINE> <INDENT> _framespec = [ Latin1TextSpec('email'), ByteSpec('rating'), ] <NEW_LINE> _optionalspec = [IntegerSpec('count')] <NEW_LINE> @property <NEW_LINE> def HashKey(self): <NEW_LINE> <INDENT> return '%s:%s' % (self.FrameID, self.email) <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_L... | Popularimeter.
This frame keys a rating (out of 255) and a play count to an email
address.
Attributes:
* email -- email this POPM frame is for
* rating -- rating from 0 to 255
* count -- number of times the files has been played (optional) | 6259904c07f4c71912bb0856 |
class nop(object): <NEW_LINE> <INDENT> def __init__(self, name=''): <NEW_LINE> <INDENT> self.name_ = name <NEW_LINE> <DEDENT> def __get__(self, *args): <NEW_LINE> <INDENT> return MayBeCalled() <NEW_LINE> <DEDENT> def __hasattr__(self, attr): <NEW_LINE> <INDENT> if len(self.name_): print('{}::{}'.format(self.name_, attr... | Nop class to handle misc optional imports
Shamelessly ripped off
from http://stackoverflow.com/questions/24946321/how-do-i-write-a-no-op-or-dummy-class-in-python | 6259904c435de62698e9d22a |
class CsrfExemptSessionAuthentication(authentication.BaseAuthentication): <NEW_LINE> <INDENT> def authenticate(self, request): <NEW_LINE> <INDENT> user = getattr(request._request, 'user', None) <NEW_LINE> if not user or not user.is_active: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> return (user, None) | Use Django's session framework for authentication. But bypass the CSRF token check mechanism. | 6259904c21a7993f00c6738b |
class NoConfigKeyException (Exception): <NEW_LINE> <INDENT> pass | A process does not define a config lookup | 6259904cd4950a0f3b111854 |
class AntilifeShell(Spell): <NEW_LINE> <INDENT> name = "Antilife Shell" <NEW_LINE> level = 5 <NEW_LINE> casting_time = "1 action" <NEW_LINE> casting_range = "Self (10-foot radius)" <NEW_LINE> components = ("V", "S") <NEW_LINE> duration = "Concentration, up to 1 hour" <NEW_LINE> magic_school = "Abjuration" <NEW_LINE> cl... | A shimmering barrier extends out from you in a 10-foot radius and
moves with you, remaining centered on you and hedging out
creatures other than undead and constructs. The barrier lasts for
the duration. The barrier prevents an affected creature from
passing or reaching through. An affected creature can cast spells
or ... | 6259904ce64d504609df9de1 |
class LoopThread(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, mqttc): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.mqttc = mqttc <NEW_LINE> self.stopped = False <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> while not self.stopped: <NEW_LINE> <INDENT> self.mqttc.loop() <NEW_L... | It keeps alive the server | 6259904cd10714528d69f09f |
class CertificateDescription(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'etag': {'readonly': True}, 'type': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'properties': {'key': 'properties', 'type': 'CertificateProperties'}, 'id': {'key': ... | The X509 Certificate.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar properties: The description of an X509 CA Certificate.
:vartype properties: ~azure.mgmt.iothub.v2021_07_01.models.CertificateProperties
:ivar id: The resource identifier.
:vartype id: str
:ivar name: Th... | 6259904cbe383301e0254c3e |
class DotDict(dict): <NEW_LINE> <INDENT> __getattr__ = dict.__getitem__ <NEW_LINE> __setattr__ = dict.__setitem__ <NEW_LINE> __delattr__ = dict.__delitem__ <NEW_LINE> def __init__(self, dct=None): <NEW_LINE> <INDENT> super(DotDict, self).__init__(self) <NEW_LINE> if dct: <NEW_LINE> <INDENT> for key, value in dct.items(... | A dictionary that supports dot notation as well as dictionary access notation
Examples:
d = DotDict() or d = DotDict({'val1':'first'})
set attributes: d.val2 = 'second' or d['val2'] = 'second'
get attributes: d.val2 or d['val2'] | 6259904c8e05c05ec3f6f86c |
@dataclass <NEW_LINE> class Soa: <NEW_LINE> <INDENT> path: Path <NEW_LINE> members: List[SoaMember] | A structure of array, loaded from a Blender array of structure like MeshVertices | 6259904c63b5f9789fe86591 |
class version_code: <NEW_LINE> <INDENT> def __init__ (self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def read (): <NEW_LINE> <INDENT> if os.altsep: <NEW_LINE> <INDENT> code_file = uno.fileUrlToSystemPath(LeenO_path() + os.altsep + 'leeno_version_code') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> code_file = uno.... | Gestisce il nome del file OXT in leeno_version_code | 6259904c16aa5153ce401911 |
class StatusSummary(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'total': {'required': True}, 'failed': {'required': True}, 'success': {'required': True}, 'in_progress': {'required': True}, 'not_yet_started': {'required': True}, 'cancelled': {'required': True}, 'total_character_charged': {'required'... | StatusSummary.
All required parameters must be populated in order to send to Azure.
:param total: Required. Total count.
:type total: int
:param failed: Required. Failed count.
:type failed: int
:param success: Required. Number of Success.
:type success: int
:param in_progress: Required. Number of in progress.
:type ... | 6259904c8a43f66fc4bf35bb |
class EdgeMock(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.angles = (0, 0, 0) <NEW_LINE> self.speeds = (0, 0, 0) <NEW_LINE> logger.info('__init__') <NEW_LINE> <DEDENT> def stop(self): <NEW_LINE> <INDENT> logger.info('stop') <NEW_LINE> self.speeds = (0, 0, 0) <NEW_LINE> <DEDENT> def output(... | Mock low level driver for the OWI Edge | 6259904cd4950a0f3b111855 |
class ReplicapoolInstanceGroupManagersSetAutoHealingPolicyRequest(_messages.Message): <NEW_LINE> <INDENT> instanceGroupManager = _messages.StringField(1, required=True) <NEW_LINE> instanceGroupManagersSetAutoHealingPolicyRequest = _messages.MessageField('InstanceGroupManagersSetAutoHealingPolicyRequest', 2) <NEW_LINE> ... | A ReplicapoolInstanceGroupManagersSetAutoHealingPolicyRequest object.
Fields:
instanceGroupManager: The name of the instance group manager.
instanceGroupManagersSetAutoHealingPolicyRequest: A
InstanceGroupManagersSetAutoHealingPolicyRequest resource to be passed
as the request body.
project: The Google D... | 6259904cec188e330fdf9cc3 |
class multiGetLastReadMessageIds_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT,(LastReadMessageIds, LastReadMessageIds.thrift_spec)), None, ), (1, TType.STRUCT, 'e', (TalkException, TalkException.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, success=None, e=None,): <NEW_L... | Attributes:
- success
- e | 6259904cd10714528d69f0a0 |
class ConstantGivenFunction(GivenFunction): <NEW_LINE> <INDENT> def __init__(self, value=0): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> GivenFunction.__init__(self, _ConstantFunctionContainer(value)) | A :class:`GivenFunction` that has a constant value on all space.
| 6259904cd99f1b3c44d06abf |
class MrpService(ManualService): <NEW_LINE> <INDENT> @deprecated <NEW_LINE> def __init__( self, identifier: Optional[str], port: int, credentials: Optional[str] = None, properties: Optional[Mapping[str, str]] = None, ) -> None: <NEW_LINE> <INDENT> super().__init__(identifier, Protocol.MRP, port, properties, credentials... | Representation of a MediaRemote Protocol (MRP) service.
**DEPRECATED: Use `pyatv.conf.ManualService` instead.** | 6259904c15baa723494633b2 |
class TwitterBackend(OAuthBackend): <NEW_LINE> <INDENT> name = 'twitter' <NEW_LINE> EXTRA_DATA = [('id', 'id')] <NEW_LINE> def get_user_details(self, response): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> first_name, last_name = response['name'].split(' ', 1) <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> first_name ... | Twitter OAuth authentication backend | 6259904c30c21e258be99c2b |
class Observation(Base): <NEW_LINE> <INDENT> __tablename__ = 'observation' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> mag = Column(Float) <NEW_LINE> mag_err = Column(Float) <NEW_LINE> bandpass_id = Column(Integer, ForeignKey('bandpass.id')) <NEW_LINE> bandpass = relationship("Bandpass", foreign_keys="... | SQLAlchemy table for representing an `observation`. | 6259904c94891a1f408ba108 |
class BroadlinkRMSwitch(BroadlinkSwitch): <NEW_LINE> <INDENT> def __init__(self, device, config): <NEW_LINE> <INDENT> super().__init__( device, config.get(CONF_COMMAND_ON), config.get(CONF_COMMAND_OFF) ) <NEW_LINE> self._attr_name = config[CONF_NAME] <NEW_LINE> <DEDENT> async def _async_send_packet(self, packet): <NEW_... | Representation of a Broadlink RM switch. | 6259904c10dbd63aa1c72003 |
class WebKitTimeEvent(TimestampEvent): <NEW_LINE> <INDENT> def __init__(self, webkit_time, usage, data_type=None): <NEW_LINE> <INDENT> super(WebKitTimeEvent, self).__init__( timelib.Timestamp.FromWebKitTime(webkit_time), usage, data_type=data_type) | Convenience class for a WebKit time-based event. | 6259904c71ff763f4b5e8bcc |
class ExtensionTestMixin(typing.Generic[ExtensionTypeVar], AbstractExtensionTestMixin[ExtensionTypeVar]): <NEW_LINE> <INDENT> def test_as_extension(self) -> None: <NEW_LINE> <INDENT> for config in self.test_values.values(): <NEW_LINE> <INDENT> if config["extension_type"] is None: <NEW_LINE> <INDENT> continue <NEW_LINE>... | Override generic implementations to use test_value property. | 6259904c004d5f362081f9fb |
class GatewayController(ABC): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def create_address(self, waves_address: str) -> str: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def get_attempt_list_by_trigger(self, trigger: AttemptListTrigger) -> Optional[TransactionAttemptList]: <NEW_LINE> <IN... | Defines the API for the Waves Client application.
All possible interfaces should forward their requests to this abstract controller. | 6259904cdc8b845886d549e4 |
@python_2_unicode_compatible <NEW_LINE> class ProductLine(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=64, verbose_name='产品线') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = '产品线' <NEW_LINE> verbose_name_plural = '产品线' <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return... | 产品线表 | 6259904ca79ad1619776b4a7 |
class Inode: <NEW_LINE> <INDENT> def __init__(self, _id): <NEW_LINE> <INDENT> self.id = _id <NEW_LINE> self.name = '' <NEW_LINE> self.isDir = True <NEW_LINE> self.size = 0 <NEW_LINE> self.permissions = None <NEW_LINE> self.uid = os.getuid() <NEW_LINE> self.gid = os.getgid() <NEW_LINE> self.atime = self.ctime = self.mti... | In-memory FS representation.
Inode data structure. | 6259904c8e71fb1e983bceed |
class AnswerViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> serializer_class = AnswerSerializer <NEW_LINE> queryset = Answer.objects.all() <NEW_LINE> permission_classes = (IsOwnerOrIsAuthenticatdThenCreateOnlyOrReadOnly,) <NEW_LINE> def perform_create(self, serializer): <NEW_LINE> <INDENT> serializer.save( author=s... | This viewset automatically provides `list`, `create`, `retrieve`,
`update` and `destroy` actions. | 6259904c45492302aabfd8fb |
class ModernOpenSslServer(_OpenSslServer): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_openssl_path(cls): <NEW_LINE> <INDENT> return ModernOpenSslBuildConfig(CURRENT_PLATFORM).exe_path <NEW_LINE> <DEDENT> def get_verify_argument(cls, client_auth_config: ClientAuthConfigEnum) -> str: <NEW_LINE> <INDENT> options ... | A wrapper around the OpenSSL 1.1.1 s_server binary. | 6259904c29b78933be26aad6 |
class ApiTest(unittest.TestCase): <NEW_LINE> <INDENT> @unittest.skipUnless(server_available,"local server is not running") <NEW_LINE> def test_01_train(self): <NEW_LINE> <INDENT> r = requests.post('http://127.0.0.1:{}/train'.format(port),json={"mode":"test"}) <NEW_LINE> train_complete = re.sub("\W+","",r.text) <NEW_LIN... | test the essential functionality | 6259904c3cc13d1c6d466b60 |
class Action(Enum): <NEW_LINE> <INDENT> WEST = (0, -1, 1) <NEW_LINE> EAST = (0, 1, 1) <NEW_LINE> NORTH = (-1, 0, 1) <NEW_LINE> SOUTH = (1, 0, 1) <NEW_LINE> NW = (-1, -1, math.sqrt(2)) <NEW_LINE> SW = (1, -1, math.sqrt(2)) <NEW_LINE> NE = (-1, 1, math.sqrt(2)) <NEW_LINE> SE = (1, 1, math.sqrt(2)) <NEW_LINE> @property <N... | An action is represented by a 3 element tuple.
The first 2 values are the delta of the action relative
to the current grid position. The third and final value
is the cost of performing the action. | 6259904c94891a1f408ba109 |
class ReplayBuffer: <NEW_LINE> <INDENT> def __init__(self, action_size, buffer_size, batch_size, seed, device): <NEW_LINE> <INDENT> self.device = device <NEW_LINE> self.action_size = action_size <NEW_LINE> self.memory = deque(maxlen=buffer_size) <NEW_LINE> self.batch_size = batch_size <NEW_LINE> self.experience = named... | Fixed-size buffer to store experience tuples. | 6259904cf7d966606f7492cc |
class CompositeShape(Shape): <NEW_LINE> <INDENT> def __init__(self, components: List[Shape]): <NEW_LINE> <INDENT> Shape.__init__(self, wx.Pen(wx.BLACK, 1), 0, 0, 0, 0) <NEW_LINE> self._Shape__Pen.DashStyle = wx.PENSTYLE_SHORT_DASH <NEW_LINE> self.__Components = components <NEW_LINE> self.CalculateEnclosingRectangle() <... | I represent a composite shape in the OOPDraw system,
holding a collection of the shapes that I consiste of. | 6259904c8a43f66fc4bf35bf |
class BaseModificationsPlugin(MegrimPlugin): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.tool = "BaseModifications" <NEW_LINE> <DEDENT> def execute(self, args): <NEW_LINE> <INDENT> warnings.simplefilter(action='ignore', category=FutureWarning) <NEW_LINE> os.environ["NU... | BaseModifications plugin class for megrim toolbox. | 6259904c50485f2cf55dc3b4 |
class truncexpon_gen(rv_continuous): <NEW_LINE> <INDENT> def _argcheck(self, b): <NEW_LINE> <INDENT> self.b = b <NEW_LINE> return (b > 0) <NEW_LINE> <DEDENT> def _pdf(self, x, b): <NEW_LINE> <INDENT> return exp(-x)/(-special.expm1(-b)) <NEW_LINE> <DEDENT> def _logpdf(self, x, b): <NEW_LINE> <INDENT> return -x - log(-sp... | A truncated exponential continuous random variable.
%(before_notes)s
Notes
-----
The probability density function for `truncexpon` is::
truncexpon.pdf(x, b) = exp(-x) / (1-exp(-b))
for ``0 < x < b``.
`truncexpon` takes ``b`` as a shape parameter.
%(after_notes)s
%(example)s | 6259904cdc8b845886d549e6 |
class AddToFeed(SingleObjectMixin, FormView): <NEW_LINE> <INDENT> queryset = FeedModel.objects.all() <NEW_LINE> pk_url_kwarg = 'feed_id' <NEW_LINE> template_name = 'feeds/add.html' <NEW_LINE> form_class = AddToFeedForm <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> self.object = self.get_object... | Add a new item to the feed. | 6259904c07f4c71912bb085d |
class FlyCamera(): <NEW_LINE> <INDENT> def __init__(self,camIndex=0): <NEW_LINE> <INDENT> bus = PyCapture2.BusManager() <NEW_LINE> numCams = bus.getNumOfCameras() <NEW_LINE> self.camera = PyCapture2.Camera() <NEW_LINE> uid = bus.getCameraFromIndex(0) <NEW_LINE> self.camera.connect(uid) <NEW_LINE> self.camera.startCaptu... | this class does all the gritty image capture stuff you need
to do to get data from the pointgrey cameras | 6259904c8da39b475be04619 |
class SET(SCPINode, SCPIQuery, SCPISet): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> _cmd = "SET" <NEW_LINE> args = [] | SYSTem:TIME:HRTimer:ABSolute:SET
Arguments: | 6259904c91af0d3eaad3b24d |
class Page(models.Model): <NEW_LINE> <INDENT> title = models.CharField(default='', max_length=80) <NEW_LINE> link = models.CharField(default='', max_length=50) <NEW_LINE> body = models.TextField('Content', default='') <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.link <NEW_LINE> <DEDENT> class Meta: <NE... | Сраница основного раздела сайта kiteup.ru | 6259904c76d4e153a661dc8c |
class Dict(List): <NEW_LINE> <INDENT> def decode(self, value): <NEW_LINE> <INDENT> if value is None: <NEW_LINE> <INDENT> if callable(self.default): <NEW_LINE> <INDENT> return self.default() <NEW_LINE> <DEDENT> return self.default or {} <NEW_LINE> <DEDENT> return dict((k, self.fld.decode(v)) for k, v in value.iteritems(... | A field representing a homogeneous mapping of data.
The elements of the mapping are decoded through another field specified
when the `Dict` is declared. | 6259904c6fece00bbacccde2 |
class ClientMeta(object): <NEW_LINE> <INDENT> def __init__(self, events): <NEW_LINE> <INDENT> self.events = events <NEW_LINE> <DEDENT> def __copy__(self): <NEW_LINE> <INDENT> copied_events = copy.copy(self.events) <NEW_LINE> return ClientMeta(copied_events) | Holds additional client methods.
This class holds additional information for clients. It exists for
two reasons:
* To give advanced functionality to clients
* To namespace additional client attributes from the operation
names which are mapped to methods at runtime. This avoids
ever running into ... | 6259904c379a373c97d9a454 |
class HStoreVirtualMixin(object): <NEW_LINE> <INDENT> def contribute_to_class(self, cls, name): <NEW_LINE> <INDENT> if self.choices: <NEW_LINE> <INDENT> setattr(cls, 'get_%s_display' % self.name, curry(cls._get_FIELD_display, field=self)) <NEW_LINE> <DEDENT> self.attname = name <NEW_LINE> self.name = name <NEW_LINE> se... | must be mixed-in with django fields | 6259904c596a897236128fc3 |
class XMLEquals(object): <NEW_LINE> <INDENT> def __init__(self, expected): <NEW_LINE> <INDENT> self.expected = expected <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "%s(%r)" % (self.__class__.__name__, self.expected) <NEW_LINE> <DEDENT> def match(self, other): <NEW_LINE> <INDENT> def xml_element_eq... | Parses two XML documents from strings and compares the results.
| 6259904c23e79379d538d927 |
class TestTimeUT1: <NEW_LINE> <INDENT> @pytest.mark.remote_data <NEW_LINE> def test_utc_to_ut1(self): <NEW_LINE> <INDENT> "" <NEW_LINE> t = Time(['2012-06-30 12:00:00', '2012-06-30 23:59:59', '2012-06-30 23:59:60', '2012-07-01 00:00:00', '2012-07-01 12:00:00'], scale='utc') <NEW_LINE> t_ut1_jd = t.ut1.jd <NEW_LINE> t_c... | Test Time.ut1 using IERS tables | 6259904ca8ecb0332587263b |
class EmcItemClass(metaclass=utils.Singleton): <NEW_LINE> <INDENT> def item_selected(self, url, user_data): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def label_get(self, url, user_data): <NEW_LINE> <INDENT> return 'Unknow' <NEW_LINE> <DEDENT> def label_end_get(self, url, user_data): <NEW_LINE> <INDENT> return None <... | TODO Class doc | 6259904c0a366e3fb87dde0f |
class xMsgRegistrar: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.context = zmq.Context.instance() <NEW_LINE> self.proxy = xMsgProxy(self.context, "localhost", 7771) <NEW_LINE> self.registrar_service = xMsgRegService(self.context, RegAddress()) <NEW_LINE> <DEDENT> def start(self): <NEW_LINE> <INDENT... | xMsgRegistrar, the main registrar service
The service always runs in a separate thread. Contains two
separate databases to store publishers and subscribers
registration data. The key for the data base is xMsgTopic, constructed as:
* *domain:subject:type*
Creates REP socket server on a default port. Following request... | 6259904ce76e3b2f99fd9e32 |
class FlagThumbAction(Action): <NEW_LINE> <INDENT> def thumb_contents(self): <NEW_LINE> <INDENT> filename = self.db.filename('flag', self.nodeid) <NEW_LINE> image = open_image_no_alpha(filename) <NEW_LINE> return scale_image_to_width_png(image, int(self.form['width'].value)) <NEW_LINE> <DEDENT> def handle(self): <NEW_L... | Action to return a thumbnail for a flag. | 6259904c76e4537e8c3f09af |
class RepositoryRoot(Container, RepositoryMixin, TranslatedTitleMixin): <NEW_LINE> <INDENT> Title = TranslatedTitleMixin.Title <NEW_LINE> def get_repository_number(self): <NEW_LINE> <INDENT> return u'' <NEW_LINE> <DEDENT> def get_retention_period(self): <NEW_LINE> <INDENT> return u'' <NEW_LINE> <DEDENT> def get_retenti... | A Repositoryroot.
| 6259904c82261d6c527308db |
class GroupMember(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(settings.AUTH_USER_MODEL) <NEW_LINE> group = models.ForeignKey('stronger.Group') <NEW_LINE> joined = models.DateField() <NEW_LINE> approved = models.BooleanField(default=False) <NEW_LINE> approved_by = models.BooleanField(default=False) <NEW_... | User membership for a group. | 6259904c1f037a2d8b9e5281 |
class ViewerBase(QWidget): <NEW_LINE> <INDENT> need_refresh = pyqtSignal(bool) <NEW_LINE> def __init__(self, parent = None): <NEW_LINE> <INDENT> super(ViewerBase, self).__init__(parent) <NEW_LINE> self.t = 0. <NEW_LINE> self.is_refreshing = False <NEW_LINE> self.need_refresh.connect(self.refresh, type = Qt.QueuedConnec... | Base for SignalViewer, TimeFreqViewer, EpochViewer, ...
This handle seek and fast_seek with TimeSeeker time_changed and fast_time_changed signals | 6259904c23849d37ff8524e7 |
class Discriminator(object): <NEW_LINE> <INDENT> def __init__(self, args, name=''): <NEW_LINE> <INDENT> self.args = args <NEW_LINE> self.name = name <NEW_LINE> self.first_call = True <NEW_LINE> <DEDENT> def __call__(self, x, is_training): <NEW_LINE> <INDENT> with tf.variable_scope(self.name, reuse=tf.AUTO_REUSE): <NEW_... | A discriminator class. | 6259904d004d5f362081f9fd |
class AccountInvoiceCancel(models.TransientModel): <NEW_LINE> <INDENT> _name = "account.invoice.cancel" <NEW_LINE> _description = "Cancel the Selected Invoices" <NEW_LINE> @api.multi <NEW_LINE> def invoice_cancel(self): <NEW_LINE> <INDENT> context = dict(self._context or {}) <NEW_LINE> active_ids = context.get('active_... | This wizard will cancel the all the selected invoices.
If in the journal, the option allow cancelling entry is not selected then it will give warning message. | 6259904d10dbd63aa1c72007 |
class TransportTestCase(unittest.TestCase): <NEW_LINE> <INDENT> klass = None <NEW_LINE> if Crypto is None: <NEW_LINE> <INDENT> skip = "cannot run w/o PyCrypto" <NEW_LINE> <DEDENT> def setUp(self): <NEW_LINE> <INDENT> self.transport = proto_helpers.StringTransport() <NEW_LINE> self.proto = self.klass() <NEW_LINE> self.p... | Base class for transport test cases. | 6259904df7d966606f7492cd |
class Hidden(Text): <NEW_LINE> <INDENT> pass | Field representing ``<input type="hidden">`` | 6259904dd53ae8145f91988c |
class Share_actions(extensions.ExtensionDescriptor): <NEW_LINE> <INDENT> name = 'ShareActions' <NEW_LINE> alias = 'share-actions' <NEW_LINE> namespace = '' <NEW_LINE> updated = '2012-08-14T00:00:00+00:00' <NEW_LINE> def get_controller_extensions(self): <NEW_LINE> <INDENT> controller = ShareActionsController() <NEW_LINE... | Enable share actions. | 6259904ddc8b845886d549e8 |
class HTail: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.rootSection = None <NEW_LINE> self.tipSection = None <NEW_LINE> self.surface = None <NEW_LINE> self.control = None <NEW_LINE> <DEDENT> def set_control(self,gain=1.0,xc_hinge=0.0): <NEW_LINE> <INDENT> ailControl = {"gain" : gain, "x_hinge" : x... | This class contains information about the details of
the horizontal tail aerodynamic model.
Namely:
- Geometry information
- Meshing info
The root and tip sections of the wing should be specified.
This class describes multiple ways to build the wing geometry
Wings are assumed to be symmetric. | 6259904d07d97122c42180ce |
class StorePeek(Peek): <NEW_LINE> <INDENT> pass | Request to get an *item* from the *store*. The request is triggered
once there is an item available in the store. | 6259904dec188e330fdf9cc9 |
class Class2(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.name = "class2" <NEW_LINE> self.R0 = 0. <NEW_LINE> self.K2 = 0. <NEW_LINE> self.K3 = 0. <NEW_LINE> self.K4 = 0. <NEW_LINE> self.reduced = False <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> if self.reduced: <NEW_LINE> <I... | Potential defined as
E = K2*(r-R0)^2 + K3*(r-R0)^3 + K4*(r-R0)^4
Input parameters: R0, K2, K3, K4. | 6259904dd99f1b3c44d06ac5 |
class EspeakTtsSender(): <NEW_LINE> <INDENT> def send(self, sender, text, lang='en'): <NEW_LINE> <INDENT> text = text.replace("'", '"') <NEW_LINE> file_path = self.tts_record(text, lang) <NEW_LINE> opus_file = "image.opus" <NEW_LINE> subprocess.check_call(("ffmpeg -y -i {} -c:a libopus {}".format(file_path, opus_file))... | Uses espeak to text to speach | 6259904d009cb60464d02963 |
class DialogHelper: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> async def run_dialog( dialog: Dialog, turn_context: TurnContext, accessor: StatePropertyAccessor ): <NEW_LINE> <INDENT> dialog_set = DialogSet(accessor) <NEW_LINE> dialog_set.add(dialog) <NEW_LINE> dialog_context = await dialog_set.create_context(turn_con... | Dialog Helper implementation. | 6259904d30dc7b76659a0c5f |
class Ldappy(object): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self._ldap_config = Config(config) <NEW_LINE> self._ldap_conn = None <NEW_LINE> self._user_objects = Users(self._ldap_config) <NEW_LINE> self._group_objects = Groups(self._ldap_config) <NEW_LINE> <DEDENT> def authenticate(self, us... | Wrapper to the ldap lib, one that will make you happy.
ldap docs: https://www.python-ldap.org/doc/html/ldap.html
ldap docs references: https://www.python-ldap.org/docs.html
ldap samples: http://www.grotan.com/ldap/python-ldap-samples.html | 6259904da79ad1619776b4ab |
class BodyguardAnt(Ant): <NEW_LINE> <INDENT> name = 'Bodyguard' <NEW_LINE> implemented = True <NEW_LINE> food_cost = 4 <NEW_LINE> container = True <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> Ant.__init__(self, 2) <NEW_LINE> self.ant = None <NEW_LINE> <DEDENT> def contain_ant(self, ant): <NEW_LINE> <INDENT> self.... | BodyguardAnt provides protection to other Ants. | 6259904d8e71fb1e983bcef1 |
class DeployDeviceEnvironment(Action): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(DeployDeviceEnvironment, self).__init__() <NEW_LINE> self.name = "deploy-device-env" <NEW_LINE> self.summary = "deploy device environment" <NEW_LINE> self.description = "deploy device environment" <NEW_LINE> self.en... | Create environment found in job parameters 'env_dut' and set it in common_data. | 6259904dcb5e8a47e493cb9c |
class BondType(ParameterType): <NEW_LINE> <INDENT> _VALENCE_TYPE = "Bond" <NEW_LINE> _ELEMENT_NAME = "Bond" <NEW_LINE> length = ParameterAttribute(default=None, unit=unit.angstrom) <NEW_LINE> k = ParameterAttribute( default=None, unit=unit.kilocalorie_per_mole / unit.angstrom**2 ) <NEW_LINE> length_bondorder = MappedPa... | A SMIRNOFF bond type
.. warning :: This API is experimental and subject to change. | 6259904d63b5f9789fe86599 |
class Frame(Model): <NEW_LINE> <INDENT> movie = models.ForeignKey(TMDBMovie) <NEW_LINE> file = models.ImageField(upload_to='pictures') <NEW_LINE> owner = models.ForeignKey(UserProfile) | Кадр из фильма | 6259904d23e79379d538d929 |
class ClassifierResult(object): <NEW_LINE> <INDENT> def __init__(self, name, classifier_id, classes): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.classifier_id = classifier_id <NEW_LINE> self.classes = classes <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def _from_dict(cls, _dict): <NEW_LINE> <INDENT> args = {}... | Classifier and score combination.
:attr str name: Name of the classifier.
:attr str classifier_id: The ID of a classifier identified in the image.
:attr list[ClassResult] classes: An array of classes within the classifier. | 6259904d24f1403a926862e3 |
class ArmRoleReceiver(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'name': {'required': True}, 'role_id': {'required': True}, } <NEW_LINE> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'role_id': {'key': 'roleId', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, name: str, role_id: s... | An arm role receiver.
All required parameters must be populated in order to send to Azure.
:param name: Required. The name of the arm role receiver. Names must be unique across all
receivers within an action group.
:type name: str
:param role_id: Required. The arm role id.
:type role_id: str | 6259904d45492302aabfd8ff |
class count_min_sketch(basic_sketch): <NEW_LINE> <INDENT> def update(self, key, freq = 1): <NEW_LINE> <INDENT> pos = self.proj.hash(key) <NEW_LINE> self.vec[range(self.proj.depth), pos] += freq <NEW_LINE> <DEDENT> def __matmul__(self, other): <NEW_LINE> <INDENT> if not isinstance(other, count_min_sketch): <NEW_LINE> <I... | Count-Min sketch | 6259904d3cc13d1c6d466b64 |
class SysIpstat(SysIpstatSchema): <NEW_LINE> <INDENT> cli_command = "/mgmt/tm/sys/ip-stat" <NEW_LINE> def rest(self): <NEW_LINE> <INDENT> response = self.device.get(self.cli_command) <NEW_LINE> response_json = response.json() <NEW_LINE> if not response_json: <NEW_LINE> <INDENT> return {} <NEW_LINE> <DEDENT> return resp... | To F5 resource for /mgmt/tm/sys/ip-stat
| 6259904d0fa83653e46f630a |
class UwsgiLogEntry(): <NEW_LINE> <INDENT> def __extractEntryData(self, log): <NEW_LINE> <INDENT> p = re.compile( "^.+?\] (.+?) .+? \[(.+?)\] .+? (\d+) bytes .+? \(HTTP.+? (\d+)\)", re.IGNORECASE) <NEW_LINE> m = p.match(log) <NEW_LINE> ip_address = "" <NEW_LINE> date_time = None <NEW_LINE> bytes_count = 0 <NEW_LINE> re... | Represents single uWSGI log entry.
Has following properties:
- type
- ip_address
- date_time
- bytes_count
- response_code | 6259904d07f4c71912bb0860 |
class Post(models.Model): <NEW_LINE> <INDENT> rareuser = models.ForeignKey("RareUser", on_delete=models.CASCADE) <NEW_LINE> category = models.ForeignKey("Category", on_delete=models.CASCADE) <NEW_LINE> title = models.CharField(max_length=75) <NEW_LINE> publication_date = models.DateField(auto_now=False, auto_now_add=Fa... | Post Model | 6259904d10dbd63aa1c72009 |
class IInternalWorkflowTransition(Interface): <NEW_LINE> <INDENT> pass | Request layer to indicate workflow transitions triggered by
other actions. | 6259904da219f33f346c7c2e |
class AiReviewTerrorismTaskInput(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Definition = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Definition = params.get("Definition") <NEW_LINE> memeber_set = set(params.keys()) <NEW_LINE> for name, value in... | 内容审核涉敏任务输入参数类型
| 6259904ddc8b845886d549ea |
class CallUnits(unittest.TestCase): <NEW_LINE> <INDENT> def testCase000(self): <NEW_LINE> <INDENT> kargs = {} <NEW_LINE> kargs['raw'] = True <NEW_LINE> kargs['rtype'] = False <NEW_LINE> apstr = 'file://///hostname///////////share/a///b//c////////////////////////' <NEW_LINE> retRef = ('raw','', '', 'file://///hostname//... | Split network resources IEEE.1003.1/CIFS/SMB/UNC/URI
| 6259904d507cdc57c63a61cc |
class PersistentModelQuerySet(models.QuerySet): <NEW_LINE> <INDENT> def delete(self): <NEW_LINE> <INDENT> self.update(deleted=True) | Model implementing QuerySet for PersistentModel: allows soft-deletion | 6259904d6fece00bbacccde6 |
class NaayaContentTestCase(NaayaTestCase.NaayaTestCase): <NEW_LINE> <INDENT> def afterSetUp(self): <NEW_LINE> <INDENT> self.login() <NEW_LINE> <DEDENT> def beforeTearDown(self): <NEW_LINE> <INDENT> self.logout() <NEW_LINE> <DEDENT> def test_main(self): <NEW_LINE> <INDENT> addNySemProject(self._portal().info, id='doc1',... | TestCase for NaayaContent object
| 6259904d76d4e153a661dc8e |
class DatasetFromNumpy(Dataset): <NEW_LINE> <INDENT> def __init__(self, ds): <NEW_LINE> <INDENT> self.ds = ds <NEW_LINE> <DEDENT> def __getitem__(self, index): <NEW_LINE> <INDENT> x, y = self.ds[0][index], self.ds[1][index] <NEW_LINE> return x, y <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> assert len(sel... | TensorDataset with support of transforms.
| 6259904d462c4b4f79dbce2d |
class CurveHelperFNGeneratorProperties(bpy.types.PropertyGroup) : <NEW_LINE> <INDENT> amplitude : bpy.props.FloatProperty(name = "Amplitude", default = 1) <NEW_LINE> phase_multiplier : bpy.props.FloatProperty(name = "Phase Multiplier", default = 1) <NEW_LINE> phase_offset : bpy.props.FloatProperty(name = "Phase Offset"... | name : StringProperty() | 6259904d30dc7b76659a0c61 |
class PicamLibError(PicamError): <NEW_LINE> <INDENT> def __init__(self, func, code, lib=None): <NEW_LINE> <INDENT> self.func=func <NEW_LINE> self.code=code <NEW_LINE> self.name=picam_defs.drPicamError.get(code,"Unknown") <NEW_LINE> self.desc=None <NEW_LINE> try: <NEW_LINE> <INDENT> if lib is not None: <NEW_LINE> <INDEN... | Generic Picam library error | 6259904d596a897236128fc5 |
class ExtraTreesClassifier(ForestClassifier): <NEW_LINE> <INDENT> def __init__(self, n_estimators=10, criterion="gini", max_depth=10, min_split=1, min_density=0.1, max_features=None, bootstrap=False, compute_importances=True, random_state=None): <NEW_LINE> <INDENT> super(ExtraTreesClassifier, self).__init__( base_estim... | An extra-trees classifier.
This class implements a meta estimator that fits a number of
randomized decision trees (a.k.a. extra-trees) on various sub-samples
of the dataset and use averaging to improve the predictive accuracy
and control over-fitting.
Parameters
----------
n_estimators : integer, optional (default=10... | 6259904dcb5e8a47e493cb9d |
class TestSimpleMatch(TestCase): <NEW_LINE> <INDENT> def test_simulation(self): <NEW_LINE> <INDENT> team1 = 'First' <NEW_LINE> team2 = 'Second' <NEW_LINE> for __ in range(1000): <NEW_LINE> <INDENT> match = SimpleMatch(team1, team2) <NEW_LINE> self.assertEqual(match.team1, team1) <NEW_LINE> self.assertEqual(match.team2,... | Basic sanity checks for SimpleMatch. | 6259904db830903b9686ee91 |
class BirdMigrating(DNFZ): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> DNFZ.__init__(self, 'BirdMigrating') <NEW_LINE> self.setspeed(random.uniform(4,16)) <NEW_LINE> self.setyawrate(random.uniform(-0.2,0.2)) <NEW_LINE> self.randalt() <NEW_LINE> <DEDENT> def update(self, deltat=1.0): <NEW_LINE> <INDENT> ... | an bird that circles slowly climbing, then dives | 6259904d29b78933be26aad9 |
class SGD(object): <NEW_LINE> <INDENT> def __init__(self, weights, lr=0.01, momentum=0.9, decay=1e-5): <NEW_LINE> <INDENT> self.v = _copy_weights_to_zeros(weights) <NEW_LINE> self.iterations = 0 <NEW_LINE> self.lr = self.init_lr = lr <NEW_LINE> self.momentum = momentum <NEW_LINE> self.decay = decay <NEW_LINE> <DEDENT> ... | 小批量梯度下降法 | 6259904d8e71fb1e983bcef4 |
class ProxyTransport(xmlrpc.client.Transport): <NEW_LINE> <INDENT> def __init__(self, schema="http"): <NEW_LINE> <INDENT> xmlrpc.client.Transport.__init__(self) <NEW_LINE> self.schema = schema <NEW_LINE> <DEDENT> def request(self, host, handler, request_body, verbose): <NEW_LINE> <INDENT> self.verbose = verbose <NEW_LI... | Provides an XMl-RPC transport routing via a http proxy.
This is done by using urllib2, which in turn uses the environment
varable http_proxy and whatever else it is built to use (e.g. the
windows registry).
NOTE: the environment variable http_proxy should be set correctly.
See checkProxySetting() below.
Written from... | 6259904d50485f2cf55dc3bb |
class OneshotAction: <NEW_LINE> <INDENT> def __init__(self, action=None, weight=1, watch=0): <NEW_LINE> <INDENT> if action is None: <NEW_LINE> <INDENT> raise UserError("action is required") <NEW_LINE> <DEDENT> self.action = action <NEW_LINE> self.weight = weight <NEW_LINE> self.watch = watch <NEW_LINE> <DEDENT> def __d... | An action in a oneshot action set.
Construct with OneshotAction(<action (Action instance)>, weight=<weight>, watch=<watch>).
You can set / get attributes action (required), weight (default 1), watch (default 0). | 6259904d07d97122c42180d2 |
class FakeJwtReturnValueNone: <NEW_LINE> <INDENT> return_value = None <NEW_LINE> @classmethod <NEW_LINE> def decode(cls, *args, **kwargs): <NEW_LINE> <INDENT> return {"sub": cls.return_value} | Fake jwt object that returns `None` when executing `decode`. | 6259904d91af0d3eaad3b253 |
class Die: <NEW_LINE> <INDENT> def __init__(self, faces): <NEW_LINE> <INDENT> self.faces = faces <NEW_LINE> self.value = faces[0] <NEW_LINE> self.held = False <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return str(self.value) <NEW_LINE> <DEDENT> def roll(self): <NEW_LINE> <INDENT> self.value = choice(se... | Creates a Die object with arbitrary faces and a roll method.
Arguments:
faces = a list of objects that represent each face
(e.g., [1,2,3,4,5,6])
value = an item in faces that the object is currently 'showing'
held = whether or not the die's value is locked | 6259904d0c0af96317c57778 |
class TestVulnerabilityExceptionApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = swagger_client.api.vulnerability_exception_api.VulnerabilityExceptionApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_create_vulnerability_except... | VulnerabilityExceptionApi unit test stubs | 6259904dec188e330fdf9cce |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.