code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class BookList(APIView): <NEW_LINE> <INDENT> def get(self, request, format=None): <NEW_LINE> <INDENT> books = Book.objects.all() <NEW_LINE> serializer = BookSerializer(books, many=True) <NEW_LINE> return Response(serializer.data) <NEW_LINE> <DEDENT> def post(self, request, format=None): <NEW_LINE> <INDENT> serializer =...
List all books or creates a new one
62598fb6a17c0f6771d5c332
class TokenAuthSupportQueryString(TokenAuthentication): <NEW_LINE> <INDENT> def authenticate(self, request): <NEW_LINE> <INDENT> if 'token' in request.query_params and 'HTTP_AUTHORIZATION' not in request.META: <NEW_LINE> <INDENT> return self.authenticate_credentials(request.query_params.get('token')) <NEW_LINE> <DEDENT...
Extend the TokenAuthentication class to support querystring authentication in the form of "http://www.example.com/?token=<token_key>" needed for google spreadsheets =importcsv()
62598fb6cc40096d6161a257
class BiddingStrategyType(enum.IntEnum): <NEW_LINE> <INDENT> UNSPECIFIED = 0 <NEW_LINE> UNKNOWN = 1 <NEW_LINE> COMMISSION = 16 <NEW_LINE> ENHANCED_CPC = 2 <NEW_LINE> MANUAL_CPC = 3 <NEW_LINE> MANUAL_CPM = 4 <NEW_LINE> MANUAL_CPV = 13 <NEW_LINE> MAXIMIZE_CONVERSIONS = 10 <NEW_LINE> MAXIMIZE_CONVERSION_VALUE = 11 <NEW_LI...
Enum describing possible bidding strategy types. Attributes: UNSPECIFIED (int): Not specified. UNKNOWN (int): Used for return value only. Represents value unknown in this version. COMMISSION (int): Commission is an automatic bidding strategy in which the advertiser pays a certain portion of the conversion valu...
62598fb67047854f4633f4d5
class Node(object): <NEW_LINE> <INDENT> def __init__(self, microdescriptor, routerstatus): <NEW_LINE> <INDENT> assert(microdescriptor and routerstatus) <NEW_LINE> logger.debug("Initializing node with fpr %s", routerstatus.fingerprint) <NEW_LINE> self.microdescriptor = microdescriptor <NEW_LINE> self.routerstatus = rout...
Represents a Tor node. A Node instance gets created for each node of a consensus. When we fetch a new consensus, we create new Node instances for the routers found inside. The 'microdescriptor' and 'routerstatus' fields of this object are immutable: They are set once when we receive the consensus based on the state o...
62598fb663d6d428bbee28aa
class ExternalAPIException(RESTException): <NEW_LINE> <INDENT> code = 503 <NEW_LINE> description = 'External API replied with an error.' <NEW_LINE> def __init__(self, response=None, **kwargs): <NEW_LINE> <INDENT> super(ExternalAPIException, self).__init__(**kwargs) <NEW_LINE> if response is not None: <NEW_LINE> <INDENT...
External API replied with an error.
62598fb67b25080760ed75af
class MultilayerPerceptronClassificationModel(JavaProbabilisticClassificationModel, JavaMLWritable, JavaMLReadable): <NEW_LINE> <INDENT> @property <NEW_LINE> @since("1.6.0") <NEW_LINE> def layers(self): <NEW_LINE> <INDENT> return self._call_java("javaLayers") <NEW_LINE> <DEDENT> @property <NEW_LINE> @since("2.0.0") <NE...
Model fitted by MultilayerPerceptronClassifier. .. versionadded:: 1.6.0
62598fb67d43ff2487427481
class HTTPTokenAuth(requests.auth.AuthBase): <NEW_LINE> <INDENT> def __init__(self, token): <NEW_LINE> <INDENT> self.token = token <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return self.token == other.token <NEW_LINE> <DEDENT> def __ne__(self, other): <NEW_LINE> <INDENT> return self.token != other...
Attaches HTTP Token Authentication to the given Request object.
62598fb6be7bc26dc9251eda
class Bytes(bytes): <NEW_LINE> <INDENT> def __new__(cls, data): <NEW_LINE> <INDENT> if data == None: <NEW_LINE> <INDENT> return str.__new__(cls, "-") <NEW_LINE> <DEDENT> return str.__new__(cls, data.encode("hex"))
String class to allow us to encode binary data
62598fb601c39578d7f12e76
class RegistrationForm(FlaskForm): <NEW_LINE> <INDENT> username = StringField('username_label', validators=[InputRequired(message="Username is required !!"), Length(min=4, max=25, message="Username must be between" "4 to 25 characters.")]) <NEW_LINE> password = PasswordField('password_label', validators=[InputRequired(...
Registration Form
62598fb692d797404e388be1
class SimplePatient(object): <NEW_LINE> <INDENT> def __init__(self, viruses, maxPop): <NEW_LINE> <INDENT> self.viruses = viruses <NEW_LINE> self.maxPop = maxPop <NEW_LINE> <DEDENT> def getTotalPop(self): <NEW_LINE> <INDENT> return len(self.viruses) <NEW_LINE> <DEDENT> def update(self): <NEW_LINE> <INDENT> survivedVirus...
Representation of a simplified patient. The patient does not take any drugs and his/her virus populations have no drug resistance.
62598fb64527f215b58e9fd2
class OSMesaPlatform(Platform): <NEW_LINE> <INDENT> def __init__(self, viewport_width, viewport_height): <NEW_LINE> <INDENT> super(OSMesaPlatform, self).__init__(viewport_width, viewport_height) <NEW_LINE> self._context = None <NEW_LINE> self._buffer = None <NEW_LINE> <DEDENT> def init_context(self): <NEW_LINE> <INDENT...
Renders into a software buffer using OSMesa. Requires special versions of OSMesa to be installed, plus PyOpenGL upgrade.
62598fb60fa83653e46f4fdd
class Meta: <NEW_LINE> <INDENT> model = models.Topic <NEW_LINE> fields = ( 'name', 'identifier', 'description', 'threads_last_day', 'threads', )
Meta options for topic serializer Defines which model to represent and which fields to display
62598fb63539df3088ecc3a9
class Game: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pygame.init() <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def w_game_init(): <NEW_LINE> <INDENT> icone = pygame.image.load(cs.IMAGE_ICONE) <NEW_LINE> pygame.display.set_icon(icone) <NEW_LINE> pygame.display.set_caption(cs.WINDOW_TITLE) <NEW_LINE> ...
The class for the window game setting.
62598fb64a966d76dd5eefd4
@pulumi.output_type <NEW_LINE> class GetCertificateResult: <NEW_LINE> <INDENT> def __init__(__self__, certificates=None, id=None, url=None, verify_chain=None): <NEW_LINE> <INDENT> if certificates and not isinstance(certificates, list): <NEW_LINE> <INDENT> raise TypeError("Expected argument 'certificates' to be a list")...
A collection of values returned by getCertificate.
62598fb6442bda511e95c556
class GetValueListSelection_String_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRUCT, '_id', (RemoteValueID, RemoteValueID.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, _id=None,): <NEW_LINE> <INDENT> self._id = _id <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class_...
Attributes: - _id
62598fb697e22403b383b003
class Encoder(simplejson.JSONEncoder): <NEW_LINE> <INDENT> def default(self, o): <NEW_LINE> <INDENT> if hasattr(o, "to_jsonable") and callable(o.to_jsonable): <NEW_LINE> <INDENT> return o.to_jsonable() <NEW_LINE> <DEDENT> if desktop.lib.thrift_util.is_thrift_struct(o): <NEW_LINE> <INDENT> return desktop.lib.thrift_util...
Automatically encodes JSON for Django models and Thrift objects, as well as objects that have "to_json" operations.
62598fb6f9cc0f698b1c534b
class PhoneBook(dict): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.phonebook = {} <NEW_LINE> <DEDENT> def add_contact(self, name, number=None): <NEW_LINE> <INDENT> self.phonebook[name] = number <NEW_LINE> return self.phonebook <NEW_LINE> <DEDENT> def view_contact(self, name=False): <NEW_LINE> <INDE...
Subclassed to dict, holds methods that manage a phone book
62598fb666673b3332c304cc
class Results: <NEW_LINE> <INDENT> def __init__(self, w): <NEW_LINE> <INDENT> self.top = Tkinter.Toplevel(w, name="results") <NEW_LINE> self.top.transient(w) <NEW_LINE> self.top.bind('<Return>', self.hide) <NEW_LINE> self.top.bind('<Escape>', self.hide) <NEW_LINE> self.text = Tkinter.Text(self.top, name="text") <NEW_LI...
Display the warnings produced by checker
62598fb68a349b6b43686339
class MongoInstance(Startable): <NEW_LINE> <INDENT> def __init__(self, prefab, addr=None, private_port=27021, public_port=None, type_="shard", replica='', configdb='', dbdir=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.prefab = prefab <NEW_LINE> if not addr: <NEW_LINE> <INDENT> self.addr = prefab.execu...
This class represents a mongo instance
62598fb6a8370b77170f04db
class Application(object): <NEW_LINE> <INDENT> deserialized_types = { 'application_id': 'str' } <NEW_LINE> attribute_map = { 'application_id': 'applicationId' } <NEW_LINE> supports_multiple_types = False <NEW_LINE> def __init__(self, application_id=None): <NEW_LINE> <INDENT> self.__discriminator_value = None <NEW_LINE>...
An object containing an application ID. This is used to verify that the request was intended for your service. :param application_id: A string representing the application identifier for your skill. :type application_id: (optional) str
62598fb65fdd1c0f98e5e08c
class EntryModeSet(Reply): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def parse(cls, packet): <NEW_LINE> <INDENT> arg0, _ = super(EntryModeSet, cls).parse(packet) <NEW_LINE> return arg0
@brief DIRECT EntryModeSet reply packet parser @see PATO_DIRECT_EMS
62598fb63d592f4c4edbafbf
class TruncatedNormalInitializer(Initializer): <NEW_LINE> <INDENT> def __init__(self, loc=0.0, scale=1.0, seed=0): <NEW_LINE> <INDENT> assert loc is not None <NEW_LINE> assert scale is not None <NEW_LINE> assert seed is not None <NEW_LINE> super(TruncatedNormalInitializer, self).__init__() <NEW_LINE> self._mean = loc <...
Implements the Random TruncatedNormal(Gaussian) distribution initializer Args: loc (float): mean of the normal distribution scale (float): standard deviation of the normal distribution seed (int): random seed Examples: .. code-block:: python fc = fluid.layers.fc(input=x, size=10, ...
62598fb61b99ca400228f5af
class SpecialoffersListView(ChunkListView, SpecialoffersParamsValidatorMixin): <NEW_LINE> <INDENT> CATEGORY_MODEL = SpecialoffersCategory <NEW_LINE> CHUNK_MODEL = Specialoffers <NEW_LINE> GENERAL_LINK = GENERAL_LINK <NEW_LINE> GENERAL_LABEL = GENERAL_LABEL <NEW_LINE> APP_NAME = APP_NAME <NEW_LINE> APP_LABEL = APP_LABEL
Specialoffers List View.
62598fb65fdd1c0f98e5e08d
class cached(object): <NEW_LINE> <INDENT> def __init__(self, key=NoDefault, expire="never", type=None, query_args=None, cache_headers=('content-type', 'content-length'), invalidate_on_startup=False, cache_response=True, **b_kwargs): <NEW_LINE> <INDENT> self.key = key <NEW_LINE> self.expire = expire <NEW_LINE> self.type...
Decorator to cache the controller. The namespace and cache key used to cache the controller are available as ``request.caching.namespace`` and ``request.caching.key``. This only caches the controller, not the template, validation or the hooks associated to the controller. If you also want to cache template remembe...
62598fb6379a373c97d99114
class ListChatsCommand: <NEW_LINE> <INDENT> name = settings.GET_CHATS <NEW_LINE> @login_required_db <NEW_LINE> def update(self, proto, msg, *args, **kwargs): <NEW_LINE> <INDENT> user = db.User.by_name(msg.user_account_name) <NEW_LINE> proto.write( Message.success( 202, **{ settings.LIST_INFO: [{ 'name': c.name, 'owner'...
Обрабатывает запросы на получение списка контактов пользователя.
62598fb6be8e80087fbbf166
class EnumValidator(EnumValidatorBase): <NEW_LINE> <INDENT> def __init__(self, values, errorMsgKey): <NEW_LINE> <INDENT> super(EnumValidator,self).__init__( errorMsgKey) <NEW_LINE> self.__values = values <NEW_LINE> <DEDENT> def getValueLabelList(self, req): <NEW_LINE> <INDENT> return self.__values
Validates that the value passed in is one of the values passed to the constructor.
62598fb699cbb53fe6830fd4
class TestValidateSchemas(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setupClass(cls): <NEW_LINE> <INDENT> args = cls._makeArgs() <NEW_LINE> cls.schemaProcessor = compile_schemas.SchemaProcessor(args) <NEW_LINE> cls.schemaProcessor.run() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def tearDownCl...
Ensure the schemas conform to certain rules
62598fb63317a56b869be5cc
class Authorizer(wsgi.Middleware): <NEW_LINE> <INDENT> def __init__(self, application): <NEW_LINE> <INDENT> super(Authorizer, self).__init__(application) <NEW_LINE> self.action_roles = { 'CloudController': { 'DescribeAvailabilityZones': ['all'], 'DescribeRegions': ['all'], 'DescribeSnapshots': ['all'], 'DescribeKeyPair...
Authorize an EC2 API request. Return a 401 if ec2.controller and ec2.action in WSGI environ may not be executed in nova.context.
62598fb69f288636728188c3
@attrs(auto_attribs=True, frozen=True) <NEW_LINE> class JSONDeserializerWithRequestIdRequired(Deserializer): <NEW_LINE> <INDENT> schema: marshmallow.Schema <NEW_LINE> request_id_field: str = 'request_id' <NEW_LINE> status_field: str = 'status' <NEW_LINE> error_field: str = 'error' <NEW_LINE> _status_error: str = 'ERROR...
Deserializer for Google Pub/Sub messages which expects a message of certain schema to be written in `message.data` as JSON encoded into binary data with utf-8. Schema used with this serializer must define some field which is used as request id (you can specify which one in constructor). If `JSONDeserializerWithReques...
62598fb6a219f33f346c6903
class BinExprNode(ExprNode): <NEW_LINE> <INDENT> def __init__(self, operator, operand_1, operand_2): <NEW_LINE> <INDENT> assert(isinstance(operator, str)) <NEW_LINE> assert(isinstance(operand_1, SingleExprNode)) <NEW_LINE> assert(isinstance(operand_2, SingleExprNode)) <NEW_LINE> self.operator = operator <NEW_LINE> self...
Represents binary expressions such as 'a + 2'
62598fb65166f23b2e2434db
class Image_MovieFrames__GUI(MovieFrames): <NEW_LINE> <INDENT> def __init__(self, seq_plotter): <NEW_LINE> <INDENT> MovieFrames.__init__(self, seq_plotter) <NEW_LINE> self.main_Window = None <NEW_LINE> self.redraw_flag=False <NEW_LINE> <DEDENT> def _setup_figure_and_axes(self, mfs): <NEW_LINE> <INDENT> self.MFS = mfs <...
Base class for GUI version of Movie Frames ---> needs matplotlib.backends.backend_gtkagg! do not clear axes each time for the next animation frame ------------- Contains: ------------- self.redraw_flag -- nedeed by MovieEngine
62598fb64428ac0f6e658621
class ListInstancesAsyncPager: <NEW_LINE> <INDENT> def __init__(self, method: Callable[..., Awaitable[cloud_redis.ListInstancesResponse]], request: cloud_redis.ListInstancesRequest, response: cloud_redis.ListInstancesResponse, *, metadata: Sequence[Tuple[str, str]] = ()): <NEW_LINE> <INDENT> self._method = method <NEW_...
A pager for iterating through ``list_instances`` requests. This class thinly wraps an initial :class:`google.cloud.redis_v1.types.ListInstancesResponse` object, and provides an ``__aiter__`` method to iterate through its ``instances`` field. If there are more pages, the ``__aiter__`` method will make additional ``Lis...
62598fb6a79ad1619776a16d
class FacticalWeatherInfo(BoxWithSchema): <NEW_LINE> <INDENT> SCHEMA = vol.Schema({ vol.Required("temp"): number, vol.Required("feels_like"): number, vol.Optional("temp_water"): number, vol.Required("icon"): Icon.validate, vol.Required("condition"): Condition.validate, vol.Required("wind_speed"): number, vol.Required("...
Объект fact Объект содержит информацию о погоде на данный момент.
62598fb6091ae35668704d1f
class Dict(dict): <NEW_LINE> <INDENT> def __init__(self, names=(), values=(), **kw): <NEW_LINE> <INDENT> super(Dict, self).__init__(**kw) <NEW_LINE> for k, v in zip(names, values): <NEW_LINE> <INDENT> self[k] = v <NEW_LINE> <DEDENT> <DEDENT> def __getattr__(self, key): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> retur...
字典类,改写构造方法,增加getattr、setattr魔法方法
62598fb69c8ee823130401f3
class Invertible1x1Conv(nn.Module): <NEW_LINE> <INDENT> def __init__(self, n_channels=3, lu_factorize=False): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.lu_factorize = lu_factorize <NEW_LINE> w = torch.randn(n_channels, n_channels) <NEW_LINE> w = torch.qr(w)[0] <NEW_LINE> if lu_factorize: <NEW_LINE> <INDENT...
Invertible 1x1 convolution layer; cf Glow section 3.2
62598fb6009cb60464d01622
class RelatedChannelIdField(serializers.PrimaryKeyRelatedField): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> if self.context is None or 'request' not in self.context: <NEW_LINE> <INDENT> return mpmodels.Channel.objects.none() <NEW_LINE> <DEDENT> user = self.context['request'].user <NEW_LINE> return ...
Related field serializer for media items or playlists which asserts that the channel field can only be set to a channel which the current user has edit permissions on. If there is no user, the empty queryset is returned.
62598fb6be383301e02538fc
class InterfacePlayGameTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.bot = unitility.AutoBot() <NEW_LINE> self.interface = interface.Interface(self.bot) <NEW_LINE> self.interface.do_stats = unitility.ProtoObject() <NEW_LINE> <DEDENT> def testAgain(self): <NEW_LINE> <INDENT> self...
Tests playing a game through the interface. (unittest.TestCase)
62598fb6e1aae11d1e7ce8a4
class FileOption(_OptionBase[str, _StrDefault]): <NEW_LINE> <INDENT> option_type: Any = custom_types.file_option
A file option.
62598fb6236d856c2adc94bf
class AbstractInstrumentSimulator: <NEW_LINE> <INDENT> neutron_coordinates_transformer = None <NEW_LINE> def run(self, neutrons, instrument, geometer, context = None): <NEW_LINE> <INDENT> nneutrons = len(neutrons) <NEW_LINE> self.context = context <NEW_LINE> from mcni.seeder import feed <NEW_LINE> feed() <NEW_LINE> com...
run simulation of an instrument
62598fb68e7ae83300ee919f
class IndicatorADX(Indicator): <NEW_LINE> <INDENT> def __init__(self, equityDataFrame, tickerCode): <NEW_LINE> <INDENT> tableName = "Indicator_ADX" <NEW_LINE> tickerCode = tickerCode <NEW_LINE> insertQuery = "insert or replace into %s (Date, Code, ADX, ADX_ROC) values (?,?,?,?)" % (tableName) <NEW_LINE> indicatorDataFr...
Average Directional Indicator(s). 14 Day
62598fb6b7558d589546372d
class Scoreboard(): <NEW_LINE> <INDENT> def __init__(self, ai_settings, screen, stats): <NEW_LINE> <INDENT> self.screen = screen <NEW_LINE> self.screen_rect = screen.get_rect() <NEW_LINE> self.ai_settings = ai_settings <NEW_LINE> self.stats = stats <NEW_LINE> self.text_color = 30, 30, 30 <NEW_LINE> self.font = pygame.f...
A class to report scoring information
62598fb6e5267d203ee6b9ff
class PricingAggregate(Choices): <NEW_LINE> <INDENT> _ = Choices.Choice <NEW_LINE> sum = _("Sum") << {'function': db.Sum} <NEW_LINE> average = _("Average") << {'function': db.Avg} <NEW_LINE> min = _("Minimum") << {'function': db.Min} <NEW_LINE> max = _("Maximum") << {'function': db.Max}
The way to aggregate values of a variable.
62598fb62c8b7c6e89bd38c4
class BaseVolumeuint16(_object): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, BaseVolumeuint16, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, BaseVolumeuint16, name) <NEW_LINE> def _...
Proxy of C++ PolyVox::BaseVolume<(uint16_t)> class.
62598fb6a17c0f6771d5c336
class TestMetricStatus(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 testMetricStatus(self): <NEW_LINE> <INDENT> pass
MetricStatus unit test stubs
62598fb663d6d428bbee28ae
class lineStyle(): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def set(lineWidth=1.0, lineColor=color.defined('black'), fillColor=None, lineJoin='round', lineCap='round', markerStart=None, markerMid=None, markerEnd=None, strokeDashArray=None): <NEW_LINE> <INDENT> if fillColor is None: <NEW_LINE> <INDENT> fillColor = '...
Class to manipulate line styles. This class is used to define line styles. It is capable of setting stroke and filling colors, line width, linejoin and linecap, markers (start, mid, and end) and stroke dash array The base method of this class is :meth:`lineStyle.set` that can create custom line types. .. note:: This...
62598fb667a9b606de5460d0
class Element(object): <NEW_LINE> <INDENT> def __init__(self,name,abbrv=None): <NEW_LINE> <INDENT> self.name=name <NEW_LINE> if abbrv==None: <NEW_LINE> <INDENT> self.abbrv=name[0] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.abbrv=abbrv <NEW_LINE> <DEDENT> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return s...
Élement de base pour la construction du roquelike
62598fb692d797404e388be3
class APIValueError(APIError): <NEW_LINE> <INDENT> def __init__(self, field, message=''): <NEW_LINE> <INDENT> super(APIValueError, self).__init__('value:invalid', field, message)
Indicate the input value has error or invalid. Hte data specifies the error field of input form.
62598fb63317a56b869be5cd
class Project(): <NEW_LINE> <INDENT> def __init__(self, project_dict): <NEW_LINE> <INDENT> self.pid = project_dict['id'] <NEW_LINE> self.blurb = project_dict['blurb'].lower() <NEW_LINE> self.deadline = project_dict['deadline'] <NEW_LINE> self.category_id = project_dict['category']['id'] <NEW_LINE> self.category_desc = ...
The Doc class rpresents a class of individula documents
62598fb667a9b606de5460d1
@dataclass <NEW_LINE> class PerceiverDecoderOutput(ModelOutput): <NEW_LINE> <INDENT> logits: torch.FloatTensor = None <NEW_LINE> cross_attentions: Optional[Tuple[torch.FloatTensor]] = None
Base class for Perceiver decoder outputs, with potential cross-attentions. Args: logits (`torch.FloatTensor` of shape `(batch_size, num_labels)`): Output of the basic decoder. cross_attentions (`tuple(torch.FloatTensor)`, *optional*, returned when `output_attentions=True` is passed or when `config.outp...
62598fb62c8b7c6e89bd38c5
class LandingPageViewServiceGrpcTransport(object): <NEW_LINE> <INDENT> _OAUTH_SCOPES = () <NEW_LINE> def __init__(self, channel=None, credentials=None, address='googleads.googleapis.com:443'): <NEW_LINE> <INDENT> if channel is not None and credentials is not None: <NEW_LINE> <INDENT> raise ValueError( 'The `channel` an...
gRPC transport class providing stubs for google.ads.googleads.v1.services LandingPageViewService API. The transport provides access to the raw gRPC stubs, which can be used to take advantage of advanced features of gRPC.
62598fb6167d2b6e312b7074
class STALTAFilterF(InPlaceFilterF): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> for _s in [InPlaceFilterF]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, STALTAFilterF, name, value) <NEW_LINE> __swig_getmethods__ = {}...
Proxy of C++ Seiscomp::Math::Filtering::STALTA<(float)> class
62598fb64428ac0f6e658623
class ContactSummary(BrowserView): <NEW_LINE> <INDENT> def __call__(self): <NEW_LINE> <INDENT> self.request.response.setHeader('X-Theme-Disabled', 'True') <NEW_LINE> return super(ContactSummary, self).__call__() <NEW_LINE> <DEDENT> def get_review_state(self): <NEW_LINE> <INDENT> return api.content.get_state(obj=self.co...
Contactsummary view
62598fb6091ae35668704d21
class ResPartnerBank(models.Model): <NEW_LINE> <INDENT> _inherit = 'res.partner.bank' <NEW_LINE> codigo_da_empresa = fields.Char( u'Código da empresa', size=20, help=u"Será informado pelo banco depois do cadastro do beneficiário " u"na agência")
Adiciona campos necessários para o cadastramentos de contas bancárias no Brasil.
62598fb6a8370b77170f04df
class ISCSITestCase(DriverTestCase): <NEW_LINE> <INDENT> driver_name = "cinder.volume.driver.ISCSIDriver" <NEW_LINE> def _attach_volume(self): <NEW_LINE> <INDENT> volume_id_list = [] <NEW_LINE> for index in xrange(3): <NEW_LINE> <INDENT> vol = {} <NEW_LINE> vol['size'] = 0 <NEW_LINE> vol_ref = db.volume_create(self.con...
Test Case for ISCSIDriver
62598fb6d58c6744b42dc35b
class SitoFileToDir(BaseModel): <NEW_LINE> <INDENT> input_uri: UriT <NEW_LINE> output_dir: Optional[Union[DirectoryPath, str]] <NEW_LINE> options: OptionsT
Single file in, directory of files out.
62598fb630bbd722464699fa
class target(parser.target): <NEW_LINE> <INDENT> def __init__(self, sString): <NEW_LINE> <INDENT> parser.target.__init__(self, sString)
unique_id = concurrent_simple_signal_assignment : target
62598fb62ae34c7f260ab1de
class LanguageResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'documents': {'required': True}, 'errors': {'required': True}, 'model_version': {'required': True}, } <NEW_LINE> _attribute_map = { 'documents': {'key': 'documents', 'type': '[DocumentLanguage]'}, 'errors': {'key': 'errors', 'type': '...
LanguageResult. All required parameters must be populated in order to send to Azure. :ivar documents: Required. Response by document. :vartype documents: list[~azure.ai.textanalytics.v3_0.models.DocumentLanguage] :ivar errors: Required. Errors by document id. :vartype errors: list[~azure.ai.textanalytics.v3_0.models....
62598fb6e5267d203ee6ba01
class DisplayInterface(metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def set_brightness(self, value): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def set_day(self, month, day, rgb): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> d...
Abstract interface for a display of the calendar
62598fb65fc7496912d482fc
class TWriter(TWorker): <NEW_LINE> <INDENT> stashed = pyqtSignal(TStashResponse) <NEW_LINE> def __init__( self, request: TStashRequest, path: Path = None, parent: QObject = None ): <NEW_LINE> <INDENT> super().__init__(path, parent) <NEW_LINE> self.request = request
Provides the base class for all different database writers
62598fb663d6d428bbee28b0
class TelnetConsole(Adapter): <NEW_LINE> <INDENT> def __init__(self, device=None, auth_token=None): <NEW_LINE> <INDENT> self.logger = logging.getLogger(self.__class__.__name__) <NEW_LINE> if device is None: <NEW_LINE> <INDENT> from droidbot.device import Device <NEW_LINE> device = Device() <NEW_LINE> <DEDENT> self.devi...
interface of telnet console, see: http://developer.android.com/tools/devices/emulator.html
62598fb656ac1b37e63022ed
class Config: <NEW_LINE> <INDENT> NEWS_API_BASE_URL ='https://newsapi.org/v2/sources?category&apiKey={}' <NEW_LINE> NEWS_API_ARTI_URL ='https://newsapi.org/v2/everything?sources={}&apiKey={}' <NEW_LINE> NEWS_API_KEY = os.environ.get('NEWS_API_KEY') <NEW_LINE> SECRET_KEY = os.environ.get('SECRET_KEY')
General configuration parent class
62598fb6f548e778e596b6a7
class Entmax15Function(Function): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def forward(ctx, input, dim=-1): <NEW_LINE> <INDENT> ctx.dim = dim <NEW_LINE> max_val, _ = input.max(dim=dim, keepdim=True) <NEW_LINE> input = input - max_val <NEW_LINE> input = input / 2 <NEW_LINE> tau_star, _ = Entmax15Function._threshold_...
An implementation of exact Entmax with alpha=1.5 (B. Peters, V. Niculae, A. Martins). See :cite:`https://arxiv.org/abs/1905.05702 for detailed description. Source: https://github.com/deep-spin/entmax
62598fb6377c676e912f6def
class PurchaseViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> serializer_class = serializers.HistorySerializer <NEW_LINE> queryset = Purchase.objects.all()
Purchase viewset of the shop.
62598fb6fff4ab517ebcd8ea
class ScoreBoard: <NEW_LINE> <INDENT> def __init__(self, window): <NEW_LINE> <INDENT> self.window = window <NEW_LINE> self.current_score = 0 <NEW_LINE> self.highest_score = self.read_highest_score() <NEW_LINE> self.current_level = 1 <NEW_LINE> self.font_36 = pygame.font.Font("fonts/wawa.ttf", constants.FONT_SIZE_36) <N...
得分板类
62598fb63539df3088ecc3af
@injected <NEW_LINE> class GatewayErrorHandler(HandlerProcessorProceed): <NEW_LINE> <INDENT> nameStatus = 'status' <NEW_LINE> nameAllow = 'allow' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> assert isinstance(self.nameStatus, str), 'Invalid status name %s' % self.nameStatus <NEW_LINE> assert isinstance(self.nameA...
Implementation for a handler that populates the gateway error parameters.
62598fb6be7bc26dc9251edd
class ReviewPage(Page): <NEW_LINE> <INDENT> search_fields = Page.search_fields + [ index.SearchField('introduction'), index.SearchField('body'), ] <NEW_LINE> image = models.ForeignKey( 'wagtailimages.Image', null=True, blank=True, on_delete=models.SET_NULL, related_name='+', help_text='Image to be used where this revie...
This is a page for an album review
62598fb6baa26c4b54d4f3bc
class Cutadapt: <NEW_LINE> <INDENT> quality_cutoff = IntegerField( label="Reads quality cutoff", required=False, description="Trim low-quality bases from 3' end of each read before " "adapter removal. The use of this option will override the use " "of NextSeq/NovaSeq-specific trim option.", )
Cutadapt filtering.
62598fb666673b3332c304d2
class ProviderBillingSource(models.Model): <NEW_LINE> <INDENT> uuid = models.UUIDField(default=uuid4, editable=False, unique=True, null=False) <NEW_LINE> bucket = models.CharField(max_length=63, null=True) <NEW_LINE> data_source = JSONField(null=True, default=dict) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> constraints...
A Koku Provider Billing Source. Used for accessing cost providers billing sourece like AWS Account S3.
62598fb64a966d76dd5eefdb
class EntityMeta(type): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def __prepare__(cls, name, bases): <NEW_LINE> <INDENT> return collections.OrderedDict() <NEW_LINE> <DEDENT> def __init__(cls, name, bases, attr_dict): <NEW_LINE> <INDENT> super().__init__(name, bases, attr_dict) <NEW_LINE> cls._field_names = [] <NEW_LI...
Metaclass for business entities with validated fields
62598fb62ae34c7f260ab1e0
class ArrayMixin: <NEW_LINE> <INDENT> def assertArraysEqual(self, a, b): <NEW_LINE> <INDENT> self.assertEquals(a.shape, b.shape) <NEW_LINE> self.assertEquals(a.dtype, b.dtype) <NEW_LINE> if (a != b).any(): <NEW_LINE> <INDENT> self.fail("a != b\na = %r\nb = %r" % (a, b))
Mixin for TestCase subclasses which make assertions about numpy arrays.
62598fb6aad79263cf42e8d7
class NotEnoughMoney(TException): <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.I64, 'moneyAvailable', None, None, ), (2, TType.I64, 'moneyRequested', None, None, ), ) <NEW_LINE> def __init__(self, moneyAvailable=None, moneyRequested=None,): <NEW_LINE> <INDENT> self.moneyAvailable = moneyAvailable <NEW_LINE> self...
Attributes: - moneyAvailable - moneyRequested
62598fb6e5267d203ee6ba03
class VerificationError(Exception): <NEW_LINE> <INDENT> pass
Attestation verification errors
62598fb64c3428357761a3bf
class TestResults(object): <NEW_LINE> <INDENT> def __init__(self, steps=0, matches=0, mismatches=0, missing=0, exact_matches=0, strict_matches=0, content_matches=0, layout_matches=0, none_matches=0, status=None, ): <NEW_LINE> <INDENT> self.steps = steps <NEW_LINE> self.matches = matches <NEW_LINE> self.mismatches = mis...
Eyes test results. # TODO: update regarding JAVA SDK
62598fb656ac1b37e63022ef
class MovingUnit(DoppelgangerUnit): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_data_format_members(cls, game_version): <NEW_LINE> <INDENT> data_format = [ (READ_GEN, None, None, IncludeMembers(cls=DoppelgangerUnit)), (READ_GEN, "move_graphics", StorageType.ID_MEMBER, "int16_t"), (READ_GEN, "run_graphics", Stor...
type_id >= 30 Moving master object
62598fb6fff4ab517ebcd8eb
class TextUtils: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def break_into_lines(text): <NEW_LINE> <INDENT> return text.split("\n") <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def filter_text(text): <NEW_LINE> <INDENT> text = text.replace('\n', '<br>')...
Utility class containing methods for manipulation of multi-line text.
62598fb6f548e778e596b6a9
class Pgl2A(object): <NEW_LINE> <INDENT> def __init__(self, d=2, m=np.zeros([3, 3]), special=False): <NEW_LINE> <INDENT> if np.array_equal(m.shape, [d + 1] * 2): <NEW_LINE> <INDENT> self.matrix = m <NEW_LINE> self.dim = d <NEW_LINE> self.special = special <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise IOError <NEW...
Classes for projective real Lie algebra, general and special, of dimension d. Default value d=2. https://en.wikipedia.org/wiki/Projective_linear_group Real projective general/special linear Lie algebra of dimension d. Each element is a (d+1)x(d+1) real matrix defined up to a constant. Its exponential is given through...
62598fb656ac1b37e63022f0
class ServerError(RPCError): <NEW_LINE> <INDENT> code = 500 <NEW_LINE> message = 'INTERNAL' <NEW_LINE> def __init__(self, message): <NEW_LINE> <INDENT> super().__init__(message) <NEW_LINE> self.message = message
An internal server error occurred while a request was being processed for example, there was a disruption while accessing a database or file storage.
62598fb6283ffb24f3cf3992
class Filter(object): <NEW_LINE> <INDENT> def __init__(self, gains): <NEW_LINE> <INDENT> self._num_states = len(gains) <NEW_LINE> self._gains = gains <NEW_LINE> self.state = 0.0, (0.0,)*self._num_states <NEW_LINE> self.signal = None <NEW_LINE> <DEDENT> state = state_property("_time", "_state") <NEW_LINE> @state.setter ...
A linear filter of arbitrary order. It also provides derivative estimates for otherwise nondifferentiable inputs. The `output` function returns to the complete signal, including derivatives. The signal is drawn from another subsystem with the `signal` callback. Make sure to set this before using the filter.
62598fb666656f66f7d5a4f6
class Rectangle: <NEW_LINE> <INDENT> pass
Rectangle class with height and width attributes
62598fb6ec188e330fdf8995
class UnsupportedOperation(MLManageException): <NEW_LINE> <INDENT> pass
This exception class is for exceptions that arise from attempts to use the API in ways that are not yet defined.
62598fb69f288636728188c9
class TestTripApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = mbtaapi.apis.trip_api.TripApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_api_web_trip_controller_index(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def te...
TripApi unit test stubs
62598fb623849d37ff8511b7
class Gene_Info(object): <NEW_LINE> <INDENT> def __init__(self, Start, End, Length, Id, Chromosome): <NEW_LINE> <INDENT> self.Start = Start <NEW_LINE> self.End = End <NEW_LINE> self.Length = Length <NEW_LINE> self.Id = Id <NEW_LINE> self.Chromosome = Chromosome
Class for showing some information about a given human gene
62598fb6796e427e5384e899
class GenericObject(object): <NEW_LINE> <INDENT> pass
Generic object into which we can stuff whichever attributes we want.
62598fb67c178a314d78d5a2
class UnknownUsageTypeUploadFreqError(Exception): <NEW_LINE> <INDENT> pass
Raised when UsageTypeUploadFreq contains a choice which is not handled in this module (see: `_get_max_expected_date` function).
62598fb65fdd1c0f98e5e094
class LifoMemoryQueue(FifoMemoryQueue): <NEW_LINE> <INDENT> def pop(self) -> Optional[Any]: <NEW_LINE> <INDENT> return self.q.pop() if self.q else None <NEW_LINE> <DEDENT> def peek(self) -> Optional[Any]: <NEW_LINE> <INDENT> return self.q[-1] if self.q else None
In-memory LIFO queue, API compliant with LifoDiskQueue.
62598fb6bf627c535bcb15a7
class WithTypeHints(object): <NEW_LINE> <INDENT> def __init__(self, *unused_args, **unused_kwargs): <NEW_LINE> <INDENT> self._type_hints = IOTypeHints() <NEW_LINE> <DEDENT> def _get_or_create_type_hints(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self._type_hints <NEW_LINE> <DEDENT> except AttributeError...
A mixin class that provides the ability to set and retrieve type hints.
62598fb68e7ae83300ee91a5
class PluginManager(object): <NEW_LINE> <INDENT> def __init__(self, *extra_packages): <NEW_LINE> <INDENT> def packages(): <NEW_LINE> <INDENT> for package_name in extra_packages: <NEW_LINE> <INDENT> yield sys.modules[package_name] <NEW_LINE> <DEDENT> cfg.CONF.import_opt('plugin_dirs', 'conveyor.conveyorheat.common.confi...
A class for managing plugin modules.
62598fb61b99ca400228f5b3
class UploadOptionsTests(SynchronousTestCase): <NEW_LINE> <INDENT> def test_must_be_release_version(self): <NEW_LINE> <INDENT> options = UploadOptions() <NEW_LINE> self.assertRaises( NotARelease, options.parseOptions, ['--flocker-version', '0.3.0+444.gf05215b']) <NEW_LINE> <DEDENT> def test_documentation_release_fails(...
Tests for :class:`UploadOptions`.
62598fb65fc7496912d482fe
class Switch(Widget): <NEW_LINE> <INDENT> active = BooleanProperty(False) <NEW_LINE> touch_control = ObjectProperty(None, allownone=True) <NEW_LINE> touch_distance = NumericProperty(0) <NEW_LINE> active_norm_pos = NumericProperty(0) <NEW_LINE> def on_touch_down(self, touch): <NEW_LINE> <INDENT> if self.touch_control is...
Switch class. See module documentation for more information.
62598fb6e5267d203ee6ba05
class TokenBlacklist(BaseMixin, db.Model): <NEW_LINE> <INDENT> __tablename__ = "tokens_blacklist" <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> token = db.Column(db.String(255), nullable=False) <NEW_LINE> blacklisted_on = db.Column( db.DateTime, default=datetime.datetime.now, nullable=False ) <NEW_...
For storing Blacklisted tokens on user logout
62598fb6a17c0f6771d5c33c
class CustomJSONWebTokenClient(JSONWebTokenClient): <NEW_LINE> <INDENT> def authenticate(self, user): <NEW_LINE> <INDENT> self._credentials = { jwt_settings.JWT_AUTH_HEADER_NAME: "{0} {1}".format( jwt_settings.JWT_AUTH_HEADER_PREFIX, get_token(user, userId=user.id) ), }
Test client with a custom authentication method.
62598fb67d847024c075c4c1
class ReGenerator(AbstractGenerator): <NEW_LINE> <INDENT> def __init__(self, pattern): <NEW_LINE> <INDENT> if not pattern: <NEW_LINE> <INDENT> raise ValueError("Pattern cannot be empty") <NEW_LINE> <DEDENT> self._pattern = pattern <NEW_LINE> self._parser = parser() <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <IND...
Regex-like Pattern Generator This generator uses regex-like patterns to generate random string which can be used as a random password or username Args: pattern (str): pattern used to generate string
62598fb6009cb60464d01629
class FactoryPattern(object): <NEW_LINE> <INDENT> def __init__(self, constructor, ignore_warnings=False): <NEW_LINE> <INDENT> self._constructor = constructor <NEW_LINE> self._constructor_args = inspect.getargspec(constructor.__init__).args[1:] <NEW_LINE> self._product = ClassPattern(constructor) <NEW_LINE> <DEDENT> def...
WRITEME
62598fb667a9b606de5460d6
class TruncateDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, dataset: Dataset, max_num: int = 100): <NEW_LINE> <INDENT> self.dataset = dataset <NEW_LINE> self.max_num = min(max_num, len(self.dataset)) <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return self.max_num <NEW_LINE> <DEDENT> def __geti...
Truncate dataset to certain num
62598fb64a966d76dd5eefde
class ToTensor(object): <NEW_LINE> <INDENT> def __call__(self, sample): <NEW_LINE> <INDENT> image, segment = sample['image'], sample['segment'] <NEW_LINE> image = image.transpose((2, 0, 1)) <NEW_LINE> return {'image': torch.from_numpy(image), 'segment': torch.from_numpy(segment)}
Convert ndarrays in sample to Tensors.
62598fb666656f66f7d5a4f8
class datemap: <NEW_LINE> <INDENT> def __init__(self, mapping): <NEW_LINE> <INDENT> self._mapping = {date: mapping[date] for date in sorted(mapping)} <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self._mapping) <NEW_LINE> <DEDENT> def __contains__(self, value): <NEW_LINE> <INDENT> return value i...
Read-only sorted dictionary mapping dates to values Example ------- .. code-block:: >>> import doubledate as dtwo >>> import datetime >>> holidays = [ ... datetime.date(2022, 1, 17), ... datetime.date(2022, 5, 30), ... datetime.date(2022, 6, 4), ... datetime.date(2022, ...
62598fb667a9b606de5460d7
class MajorityVoteClassifier(BaseEstimator, ClassifierMixin): <NEW_LINE> <INDENT> def __init__(self, classifiers, vote='classlabel', weights=None): <NEW_LINE> <INDENT> self.classifiers = classifiers <NEW_LINE> self.named_classifiers = {key: value for key, value in _name_estimators(classifiers)} <NEW_LINE> self.vote = v...
A majority vote ensemble classifier Parameters ---------- classifiers : array-like, shape = [n_classifiers] Different classifiers for the ensemble vote : str, {'classlabel', 'probability'} (default='label') If 'classlabel' the prediction is based on the argmax of class labels. Else if 'probability', the argma...
62598fb6442bda511e95c560
class ApiClient(AbstractApi): <NEW_LINE> <INDENT> def __init__(self, base_url=None): <NEW_LINE> <INDENT> base_url = base_url or os.environ.get('API_URL', 'http://localhost:5000/api') <NEW_LINE> super(ApiClient, self).__init__(base_url=base_url, auth_header_name=auth_header_name, auth_header_val=os.environ.get(auth_head...
Glassdoor-NLP API client class
62598fb660cbc95b06364445
class Loan(WorkItem): <NEW_LINE> <INDENT> def __init__(self, loan_request): <NEW_LINE> <INDENT> WorkItem.__init__(self) <NEW_LINE> if not RuleManager.get_instance().check_rule('should_be_instance_of_loan_request', loan_request): <NEW_LINE> <INDENT> raise AssociationError('Loan Request instance expected, instead %s pass...
A Loan is generated from a Loan Request
62598fb65fdd1c0f98e5e096
class Question(models.Model): <NEW_LINE> <INDENT> cmap = models.ForeignKey(CareerMap) <NEW_LINE> text = models.TextField(default="", blank=True, null=True) <NEW_LINE> layer = models.ForeignKey(Layer, blank=True, null=True) <NEW_LINE> basemap = models.ForeignKey(BaseMap, blank=True, null=True) <NEW_LINE> class Meta: <NE...
These are just "did you know" questions
62598fb64428ac0f6e658629