code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
@unittest.skipUnless(test_redis, "requires fakeredis") <NEW_LINE> class LocationTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.coordinates = [300, 500, -100] <NEW_LINE> self.test_coordinates = [600, 400, 0] <NEW_LINE> self.r = fakeredis.FakeStrictRedis() <NEW_LINE> self.db = DB()... | Get the bot's location | 62598f054527f215b58e8971 |
class YandexParser(Parser): <NEW_LINE> <INDENT> search_engine = 'yandex' <NEW_LINE> search_types = ['normal', 'image'] <NEW_LINE> no_results_selector = ['.message .misspell__message::text'] <NEW_LINE> effective_query_selector = ['.misspell__message .misspell__link'] <NEW_LINE> num_results_search_selectors = ['.serp-lis... | Parses SERP pages of the Yandex search engine. | 62598f05aad79263cf42d286 |
class itkBinaryThresholdImageFilterIF3IUS3_Superclass(itkInPlaceImageFilterAPython.itkInPlaceImageFilterIF3IUS3): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> def __init__(self, *args, **kwargs): raise AttributeError("No construct... | Proxy of C++ itkBinaryThresholdImageFilterIF3IUS3_Superclass class | 62598f053617ad0b5ee04ba2 |
class IndexingInernRangeSplit(Unit): <NEW_LINE> <INDENT> def _declr(self): <NEW_LINE> <INDENT> self.a = VectSignal(4) <NEW_LINE> self.b = VectSignal(4)._m() <NEW_LINE> <DEDENT> def _impl(self): <NEW_LINE> <INDENT> internA = self._sig("internA", Bits(2)) <NEW_LINE> internB = self._sig("internB", Bits(2)) <NEW_LINE> inte... | .. hwt-autodoc:: | 62598f057b180e01f3e48583 |
class TestBasicCommands(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.env = TestFileEnvironment('./test-output') <NEW_LINE> <DEDENT> def test_default(self): <NEW_LINE> <INDENT> res = self.env.run('../run.py', '-s', '1', expect_stderr=True) <NEW_LINE> assert 'Timeout' in res.stdout <NEW_LINE> ... | Test basic command-line invoke of the program | 62598f05656771135c488103 |
class MAVLink_fence_point_message(MAVLink_message): <NEW_LINE> <INDENT> def __init__(self, idx, count, lat, lng): <NEW_LINE> <INDENT> MAVLink_message.__init__(self, MAVLINK_MSG_ID_FENCE_POINT, 'FENCE_POINT') <NEW_LINE> self._fieldnames = ['idx', 'count', 'lat', 'lng'] <NEW_LINE> self.idx = idx <NEW_LINE> self.count = c... | A fence point. Used to set a point when from GCS
-> MAV. Also used to return a point from MAV -> GCS | 62598f057c178a314d78bf16 |
class Shrink(Operator): <NEW_LINE> <INDENT> pass | E.g.::
1d20!shrink(1) | 62598f054527f215b58e8973 |
class DequantizeArgs(Enum): <NEW_LINE> <INDENT> IFM = 0 <NEW_LINE> IFM_SCALE = 1 <NEW_LINE> IFM_ZERO_POINT = 2 | This is a helper enums to access the correct index of
dequantize arguments | 62598f053617ad0b5ee04ba4 |
class ProductionConfig: <NEW_LINE> <INDENT> CLIENT_ID = get_env_variable_value('CLIENT_ID', is_mandatory=True) <NEW_LINE> QUEUE_URL = get_env_variable_value('CLIENT_SQS_URL', is_mandatory=True) <NEW_LINE> SFTP_HOST = get_env_variable_value('SFTP_HOST', is_mandatory=True) <NEW_LINE> SFTP_PORT = get_env_variable_value('S... | Production application configuration - pulled from task environment. | 62598f055fcc89381b265667 |
class Tweets(DataModule): <NEW_LINE> <INDENT> def __init__(self, mode, data_id, data_values, world): <NEW_LINE> <INDENT> super().__init__(mode, data_id, data_values, world) <NEW_LINE> self.description = data_values[definitions.description] <NEW_LINE> self.source = data_values[definitions.source] <NEW_LINE> <DEDENT> def... | Tweets: Module to store tweets data description, content and analysis. | 62598f05ff9c53063f5190d9 |
class BoxPredictor(nn.Module): <NEW_LINE> <INDENT> def __init__(self, cfg): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.cfg = cfg <NEW_LINE> self.cls_headers = nn.ModuleList() <NEW_LINE> self.reg_headers = nn.ModuleList() <NEW_LINE> for level, (boxes_per_location, out_channels) in enumerate( zip(cfg.MODEL.PR... | The class responsible for generating predictions for each prior | 62598f05adb09d7d5dc09029 |
class ConfigPanel(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._widget = Gtk.Label("Configuration panel for JSHint Plugin") <NEW_LINE> <DEDENT> @property <NEW_LINE> def widget(self): <NEW_LINE> <INDENT> return self._widget | Panel to configure the JSHint plugin. | 62598f057b180e01f3e48584 |
class STD_ANON (pyxb.binding.datatypes.boolean): <NEW_LINE> <INDENT> _ExpandedName = None <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('/tmp/pyxbdist.mqXn05k/PyXB-1.2.4/pyxb/bundles/wssplat/schemas/soap11.xsd', 76, 5) <NEW_LINE> _Documentation = None | An atomic simple type. | 62598f05f9cc0f698b1c480b |
class PreviewMode: <NEW_LINE> <INDENT> FORM = 'FORM' <NEW_LINE> TABLE = 'TABLE' | constants for AccessObject preview_as parameter | 62598f05283ffb24f3cf2325 |
class Ability(): <NEW_LINE> <INDENT> def __init__(self, name, description, generation): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.description = description <NEW_LINE> self.generation = generation <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return (self.name + ": " + self.description) <NEW_LINE... | Uses an ability's data to construct a class. | 62598f057047854f4633de41 |
class AddressView(LoginRequiredMixin, View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> user = request.user <NEW_LINE> address = Address.objects.get_default_address(user) <NEW_LINE> return render(request, 'user_center_site.html', {'page': 'address', 'address': address}) <NEW_LINE> <DEDENT> def post... | 用户中心-地址 | 62598f055fdd1c0f98e5ca1a |
class OperatingSystem(object): <NEW_LINE> <INDENT> logger = Logger() <NEW_LINE> executor = ExecuteCommand() <NEW_LINE> file_writer = FileWriter("operating_system.lsc") <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.setup_os_info() <NEW_LINE> self.issues = {} <NEW_LINE> self.releases = {} <NEW_LINE> self.kernel... | constructor | 62598f055fcc89381b265668 |
class Sheep(Animal): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__(2, 4, 4) <NEW_LINE> self._name = 'Baby Lamb' <NEW_LINE> self._type = 'Sheep' <NEW_LINE> <DEDENT> def grow(self, food, water): <NEW_LINE> <INDENT> if food >= self._food_need and water >= self._water_need: <NEW_LINE> <INDENT... | Subclass of Animal | 62598f0560cbc95b06362dac |
class HouseLight(BaseComponent): <NEW_LINE> <INDENT> def __init__(self, light, *args, **kwargs): <NEW_LINE> <INDENT> super(HouseLight, self).__init__(*args, **kwargs) <NEW_LINE> if isinstance(light, hwio.BooleanOutput): <NEW_LINE> <INDENT> self.light = light <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise ValueErro... | Class which holds information about the house light
Parameters
----------
light : hwio.BooleanOutput
output channel to turn the light on and off
Attributes
----------
light : hwio.BooleanOutput
output channel to turn the light on and off | 62598f05bf627c535bcafef0 |
class Config(object): <NEW_LINE> <INDENT> JWT_BLACKLIST_ENABLED = True <NEW_LINE> JWT_BLACKLIST_TOKEN_CHECKS = ['access', 'refresh'] <NEW_LINE> SECRET_KEY = "some-very-long-string-of-random-characters-CHANGE-TO-YOUR-LIKING" <NEW_LINE> APP_SETTINGS = "development" <NEW_LINE> SQLALCHEMY_TRACK_MODIFICATIONS = False <NEW_L... | Parent configuration class. | 62598f05d486a94d0ba2aa42 |
class NaiveBayesTest(TestCase): <NEW_LINE> <INDENT> def test_even_odd(self): <NEW_LINE> <INDENT> classifier = NaiveBayes() <NEW_LINE> classifier.train([EvenOdd(0, True), EvenOdd(1, False)]) <NEW_LINE> test = [EvenOdd(i, i % 2 == 0) for i in range(2, 1000)] <NEW_LINE> self.assertEqual(accuracy(classifier, test), 1.0) <N... | Tests for the naïve Bayes classifier. | 62598f057b180e01f3e48585 |
class RingBuffer(object): <NEW_LINE> <INDENT> def __init__(self, size=16000 * 5): <NEW_LINE> <INDENT> self._buf = collections.deque(maxlen=size) <NEW_LINE> <DEDENT> def extend(self, data): <NEW_LINE> <INDENT> self._buf.extend(data) <NEW_LINE> <DEDENT> def get(self): <NEW_LINE> <INDENT> tmp = bytes(bytearray(self._buf))... | Ring buffer to hold audio from PortAudio | 62598f05167d2b6e312b5a17 |
class ScalingField(Field): <NEW_LINE> <INDENT> __slots__ = ["scaling", "unit", "offset", "ndigits"] <NEW_LINE> def __init__(self, name, default, scaling=1, unit="", offset=0, ndigits=3, fmt="B"): <NEW_LINE> <INDENT> self.scaling = scaling <NEW_LINE> self.unit = unit <NEW_LINE> self.offset = offset <NEW_LINE> self.ndigi... | Handle physical values which are scaled and/or offset for communication
Example:
>>> from scapy.packet import Packet
>>> class ScalingFieldTest(Packet):
fields_desc = [ScalingField('data', 0, scaling=0.1, offset=-1, unit='mV')] # noqa: E501
>>> ScalingFieldTest(data=10).show2()
###[ Scalin... | 62598f05cc40096d61619717 |
class Dns01Handler(ChallengeHandlerBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__record_ids = {} <NEW_LINE> self.__resolver = dns.resolver.Resolver(configure=False) <NEW_LINE> self.__resolver.nameservers = ['8.8.8.8', '1.1.1.1', '9.9.9.9'] <NEW_LINE> self.__resolver.retry_servfail = False <N... | This class handles dns-01 challenge. | 62598f05377c676e912f62a3 |
class List(models.Model): <NEW_LINE> <INDENT> profile = models.ForeignKey(Profile, on_delete=models.CASCADE) <NEW_LINE> vehicle = models.OneToOneField('vehicle.Vehicle', on_delete=models.CASCADE) <NEW_LINE> address = models.CharField(max_length=acc_const.LIST_ADDRESS_MAX_LENGTH) <NEW_LINE> list_date = models.DateField(... | This model represents a user listing a vehicle | 62598f050fa83653e46f395f |
class MicroCluster: <NEW_LINE> <INDENT> def __init__(self, id_: int, n_features: int, creation_time: int, lambda_: float): <NEW_LINE> <INDENT> self.id = id_ <NEW_LINE> self.cf1 = np.zeros(n_features) <NEW_LINE> self.cf2 = np.zeros(n_features) <NEW_LINE> self.weight = 0 <NEW_LINE> self.lambda_ = lambda_ <NEW_LINE> self.... | The class represents a micro-cluster and its attributes. | 62598f05ec188e330fdf732d |
class FIFOBuffer: <NEW_LINE> <INDENT> @cbook.deprecated('1.3', name='FIFOBuffer', obj_type='class') <NEW_LINE> def __init__(self, nmax): <NEW_LINE> <INDENT> self._xa = np.zeros((nmax,), np.float_) <NEW_LINE> self._ya = np.zeros((nmax,), np.float_) <NEW_LINE> self._xs = np.zeros((nmax,), np.float_) <NEW_LINE> self._ys =... | A FIFO queue to hold incoming *x*, *y* data in a rotating buffer
using numpy arrays under the hood. It is assumed that you will
call asarrays much less frequently than you add data to the queue
-- otherwise another data structure will be faster.
This can be used to support plots where data is added from a real
time f... | 62598f054f88993c371efa29 |
class _FrameBreak(LCActionFlowable): <NEW_LINE> <INDENT> def __call__(self,ix=None,resume=0): <NEW_LINE> <INDENT> r = self.__class__(self.action+(resume,)) <NEW_LINE> r._ix = ix <NEW_LINE> return r <NEW_LINE> <DEDENT> def apply(self,doc): <NEW_LINE> <INDENT> if getattr(self,'_ix',None): <NEW_LINE> <INDENT> doc.handle_n... | A special ActionFlowable that allows setting doc._nextFrameIndex
eg story.append(FrameBreak('mySpecialFrame')) | 62598f05091ae35668703697 |
class EiExportOnlyBons(bpy.types.Operator): <NEW_LINE> <INDENT> bl_label = 'export bon' <NEW_LINE> bl_idname = 'object.export_only_bon' <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> clean() <NEW_LINE> scn = bpy.context.scene <NEW_LINE> info = len(bpy.context.selected_objects) <NEW_LINE> for obj in bpy.cont... | writes selected objects positions in file as *.fig | 62598f05a219f33f346c52aa |
class TrackingTestHarness(TestHarness): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(TrackingTestHarness, self).__init__() <NEW_LINE> self.tracks = OrderedDict() <NEW_LINE> self._result = '' <NEW_LINE> self.zcoord = 0.0 <NEW_LINE> <DEDENT> def _segment_track(self, track, geometry): <NEW_LINE> <INDE... | Specialized TestHarness for testing tracking. | 62598f053617ad0b5ee04ba8 |
class ModifyConnectionModeRequest(JDCloudRequest): <NEW_LINE> <INDENT> def __init__(self, parameters, header=None, version="v1"): <NEW_LINE> <INDENT> super(ModifyConnectionModeRequest, self).__init__( '/regions/{regionId}/instances/{instanceId}:modifyConnectionMode', 'POST', header, version) <NEW_LINE> self.parameters ... | 修改MySQL实例的连接模式:标准模式(standard) 和高安全模式(security).<br>- **标准模式**:响应时间短,但没有 SQL 审计和拦截的能力。<br>- **高安全模式**:具备一定的 SQL注入拦截能力(通过分析表达式、关键系统函数等来实现防御 SQL 注入攻击),并可开启 SQL 审计,但会增加一定的响应时间。<br>- 仅支持MySQL | 62598f05167d2b6e312b5a19 |
class CardHand: <NEW_LINE> <INDENT> def __init__(self, bet): <NEW_LINE> <INDENT> self.hand = [] <NEW_LINE> self.bet = bet <NEW_LINE> self.stop = False <NEW_LINE> self.abandon = False <NEW_LINE> <DEDENT> def score(self): <NEW_LINE> <INDENT> score = 0 <NEW_LINE> num_A = 0 <NEW_LINE> for card in self.hand: <NEW_LINE> <IND... | This class represents a hand of cards - either of a player,
or of the dealer, in a Blackjack game round.
Class attributes:
hand
bet
stop
abandon
Class methods:
__init__
score
score_type
blackjack_check
bust_check
splittable
hit
stand
double_down
surrender | 62598f05dc8b845886d52044 |
class IEventFolder(form.Schema): <NEW_LINE> <INDENT> pass | A folder acting as a collection for events | 62598f05be7bc26dc92513a2 |
class FeatureType(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=50, unique=True) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.name | A type of location that might be a point of interest. | 62598f05d8ef3951e32c7391 |
class SendOTPView(APIView): <NEW_LINE> <INDENT> permission_classes = () <NEW_LINE> @classmethod <NEW_LINE> def new_user_onboarding(cls, mobile_number, user_name, request, app_version): <NEW_LINE> <INDENT> with transaction.atomic(): <NEW_LINE> <INDENT> logger.info("Creating new user entry") <NEW_LINE> user = User.create... | API to perform OTP based signup or login for farmers.
:returns Response({ session_id: "uteir-12hsd-1823h2" }) | 62598f05aad79263cf42d28d |
class Layer(bpy.types.PropertyGroup): <NEW_LINE> <INDENT> def hide_get(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> nodes = bpy.context.object.active_material.node_tree.nodes <NEW_LINE> return nodes[self.mix].mute <NEW_LINE> <DEDENT> except KeyError as e: <NEW_LINE> <INDENT> print("Can't find mix node for gettin... | Group of properties representing a layer in the list. | 62598f05ad47b63b2c5a6296 |
class CodecDecodeError(Exception): <NEW_LINE> <INDENT> pass | Exception raised by a codec during a decoding operation. | 62598f05fff4ab517ebcc251 |
class BaseModel(Base): <NEW_LINE> <INDENT> __abstract__ = True <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> created = Column(DateTime, default=datetime.datetime.utcnow) <NEW_LINE> updated = Column(DateTime, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow) <NEW_LINE> @classmethod <NEW... | Base class that provides the basic interface for every class to inherits from | 62598f0563b5f9789fe83bdf |
class NegativeResponseNBDD( DSQuery ): <NEW_LINE> <INDENT> def __init__( self, dgmId = 0, srcIP = None, srcPort = 0, qryName = None ): <NEW_LINE> <INDENT> super( NegativeResponseNBDD, self ).__init__( msgType = DS_DGM_NEGRESP, hdrSNT = DS_SNT_NBDD, dgmId = dgmId, srcIP = srcIP, srcPort = srcPort, qryName = qry... | NBDD Negative Query Response message.
Properties:
msgType - Get the message type, which will always be DS_DGM_NEGRESP.
Doctest:
>>> ip = chr( 10 ) + chr( 10 ) + chr( 44 ) + chr( 66 )
>>> qName = Name( "Ruby" ).L2name
>>> nNBDD = NegativeResponseNBDD( 7654, ip, DS_PORT, qName )
>>> print ParseDgm( nNBDD.c... | 62598f05adb09d7d5dc0902f |
class InternalError(CustomError): <NEW_LINE> <INDENT> def __init__(self, error, headers=None): <NEW_LINE> <INDENT> CustomError.__init__(self, '500 Internal Error', error, headers) | Internal error. | 62598f057b180e01f3e48587 |
class NextPreviousToggleTests(NextPreviousBase, unittest.TestCase): <NEW_LINE> <INDENT> layer = DEXTERITY_INTEGRATION_TESTING <NEW_LINE> _behaviors = ( 'plone.app.dexterity.behaviors.nextprevious.INextPreviousToggle',) <NEW_LINE> _portal_type = 'FolderWithToggle' <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.por... | basic use cases and tests for next/previous navigation, essentially
borrowed from `plone.app.folder.tests.test_nextprevious.py` | 62598f05f9cc0f698b1c480e |
class CreateQuestionnaireResponse: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swaggerTypes = { 'result': 'CreateQuestionnaireResult', 'status': 'str', 'error_message': 'str', 'composedOn': 'long' } <NEW_LINE> self.result = None <NEW_LINE> self.status = None <NEW_LINE> self.error_message = None <NE... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f0550812a4eaa62012b |
class MachineTypesService(base_api.BaseApiService): <NEW_LINE> <INDENT> _NAME = u'machineTypes' <NEW_LINE> def __init__(self, client): <NEW_LINE> <INDENT> super(ComputeV1.MachineTypesService, self).__init__(client) <NEW_LINE> self._method_configs = { 'AggregatedList': base_api.ApiMethodInfo( http_method=u'GET', method_... | Service class for the machineTypes resource. | 62598f05377c676e912f62a5 |
class TestRcr(unittest.TestCase): <NEW_LINE> <INDENT> def test_who_i_am(self): <NEW_LINE> <INDENT> my_name = rcr.get_who_am_i() <NEW_LINE> self.assertIsInstance( my_name, str, msg='My name was not a string', ) <NEW_LINE> self.assertEqual('Jean Val Jean', my_name, msg='Got wrong name') <NEW_LINE> <DEDENT> def test_priso... | This tests all of our shit. | 62598f0571ff763f4b5e61e3 |
class NodeFactory: <NEW_LINE> <INDENT> def __init__(self, k, storage_factory): <NEW_LINE> <INDENT> self.k = k <NEW_LINE> self.storage_factory = storage_factory <NEW_LINE> <DEDENT> def create(self, label): <NEW_LINE> <INDENT> return Node(label, self.k, self.storage_factory) | This class should work as interface for for creating Node instances.
Since Node may depends on distance function - it is necessary to allow external definition of this class | 62598f057c178a314d78bf1e |
class Permission(DeclarativeBase): <NEW_LINE> <INDENT> __tablename__ = 'tg_permission' <NEW_LINE> permission_id = Column(Integer, autoincrement=True, primary_key=True) <NEW_LINE> permission_name = Column(Unicode(63), unique=True, nullable=False) <NEW_LINE> description = Column(Unicode(255)) <NEW_LINE> groups = relation... | Permission definition for :mod:`repoze.what`.
Only the ``permission_name`` column is required by :mod:`repoze.what`. | 62598f054f88993c371efa2b |
class Screen(object): <NEW_LINE> <INDENT> def __init__(self, ui): <NEW_LINE> <INDENT> self._ui = ui <NEW_LINE> <DEDENT> def closeScreen(self): <NEW_LINE> <INDENT> self._ui.popState() <NEW_LINE> <DEDENT> def handleEvents(self, events): <NEW_LINE> <INDENT> for e in events: <NEW_LINE> <INDENT> if e.type == pygame.QUIT: <N... | The base class for all screens | 62598f055fcc89381b26566b |
class intSet(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.vals = [] <NEW_LINE> <DEDENT> def insert(self, e): <NEW_LINE> <INDENT> if not e in self.vals: <NEW_LINE> <INDENT> self.vals.append(e) <NEW_LINE> <DEDENT> <DEDENT> def member(self, e): <NEW_LINE> <INDENT> return e in self.vals <NEW_LI... | An intSet is a set of integers
The value is represented by a list of ints, self.vals.
Each int in the set occurs in self.vals exactly once. | 62598f055fdd1c0f98e5ca20 |
class MNPuzzle(Puzzle): <NEW_LINE> <INDENT> def __init__(self, from_grid, to_grid): <NEW_LINE> <INDENT> assert len(from_grid) > 0 <NEW_LINE> assert all([len(r) == len(from_grid[0]) for r in from_grid]) <NEW_LINE> assert all([len(r) == len(to_grid[0]) for r in to_grid]) <NEW_LINE> self.n, self.m = len(from_grid), len(fr... | An nxm puzzle, like the 15-puzzle, which may be solved, unsolved,
or even unsolvable. | 62598f05ab23a570cc2d42ac |
class OffensiveReflexAgent(ReflexCaptureAgent): <NEW_LINE> <INDENT> def getFeatures(self, gameState, action): <NEW_LINE> <INDENT> features = util.Counter() <NEW_LINE> successor = self.getSuccessor(gameState, action) <NEW_LINE> features['successorScore'] = self.getScore(successor) <NEW_LINE> legalPositions = [p for p in... | A reflex agent that seeks food. This is an agent
we give you to get an idea of what an offensive agent might look like,
but it is by no means the best or only way to build an offensive agent. | 62598f054c34283577618d6a |
class VisualPredictor(object): <NEW_LINE> <INDENT> def __init__(self, ariadne): <NEW_LINE> <INDENT> self.ariadne = ariadne <NEW_LINE> <DEDENT> def computeScore(self, n1, n2, reference_value=None): <NEW_LINE> <INDENT> return 1.0 | Base class for visual Predictors
Parameters
----------
ariadne : Ariadne
object associated with a source image | 62598f05bf627c535bcafef6 |
class Propagator(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> raise NotImplementedError("'Propagator' is an abstract base class.") <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> raise NotImplementedError("'Propagator' is an abstract base class.") <NEW_LINE> <DEDENT> def get_number_co... | Propagators can numerically simulate the time evolution of quantum states
:math:`\psi(x,t)` as described by the time-dependent Schroedinger equation
.. math:: i \varepsilon^2 \frac{\partial}{\partial t} \psi(x,t) = H \psi(x,t)
where the semi-classical scaling parameter :math:`\varepsilon > 0` is already included.
The... | 62598f057cff6e4e811b4467 |
class V1beta1PodDisruptionBudgetSpec(object): <NEW_LINE> <INDENT> openapi_types = { 'max_unavailable': 'object', 'min_available': 'object', 'selector': 'V1LabelSelector' } <NEW_LINE> attribute_map = { 'max_unavailable': 'maxUnavailable', 'min_available': 'minAvailable', 'selector': 'selector' } <NEW_LINE> def __init__(... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598f057b180e01f3e48588 |
class DataProcessor(object): <NEW_LINE> <INDENT> def get_example_from_tensor_dict(self, tensor_dict): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def get_train_examples(self, data_dir): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def get_dev_examples(self, data_dir): <NEW... | Base class for data converters for sequence classification data sets. | 62598f05d486a94d0ba2aa48 |
class CaseInfo: <NEW_LINE> <INDENT> def __init__(self, case_expressions: typing.List[str], field: typing.Optional[MemberInfo]): <NEW_LINE> <INDENT> self._case_expressions = case_expressions <NEW_LINE> self._field = field <NEW_LINE> <DEDENT> @property <NEW_LINE> def case_expressions(self) -> typing.List[str]: <NEW_LINE>... | Case info class which provides information about choice cases in generated choices. | 62598f05f9cc0f698b1c480f |
class Error: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def error(x, y): <NEW_LINE> <INDENT> while True: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> user_input = int(input("\n>>")) <NEW_LINE> if user_input not in range(x, y): <NEW_LINE> <INDENT> raise ... | The error class was created to hold all errors that could occur during the program.
Everything from incorrect datetime formats to integer ranges and empty strings
are included. | 62598f059f28863672817277 |
class BizAPIBlueprintConfig(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.PREFERRED_URL_SCHEME = os.environ.get( "PREFERRED_URL_SCHEME", "https") | Configuration defaults for the biz API blueprint. | 62598f05ad47b63b2c5a629a |
class TableLayer(FeatureLayer): <NEW_LINE> <INDENT> pass | Table object is exactly like FeatureLayer object | 62598f054f88993c371efa2c |
class Classifier(object): <NEW_LINE> <INDENT> def __init__(self, labels, features, labelDist={}): <NEW_LINE> <INDENT> self.labels = labels <NEW_LINE> self.features = features <NEW_LINE> self.labelDist = labelDist <NEW_LINE> self.jointProbDict = {} <NEW_LINE> <DEDENT> def predictdf(self, df): <NEW_LINE> <INDENT> return ... | Classifier has 2 (principal) propteries
labels: labels
features: features | 62598f05283ffb24f3cf2330 |
class BitField(object): <NEW_LINE> <INDENT> def __init__(self, names): <NEW_LINE> <INDENT> self.names = names <NEW_LINE> self.values = {} <NEW_LINE> <DEDENT> def set(self, name, value): <NEW_LINE> <INDENT> if name not in self.names: <NEW_LINE> <INDENT> assert False <NEW_LINE> <DEDENT> self.values[name] = value <NEW_LIN... | Represents a flags bitfield, makes it easier to represent flags by name | 62598f053d592f4c4edb996d |
class ModelVectorizer(BaseVectorizer): <NEW_LINE> <INDENT> def __init__(self, embeddings_path, no_duplicates): <NEW_LINE> <INDENT> super(ModelVectorizer, self).__init__(embeddings_path, no_duplicates) <NEW_LINE> <DEDENT> def vectorize_text(self, tokens): <NEW_LINE> <INDENT> t_vec = self.base_vectorize_text(tokens) <NEW... | векторизация текста моделью | 62598f054527f215b58e897f |
class DonorMongodb(object): <NEW_LINE> <INDENT> def __init__(self, name, donation): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.donation = donation <NEW_LINE> self.total = 0.00 | Locally stores the donor name and donation | 62598f055fdd1c0f98e5ca24 |
class RSAKeyUnwrappingError(Exception): <NEW_LINE> <INDENT> def __init__(self, message="Unknown error"): <NEW_LINE> <INDENT> self._message = message <NEW_LINE> super(Exception).__init__(message) | Exception indicating an error with RSA key unwrapping. | 62598f05a219f33f346c52b2 |
class TempWaveReader(WaveReader): <NEW_LINE> <INDENT> def __init__(self, tempfile): <NEW_LINE> <INDENT> WaveReader.__init__(self, tempfile.name) <NEW_LINE> self.tempfile = tempfile <NEW_LINE> <DEDENT> def __del__(self): <NEW_LINE> <INDENT> WaveReader.__del__(self) <NEW_LINE> self.tempfile.close() <NEW_LINE> <DEDENT> de... | a subclass of WaveReader for reading wave data from temporary files | 62598f054c34283577618d6e |
class NEMFile(NamedTuple): <NEW_LINE> <INDENT> header: HeaderRecord <NEW_LINE> readings: Dict[str, Dict[str, List[Reading]]] <NEW_LINE> transactions: Dict[str, Dict[str, list]] | Represents a meter reading | 62598f055166f23b2e241e64 |
class Game(object): <NEW_LINE> <INDENT> def __init__(self, board=Board(), player=Player(), **kwargs): <NEW_LINE> <INDENT> self.board = board <NEW_LINE> self.player = player <NEW_LINE> <DEDENT> def graphic(self, board): <NEW_LINE> <INDENT> width = board.width <NEW_LINE> height = board.height <NEW_LINE> size = 4 <NEW_LI... | game server | 62598f057cff6e4e811b446b |
class UserNotFound(UserManagerError): <NEW_LINE> <INDENT> msg = "The user was not found" <NEW_LINE> def __init__(self, username): <NEW_LINE> <INDENT> self.username = username | a user was not found in the database | 62598f055fc7496912d477b6 |
class Like(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(TopicUser) <NEW_LINE> comment = models.ForeignKey(Comment) <NEW_LINE> time_voted = models.DateTimeField(auto_now_add=True) <NEW_LINE> active = models.BooleanField(default=True) | A like. | 62598f0550812a4eaa62012e |
class OrganisationContactUpdate(LoginRequiredMixin, UpdateView): <NEW_LINE> <INDENT> model = OrganisationContact <NEW_LINE> form_class = apps_forms.OrganisationContactForm <NEW_LINE> template_name = 'applications/organisation_contact_form.html' <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> con... | A view to update an Organisation object.
| 62598f05283ffb24f3cf2331 |
class Dbf1to1_Right(Dbf1toN_Right): <NEW_LINE> <INDENT> def __init__(self, id, properties={}): <NEW_LINE> <INDENT> super(Dbf1to1_Right, self).__init__(id, properties, flag_to1=True) | Relationship field. | 62598f059f2886367281727b |
@permission_classes([permissions.IsAuthenticated]) <NEW_LINE> class InitiateRegisterCreditCardView(APIView): <NEW_LINE> <INDENT> def post(self, request, *args, **kwargs): <NEW_LINE> <INDENT> account = get_object_or_404(Account, owner=request.user) <NEW_LINE> payment_parameters = initiate_register_credit_card(account=ac... | post: Initiate the credit card registration on the user's account. Returns datatrans params.
A user has a single billing account, so this endpoint doesn't take an account parameter.
The account gets inferred from the connected user. | 62598f05377c676e912f62a8 |
class GaussianNoiseLayer(NoiseLayer): <NEW_LINE> <INDENT> def __init__(self, name, session, input_shape, noise_stddev, input_node=None, save_location=None): <NEW_LINE> <INDENT> self.noise_stddev = noise_stddev <NEW_LINE> super().__init__(name, session, input_shape, input_node, save_location) <NEW_LINE> <DEDENT> def noi... | Adds IDD Gaussian noise to the elements of a tensor with a
mean of zero and a standard deviation that is constant across
all elements. | 62598f05d8ef3951e32c7395 |
class ListNetworkCapabilities(command.ListCommand): <NEW_LINE> <INDENT> resource = 'network' <NEW_LINE> log = logging.getLogger(__name__ + '.ListNetworkCapabilities') <NEW_LINE> list_columns = ['property', 'private', 'capability_values'] <NEW_LINE> def args2body(self, parsed_args): <NEW_LINE> <INDENT> params = {'detail... | List network capabilities. | 62598f054f88993c371efa2e |
class Solution: <NEW_LINE> <INDENT> def longestCommonPrefix(self, strs): <NEW_LINE> <INDENT> res = '' <NEW_LINE> if not strs or not strs[0]: <NEW_LINE> <INDENT> return res <NEW_LINE> <DEDENT> for i in range(len(strs[0])): <NEW_LINE> <INDENT> ch = strs[0][i] <NEW_LINE> for s in strs: <NEW_LINE> <INDENT> if i >= len(s) o... | @param strs: A list of strings
@return: The longest common prefix | 62598f057047854f4633de4d |
class FlashAirError(BaseError): <NEW_LINE> <INDENT> pass | Error while accessing the FlashAir card's API. | 62598f05099cdd3c6367491a |
class PyPythonOauth2(PythonPackage): <NEW_LINE> <INDENT> pypi = "python-oauth2/python-oauth2-1.1.1.tar.gz" <NEW_LINE> version('1.1.1', sha256='d7a8544927ac18215ba5317edd8f640a5f1f0593921bcf3ce862178312c8c9a4') <NEW_LINE> depends_on('py-setuptools', type='build') | python-oauth2 is a framework that aims at making it easy to
provide authentication via OAuth 2.0 within an application stack. | 62598f057cff6e4e811b446d |
class TestFeatures(unittest.TestCase): <NEW_LINE> <INDENT> TEST_FILENAME='tests/data/sample.exe' <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> overrides = { 'hashdd_file_absolute_path': 'test/', 'hashdd_size': 0 } <NEW_LINE> h = hashdd(filename=self.TEST_FILENAME, features=['hashdd_file_name', 'hashdd_file_absolute_p... | Unittests for defining selective modules and overrides
| 62598f05851cf427c66b6d4f |
class Imply(PathFormula, CTLS.Imply): <NEW_LINE> <INDENT> pass | A class representing LTL implications. | 62598f05d486a94d0ba2aa4e |
class Handler(object): <NEW_LINE> <INDENT> def __call__(self, actual_function_name, kwds): <NEW_LINE> <INDENT> raise NotImplementedError() | Callable object that handles the invocation of a mock dialog function. | 62598f05167d2b6e312b5a23 |
class Wlan(base.InLoopPollText): <NEW_LINE> <INDENT> orientations = base.ORIENTATION_HORIZONTAL <NEW_LINE> defaults = [ ('interface', 'wlan0', 'The interface to monitor'), ('update_interval', 1, 'The update interval.'), ( 'disconnected_message', 'Disconnected', 'String to show when the wlan is diconnected.' ), ( 'forma... | Displays Wifi ssid and quality | 62598f05aad79263cf42d297 |
class AuthError(Exception): <NEW_LINE> <INDENT> pass | An exception representing login failures.
This usually means that the user has cancelled a login attempt. | 62598f057c178a314d78bf26 |
class Uint64(CIMInt): <NEW_LINE> <INDENT> cimtype = 'uint64' <NEW_LINE> minvalue = 0 <NEW_LINE> maxvalue = 2 ** 64 - 1 | A value of CIM data type uint64. Derived from :class:`~pywbem.CIMInt`.
For details on CIM integer data types, see :class:`~pywbem.CIMInt`. | 62598f05ec188e330fdf7339 |
class PointOfContact(Point, FirstSecondPointMixin, CenterRadiusMixin): <NEW_LINE> <INDENT> _logger = _module_logger.getChild('PointOfContact') <NEW_LINE> def __init__(self, sketch, name, first_point, second_point, center, radius, label_offset, id=None, ): <NEW_LINE> <INDENT> Point.__init__(self, sketch, name, label_off... | Construct a point at the intersection of a circle and a line | 62598f053d592f4c4edb9971 |
class ReaderTest(TestCase): <NEW_LINE> <INDENT> def _validate_base(self, base_mva): <NEW_LINE> <INDENT> c = self.case <NEW_LINE> self.assertEqual(c.base_mva, base_mva) <NEW_LINE> <DEDENT> def _validate_object_numbers(self, n_buses, n_branches, n_gen): <NEW_LINE> <INDENT> c = self.case <NEW_LINE> self.assertEqual(len(c.... | Defines a base class for many reader test cases.
| 62598f05099cdd3c6367491b |
@tag('functional') <NEW_LINE> class NewVisitorTest(StaticLiveServerTestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> super(NewVisitorTest, cls).setUpClass() <NEW_LINE> cls.browser = webdriver.Chrome() <NEW_LINE> cls.browser.maximize_window() <NEW_LINE> cls.browser.implicitl... | Tests for first-time users visiting the site.
| 62598f05d486a94d0ba2aa50 |
@hashable <NEW_LINE> class MP4FreeForm(bytes): <NEW_LINE> <INDENT> FORMAT_DATA = AtomDataType.IMPLICIT <NEW_LINE> FORMAT_TEXT = AtomDataType.UTF8 <NEW_LINE> def __new__(cls, data, *args, **kwargs): <NEW_LINE> <INDENT> return bytes.__new__(cls, data) <NEW_LINE> <DEDENT> def __init__(self, data, dataformat=AtomDataType.U... | A freeform value.
Attributes:
* dataformat -- format of the data (see AtomDataType) | 62598f057c178a314d78bf28 |
class CommentDownload(Download): <NEW_LINE> <INDENT> def _getFile(self): <NEW_LINE> <INDENT> context = getattr(self.context, 'aq_explicit', self.context) <NEW_LINE> file = getattr(context, self.fieldname, None) <NEW_LINE> if file is None: <NEW_LINE> <INDENT> raise NotFound(self, self.fieldname, self.request) <NEW_LINE>... | Customization to overcome the traversing limitation of comment objects
| 62598f057047854f4633de51 |
class Meta(object): <NEW_LINE> <INDENT> model=Charge <NEW_LINE> fields = ['forex_percentage', 'transfer_fee_percentage', 'transfer_maximum_usd', 'transfer_minimum_usd','general_network_charge','mtn_charge','airtel_charge','safaricom_charge'] | docstring for Meta | 62598f05fff4ab517ebcc25e |
class sshConnecter(sshBaseConnecter): <NEW_LINE> <INDENT> def __init__(self,ip,userName,passWord): <NEW_LINE> <INDENT> super().__init__(ip,userName,passWord) <NEW_LINE> self.sh=paramiko.SSHClient() <NEW_LINE> <DEDENT> def ssh_get_connect(self,retryList): <NEW_LINE> <INDENT> self.sh.set_missing_host_key_policy(paramiko.... | 建立连接,并完成一系列操作 | 62598f05f548e778e596a011 |
class DescribeScheduledActionsRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ScheduledActionIds = None <NEW_LINE> self.Filters = None <NEW_LINE> self.Offset = None <NEW_LINE> self.Limit = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Schedule... | DescribeScheduledActions request structure.
| 62598f053617ad0b5ee04bb6 |
class Circle(object): <NEW_LINE> <INDENT> def __init__(self, x, y, radius, drawing_api): <NEW_LINE> <INDENT> self._x = x <NEW_LINE> self._y = y <NEW_LINE> self._radius = radius <NEW_LINE> self._drawing_api = drawing_api <NEW_LINE> <DEDENT> def draw(self): <NEW_LINE> <INDENT> self._drawing_api.draw_circle(self._x, self.... | Implementation-independent abstraction: for example, therre could be a rectangle class! | 62598f057cff6e4e811b4471 |
class Dx(Operator): <NEW_LINE> <INDENT> differential_order = 1 | Deriviative with repect to space. | 62598f05d486a94d0ba2aa52 |
class call_SHFileOperationW(object): <NEW_LINE> <INDENT> def __init__(self, view, sources_move, sources_copy, destination): <NEW_LINE> <INDENT> self.view = view <NEW_LINE> if sources_move: <NEW_LINE> <INDENT> self.shfow_m_thread = threading.Thread(target=self.caller, args=(1, sources_move, destination)) <NEW_LINE> self... | call Windows API for file operations | 62598f0550812a4eaa620131 |
class Comment(models.Model): <NEW_LINE> <INDENT> comment_text = models.CharField(max_length=512) <NEW_LINE> comment_user = models.ForeignKey(User, on_delete=models.CASCADE) <NEW_LINE> comment_task = models.ForeignKey(Task, on_delete=models.CASCADE) <NEW_LINE> comment_date = models.DateTimeField() | This class represents comments given on tasks.
Attributes:
comment_text: The text of the comment
comment_user: The user who commented
comment_task: The task to which the comment refers
comment_date: The date on which the comment was given | 62598f05ad47b63b2c5a62a4 |
class brk(angr.SimProcedure): <NEW_LINE> <INDENT> IS_SYSCALL = True <NEW_LINE> def run(self, new_brk): <NEW_LINE> <INDENT> r = self.state.posix.set_brk(new_brk) <NEW_LINE> l.debug('brk(%s) = %s', new_brk, r) <NEW_LINE> return r | This implements the brk system call. | 62598f05ec188e330fdf733d |
class MediaFilterFilter(admin.SimpleListFilter): <NEW_LINE> <INDENT> title = _('Media filter') <NEW_LINE> parameter_name = 'media_filter' <NEW_LINE> def lookups(self, request, model_admin): <NEW_LINE> <INDENT> media_filters = models.MediaFilter.objects.all() <NEW_LINE> return [(x.id, x.name) for x in media_filters] <NE... | filter by media_filter | 62598f05091ae356687036a6 |
class BeatLazyFunc: <NEW_LINE> <INDENT> def __init__(self, func, *args, **kwargs): <NEW_LINE> <INDENT> self._func = func <NEW_LINE> self._func_params = { "args": args, "kwargs": kwargs } <NEW_LINE> <DEDENT> def __call__(self): <NEW_LINE> <INDENT> return self.delay() <NEW_LINE> <DEDENT> def delay(self): <NEW_LINE> <INDE... | An lazy function declared in 'beat_schedule' and called before sending to worker.
Example:
beat_schedule = {
'test-every-5-minutes': {
'task': 'test',
'schedule': 300,
'kwargs': {
"current": BeatCallBack(datetime.datetime.now)
}
}
... | 62598f053617ad0b5ee04bb8 |
class Globals(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> cache_opts = { 'cache.data_dir':'/tmp/cache/data', 'cache.lock_dir':'/tmp/cache/lock', 'cache.regions':'short_term, long_term, medium_term', 'cache.short_term.type':'memory', 'cache.short_term.expire':'3600', 'cache.medium_term.type':'fi... | Globals acts as a container for objects available throughout the
life of the application | 62598f05956e5f7376df4bc2 |
class Version(object): <NEW_LINE> <INDENT> _RESOURCE_PATH_PARTS = 3 <NEW_LINE> def __init__(self, project, service, version, traffic_allocation=None): <NEW_LINE> <INDENT> self.project = project <NEW_LINE> self.service = service <NEW_LINE> self.version = version <NEW_LINE> self.traffic_allocation = traffic_allocation <N... | Value class representing a version resource. | 62598f05d486a94d0ba2aa54 |
class WebTest(unittest.TestCase): <NEW_LINE> <INDENT> @property <NEW_LINE> def app(self): <NEW_LINE> <INDENT> if not getattr(self, '_web_test_app', None): <NEW_LINE> <INDENT> self._web_test_app = webtest.TestApp(self.APPLICATION) <NEW_LINE> <DEDENT> return self._web_test_app <NEW_LINE> <DEDENT> def get(self, url, param... | A base class for testing web requests. Provides a wrapper around
the `WebTest`_ package that is mostly compatable with `gaetestbed`_'s.
To use, inherit from :py:class:`WebTest` and define a class-level
variable called ``APPLICATION`` that is set to the WSGI application
under test.
:py:class:`WebTest` is usually used ... | 62598f05656771135c488119 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.