code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class DateField(DateTimeField): <NEW_LINE> <INDENT> def to_python(self): <NEW_LINE> <INDENT> if self.data is None: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> if isinstance(self.data, datetime.date): <NEW_LINE> <INDENT> return self.data <NEW_LINE> <DEDENT> return parse(self.data).date() | Field to represent a :mod:`datetime.date` | 62598fb992d797404e388c14 |
class Fixed: <NEW_LINE> <INDENT> can_take = False | Cannot be taken or moved.
| 62598fb999fddb7c1ca62e9c |
class Game: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.players = [] <NEW_LINE> self.battles = [] <NEW_LINE> <DEDENT> def get_player(self, username): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return next( p for p in self.players if p.username == username) <NEW_LINE> <DEDENT> except StopIteration... | The Game class keeps track of players and WebSockets. | 62598fb9bf627c535bcb1606 |
class AccountInvoices(osv.Model): <NEW_LINE> <INDENT> _inherit = 'account.invoice' <NEW_LINE> def print_invoice(self, cr, user, ids, context={}): <NEW_LINE> <INDENT> return {'type': 'ir.action.report.xml', 'report_name': 'account.invoice'} | account_invoices
| 62598fb97047854f4633f539 |
class ConstantDependencyDistancePass(microprobe.passes.Pass): <NEW_LINE> <INDENT> def __init__(self, dep): <NEW_LINE> <INDENT> super(ConstantDependencyDistancePass, self).__init__() <NEW_LINE> self._dep = dep <NEW_LINE> <DEDENT> def __call__(self, building_block, dummy_target): <NEW_LINE> <INDENT> for bbl in building_b... | ConstantDependencyDistancePass pass.
| 62598fb98e7ae83300ee9202 |
class FlaskPlugin(BasePlugin): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.converter_mapping = dict(DEFAULT_CONVERTER_MAPPING) <NEW_LINE> self.openapi_version = None <NEW_LINE> <DEDENT> def init_spec(self, spec): <NEW_LINE> <INDENT> super().init_spec(spec) <NEW_LINE> s... | Plugin to create OpenAPI paths from Flask rules | 62598fb9dc8b845886d5371c |
class SensorMap(SensorMapMixin, _EelFigure): <NEW_LINE> <INDENT> def __init__(self, sensors, labels='name', proj='default', mark=None, frame=.05, *args, **kwargs): <NEW_LINE> <INDENT> sensors = as_sensor(sensors) <NEW_LINE> if sensors.sysname: <NEW_LINE> <INDENT> ftitle = 'SensorMap: %s' % sensors.sysname <NEW_LINE> <D... | Plot sensor positions in 2 dimensions
Parameters
----------
sensors : NDVar | Sensor
sensor-net object or object containing sensor-net
labels : None | 'index' | 'name' | 'fullname'
Content of the labels. For 'name', any prefix common to all names
is removed; with 'fullname', the full name is shown.
proj:
... | 62598fb9627d3e7fe0e07015 |
class CouplingLayer(nn.Module): <NEW_LINE> <INDENT> def __init__(self, num_inputs, num_hidden=64): <NEW_LINE> <INDENT> super(CouplingLayer, self).__init__() <NEW_LINE> self.num_inputs = num_inputs <NEW_LINE> self.main = nn.Sequential( nn.Linear(num_inputs // 2, num_hidden), nn.ReLU(), nn.Linear(num_hidden, num_hidden),... | An implementation of a coupling layer
from RealNVP (https://arxiv.org/abs/1605.08803). | 62598fb9a219f33f346c6969 |
class CertificateError(ValueError): <NEW_LINE> <INDENT> pass | Raised on certificate errors. | 62598fb9be383301e0253960 |
class Entry(object): <NEW_LINE> <INDENT> def __init__(self, _id, names, emails, grades, genders, ec_list, ec_dict, clublist, ix): <NEW_LINE> <INDENT> self._id = _id <NEW_LINE> self.names=names <NEW_LINE> self.emails=emails <NEW_LINE> self.grades=grades <NEW_LINE> self.genders=genders <NEW_LINE> self.ec_list = ec_list <... | A class that turns participants into objects | 62598fb95fc7496912d4832d |
class AsyncAwaker(GanetiBaseAsyncoreDispatcher): <NEW_LINE> <INDENT> def __init__(self, signal_fn=None): <NEW_LINE> <INDENT> GanetiBaseAsyncoreDispatcher.__init__(self) <NEW_LINE> assert signal_fn is None or callable(signal_fn) <NEW_LINE> (self.in_socket, self.out_socket) = socket.socketpair(socket.AF_UNIX, socket.SOCK... | A way to notify the asyncore loop that something is going on.
If an asyncore daemon is multithreaded when a thread tries to push some data
to a socket, the main loop handling asynchronous requests might be sleeping
waiting on a select(). To avoid this it can create an instance of the
AsyncAwaker, which other threads c... | 62598fb9a8370b77170f0543 |
class TestBug666(unittest.TestCase): <NEW_LINE> <INDENT> def testIt(self): <NEW_LINE> <INDENT> if not py3k.IS_PY3K: <NEW_LINE> <INDENT> ba = QByteArray('1234567890') <NEW_LINE> self.assertEqual(ba[2:4], '34') <NEW_LINE> self.assertEqual(ba[:4], '1234') <NEW_LINE> self.assertEqual(ba[4:], '567890') <NEW_LINE> self.asser... | QByteArray does not support slices | 62598fb9ad47b63b2c5a79b7 |
class NetdevSimDev: <NEW_LINE> <INDENT> def __init__(self, port_count=1): <NEW_LINE> <INDENT> addr = 0 <NEW_LINE> while True: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> with open("/sys/bus/netdevsim/new_device", "w") as f: <NEW_LINE> <INDENT> f.write("%u %u" % (addr, port_count)) <NEW_LINE> <DEDENT> <DEDENT> except O... | Class for netdevsim bus device and its attributes. | 62598fb9aad79263cf42e938 |
class IdentityClientMeta(type): <NEW_LINE> <INDENT> _transport_registry = OrderedDict() <NEW_LINE> _transport_registry['grpc'] = IdentityGrpcTransport <NEW_LINE> def get_transport_class(cls, label: str = None, ) -> Type[IdentityTransport]: <NEW_LINE> <INDENT> if label: <NEW_LINE> <INDENT> return cls._transport_registry... | Metaclass for the Identity client.
This provides class-level methods for building and retrieving
support objects (e.g. transport) without polluting the client instance
objects. | 62598fb93d592f4c4edbb022 |
class SignUpForm(UserCreationForm): <NEW_LINE> <INDENT> email = forms.EmailField(max_length=254, help_text='Required. Inform a valid email address.') <NEW_LINE> first_name = forms.CharField(label='First name', max_length=100) <NEW_LINE> last_name = forms.CharField(label='Last name', max_length=100) <NEW_LINE> class Met... | Class for signup form. | 62598fb932920d7e50bc61b2 |
class CodegenPanic(VyperInternalException): <NEW_LINE> <INDENT> pass | Invalid code generated during codegen phase | 62598fb9236d856c2adc94f2 |
class EYFSDetailsForm(ChildminderForms): <NEW_LINE> <INDENT> field_label_classes = 'form-label-bold' <NEW_LINE> error_summary_template_name = 'standard-error-summary.html' <NEW_LINE> auto_replace_widgets = True <NEW_LINE> eyfs_course_name = forms.CharField(label='Title of training course', error_messages={'required': '... | GOV.UK form for the Early Years details: details page | 62598fb95166f23b2e243541 |
class ToolsStatusVersionListRow_Locators_Base(object): <NEW_LINE> <INDENT> locators = { 'base' : "css=tr", 'version' : "css=td:nth-of-type(1)", 'released' : "css=td:nth-of-type(2)", 'subversion' : "css=td:nth-of-type(3)", 'published' : "css=td:nth-of-type(4) span", 'edit' : "cs... | locators for ToolsStatusVersionListRow object | 62598fb9ff9c53063f51a7b2 |
class CommunicationIdentityAccessToken(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'token': {'required': True}, 'expires_on': {'required': True}, } <NEW_LINE> _attribute_map = { 'token': {'key': 'token', 'type': 'str'}, 'expires_on': {'key': 'expiresOn', 'type': 'iso-8601'}, } <NEW_LINE> def __init... | An access token.
All required parameters must be populated in order to send to Azure.
:ivar token: Required. The access token issued for the identity.
:vartype token: str
:ivar expires_on: Required. The expiry time of the token.
:vartype expires_on: ~datetime.datetime | 62598fb9f548e778e596b70a |
class OzonePressure(Ozone): <NEW_LINE> <INDENT> def __call__(self, **kwargs): <NEW_LINE> <INDENT> return | Ozone fixed with pressure, no adjustment needed. | 62598fb9cc0a2c111447b171 |
class GoalStmt(Visitable): <NEW_LINE> <INDENT> def __init__(self, formula): <NEW_LINE> <INDENT> self._visitorName = 'visit_goal_stmt' <NEW_LINE> self.formula = formula | This class represents the AST node for a pddl problem goal condition. | 62598fb9283ffb24f3cf39e8 |
class TestDeAT(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.factory = Faker('de_AT') <NEW_LINE> <DEDENT> def test_city(self): <NEW_LINE> <INDENT> city = self.factory.city() <NEW_LINE> assert isinstance(city, string_types) <NEW_LINE> assert city in DeAtProvider.cities <NEW_LINE> <DED... | Tests in addresses in the de_AT locale | 62598fb991f36d47f2230f5c |
class IiChipAssays(Interface): <NEW_LINE> <INDENT> pass | Marker interface for navigation-root folder
| 62598fb963b5f9789fe852d3 |
class SessionIndex(SamlBase): <NEW_LINE> <INDENT> c_tag = 'SessionIndex' <NEW_LINE> c_namespace = NAMESPACE <NEW_LINE> c_value_type = {'base': 'string'} <NEW_LINE> c_children = SamlBase.c_children.copy() <NEW_LINE> c_attributes = SamlBase.c_attributes.copy() <NEW_LINE> c_child_order = SamlBase.c_child_order[:] <NEW_LIN... | The urn:oasis:names:tc:SAML:2.0:protocol:SessionIndex element | 62598fb956b00c62f0fb2a1f |
class RouteError(Exception): <NEW_LINE> <INDENT> pass | Error when the remote planner service can't
process the input data and produce routes | 62598fb94527f215b58ea03a |
@inherit_doc <NEW_LINE> class JavaModel(Model, JavaTransformer): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> def __init__(self, java_model): <NEW_LINE> <INDENT> super(JavaModel, self).__init__() <NEW_LINE> self._java_obj = java_model <NEW_LINE> self.uid = java_model.uid() <NEW_LINE> <DEDENT> def copy(self, e... | Base class for :py:class:`Model`s that wrap Java/Scala
implementations. Subclasses should inherit this class before
param mix-ins, because this sets the UID from the Java model. | 62598fb9aad79263cf42e939 |
class QQAuthUserSerializer(serializers.Serializer): <NEW_LINE> <INDENT> access_token = serializers.CharField(label='操作凭证') <NEW_LINE> mobile = serializers.RegexField(label='手机号', regex=r'^1[3-9]\d{9}$') <NEW_LINE> password = serializers.CharField(label='密码', max_length=20, min_length=8) <NEW_LINE> sms_code = serializer... | 绑定用户的序列化器 | 62598fb9498bea3a75a57c88 |
class IdData(): <NEW_LINE> <INDENT> def __init__(self, id_folder, distance_treshold): <NEW_LINE> <INDENT> print('Loading embeddings: ') <NEW_LINE> self.distance_treshold = distance_treshold <NEW_LINE> self.id_folder = id_folder <NEW_LINE> self.embeddings = np.load(self.id_folder + '/' + 'embeddings.npy') <NEW_LINE> sel... | Keeps track of known identities and calculates id matches | 62598fb9e5267d203ee6ba64 |
class Automaton(metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def __init__(self, obj=None, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def validate_self(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def _validat... | An abstract base class for all Turing machines. | 62598fb9fff4ab517ebcd948 |
class OBJECT_OT_FeatureShow(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "show.feature" <NEW_LINE> bl_label = "Show previously set feature edges" <NEW_LINE> whichLevel = IntProperty() <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> obj = context.active_object <NEW_LINE> scn = context.scene <NEW_LINE>... | Show previously set feature edges | 62598fb9627d3e7fe0e07017 |
class BorderCommand(Command): <NEW_LINE> <INDENT> BORDER_BEFORE = 0 <NEW_LINE> BORDER_AFTER = 1 <NEW_LINE> position = BORDER_BEFORE <NEW_LINE> def applyBorders(self, cells, location=None): <NEW_LINE> <INDENT> a = self.attributes <NEW_LINE> if a and 'span' in list(a.keys()): <NEW_LINE> <INDENT> try: start, end = a['spa... | Base class for border commands | 62598fb9ec188e330fdf89f6 |
class GlanceImages(utils.GlanceScenario, nova_utils.NovaScenario): <NEW_LINE> <INDENT> RESOURCE_NAME_PREFIX = "rally_image_" <NEW_LINE> RESOURCE_NAME_LENGTH = 16 <NEW_LINE> @validation.required_services(consts.Service.GLANCE) <NEW_LINE> @validation.required_openstack(users=True) <NEW_LINE> @base.scenario(context={"clea... | Benchmark scenarios for Glance images. | 62598fb9a05bb46b3848a9d1 |
class Loader: <NEW_LINE> <INDENT> from ..primitives import uri <NEW_LINE> from .exceptions import LoadingError <NEW_LINE> @classmethod <NEW_LINE> def loadShelves(cls, executive, protocol, uri, scheme, context, **kwds): <NEW_LINE> <INDENT> linker = executive.linker <NEW_LINE> candidates = cls.locateShelves(executive=exe... | Base class for strategies that build component descriptors from persistent stores | 62598fb9a8370b77170f0544 |
class QLinear(nn.Linear): <NEW_LINE> <INDENT> def __init__(self, in_features, out_features, bias=True, num_bits=8, num_bits_weight=8, num_bits_grad=8, biprecision=True): <NEW_LINE> <INDENT> super(QLinear, self).__init__(in_features, out_features, bias) <NEW_LINE> self.num_bits = num_bits <NEW_LINE> self.num_bits_weight... | docstring for QConv2d. | 62598fb967a9b606de546137 |
class UserAssistantsList(object): <NEW_LINE> <INDENT> swagger_types = { 'assistants': 'list[UsersuserIdassistantsAssistants]' } <NEW_LINE> attribute_map = { 'assistants': 'assistants' } <NEW_LINE> def __init__(self, assistants=None): <NEW_LINE> <INDENT> self._assistants = None <NEW_LINE> self.discriminator = None <NEW_... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598fb926068e7796d4cabf |
class Interaction(object): <NEW_LINE> <INDENT> INTERACT_SCRIPT = 'interact.scm' <NEW_LINE> def __init__(self, query): <NEW_LINE> <INDENT> self.query = query <NEW_LINE> self.proc = None <NEW_LINE> self.state = None <NEW_LINE> self.good_path = None <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self.proc = ... | Interaction object that communicates with scheme to solve a
miniKaren Programming by Example query. Should use with
with Interaction(query) as env:
...
See example_interaction_gt() for example usage. | 62598fb93346ee7daa3376fb |
class SoOrthoSliceDetail(coin.SoDetail): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def getTypeId(self): <NEW_LINE> <INDENT> return _simvoleon.SoOrthoSliceDetail_getTypeId(self) <NEW_LINE> <DEDEN... | Proxy of C++ SoOrthoSliceDetail class | 62598fb932920d7e50bc61b4 |
class Event(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Event, self).__init__() <NEW_LINE> self.title = "Example Event 2015" <NEW_LINE> self.streets = Street(), Street(), Street() <NEW_LINE> self.closed_periods = [(datetime.datetime.utcnow() - datetime.timedelta(hours=random.randint(24, 3... | A collection of streets, and a range of time, and a name. | 62598fb9f548e778e596b70c |
class Player(pygame.sprite.DirtySprite): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Player, self).__init__() <NEW_LINE> self.width = 10 <NEW_LINE> self.height = 25 <NEW_LINE> self.speed = 5.5 <NEW_LINE> self.color = 'white' <NEW_LINE> self.pos = pygame.Vector2(GAME.screen_width // 2, GAME.screen_... | User controlled object. Movement is based on arrow-key presses and limited to the screen dimensions. | 62598fb9283ffb24f3cf39ea |
class ContractGroup(BaseModel): <NEW_LINE> <INDENT> name = models.CharField(max_length=255, unique=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name | Contract group model. | 62598fb991f36d47f2230f5d |
class HuaweiK4605(HuaweiWCDMADevicePlugin): <NEW_LINE> <INDENT> name = "Huawei K4605" <NEW_LINE> version = "0.1" <NEW_LINE> author = u"Andrew Bird" <NEW_LINE> custom = HuaweiK4605Customizer() <NEW_LINE> __remote_name__ = "K4605" <NEW_LINE> __properties__ = { 'ID_VENDOR_ID': [0x12d1], 'ID_MODEL_ID': [0x14c6], } <NEW_LIN... | :class:`~core.plugin.DevicePlugin` for Huawei's Vodafone K4605 | 62598fb963b5f9789fe852d4 |
class ProgressBarReader(progressbar.ProgressBar): <NEW_LINE> <INDENT> def __init__(self, iterable, widgets, max_value=None): <NEW_LINE> <INDENT> super(ProgressBarReader, self).__init__( widgets=widgets, max_value=max_value or progressbar.UnknownLength) <NEW_LINE> self._iterable = iterable <NEW_LINE> self.done = False <... | Extension of ProgressBar that supports starting and stopping the
BatchReader. | 62598fb94c3428357761a422 |
class TestLinkedQueue(object): <NEW_LINE> <INDENT> def test_linkedqueue_ctor(self): <NEW_LINE> <INDENT> queue = LinkedQueue() <NEW_LINE> assert_equal(0, len(queue)) <NEW_LINE> <DEDENT> @raises(EmptyError) <NEW_LINE> def test_emptylinkedqueue_front(self): <NEW_LINE> <INDENT> queue = LinkedQueue() <NEW_LINE> val = queue.... | Test class for the queue implementation | 62598fb9167d2b6e312b70dc |
class AsyncQequeSchedulerContainer(BaseSchedulerContainer): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.url_queue = asyncio.Queue() <NEW_LINE> <DEDENT> async def push(self, request: Request): <NEW_LINE> <INDENT> await self.url_queue.put(request) <NEW_LINE> <DEDENT> async def pop(self) -> Optional[R... | deque 保存request | 62598fb910dbd63aa1c70d20 |
class Cash(Payment): <NEW_LINE> <INDENT> def __init__(self, id,amount): <NEW_LINE> <INDENT> super().__init__(id,amount) | cash class | 62598fb9e1aae11d1e7ce8d8 |
class Flatten(nn.Module): <NEW_LINE> <INDENT> def __init__(self, dims_in): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.size = dims_in[0] <NEW_LINE> <DEDENT> def forward(self, x, rev=False): <NEW_LINE> <INDENT> if not rev: <NEW_LINE> <INDENT> return [x[0].view(x[0].shape[0], -1)] <NEW_LINE> <DEDENT> else: <NE... | Flattens N-D tensors into 1-D tensors. | 62598fb9656771135c4897d5 |
class RandomVocabulary(VocabularyBase): <NEW_LINE> <INDENT> CHOICES = ( ('consider', 'Deem to be'), ('minute', 'Infinitely or immeasurably small'), ('evident', 'Clearly revealed to the mind or the senses or judgment'), ('commit', 'Perform an act, usually with a negative connotation'), ('issue', 'Some situation or event... | Vocabulary example.
Choose random word from choices. | 62598fb97d43ff24874274b7 |
class rule_004(Rule): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Rule.__init__(self, 'loop_statement', '004', oToken, lAnchorTokens, oStartToken, oEndToken) <NEW_LINE> self.subphase = 3 | This rule checks the semicolon is on the same line as the **end loop** keyword.
**Violation**
.. code-block:: vhdl
end loop
;
end loop LOOP_LABEL
;
**Fix**
.. code-block:: vhdl
end loop;
end loop LOOP_LABEL; | 62598fb92c8b7c6e89bd392d |
class Filter: <NEW_LINE> <INDENT> def __init__(self, *functions): <NEW_LINE> <INDENT> self.functions = functions <NEW_LINE> <DEDENT> def apply(self, data): <NEW_LINE> <INDENT> return [item for item in data if all(i(item) for i in self.functions)] | Helper filter class. Accepts a list of single-argument
functions that return True if object in list conforms to some criteria | 62598fb9be383301e0253964 |
class SpiderMain(object): <NEW_LINE> <INDENT> def __init__(self,url): <NEW_LINE> <INDENT> self.url = url <NEW_LINE> <DEDENT> def _sleep(self): <NEW_LINE> <INDENT> time.sleep(random.randint(2,5)) <NEW_LINE> <DEDENT> def start(self): <NEW_LINE> <INDENT> driver = webdriver.Chrome() <NEW_LINE> driver.get(self.url) <NEW_LIN... | 搜狗微信号内容爬取 | 62598fb98a43f66fc4bf22e2 |
class ListBase(Structure): <NEW_LINE> <INDENT> _fields_ = [ ('first', c_void_p), ('last', c_void_p) ] | source/blender/makesdna/DNA_listBase.h: 59 | 62598fb91f5feb6acb162d87 |
class HandlerTest(gr_testutil.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(HandlerTest, self).setUp() <NEW_LINE> self.handler = util.Handler(self.request, self.response) <NEW_LINE> FakeBase.clear() <NEW_LINE> util.now_fn = lambda: NOW <NEW_LINE> policy = datastore_stub_util.PseudoRandomHRCo... | Base test class.
| 62598fb93539df3088ecc415 |
class QueenAnt(ScubaThrower): <NEW_LINE> <INDENT> name = 'Queen' <NEW_LINE> food_cost = 7 <NEW_LINE> True_queen = 1 <NEW_LINE> powered_ants = [] <NEW_LINE> implemented = True <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> if QueenAnt.True_queen: <NEW_LINE> <INDENT> QueenAnt.True_queen = 0 <NEW_LINE> self.true = Tru... | The Queen of the colony. The game is over if a bee enters her place. | 62598fb971ff763f4b5e78e0 |
class LiveStreamAiReviewImagePoliticalResult(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.StartPtsTime = None <NEW_LINE> self.EndPtsTime = None <NEW_LINE> self.Confidence = None <NEW_LINE> self.Suggestion = None <NEW_LINE> self.Label = None <NEW_LINE> self.Name = None <NEW_LINE> self... | 直播 AI 内容审核图片鉴政结果
| 62598fb9091ae35668704d89 |
class PubKey(bytes): <NEW_LINE> <INDENT> def __new__(cls, buf, eckey=None): <NEW_LINE> <INDENT> self = super(PubKey, cls).__new__(cls, buf) <NEW_LINE> if eckey is None: <NEW_LINE> <INDENT> eckey = ECKey() <NEW_LINE> <DEDENT> eckey.pub = buf <NEW_LINE> self.eckey = eckey <NEW_LINE> return self <NEW_LINE> <DEDENT> def ve... | Public key | 62598fb94f6381625f199576 |
class Vector: <NEW_LINE> <INDENT> def __init__(self, d): <NEW_LINE> <INDENT> self._coords = [0]*d <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self._coords) <NEW_LINE> <DEDENT> def __getitem__(self, j): <NEW_LINE> <INDENT> return self._coords[j] <NEW_LINE> <DEDENT> def __setitem__(self, j, val)... | Represents a vector in a multidimensional space | 62598fb9a8370b77170f0547 |
class TestVoiceprintCtcdasrResponse(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 testVoiceprintCtcdasrResponse(self): <NEW_LINE> <INDENT> pass | VoiceprintCtcdasrResponse unit test stubs | 62598fb9ad47b63b2c5a79bb |
class ReconfigDetectionSQLQueryCommand(base.SQLCommand): <NEW_LINE> <INDENT> query = "SELECT * FROM gp_dist_random('gp_id')" <NEW_LINE> def __init__(self, conn): <NEW_LINE> <INDENT> base.SQLCommand.__init__(self, "Reconfig detection sql query") <NEW_LINE> self.cancel_conn = conn <NEW_LINE> <DEDENT> def run(self): <NEW_... | A distributed query that will cause the system to detect
the reconfiguration of the system | 62598fb9aad79263cf42e93c |
class PrmFeu(Parametre): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Parametre.__init__(self, "feu", "fire") <NEW_LINE> self.aide_courte = "fait détonner le canon" <NEW_LINE> self.aide_longue = "Cette commande permet de faire détonner un canon " "présent dans la salle où vous vous ... | Commande 'canon feu'.
| 62598fb923849d37ff85121b |
class AutoRestBoolTestService(object): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self._client = ServiceClient(None, config) <NEW_LINE> client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} <NEW_LINE> self._serialize = Serializer() <NEW_LINE> self._deserialize = Dese... | Test Infrastructure for AutoRest
:param config: Configuration for client.
:type config: AutoRestBoolTestServiceConfiguration
:ivar bool_model: BoolModel operations
:vartype bool_model: .operations.BoolModel | 62598fb9d7e4931a7ef3c1fe |
class Limepy(LiteratureReferencesMixIn): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> LiteratureReferencesMixIn.__init__(self) <NEW_LINE> kwargs["M"] = 1 <NEW_LINE> kwargs["G"] = 1 <NEW_LINE> kwargs["rv"] = 1 <NEW_LINE> self.model = limepy(*args, **kwargs) <NEW_LINE> self.kwargs = kwargs... | LIMEPY : Lowered Isothermal Model Explorer in PYthon
for help:
print help(limepy.limepy)
print help(limepy.sample)
Relevant references:
.. [#] Gieles & Zocchi 2015, MNRAS, 454,576 | 62598fb93617ad0b5ee062af |
class TotalVatAmount(Vat): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_vat(cls, vat): <NEW_LINE> <INDENT> return cls( value=vat.value, currency=vat.currency, rate=vat.rate, ) <NEW_LINE> <DEDENT> def to_xml(self, factory): <NEW_LINE> <INDENT> metadata = factory.resolver.find('ns0:totalVatAmount') <NEW_LINE> ele... | A variation of the Vat for the totalVatAmount array. | 62598fb9009cb60464d0168c |
class ContextNotConfigured(Error): <NEW_LINE> <INDENT> pass | Thrown if use not configured context | 62598fb99f2886367281892d |
class LmdbEventStore(object): <NEW_LINE> <INDENT> def __init__(self, env): <NEW_LINE> <INDENT> self._env = env <NEW_LINE> self._event_history = self._env.open_db('event-history') | LMDB backed event store. | 62598fb9be383301e0253966 |
class QValues(Utilities): <NEW_LINE> <INDENT> @autocastable <NEW_LINE> def get_q_value(self, observation: D.T_agent[D.T_observation], action: D.T_agent[D.T_concurrency[D.T_event]]) -> D.T_value: <NEW_LINE> <INDENT> return self._get_q_value(observation, action) <NEW_LINE> <DEDENT> def _get_q_value(self, observation: D.T... | A solver must inherit this class if it can provide the Q function (i.e. action-value function). | 62598fb95fdd1c0f98e5e0f9 |
class PersonNew(object): <NEW_LINE> <INDENT> age = 3 <NEW_LINE> height = 170 <NEW_LINE> def __init__(self, name, age=18): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.age = age | docstring for PersonNew | 62598fb9091ae35668704d8b |
class Sheet(PeriodicModel, TimeStampedModel, UUIDModel, ClassMethodMixin): <NEW_LINE> <INDENT> objects = SheetManager() <NEW_LINE> entity = models.ForeignKey( Entity, related_name='%(class)ss' ) <NEW_LINE> template = models.ForeignKey( BudgetTemplate, related_name='%(class)ss' ) <NEW_LINE> description = models.TextFiel... | An abstract class for common Budget and Actual data | 62598fb9f548e778e596b70f |
class Order: <NEW_LINE> <INDENT> def __init__(self,order_id,price,timestamp,ordertype): <NEW_LINE> <INDENT> self.price = price <NEW_LINE> self.timestamp = TimeCal(timestamp) <NEW_LINE> self.orderid = order_id <NEW_LINE> self.ordertype = ordertype <NEW_LINE> <DEDENT> def order_time_relative(self): <NEW_LINE> <INDENT> re... | 委托订单 | 62598fb932920d7e50bc61b8 |
class Example(OObject): <NEW_LINE> <INDENT> def __init__( self, summary: Optional[str] = None, description: Optional[str] = None, value: Optional[Any] = None, external_value: Optional[str] = None, ): <NEW_LINE> <INDENT> _assert_type(summary, (str,), "summary", self.__class__) <NEW_LINE> _assert_type(description, (str,)... | In the `spec <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#example-object>`_ there is
no top-line description, but there is supplemental doc.
In all cases, the example value is expected to be compatible with the type schema of its associated value. Tooling
implementations MAY choose to va... | 62598fb95fcc89381b266201 |
class EventCreateView(LoginRequiredMixin, HelpMixin, CreateView): <NEW_LINE> <INDENT> model = Event <NEW_LINE> form_class = EventCreateForm <NEW_LINE> def get_success_url(self): <NEW_LINE> <INDENT> messages.add_message(self.request, messages.SUCCESS, self.object.MESSAGES['create']) <NEW_LINE> return super().get_success... | СОЗДАНИЕ МЕРОПРИЯТИЙ | 62598fb923849d37ff85121d |
class Mapper(object): <NEW_LINE> <INDENT> def __init__(self,arch,bytes,base,entry,context): <NEW_LINE> <INDENT> raise NotImplementedError('Override __init__() in a child class') <NEW_LINE> <DEDENT> def gen_mapping(self): <NEW_LINE> <INDENT> raise NotImplementedError('Override gen_mapping() in a child class') <NEW_LINE>... | A mapper maps old addresses to new addresses and old
instructions to new instructions.
This is a generic Mapper object. All mappers
used by this system should inherit from this parent
object and provide implementations for all functions listed. | 62598fb9236d856c2adc94f5 |
class FieldConverter(models.AbstractModel): <NEW_LINE> <INDENT> _name = 'ir.qweb.field' <NEW_LINE> @api.model <NEW_LINE> def attributes(self, record, field_name, options, values=None): <NEW_LINE> <INDENT> data = OrderedDict() <NEW_LINE> field = record._fields[field_name] <NEW_LINE> if not options['inherit_branding'] an... | Used to convert a t-field specification into an output HTML field.
:meth:`~.to_html` is the entry point of this conversion from QWeb, it:
* converts the record value to html using :meth:`~.record_to_html`
* generates the metadata attributes (``data-oe-``) to set on the root
result node
* generates the root result n... | 62598fb9851cf427c66b8420 |
class DebuggerRubyPage(ConfigurationPageBase, Ui_DebuggerRubyPage): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(DebuggerRubyPage, self).__init__() <NEW_LINE> self.setupUi(self) <NEW_LINE> self.setObjectName("DebuggerRubyPage") <NEW_LINE> self.rubyInterpreterButton.setIcon(UI.PixmapCache.getIcon("o... | Class implementing the Debugger Ruby configuration page. | 62598fb9be7bc26dc9251f11 |
class RestoreTest(CBBackupRestoreBase): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> super(RestoreTest, self).run() <NEW_LINE> self.cbbackup(wrapper=self.test_config.test_case.use_backup_wrapper) <NEW_LINE> self.flush_buckets() <NEW_LINE> start = time() <NEW_LINE> self.run_cbrestore_with_stats( wrapper=self.t... | After typical workload we backup all nodes then restore
and measure time it takes to perform restore. | 62598fb991f36d47f2230f5f |
@implementer(_IEllipticCurveExchangeKexAlgorithm) <NEW_LINE> class _ECDH384(object): <NEW_LINE> <INDENT> preference = 4 <NEW_LINE> hashProcessor = sha384 | Elliptic Curve Key Exchange with SHA-384 as HASH. Defined in
RFC 5656. | 62598fb963d6d428bbee291a |
class ZDT4(ZDTBaseProblem): <NEW_LINE> <INDENT> def __init__(self, num_variables=10, phenome_preprocessor=None, **kwargs): <NEW_LINE> <INDENT> f2 = ZDT_f2(ZDT1to4_f1, self.g, self.h) <NEW_LINE> self.min_bounds = [-5.0] * num_variables <NEW_LINE> self.min_bounds[0] = 0.0 <NEW_LINE> self.max_bounds = [5.0] * num_variable... | The ZDT4 problem. | 62598fb9283ffb24f3cf39ee |
class ArrayExpNode(VarExpNode): <NEW_LINE> <INDENT> def __init__(self, kind, line_number, name, expression, next_node = None): <NEW_LINE> <INDENT> VarExpNode.__init__(self, kind, line_number, name, next_node) <NEW_LINE> self.expression = expression <NEW_LINE> self.declaration = None <NEW_LINE> <DEDENT> def __str__(self... | Represents an array indexing expression, e.g. arr[x+1]. | 62598fb997e22403b383b071 |
class StructureType(Type): <NEW_LINE> <INDENT> def __init__(self, structure_type): <NEW_LINE> <INDENT> self.structure_type = structure_type <NEW_LINE> return <NEW_LINE> <DEDENT> def GetSExp(self): <NEW_LINE> <INDENT> li = [] <NEW_LINE> li.append('structure-of') <NEW_LINE> li.append(self.structure_type) <NEW_LINE> retur... | Represents a Structure type. | 62598fb9aad79263cf42e93f |
class MediaStorage(S3BotoStorage): <NEW_LINE> <INDENT> location = settings.MEDIAFILES_LOCATION | Change the Media Storage. | 62598fb910dbd63aa1c70d24 |
class UnsupportedOSVersionError(XylemError): <NEW_LINE> <INDENT> pass | Version of OS is unsupported.
Overriding a specific version is not supported. Version-order can
not be computed for specific version. | 62598fb97d43ff24874274b9 |
class Schueler(object): <NEW_LINE> <INDENT> def setData( self, nachname, vorname, klasse, nutzername, passwort, uid ): <NEW_LINE> <INDENT> self.data = {"nachname" : nachname, "vorname": vorname, "klasse" : klasse, "nutzername" : nutzername, "passwort" : passwort, "uid" : uid } <NEW_LINE> <DEDENT> def debugInfo(self): ... | Basisklasse für das Programm. Alle Infos eines Schülers
sind hier gespeichert. über debugInfo() erhält man einen kurzen
Überblick über den Schüler | 62598fb97cff6e4e811b5b8c |
class DraggableMixIn(ItemMixInBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._draggable = False <NEW_LINE> <DEDENT> def isDraggable(self): <NEW_LINE> <INDENT> return self._draggable <NEW_LINE> <DEDENT> def _setDraggable(self, draggable): <NEW_LINE> <INDENT> self._draggable = bool(draggable) <NE... | Mix-in class for draggable items | 62598fb98a43f66fc4bf22e6 |
class EmailAuthBackend(ModelBackend): <NEW_LINE> <INDENT> def authenticate(self, request, **kwargs): <NEW_LINE> <INDENT> email = kwargs.get('email') <NEW_LINE> password = kwargs.get('password') <NEW_LINE> email = email.strip() if email else email <NEW_LINE> if email: <NEW_LINE> <INDENT> for user in User.objects.filter(... | Email Authentication Backend: make possible to use email rather than username for user authentication | 62598fb9f9cc0f698b1c5383 |
class WeakValueDictionary(weakref.WeakValueDictionary): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> weakref.WeakValueDictionary.__init__(self, *args, **kwargs) <NEW_LINE> remove_base = self._remove <NEW_LINE> def remove(*args): <NEW_LINE> <INDENT> if safe_equal is None: <NEW_LINE> <INDE... | A subclass of weakref.WeakValueDictionary
which resets the 'nested_hash_level' when keys are being deleted. | 62598fb9a8370b77170f054a |
class OutboundEventSocket(EventSocket): <NEW_LINE> <INDENT> def __init__(self, socket, address, filter="ALL", connect_timeout=60, eventjson=True, pool_size=5000, trace=False): <NEW_LINE> <INDENT> EventSocket.__init__(self, filter, eventjson, pool_size, trace=trace) <NEW_LINE> self.transport = OutboundTransport(socket, ... | FreeSWITCH Outbound Event Socket.
A new instance of this class is created for every call/ session from FreeSWITCH. | 62598fb967a9b606de54613d |
class Class(object): <NEW_LINE> <INDENT> _name = "" <NEW_LINE> _conditional_probabilities = {} <NEW_LINE> _prior_probability = 0.0 <NEW_LINE> def __init__(self, name, prior_probability, conditional_probabilities = None): <NEW_LINE> <INDENT> if conditional_probabilities is None: <NEW_LINE> <INDENT> conditional_probabili... | Represents a class, has information about the prior probability of the class and maps words to
the conditional probability that they occur in a document of this class.
The prior_probability property contains the prior probability of the class, use the
conditional_probability(word) method to retrieve the probability f... | 62598fb9097d151d1a2c119e |
class AmbiguousRepr(object): <NEW_LINE> <INDENT> __repr__ = lambda self: Missing | Uninferable return value | 62598fb93d592f4c4edbb02a |
class TextToken(Token): <NEW_LINE> <INDENT> defaultStyle = 'fore:#000' | Anything that is not a string or comment. | 62598fb9099cdd3c63675498 |
class FetchLoveProduct(APIView): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> res = Product.objects.filter().order_by('-lovenum')[:5] <NEW_LINE> ret = ProductModelSerializer(res, many=True).data <NEW_LINE> mes = {} <NEW_LINE> mes['code'] = 200 <NEW_LINE> mes['list'] = ret <NEW_LINE> return Response(m... | 首页 人气推荐 | 62598fb966656f66f7d5a55e |
class RHSubContributionREST(RHManageSubContributionBase): <NEW_LINE> <INDENT> def _process_DELETE(self): <NEW_LINE> <INDENT> delete_subcontribution(self.subcontrib) <NEW_LINE> flash(_("Subcontribution '{}' deleted successfully").format(self.subcontrib.title), 'success') <NEW_LINE> return jsonify_data(html=_render_subco... | REST endpoint for management of a single subcontribution. | 62598fb9f548e778e596b712 |
class LogAnalyticsOperationResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'properties': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'properties': {'key': 'properties', 'type': 'LogAnalyticsOutput'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(LogAnalyticsOpera... | LogAnalytics operation status response.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar properties: LogAnalyticsOutput.
:vartype properties: ~azure.mgmt.compute.v2020_06_01.models.LogAnalyticsOutput | 62598fb9bf627c535bcb1610 |
class Font(object): <NEW_LINE> <INDENT> texture_width = 256 <NEW_LINE> texture_height = 256 <NEW_LINE> texture_internalformat = GL_ALPHA <NEW_LINE> ascent = 0 <NEW_LINE> descent = 0 <NEW_LINE> glyph_renderer_class = GlyphRenderer <NEW_LINE> texture_class = GlyphTextureAtlas <NEW_LINE> def __init__(self): <NEW_LINE> <IN... | Abstract font class able to produce glyphs.
To construct a font, use `pyglet.font.load`, which will instantiate the
platform-specific font class.
Internally, this class is used by the platform classes to manage the set
of textures into which glyphs are written.
:Ivariables:
`ascent` : int
Maximum ascent ... | 62598fb991f36d47f2230f60 |
class CommonMetricPrinter(EventWriter): <NEW_LINE> <INDENT> def __init__(self, max_iter): <NEW_LINE> <INDENT> self.logger = logging.getLogger(__name__) <NEW_LINE> self._max_iter = max_iter <NEW_LINE> self._last_write = None <NEW_LINE> <DEDENT> def write(self): <NEW_LINE> <INDENT> storage = get_event_storage() <NEW_LINE... | Print **common** metrics to the terminal, including
iteration time, ETA, memory, all losses, and the learning rate.
To print something different, please implement a similar printer by yourself. | 62598fb9d7e4931a7ef3c202 |
class ModuleStoreNoSettings(unittest.TestCase): <NEW_LINE> <INDENT> HOST = MONGO_HOST <NEW_LINE> PORT = MONGO_PORT_NUM <NEW_LINE> DB = 'test_mongo_%s' % uuid4().hex[:5] <NEW_LINE> COLLECTION = 'modulestore' <NEW_LINE> FS_ROOT = DATA_DIR <NEW_LINE> DEFAULT_CLASS = 'modulestore.tests.test_xml_importer.StubXBlock' <NEW_LI... | A mixin to create a mongo modulestore that avoids settings | 62598fb999cbb53fe6831045 |
class UncheckedKey(KaitaiStruct): <NEW_LINE> <INDENT> def __init__(self, _io, _parent=None, _root=None): <NEW_LINE> <INDENT> self._io = _io <NEW_LINE> self._parent = _parent <NEW_LINE> self._root = _root if _root else self <NEW_LINE> self._read() <NEW_LINE> <DEDENT> def _read(self): <NEW_LINE> <INDENT> self.previous = ... | Key of the unchecked table. | 62598fb91b99ca400228f5e7 |
class PubSubQueue(asyncio.Queue): <NEW_LINE> <INDENT> def __init__(self, *args, **kwds): <NEW_LINE> <INDENT> super().__init__(*args, **kwds) <NEW_LINE> self._exc = None <NEW_LINE> self._closed = False <NEW_LINE> <DEDENT> def close(self, exc=None): <NEW_LINE> <INDENT> self._exc = exc <NEW_LINE> self._closed = True <NEW_... | Queue class to hold incomming messages. | 62598fb99c8ee8231304022a |
class CRAM2FASTQ(ConvBase): <NEW_LINE> <INDENT> _default_method = "samtools" <NEW_LINE> _threading = True <NEW_LINE> def __init__(self, infile, outfile, *args, **kargs): <NEW_LINE> <INDENT> super(CRAM2FASTQ, self).__init__(infile, outfile, *args, **kargs) <NEW_LINE> <DEDENT> @requires("samtools") <NEW_LINE> def _method... | Convert :term:`CRAM` file to :term:`FASTQ` file
Methods available are based on samtools [SAMTOOLS]_. | 62598fb94c3428357761a427 |
class KittiOdometryDataset(dataset.DatasetMixin): <NEW_LINE> <INDENT> def __init__(self, data_dir=None, seq_len=3, split='train'): <NEW_LINE> <INDENT> with open(os.path.join(data_dir, "{}.txt".format(split)), 'r') as f: <NEW_LINE> <INDENT> dir_indexes = f.read().split('\n') <NEW_LINE> <DEDENT> if not dir_indexes[-1]: <... | Dataset class for a task on `Kitti Raw Dataset`_.
Args:
data_dir (string): Path to the dataset directory. The directory should
contain at least three directories, :obj:`training`, `testing`
and `ImageSets`.
split ({'train', 'val'}): Select from dataset splits used in
KiTTi Raw Dataset. | 62598fb93346ee7daa3376fe |
class Refreshable(RedditContentObject): <NEW_LINE> <INDENT> def refresh(self): <NEW_LINE> <INDENT> unique = self.reddit_session._unique_count <NEW_LINE> self.reddit_session._unique_count += 1 <NEW_LINE> if isinstance(self, Redditor): <NEW_LINE> <INDENT> other = Redditor(self.reddit_session, self._case_name, fetch=True,... | Interface for objects that can be refreshed. | 62598fb910dbd63aa1c70d26 |
class Life: <NEW_LINE> <INDENT> def __init__(self, ROWS, COLUMNS): <NEW_LINE> <INDENT> self.ROWS = ROWS <NEW_LINE> self.COLUMNS = COLUMNS <NEW_LINE> self.grid = np.zeros((self.COLUMNS, self.ROWS)) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return str(self.grid) <NEW_LINE> <DEDENT> def nextGeneration(sel... | The game of life | 62598fbaec188e330fdf89fe |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.