code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class BaseJobRunner(object): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> _job_options = JOB_OPTIONS <NEW_LINE> def __init__(self, job, priority=NORMAL): <NEW_LINE> <INDENT> self._job = job <NEW_LINE> self._priority = priority <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def run_job(self): <NEW_LINE> <INDEN...
Abstract job runner class. Segregates job execution logic. Creates job arguments from the job instance and runs this job.
62598fb82c8b7c6e89bd390f
class GANModelTest(test.TestCase, parameterized.TestCase): <NEW_LINE> <INDENT> @parameterized.named_parameters( ('gan', get_gan_model, namedtuples.GANModel), ('callable_gan', get_callable_gan_model, namedtuples.GANModel), ('infogan', get_infogan_model, namedtuples.InfoGANModel), ('callable_infogan', get_callable_infoga...
Tests for `gan_model`.
62598fb8e5267d203ee6ba49
class reply_nyc_weather (threading.Thread): <NEW_LINE> <INDENT> email_dict = None <NEW_LINE> sender = None <NEW_LINE> subject = None <NEW_LINE> text = None <NEW_LINE> html = None <NEW_LINE> def __init__ (self, email_dict, sender, subject, text, html=None): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> ...
In reply to email sent to nyc-weather@ -> lookup the current weather conditions for New York City and return it to the sender of this email
62598fb8a8370b77170f0528
class Struct: <NEW_LINE> <INDENT> def __init__(self, name, decls, bindingsgenerator): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.decls = decls <NEW_LINE> self.bindingsgenerator = bindingsgenerator
Representation of an Lvgl struct type for which to generate bindings To be overridden by language-specific classes
62598fb8dc8b845886d53702
class ZmqClientDirect(zmq_client_base.ZmqClientBase): <NEW_LINE> <INDENT> def __init__(self, conf, matchmaker=None, allowed_remote_exmods=None): <NEW_LINE> <INDENT> if conf.use_pub_sub or conf.use_router_proxy: <NEW_LINE> <INDENT> raise WrongClientException() <NEW_LINE> <DEDENT> publisher = zmq_dealer_publis...
This kind of client (publishers combination) is to be used for direct connections only: use_pub_sub = false use_router_proxy = false
62598fb83d592f4c4edbb008
class Tile(LVMOpsBaseModel): <NEW_LINE> <INDENT> TileID = IntegerField(primary_key=True) <NEW_LINE> TargetIndex = IntegerField(null=True) <NEW_LINE> Target = CharField(null=False) <NEW_LINE> Telescope = CharField(null=False) <NEW_LINE> RA = FloatField(null=True, default=0) <NEW_LINE> DEC = FloatField(null=True, default...
Peewee ORM class for LVM Survey Tiles
62598fb8aad79263cf42e91e
@db_test_lib.DualDBTest <NEW_LINE> class ApiGetVfsFileContentUpdateStateHandlerTest( api_test_lib.ApiCallHandlerTest, VfsTestMixin): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(ApiGetVfsFileContentUpdateStateHandlerTest, self).setUp() <NEW_LINE> self.handler = vfs_plugin.ApiGetVfsFileContentUpdateSta...
Test for ApiGetVfsFileContentUpdateStateHandler.
62598fb85fdd1c0f98e5e0d9
class ResourceLimit(abc.ABC): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def check(self, usage: ResourceUsageTracker) -> None: <NEW_LINE> <INDENT> ...
Used to check if a particular resource limit is exceeded.
62598fb8f9cc0f698b1c5372
class Resize(object): <NEW_LINE> <INDENT> def __init__(self, output_size): <NEW_LINE> <INDENT> assert isinstance(output_size, (int, tuple)) <NEW_LINE> self.output_size = output_size <NEW_LINE> <DEDENT> def _resize(self, image): <NEW_LINE> <INDENT> h, w = image.size()[1:3] <NEW_LINE> if isinstance(self.output_size, int)...
Rescale the image in a sample to a given size. Args: output_size (tuple or int): Desired output size. If tuple, output is matched to output_size. If int, smaller of image edges is matched to output_size keeping aspect ratio the same.
62598fb899fddb7c1ca62e90
class ColorTranslator(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def FromHtml(htmlColor): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def FromOle(oleColor): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def FromWin32(win32Color): <NEW_LINE> <INDENT> pass <NEW...
Translates colors to and from GDI+ System.Drawing.Color structures. This class cannot be inherited.
62598fb821bff66bcd722db3
class UserLoginSerializer(serializers.Serializer): <NEW_LINE> <INDENT> email= serializers.EmailField() <NEW_LINE> password = serializers.CharField(min_length=8) <NEW_LINE> def validate(self, data): <NEW_LINE> <INDENT> user = authenticate(username=data['email'], password=data['password']) <NEW_LINE> if not user: <NEW_LI...
User Login serializer. Handle the login request data.
62598fb8adb09d7d5dc0a6c8
class GetJob(Resource): <NEW_LINE> <INDENT> def get(self,id): <NEW_LINE> <INDENT> response = db.get_one(id) <NEW_LINE> if response: <NEW_LINE> <INDENT> return make_response(jsonify({"status": 200, "data": [{'message': 'jobs available', 'jobs':response}]}), 200) <NEW_LINE> <DEDENT> return abort(make_response(jsonify({'...
Class with method to get one job
62598fb856ac1b37e6302337
class Level(): <NEW_LINE> <INDENT> def __init__(self, player): <NEW_LINE> <INDENT> self.platform_list = None <NEW_LINE> self.background = None <NEW_LINE> self.world_shift = 0 <NEW_LINE> self.world_shift_y = 0 <NEW_LINE> self.level_limit = -1000 <NEW_LINE> self.platform_list = pygame.sprite.Group() <NEW_LINE> self.playe...
Cette super class definie tout le level et comporte deux classes filles définissant chaque level
62598fb84527f215b58ea021
class TestListar_mis_solicitudes(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = User.objects.create_user('super', 'lennon@thebeatles.com', 'super') <NEW_LINE> self.proyecto = Proyecto.objects.create(numero_fases=2, usuario=self.user, observaciones='ninguna', presupuesto=111, nombre='pro...
Clase de test para la vista solicitudCambio.views.listar_mis_solicitudes
62598fb8aad79263cf42e91f
class Category(models.Model): <NEW_LINE> <INDENT> nid = models.AutoField(primary_key=True) <NEW_LINE> title = models.CharField(max_length=32) <NEW_LINE> blog = models.ForeignKey(to="Blog", to_field="nid") <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.title <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <IND...
个人博客文章分类
62598fb8167d2b6e312b70c0
class BasicType: <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return "[" + self.__class__.__name__ + "]" <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def has_member(cls, v): <NEW_LINE> <INDENT> return type(v) is cls
Basic Type declaration Z: [Name, Date] today : Date Python: Name = BasicType Date = BasicType today = BasicType()
62598fb830dc7b766599f999
class LeadTimeProjection(metaclass=ABCMeta): <NEW_LINE> <INDENT> def __init__(self, board_id, **kwargs): <NEW_LINE> <INDENT> self._board_id = board_id <NEW_LINE> super().__init__(**kwargs) <NEW_LINE> self._work_item_start_times = {} <NEW_LINE> self._lead_times = {} <NEW_LINE> self._load_events() <NEW_LINE> subscribe(se...
A projection which tracks the lead time for work items with respect to a specified Board.
62598fb8e5267d203ee6ba4b
class LSTMacceptor(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.model = dy.ParameterCollection() <NEW_LINE> self.trainer = dy.AdamTrainer(self.model) <NEW_LINE> self.embeddings = self.model.add_lookup_parameters((len(C2I), EMBEDDINGS_DIM)) <NEW_LINE> self.builder = dy.LSTMBuilder(LAYERS, EM...
initialize LSTM acceptor model of 1 layer with MLP of one hidden layer
62598fb863b5f9789fe852b9
class Invocation(object): <NEW_LINE> <INDENT> def __init__(self, command, cwd): <NEW_LINE> <INDENT> self.command = command <NEW_LINE> self.cwd = cwd <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return ' '.join(self.command) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_compile_command(cls, entry, e...
Holds arguments of an IWYU invocation.
62598fb891f36d47f2230f4f
class ChangeSegmentation(base.TemplateView): <NEW_LINE> <INDENT> template_name = 'feats/segmentation/change_segments.html' <NEW_LINE> @property <NEW_LINE> def feature(self): <NEW_LINE> <INDENT> return self.feats_app.features[self.args[0]] <NEW_LINE> <DEDENT> def get_formset(self, feature, state): <NEW_LINE> <INDENT> re...
Changes how a Feature is Segmented and how selectors map to those segments. Updating segmentation resets any selector mappings, so this form is done in two steps The first form submits through a GET to mapping url with the segments. This does not save any data to the database. The next form submits through a POST ...
62598fb8fff4ab517ebcd934
class CrudAux(Crud): <NEW_LINE> <INDENT> permission_required = ('base.view_tabelas_auxiliares',) <NEW_LINE> class ListView(Crud.ListView): <NEW_LINE> <INDENT> template_name = "crud/list_tabaux.html" <NEW_LINE> <DEDENT> class BaseMixin(Crud.BaseMixin): <NEW_LINE> <INDENT> subnav_template_name = None <NEW_LINE> def get_c...
Checa permissão para ver qualquer dado de tabela auxiliar a permissão base.view_tabelas_auxiliares está definada class Meta do model sapl.base.models.AppConfig que, naturalmente é um arquivo de configuração geral e só pode ser acessado através das Tabelas Auxiliares... Com isso o script de geração de perfis acaba que p...
62598fb8009cb60464d0166f
class ChiaJob(InspiralAnalysisJob): <NEW_LINE> <INDENT> def __init__(self,cp): <NEW_LINE> <INDENT> exec_name = 'chia' <NEW_LINE> sections = ['chia'] <NEW_LINE> extension = 'xml' <NEW_LINE> InspiralAnalysisJob.__init__(self,cp,sections,exec_name,extension)
A lalapps_coherent_inspiral job used by the inspiral pipeline. The static options are read from the section [chia] in the ini file. The stdout and stderr from the job are directed to the logs directory. The path to the executable is determined from the ini file.
62598fb8a05bb46b3848a9b7
class Status(object): <NEW_LINE> <INDENT> deserialized_types = { 'url': 'str', 'status': 'ask_sdk_model.services.list_management.list_item_state.ListItemState' } <NEW_LINE> attribute_map = { 'url': 'url', 'status': 'status' } <NEW_LINE> def __init__(self, url=None, status=None): <NEW_LINE> <INDENT> self.__discriminator...
:param url: :type url: (optional) str :param status: :type status: (optional) ask_sdk_model.services.list_management.list_item_state.ListItemState
62598fb8dc8b845886d53704
@implementer(ISequenceNumber) <NEW_LINE> class SequenceNumber(object): <NEW_LINE> <INDENT> def get_number(self, obj): <NEW_LINE> <INDENT> ann = unprotected_write(IAnnotations(obj)) <NEW_LINE> if SEQUENCE_NUMBER_ANNOTATION_KEY not in ann.keys(): <NEW_LINE> <INDENT> generator = getAdapter(obj, ISequenceNumberGenerator) <...
The sequence number utility provides a getNumber(obj) method which returns a unique number for each object.
62598fb871ff763f4b5e78c4
class VolumeGroup(FilesystemGroup, metaclass=VolumeGroupType): <NEW_LINE> <INDENT> uuid = ObjectField.Checked("uuid", check(str), check(str)) <NEW_LINE> size = ObjectField.Checked("size", check(int), check(int), readonly=True) <NEW_LINE> available_size = ObjectField.Checked("available_size", check(int), readonly=True) ...
A volume group on a machine.
62598fb823849d37ff8511ff
class EulerianBarycenter(Barycenter): <NEW_LINE> <INDENT> def __init__(self, loss, w=0.5): <NEW_LINE> <INDENT> super(EulerianBarycenter, self).__init__(loss, w) <NEW_LINE> self.a_i = (torch.ones(len(self.x_i)) / len(self.x_i)).type_as(self.x_i) <NEW_LINE> self.b_j = (torch.ones(len(self.y_j)) / len(self.y_j)).type_as(s...
Barycentric model with fixed locations z_k, as we optimize on the log-weights l_k.
62598fb826068e7796d4caa5
class UploadMode(object): <NEW_LINE> <INDENT> blocking = 0 <NEW_LINE> background = 1 <NEW_LINE> lazy = 2
How to add files on a :class:`Disk`.
62598fb866656f66f7d5a53e
class TransactionViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> serializer_class = TransactionSerializer <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> if self.request.user.has_perm("transaction.view"): <NEW_LINE> <INDENT> return Transaction.objects.all() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> retur...
Views for Transaction objects. :methods: GET, POST, PATCH
62598fb98a349b6b43686388
class ExtensionError(SyntaxError): <NEW_LINE> <INDENT> def __init__(self, error, data): <NEW_LINE> <INDENT> super(ExtensionError, self).__init__(str(error), data) <NEW_LINE> self.inner = error
Defines an error when creating an extension object.
62598fb9f548e778e596b6f2
class Square: <NEW_LINE> <INDENT> def __init__(self, size): <NEW_LINE> <INDENT> __size = 0 <NEW_LINE> self.__size = size
define class square
62598fb997e22403b383b053
class MyRound(torch.autograd.Function): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def forward(ctx, input): <NEW_LINE> <INDENT> return torch.round(input) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def backward(ctx, grad_output): <NEW_LINE> <INDENT> return grad_output
default round function available to use in pytorch forward|backward module functions
62598fb910dbd63aa1c70d06
class Meta: <NEW_LINE> <INDENT> model = Author <NEW_LINE> fields = ('name',)
AuthorSerializer Meta.
62598fb9ad47b63b2c5a79a1
class AMQPAgent(): <NEW_LINE> <INDENT> def __init__(self, name, host, msg=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.host = host <NEW_LINE> self.msg = msg <NEW_LINE> <DEDENT> def send(self,msgQueue,msg): <NEW_LINE> <INDENT> cParams = pika.ConnectionParameters(host=self.host) <NEW_LINE> connection = pik...
Can send and receive msgs, init with host string and msg format uses json dumps and loads to send/receive native python objects
62598fb9ec188e330fdf89de
class Kitchen(Base): <NEW_LINE> <INDENT> __tablename__ = 'kitchen' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> user_id = Column(Integer, ForeignKey('users.id')) <NEW_LINE> ingredient_id = Column(Integer, ForeignKey('ingredients.id'))
What ingredients a user has
62598fb9a8370b77170f052c
class Synonyms(): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def is_synonym_throw(cls, name): <NEW_LINE> <INDENT> syn = False <NEW_LINE> if name in (Global.THROW, Global.OPEN, Global.ON, Global.ACTIVATE, "1"): <NEW_LINE> <INDENT> syn = True <NEW_LINE> <DEDENT> return syn <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def...
help class for synonyms of global terms
62598fb9be383301e025394a
class CorrelationStats(DistanceMatrixStats): <NEW_LINE> <INDENT> @property <NEW_LINE> def DistanceMatrices(self): <NEW_LINE> <INDENT> return super(CorrelationStats, self).DistanceMatrices <NEW_LINE> <DEDENT> @DistanceMatrices.setter <NEW_LINE> def DistanceMatrices(self, dms): <NEW_LINE> <INDENT> DistanceMatrixStats.Dis...
Base class for distance matrix correlation statistical methods. It is subclassed by correlation methods such as partial Mantel and Mantel that compare two or more distance matrices. A valid instance of CorrelationStats must have at least one distance matrix, and all distance matrices must have matching dimensions and...
62598fb95fc7496912d48322
class OperatorPDDiag(OperatorPDDiagBase): <NEW_LINE> <INDENT> def __init__(self, diag, verify_pd=True, name="OperatorPDDiag"): <NEW_LINE> <INDENT> super(OperatorPDDiag, self).__init__( diag, verify_pd=verify_pd, name=name) <NEW_LINE> <DEDENT> def _batch_log_det(self): <NEW_LINE> <INDENT> return math_ops.reduce_sum( mat...
Class representing a (batch) of positive definite matrices `A`. This class provides access to functions of a batch of symmetric positive definite (PD) matrices `A` in `R^{k x k}`. In this case, `A` is diagonal and is defined by a provided tensor `diag`, `A_{ii} = diag[i]`. Determinants, solves, and storage are `O(k)...
62598fb93d592f4c4edbb00c
class ItemAddBlocks(Item): <NEW_LINE> <INDENT> def __init__(self, x, y, level): <NEW_LINE> <INDENT> Item.__init__(self, x, y) <NEW_LINE> self.image = Assets.itemAddBlocks <NEW_LINE> self.level = level <NEW_LINE> <DEDENT> def affect(self, level): <NEW_LINE> <INDENT> level.place_random_blocks() <NEW_LINE> <DEDENT> def on...
Add Blocks Item. Places additional blocks into enemy's game
62598fb955399d3f05626661
class UIInterfaceTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.module = UIModule() <NEW_LINE> self.interface = UIInterface(self.module) <NEW_LINE> <DEDENT> def _check_dbus_property(self, *args, **kwargs): <NEW_LINE> <INDENT> check_dbus_property( USER_INTERFACE, self.interfac...
Test DBus interface of the user interface module.
62598fb967a9b606de54611f
class BayesModel(Model): <NEW_LINE> <INDENT> def __init__(self, corpus): <NEW_LINE> <INDENT> self.__bigram_vectorizer = TfidfVectorizer(ngram_range=(2, 2), analyzer='word', stop_words='english') <NEW_LINE> self.__bigrams = self.__bigram_vectorizer.fit_transform(corpus) <NEW_LINE> print (self.__bigrams.shape) <NEW_LINE>...
Bayes Model
62598fb9851cf427c66b8404
class Kernel(BuildTask): <NEW_LINE> <INDENT> @property <NEW_LINE> def project(self): <NEW_LINE> <INDENT> return 'kernel' <NEW_LINE> <DEDENT> @property <NEW_LINE> def url(self): <NEW_LINE> <INDENT> return 'https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.11.1.tar.xz' <NEW_LINE> <DEDENT> def compile(self, j): <NEW_LI...
Download and compile kernel
62598fb9a219f33f346c6954
class PostListView(LoginRequiredMixin, ListView): <NEW_LINE> <INDENT> model = models.Post <NEW_LINE> template_name = 'blog/index.html' <NEW_LINE> paginate_by = 10 <NEW_LINE> context_object_name = 'posts' <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> queryset = super().get_queryset().filter(Q(is_public=True) | ...
public blog list
62598fb960cbc95b0636448d
class OrderZip(OrderApiV1Mixin, OrderCsv): <NEW_LINE> <INDENT> def get(self, iuid): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> order = self.get_order(iuid) <NEW_LINE> <DEDENT> except ValueError as msg: <NEW_LINE> <INDENT> raise tornado.web.HTTPError(404, reason=str(msg)) <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> s...
Return a ZIP file containing CSV, XLSX, JSON and files for the order.
62598fb921bff66bcd722db7
class DetRootN_Exp(Expression): <NEW_LINE> <INDENT> def __init__(self, exp): <NEW_LINE> <INDENT> if exp.size[0] != exp.size[1]: <NEW_LINE> <INDENT> raise TypeError('Matrix must be square') <NEW_LINE> <DEDENT> Expression.__init__(self, "n-th Root of a Determinant", glyphs.power(glyphs.det(exp.string), glyphs.div(1, exp....
A class storing the :math:`n`-th root of the determinant of a positive semidefinite matrix. Use the function :func:`picos.detrootn <picos.tools.detrootn>` to create an instance of this class. Note that the matrix :math:`X` is forced to be positive semidefinite when a constraint of the form ``t < pic.detrootn(X)`` is ...
62598fb9236d856c2adc94e7
class CategoryAdmin(object): <NEW_LINE> <INDENT> list_display = ['name', 'rank', 'create_time', 'update_time'] <NEW_LINE> search_fields = ['name', 'rank'] <NEW_LINE> list_filter = ['name', 'rank', 'create_time', 'update_time']
后台-文章类型
62598fb999cbb53fe6831027
class Driver_2: <NEW_LINE> <INDENT> def __init__(self, port1, port2): <NEW_LINE> <INDENT> self.L = SpeedCon(port1, True) <NEW_LINE> self.R = SpeedCon(port2, True) <NEW_LINE> self.vicList = [self.L, self.R] <NEW_LINE> print("Two-wheeled driver on ports " + str(port1) + " and " + str(port2)) <NEW_LINE> <DEDENT> def stop(...
Driver class for two motor robots
62598fb9283ffb24f3cf39d2
class GetViewMapGradientNormF0D: <NEW_LINE> <INDENT> def __init__(self, level: int): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __call__(self, it: 'freestyle.types.Interface0DIterator') -> float: <NEW_LINE> <INDENT> pass
Class hierarchy: freestyle.types.UnaryFunction0D > freestyle.types.UnaryFunction0DFloat > GetViewMapGradientNormF0D
62598fb9ad47b63b2c5a79a3
class TemplateAdapter(object): <NEW_LINE> <INDENT> def __init__(self, target, logger): <NEW_LINE> <INDENT> self.target = target <NEW_LINE> self.logger = logger <NEW_LINE> <DEDENT> def get_auth_token(self, user, proxies): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> url = self.target.get_host() + BasicConstants.VERIFY_T...
The Template Adapter class.
62598fb97c178a314d78d5ed
class SDPD(Interaction): <NEW_LINE> <INDENT> def __init__(): <NEW_LINE> <INDENT> pass
Compute SDPD interaction with angular momentum conservation. Must be used together with :any:`Density` interaction with the same density kernel. The available density kernels are listed in :any:`Density`. The available equations of state (EOS) are: Linear equation of state: .. math:: p(\rho) = c^2 \rho ...
62598fb9460517430c432105
class post_get_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.STRUCT, 'success', (Post, Post.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBina...
Attributes: - success
62598fb93617ad0b5ee06296
class FailView(utils.CSRFExempt, generic.TemplateView): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> payment_no = utils.get_request_data(request)['LMI_PAYMENT_NO'] <NEW_LINE> try: <NEW_LINE> <INDENT> invoice = Invoice.objects.get(number=payment_no) <NEW_LINE> logger.info( u'Invoice {0} fail page visi...
Страница неуспешного возврата. Предназначена исклчительно для уведомления пользователя об неудачном завершении операции.
62598fb92c8b7c6e89bd3914
class XTreeTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_find_tiebreaker(self): <NEW_LINE> <INDENT> final_actions = [((0, 0), (1, 1)), ((1, 1), (2, 2))] <NEW_LINE> self.assertEqual(((0, 0), (1, 1)), xtree.find_tiebreaker(final_actions)) <NEW_LINE> final_actions = [((0, 2), (1, 1)), ((0, 1), (2, 2))] <NEW_LINE>...
Test our test harness for Milestone 4
62598fb9ec188e330fdf89e0
class SourceData(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'source_data' <NEW_LINE> __mapper_args__ = { 'extension': BaseExtension(), } <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> method = db.Column(db.Text, index=True) <NEW_LINE> route = db.Column(db.Text, index=True) <NEW_LINE> payload = d...
Raw data, stored as JSONb. If data already exists, raises SQLAlchemy IntegrityError
62598fb97d43ff24874274ab
@dataclass <NEW_LINE> class Media: <NEW_LINE> <INDENT> title: str <NEW_LINE> url: str <NEW_LINE> format: Format <NEW_LINE> @property <NEW_LINE> def type(self) -> str: <NEW_LINE> <INDENT> if self.format in {Format.PDF, Format.PS}: <NEW_LINE> <INDENT> return f"application/{self.format}" <NEW_LINE> <DEDENT> return "text/h...
Represents a media item.
62598fb9dc8b845886d53708
class TopicTypesListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[TopicTypeInfo]'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(TopicTypesListResult, self).__init__(**kwargs) <NEW_LINE> self.value = kwargs.get('value', None)
Result of the List Topic Types operation. :ivar value: A collection of topic types. :vartype value: list[~azure.mgmt.eventgrid.models.TopicTypeInfo]
62598fb9379a373c97d99166
class DocumentNotFound(ESException): <NEW_LINE> <INDENT> pass
Document not found exception. .. note:: When we are indexing files and a document is not found we can decide if we create it or fail.
62598fb944b2445a339b6a1c
class UserInfoView(LoginRequirdeMixin,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> con = get_redis_connection('default') <NEW_LINE> history_key = 'history_%d'%user.id <NEW_LINE> sku_ids = con.lrange(hi...
用户中心-信息页
62598fb95fdd1c0f98e5e0df
class Break(object): <NEW_LINE> <INDENT> def __init__(self, break_type, name, time, image, plugins): <NEW_LINE> <INDENT> self.type = break_type <NEW_LINE> self.name = name <NEW_LINE> self.time = time <NEW_LINE> self.image = image <NEW_LINE> self.plugins = plugins <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDEN...
An entity class which represents a break.
62598fb9a219f33f346c6956
class ProductVariantCreateForm(ModelForm): <NEW_LINE> <INDENT> def __init__(self, options=None, product=None, *args, **kwargs): <NEW_LINE> <INDENT> super(ProductVariantCreateForm, self).__init__(*args, **kwargs) <NEW_LINE> self.fields['slug'].required = False <NEW_LINE> self.options = options <NEW_LINE> self.product = ...
Form used to create product variant for specific set of options
62598fb9ff9c53063f51a79e
@dataclass <NEW_LINE> class PrivacyIdCountParams: <NEW_LINE> <INDENT> noise_kind: NoiseKind <NEW_LINE> max_partitions_contributed: int <NEW_LINE> partition_extractor: Callable <NEW_LINE> budget_weight: float = 1 <NEW_LINE> public_partitions: Union[Iterable, 'PCollection', 'RDD'] = None
Specifies parameters for differentially-private privacy id count calculation. Args: noise_kind: The type of noise to use for the DP calculations. max_partitions_contributed: A bound on the number of partitions to which one unit of privacy (e.g., a user) can contribute. budget_weight: Relative weigh...
62598fb9851cf427c66b8406
class ComputePlanSpec(_BaseComputePlanSpec): <NEW_LINE> <INDENT> tag: Optional[str] <NEW_LINE> clean_models: Optional[bool] <NEW_LINE> metadata: Optional[Dict[str, str]] <NEW_LINE> type_: typing.ClassVar[Type] = Type.ComputePlan
Specification for creating a compute plan
62598fb95fdd1c0f98e5e0e0
class AssignmentStatement(BaseCQLStatement): <NEW_LINE> <INDENT> def __init__(self, table, assignments=None, consistency=None, where=None, ttl=None): <NEW_LINE> <INDENT> super(AssignmentStatement, self).__init__( table, consistency=consistency, where=where, ) <NEW_LINE> self.ttl = ttl <NEW_LINE> self.assignments = [] <...
value assignment statements
62598fb9f548e778e596b6f6
class PanelSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Panel <NEW_LINE> fields = ('id', 'brand', 'serial', 'latitude', 'longitude')
Panel Serializer.
62598fb93317a56b869be5f6
class ContainerBrokerMigrationMixin(object): <NEW_LINE> <INDENT> class OverrideCreateShardRangesTable(object): <NEW_LINE> <INDENT> def __init__(self, func): <NEW_LINE> <INDENT> self.func = func <NEW_LINE> <DEDENT> def __get__(self, obj, obj_type): <NEW_LINE> <INDENT> if inspect.stack()[1][3] == '_initialize': <NEW_LINE...
Mixin for running ContainerBroker against databases created with older schemas.
62598fb956ac1b37e630233d
class ChangeBrowserContext: <NEW_LINE> <INDENT> def __init__(self, browser): <NEW_LINE> <INDENT> self.browser = world.browser <NEW_LINE> self.new_browser = browser <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> world.browser = self.new_browser <NEW_LINE> <DEDENT> def __exit__(self, type, value, traceback)...
Switch between multiple browser context, will be used in with statement
62598fb91b99ca400228f5d9
class PhysicalASMixin(object): <NEW_LINE> <INDENT> PHYSICAL_AS_REQUIRED = True <NEW_LINE> @classmethod <NEW_LINE> def args(cls, metadata): <NEW_LINE> <INDENT> super(PhysicalASMixin, cls).args(metadata) <NEW_LINE> metadata.add_requirement("physical_address_space") <NEW_LINE> <DEDENT> def __init__(self, *args, **kwargs):...
A mixin for those plugins which require a valid physical address space. This class ensures a valid physical AS exists or an exception is raised.
62598fb9aad79263cf42e925
class GlobalKeyValueStore(MutableMapping): <NEW_LINE> <INDENT> def __init__(self, qe): <NEW_LINE> <INDENT> self.qe = qe <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> for (k, v) in self.qe.global_items(): <NEW_LINE> <INDENT> yield k <NEW_LINE> <DEDENT> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return...
A dict-like object that keeps its contents in a table. Mostly this is for holding the current branch and revision.
62598fb9498bea3a75a57c74
class GeometrySequence(object): <NEW_LINE> <INDENT> shape_factory = None <NEW_LINE> _geom = None <NEW_LINE> __p__ = None <NEW_LINE> _ndim = None <NEW_LINE> def __init__(self, parent, type): <NEW_LINE> <INDENT> self.shape_factory = type <NEW_LINE> self.__p__ = parent <NEW_LINE> <DEDENT> def _update(self): <NEW_LINE> <IN...
Iterative access to members of a homogeneous multipart geometry.
62598fb98e7ae83300ee91f1
class GeoDegree(int): <NEW_LINE> <INDENT> __slots__ = [] <NEW_LINE> def __new__(cls, value=None): <NEW_LINE> <INDENT> if value is None: <NEW_LINE> <INDENT> return int.__new__(cls, 0) <NEW_LINE> <DEDENT> if isinstance(value, int): <NEW_LINE> <INDENT> if (value <= 90 and value >= -90) or (value <= 180 and value >= -180):...
Data class representing a geographic coordinate degree componenent.
62598fb966673b3332c30521
class AristonAquaSwitch(SwitchEntity): <NEW_LINE> <INDENT> def __init__(self, name, device, switch_type): <NEW_LINE> <INDENT> self._api = device.api.ariston_api <NEW_LINE> self._icon = SWITCHES[switch_type][1] <NEW_LINE> self._name = "{} {}".format(name, SWITCHES[switch_type][0]) <NEW_LINE> self._switch_type = switch_t...
Switch for Ariston Aqua.
62598fb99f28863672818916
class SocialLoginNoPermissionTests(SocialLoginWrongPermissionsMixin, SocialLoginTestCase): <NEW_LINE> <INDENT> fixtures = ['users_testdata']
User testing the views is not logged and therefore lacking the required permissions.
62598fb91f5feb6acb162d71
class GoodCategoryNestViewSet(viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> queryset = GoodsCategory.objects.all() <NEW_LINE> serializer_class = GoodCategoryNestModelSerializer
list: 商品分类列表数据
62598fb9a05bb46b3848a9bd
class Token: <NEW_LINE> <INDENT> def __init__(self, term, token_value): <NEW_LINE> <INDENT> assert(isinstance(term, unicode)) <NEW_LINE> assert(isinstance(token_value, unicode)) <NEW_LINE> self._term = term <NEW_LINE> self._token_value = token_value <NEW_LINE> <DEDENT> def get_original_value(self): <NEW_LINE> <INDENT> ...
Token that stores original and resulted token values i.e.: term=',', token_value='<[COMMA]>'
62598fb9be383301e025394e
class TestBuildStaticLinks(BuildStaticTestCase, TestDefaults): <NEW_LINE> <INDENT> def run_collectstatic(self): <NEW_LINE> <INDENT> super(TestBuildStaticLinks, self).run_collectstatic(link=True) <NEW_LINE> <DEDENT> def test_links_created(self): <NEW_LINE> <INDENT> self.assertTrue(os.path.islink(os.path.join(settings.ST...
Test ``--link`` option for ``collectstatic`` management command. Note that by inheriting ``TestDefaults`` we repeat all the standard file resolving tests here, to make sure using ``--link`` does not change the file-selection semantics.
62598fb94f88993c371f05b6
class AmbilKurs(object): <NEW_LINE> <INDENT> def raw_kurs_bca(self): <NEW_LINE> <INDENT> html = urllib.urlopen('http://www.klikbca.com').read() <NEW_LINE> kurs_data1 = re.findall(re.compile(r"bgcolor=\"#dcdcdc\">\s?(\d+\.\d+)</td>"), html) <NEW_LINE> kurs_data2 = re.findall(re.compile(r"bgcolor=\"#f0f0f0\">\s?(\d+\.\d+...
Modul sederhana untuk menampilkan notifikasi kurs valas pada desktop Ubuntu. Penggunaan: $ python notifikasi_kurs.py
62598fb9f548e778e596b6f7
class ToolParser(argparse.ArgumentParser): <NEW_LINE> <INDENT> class StripTrailingSlash(argparse.Action): <NEW_LINE> <INDENT> def __call__(self, parser, namespace, values, option_string=None): <NEW_LINE> <INDENT> if values.endswith('/'): <NEW_LINE> <INDENT> values = values[:-1] <NEW_LINE> <DEDENT> setattr(namespace, se...
Parser with common options.
62598fb90fa83653e46f5034
class Host(): <NEW_LINE> <INDENT> def __init__(self, ip=None, mac=None, man=None, hostname=None, ports=[]): <NEW_LINE> <INDENT> self.ip = ip <NEW_LINE> self.mac = mac <NEW_LINE> self.man = man <NEW_LINE> self.hostname = hostname <NEW_LINE> self.ports = ports <NEW_LINE> <DEDENT> def __str__(...
basic class for storing nmap results
62598fb955399d3f05626665
class LiquidationApi(object): <NEW_LINE> <INDENT> def __init__(self, api_client=None): <NEW_LINE> <INDENT> if api_client is None: <NEW_LINE> <INDENT> api_client = ApiClient() <NEW_LINE> <DEDENT> self.api_client = api_client <NEW_LINE> <DEDENT> def liquidation_get(self, **kwargs): <NEW_LINE> <INDENT> kwargs['_return_htt...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. Ref: https://github.com/swagger-api/swagger-codegen
62598fb95166f23b2e24352f
class Expect(object): <NEW_LINE> <INDENT> def __init__(self, remote_command, args, incomparable_args=[]): <NEW_LINE> <INDENT> self.remote_command = remote_command <NEW_LINE> self.incomparable_args = incomparable_args <NEW_LINE> self.args = args <NEW_LINE> self.result = None <NEW_LINE> self.behaviors = [] <NEW_LINE> <DE...
Define an expected L{RemoteCommand}, with the same arguments Extra behaviors of the remote command can be added to the instance, using class methods. Use L{Expect.log} to add a logfile, L{Expect.update} to add an arbitrary update, or add an integer to specify the return code (rc), or add a Failure instance to raise a...
62598fb93317a56b869be5f7
class QTraffic: <NEW_LINE> <INDENT> def __init__(self, iface): <NEW_LINE> <INDENT> self.iface = iface <NEW_LINE> self.plugin_dir = os.path.dirname(__file__) <NEW_LINE> self.pluginTag = 'QTraffic' <NEW_LINE> locale = QSettings().value('locale/userLocale')[0:2] <NEW_LINE> locale_path = os.path.join( self.plugin_dir, 'i18...
QGIS Plugin Implementation.
62598fb99c8ee8231304021d
class TestInstallation(unittest.TestCase): <NEW_LINE> <INDENT> layer = INTEGRATION_TESTING <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.portal = self.layer['portal'] <NEW_LINE> <DEDENT> def testBrowserLayerRegistered(self): <NEW_LINE> <INDENT> layers = [o.__name__ for o in registered_layers()] <NEW_LINE> assert...
Ensure product is properly installed
62598fb9bf627c535bcb15f6
class GenericContent(object): <NEW_LINE> <INDENT> PROPERTIES = [ ('dummy', 'shortstr'), ] <NEW_LINE> def __init__(self, **props): <NEW_LINE> <INDENT> d = {} <NEW_LINE> for propname, _ in self.PROPERTIES: <NEW_LINE> <INDENT> if propname in props: <NEW_LINE> <INDENT> d[propname] = props[propname] <NEW_LINE> <DEDENT> <DED...
Abstract base class for AMQP content. Subclasses should override the PROPERTIES attribute.
62598fb956b00c62f0fb2a0d
class IconTree(Tree): <NEW_LINE> <INDENT> FIELDS = (gobject.TYPE_STRING, gobject.TYPE_PYOBJECT, gobject.TYPE_STRING, gtk.gdk.Pixbuf) <NEW_LINE> COLUMNS = [[gtk.CellRendererPixbuf, 'pixbuf', 3], [gtk.CellRendererText, 'markup', 2]] <NEW_LINE> def add_item(self, item, key=None, parent=None): <NEW_LINE> <INDENT> pixbuf = ...
Tree with icons.
62598fb9ad47b63b2c5a79a7
class BaseItem(object): <NEW_LINE> <INDENT> def __init__(self, data, parent=None): <NEW_LINE> <INDENT> self.parentItem = parent <NEW_LINE> self.itemData = None <NEW_LINE> self.childItems = [] <NEW_LINE> self.updateData(data) <NEW_LINE> <DEDENT> def updateData(self, data): <NEW_LINE> <INDENT> if self.itemData != data: <...
Base Item class for all tree item classes.
62598fb98e7ae83300ee91f3
class getActiveMemberMidsByBuddyMid_result(object): <NEW_LINE> <INDENT> def __init__(self, success=None, e=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> self.e = e <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CRea...
Attributes: - success - e
62598fb966673b3332c30523
class Video3x3ExampleMainWidget(Video2x2ExampleMainWidget): <NEW_LINE> <INDENT> plugin_uid = 'video_3x3' <NEW_LINE> cols = 3 <NEW_LINE> rows = 3
Video2x2 plugin widget for Example layout (placeholder `main`).
62598fb91f5feb6acb162d73
class ImagePlot(DocumentLayout): <NEW_LINE> <INDENT> def __init__(self, width=640, height=360): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.width = width <NEW_LINE> self.height = height <NEW_LINE> self.image_source = ColumnDataSource({'image': []}) <NEW_LINE> self._init_image_plot() <NEW_LINE> <DEDENT> def _...
Plot of received images.
62598fb9a05bb46b3848a9bf
class RecipeList(generics.ListCreateAPIView): <NEW_LINE> <INDENT> queryset = Recipe.objects.all() <NEW_LINE> serializer_class = RecipeSerializer <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> queryset = Recipe.objects.all() <NEW_LINE> user_id = self.request.query_params.get('user_id') <NEW_LINE> if user_id: <NE...
Recipe List & Create View.
62598fb971ff763f4b5e78cc
class Biblioteca: <NEW_LINE> <INDENT> def __init__(self, name, root=vkconfig.BIBLIOTECHE_ROOT): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.root = root <NEW_LINE> self.textdao = XMLBiblioteche(root).getCorpusCollection(name) <NEW_LINE> self.sqldao = CorpusCollectionSQLite(root).getCorpusDAO(name) <NEW_LINE> se...
One biblioteca contains many corpora It's a collection of documents
62598fb9cc40096d6161a283
class Service(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.config = config.Config('email_service') <NEW_LINE> <DEDENT> def __callback(self, ch, method, properties, body): <NEW_LINE> <INDENT> print(' [x] Received {0}'.format(body)) <NEW_LINE> print(' [x] Sending email.') <NEW_LINE> try: <NEW_LINE>...
TODO Make this useful. This is the Service class.
62598fb9091ae35668704d75
class DBSubnetGroup(object): <NEW_LINE> <INDENT> def __init__(self, connection=None, name=None, description=None, subnet_ids=None): <NEW_LINE> <INDENT> self.connection = connection <NEW_LINE> self.name = name <NEW_LINE> self.description = description <NEW_LINE> if subnet_ids is not None: <NEW_LINE> <INDENT> self.subnet...
Represents an RDS database subnet group Properties reference available from the AWS documentation at http://docs.amazonwebservices.com/AmazonRDS/latest/APIReference/API_DeleteDBSubnetGroup.html :ivar status: The current status of the subnet group. Possibile values are [ active, ? ]. Reference documentation lacks spec...
62598fb93d592f4c4edbb012
class SocialMediaObject(db.EmbeddedDocument): <NEW_LINE> <INDENT> facebook_id = db.StringField(max_length=100) <NEW_LINE> twitter_id = db.StringField(max_length=100) <NEW_LINE> def as_dict(self): <NEW_LINE> <INDENT> return swap_null_id(self._data)
ABOUT This helps us track if the post was coppied to a social platform such as Twitter or Facebook by storing the appropriate ID. The actual posting occurs in external modules
62598fb992d797404e388c0d
class AdminIndexView(admin.AdminIndexView): <NEW_LINE> <INDENT> @expose('/') <NEW_LINE> def index(self): <NEW_LINE> <INDENT> if not login.current_user.is_authenticated(): <NEW_LINE> <INDENT> return redirect(url_for('.login_view')) <NEW_LINE> <DEDENT> return super(AdminIndexView, self).index() <NEW_LINE> <DEDENT> @expos...
Customized index view class that handles login/logout"
62598fb957b8e32f525081c7
class ExactInference(InferenceModule): <NEW_LINE> <INDENT> def initializeUniformly(self, gameState): <NEW_LINE> <INDENT> self.beliefs = DiscreteDistribution() <NEW_LINE> for p in self.legalPositions: <NEW_LINE> <INDENT> self.beliefs[p] = 1.0 <NEW_LINE> <DEDENT> self.beliefs.normalize() <NEW_LINE> <DEDENT> def observeUp...
The exact dynamic inference module should use forward algorithm updates to compute the exact belief function at each time step.
62598fb95fcc89381b2661f6
class IterDB: <NEW_LINE> <INDENT> def __init__(self, db, report_type, stream_mode): <NEW_LINE> <INDENT> self.db = db <NEW_LINE> self.stream_mode = stream_mode <NEW_LINE> self.report_type = report_type <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def __next_...
IterDB class This class allows to browse a database as an iterable
62598fb9be7bc26dc9251f06
class Meta: <NEW_LINE> <INDENT> verbose_name = _("Concept Plan") <NEW_LINE> verbose_name_plural = _("Concept Plans") <NEW_LINE> display_order = 10
Class options.
62598fb9851cf427c66b840a
class TerminalAdapter(InputAdapter): <NEW_LINE> <INDENT> def process_input(self, *args): <NEW_LINE> <INDENT> user_input = input() <NEW_LINE> return Statement(text=user_input)
A simple adapter that allows ChatterBot to communicate through the terminal.
62598fb95fdd1c0f98e5e0e4
class Command: <NEW_LINE> <INDENT> (DATA, DISPLAY, ADDRESS) = (0x40, 0x80, 0xC0)
Enumeration of command registers addresses (bits 6 ~ 7).
62598fb95166f23b2e243531
@dataclass <NEW_LINE> class Const(Value): <NEW_LINE> <INDENT> value: object <NEW_LINE> _type: typ.Type <NEW_LINE> @AstNode.cache_type <NEW_LINE> def infer_type(self, checker: check.Checker) -> typ.Type: <NEW_LINE> <INDENT> return self.type <NEW_LINE> <DEDENT> def to_lir(self, ctx: gen_ctx.NasmGenCtx) -> lir.Value: <NEW...
A literal. 1, true, -4.21983, point { x=1, y=2 }
62598fb9d7e4931a7ef3c1ea
class ImageIDField(forms.IntegerField): <NEW_LINE> <INDENT> widget = ImagePluginChoiceWidget(clearable=True) <NEW_LINE> def clean(self, value): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> value = super(ImageIDField, self).clean(value) <NEW_LINE> <DEDENT> except ValidationError: <NEW_LINE> <INDENT> raise ValidationErro...
A custom field that stores the ID value of a Filer image and presents Shuup admin's image popup widget
62598fb9cc0a2c111447b161