code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Decoder(nn.Module): <NEW_LINE> <INDENT> def __init__(self, num_channels, encoder_dim, decoder_dim1, decoder_dim2, decoder_dim3, num_classes, num_lstm_cell): <NEW_LINE> <INDENT> super(Decoder, self).__init__() <NEW_LINE> self.num_classes = num_classes <NEW_LINE> self.num_lstm_cell = num_lstm_cell <NEW_LINE> self.a...
This will recieve the input from the Attention Layer & encoder, that will be passed on to the LSTM cell to do it's work.
62598fa660cbc95b06364243
class Callable(Validator): <NEW_LINE> <INDENT> def __init__(self, callable_): <NEW_LINE> <INDENT> if not callable(callable_): <NEW_LINE> <INDENT> raise TypeError('"callable" argument is not callable') <NEW_LINE> <DEDENT> self.callable = callable_ <NEW_LINE> <DEDENT> def validate(self, value): <NEW_LINE> <INDENT> try: <...
A validator that accepts a callable. Attributes: - callable: The callable
62598fa6e76e3b2f99fd892d
class MockDoc(object): <NEW_LINE> <INDENT> def __init__(self, Name): <NEW_LINE> <INDENT> self.Name = Name <NEW_LINE> <DEDENT> def PrintOut(self, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Save(self, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def SaveAs(self, **kwargs): <NEW_LINE> <INDENT> ...
A Document object.
62598fa65f7d997b871f935c
class LevenshteinSimilarity(object): <NEW_LINE> <INDENT> def __init__(self, content_x1, content_y2): <NEW_LINE> <INDENT> self.s1 = content_x1 <NEW_LINE> self.s2 = content_y2 <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def extract_keyword(content): <NEW_LINE> <INDENT> re_exp = re.compile(r'(<style>.*?</style>)|(<[^>]+>...
编辑距离
62598fa699cbb53fe6830dcc
class AggBatchSGD(Optimizer): <NEW_LINE> <INDENT> def __init__(self, lr=0.01, batches_per_update=1, **kwargs): <NEW_LINE> <INDENT> super(AggBatchSGD, self).__init__(**kwargs) <NEW_LINE> with K.name_scope(self.__class__.__name__): <NEW_LINE> <INDENT> self.iterations = K.variable(0, dtype='int64', name='iterations') <NEW...
vanilla SGD which aggregates gradients from multiple mini batches and then perfom an update # TODO: Can we get a implementation of this with momentum and nesterov? # Larger batch_size is really desirable. # See idea from : https://arxiv.org/abs/1711.00489
62598fa67047854f4633f2d0
class LatticeString(str): <NEW_LINE> <INDENT> def __new__(cls, value, multi=None, in_dict=True): <NEW_LINE> <INDENT> return str.__new__(cls, value) <NEW_LINE> <DEDENT> def __init__(self, value, multi=None, in_dict=True): <NEW_LINE> <INDENT> self.unique = True <NEW_LINE> if multi: <NEW_LINE> <INDENT> self.multi = list(m...
String subclass เพื่อเก็บวิธีตัดหลายๆ วิธี
62598fa6fff4ab517ebcd6dc
class YAMLConfigFileParser(ConfigFileParser): <NEW_LINE> <INDENT> def get_syntax_description(self): <NEW_LINE> <INDENT> msg = ("The config file uses YAML syntax and must represent a YAML " "'mapping' (for details, see http://learn.getgrav.org/advanced/yaml).") <NEW_LINE> return msg <NEW_LINE> <DEDENT> @staticmethod <NE...
Parses YAML config files. Depends on the PyYAML module. https://pypi.python.org/pypi/PyYAML
62598fa691af0d3eaad39d06
class GNMTEncoderModel(attention_model.AttentionModel): <NEW_LINE> <INDENT> def _build_encoder(self, hparams): <NEW_LINE> <INDENT> if hparams.encoder_type != "gnmt": <NEW_LINE> <INDENT> return super(GNMTEncoderModel, self)._build_encoder(hparams) <NEW_LINE> <DEDENT> num_layers = hparams.num_layers <NEW_LINE> num_residu...
Sequence-to-sequence dynamic model with GNMT encoder architecture.
62598fa691f36d47f2230e1f
class LocationNotInFeature(ValueError): <NEW_LINE> <INDENT> pass
The location isn't contained in the given feature
62598fa64428ac0f6e658419
class Message(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'messages' <NEW_LINE> id = db.Column( db.Integer, primary_key=True, ) <NEW_LINE> text = db.Column( db.String(140), nullable=False, ) <NEW_LINE> timestamp = db.Column( db.DateTime, nullable=False, server_default=db.func.now(), ) <NEW_LINE> user_id = db.Column(...
An individual message ("warble").
62598fa610dbd63aa1c70aa9
class Verse(models.Model): <NEW_LINE> <INDENT> book = models.CharField(max_length=10) <NEW_LINE> chapter = models.IntegerField() <NEW_LINE> verse = models.IntegerField() <NEW_LINE> txt_hebrew = models.TextField(blank=True, null=True) <NEW_LINE> txt_greek = models.TextField(blank=True, null=True) <NEW_LINE> txt_latin = ...
Verse model.
62598fa63539df3088ecc1ac
class TestWrapperMetadata(unittest2.TestCase): <NEW_LINE> <INDENT> def test_cf(self): <NEW_LINE> <INDENT> metadata = atmos_flux_inversion.wrapper.global_attributes_dict() <NEW_LINE> self.assertIn("Conventions", metadata) <NEW_LINE> self.assertIn("CF", metadata.get("Conventions", "")) <NEW_LINE> self.assertIn("history",...
Test the metadata provided for the wrapper.
62598fa6d486a94d0ba2bec6
class MulticlassLogistic(): <NEW_LINE> <INDENT> def __init__(self, l2_coef, class_number=None): <NEW_LINE> <INDENT> self.class_number = class_number <NEW_LINE> self.lambda_2 = l2_coef <NEW_LINE> <DEDENT> def func(self, X, y, w): <NEW_LINE> <INDENT> M = X.dot(w.T) <NEW_LINE> return (((-1 / X.shape[0]) * (M[np.arange(X.s...
Оракул для задачи многоклассовой логистической регрессии. Оракул должен поддерживать l2 регуляризацию. w в этом случае двумерный numpy array размера (class_number, d), где class_number - количество классов в задаче, d - размерность задачи
62598fa67d43ff248742737e
class GetEnabledSubclassesMixin: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_enabled(cls, *args): <NEW_LINE> <INDENT> enabled = list() <NEW_LINE> for subclass in cls.__subclasses__(): <NEW_LINE> <INDENT> if subclass.is_enabled(): <NEW_LINE> <INDENT> enabled.append(subclass(*args)) <NEW_LINE> <DEDENT> <DEDENT> r...
This mixin provides a method that returns all subclasses that are enabled. It should be used with abstract plugins
62598fa6b7558d5895463527
class MA2_Problem(ABC_problems.ABC_Problem): <NEW_LINE> <INDENT> def __init__(self, N=100, n=50): <NEW_LINE> <INDENT> self.N = N <NEW_LINE> self.n = n <NEW_LINE> self.prior = [distributions.uniform, distributions.uniform] <NEW_LINE> self.prior_args = np.array([[0, 1], [0, 1]]) <NEW_LINE> self.simulator_args = ['theta1'...
The MA2 problem with two parameters: y_t = w_t + theta1 * w_(t-1) + theta2 * w_(t-2)
62598fa624f1403a9268582f
class CartridgeHealthStatistics: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.memory_usage = None <NEW_LINE> self.load_avg = None
Holds the memory usage and load average reading
62598fa657b8e32f52508097
class TextEntityTypeBotCommand(Object): <NEW_LINE> <INDENT> ID = "textEntityTypeBotCommand" <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def read(q: dict, *args) -> "TextEntityTypeBotCommand": <NEW_LINE> <INDENT> return TextEntityTypeBotCommand()
A bot command, beginning with "/". This shouldn't be highlighted if there are no bots in the chat Attributes: ID (:obj:`str`): ``TextEntityTypeBotCommand`` No parameters required. Returns: TextEntityType Raises: :class:`telegram.Error`
62598fa6d268445f26639aff
@attr.s(frozen=True, slots=True) <NEW_LINE> class NavBoxInfo(object): <NEW_LINE> <INDENT> u <NEW_LINE> background_img_src = attr.ib( validator=attr.validators.instance_of(unicode) ) <NEW_LINE> count = attr.ib( validator=attr.validators.instance_of(int) ) <NEW_LINE> description = attr.ib( validator=attr.validators.insta...
Immutable object describing a homepage navigation box.
62598fa6eab8aa0e5d30bc82
class ConditionalGetMiddleware(MiddlewareMixin): <NEW_LINE> <INDENT> def process_response(self, request, response): <NEW_LINE> <INDENT> if not response.streaming and not response.has_header('Content-Length'): <NEW_LINE> <INDENT> response['Content-Length'] = str(len(response.content)) <NEW_LINE> <DEDENT> if request.meth...
Handles conditional GET operations. If the response has an ETag or Last-Modified header, and the request has If-None-Match or If-Modified-Since, the response is replaced by an HttpNotModified. An ETag header is added if needed. Also sets the Content-Length response-header.
62598fa67d847024c075c2bc
class interp_dl(object): <NEW_LINE> <INDENT> def __init__(self, filename, tst = False): <NEW_LINE> <INDENT> self.tau, self.vx, self.vy = read_kl_2d(filename) <NEW_LINE> self.eps = 1e-6 <NEW_LINE> self.f_interp_x = interp1d(self.tau, self.vx, kind = 'cubic', bounds_error=False) <NEW_LINE> self.f_interp_y = interp1d(self...
The main connection between an external force characterized by a number of points and the mubosym After running the initialization the base-functions are setup (by means of optimized coefficients) :param filename: the external file with a list of x y - values (table, separation sign is space), if filename is empty the...
62598fa6a219f33f346c6710
class PrincipalSource: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> None_ = 0 <NEW_LINE> UserInfoList = 1 <NEW_LINE> Windows = 2 <NEW_LINE> MembershipProvider = 4 <NEW_LINE> RoleProvider = 8 <NEW_LINE> All = 15
Specifies the source of a principal.
62598fa6796e427e5384e68c
class laneletType (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin): <NEW_LINE> <INDENT> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'laneletType') <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('/home/hans/workspace/thesis/extras/schema-extended.xsd', 247, 4) <NEW_LINE> _Documenta...
An atomic simple type.
62598fa64f88993c371f0486
class Operations(object): <NEW_LINE> <INDENT> def __init__(self, client, config, serializer, deserializer): <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._serialize = serializer <NEW_LINE> self._deserialize = deserializer <NEW_LINE> self.api_version = "2017-03-01" <NEW_LINE> self.config = config <NEW_LINE> ...
Operations operations. :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An objec model deserializer. :ivar api_version: The client API version. Constant value: "2017-03-01".
62598fa667a9b606de545ec4
class Literal(Syn): <NEW_LINE> <INDENT> value: Any <NEW_LINE> type: Any
Represent literal values.
62598fa6925a0f43d25e7f36
class AllowForm(forms.Form): <NEW_LINE> <INDENT> allow = forms.BooleanField(required=False) <NEW_LINE> redirect_uri = forms.CharField(widget=forms.HiddenInput()) <NEW_LINE> scope = forms.CharField(widget=forms.HiddenInput()) <NEW_LINE> client_id = forms.CharField(widget=forms.HiddenInput()) <NEW_LINE> state = forms.Cha...
用户选择是否允许授权的表单(Authorization code /Implicit grant 模式)
62598fa616aa5153ce4003fb
class TestPdfSettingsDto(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 testPdfSettingsDto(self): <NEW_LINE> <INDENT> pass
PdfSettingsDto unit test stubs
62598fa6a8370b77170f02d3
class Config(object): <NEW_LINE> <INDENT> def __getattr__(self, variable): <NEW_LINE> <INDENT> warn('Config has been deprecated', DeprecationWarning) <NEW_LINE> return V[variable] <NEW_LINE> <DEDENT> def __setattr__(self, variable, value): <NEW_LINE> <INDENT> warn('Config has been deprecated', DeprecationWarning) <NEW_...
Deprecated, but still provide the same interface, but to variables.
62598fa68e71fb1e983bb9aa
class ElementMap(Elements): <NEW_LINE> <INDENT> def __init__(self, locator_type, query_string=None, base_element=None, timeout=0, key=lambda el: el.text, value=lambda el: el, only_if=lambda els: len(els) > 0, facet=False, filter_by=lambda el: el is not None): <NEW_LINE> <INDENT> super(ElementMap, self).__init__( locato...
Used to create dynamic dictionaries based on an element locator specified by one of :class:`holmium.core.Locators`. The wrapped dictionary is an :class:`collections.OrderedDict` instance. :param holmium.core.Locators locator_type: selenium locator to use when locating the element :param str query_string: the value t...
62598fa6ac7a0e7691f72403
class PKR251Exception(Exception): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs)
Exception class for
62598fa630bbd722464698f4
class Application(Gtk.Application): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Gtk.Application.__init__(self) <NEW_LINE> <DEDENT> def do_activate(self): <NEW_LINE> <INDENT> window = ApplicationWindow(self) <NEW_LINE> self.add_window(window) <NEW_LINE> window.show_all() <NEW_LINE> last_used_file = Setti...
The FavaGTK application.
62598fa632920d7e50bc5f4f
@constructible <NEW_LINE> class IgniteServiceType(IntEnum): <NEW_LINE> <INDENT> NODE = 0 <NEW_LINE> THIN_CLIENT = 1 <NEW_LINE> NONE = 2
Application start mode.
62598fa67d847024c075c2bd
class SessionResumeHelper2(SessionResumeHelper1): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def _restore_SessionState_metadata(cls, session, session_repr): <NEW_LINE> <INDENT> metadata_repr = _validate( session_repr, key='metadata', value_type=dict) <NEW_LINE> session.metadata.title = _validate( metadata_repr, key='t...
Helper class for implementing session resume feature This class works with data constructed by :class:`~plainbox.impl.session.suspend.SessionSuspendHelper2` which has been pre-processed by :class:`SessionResumeHelper` (to strip the initial envelope). Due to the constraints of what can be represented in a suspended se...
62598fa63539df3088ecc1ad
class IWorkspaceFolder(form.Schema, IImageScaleTraversable): <NEW_LINE> <INDENT> calendar_visible = schema.Bool( title=MessageFactory(u"label_workspace_calendar_visibility", u"Calendar visible in central calendar"), required=False, default=False, ) <NEW_LINE> email = schema.TextLine( title=MessageFactory(u'label_worksp...
Interface for WorkspaceFolder
62598fa607f4c71912baf33c
class ImagableItemMixin(models.Model): <NEW_LINE> <INDENT> image = models.ImageField(blank=True, verbose_name=_(u"image"), upload_to=get_image_upload_path, default=DEFAULT_PATH) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> <DEDENT> @property <NEW_LINE> def image_height(self): <NEW_LINE> <INDENT...
A class that adds a field to the model that stores the image.
62598fa6442bda511e95c34e
class return_descriptors_result(object): <NEW_LINE> <INDENT> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is n...
Attributes: - success
62598fa6cc0a2c111447af08
class GenomicRegionDataProvider( column.ColumnarDataProvider ): <NEW_LINE> <INDENT> COLUMN_NAMES = [ 'chrom', 'start', 'end' ] <NEW_LINE> settings = { 'chrom_column' : 'int', 'start_column' : 'int', 'end_column' : 'int', 'named_columns' : 'bool', } <NEW_LINE> def __init__( self, dataset, chrom_column=None, start_c...
Data provider that parses chromosome, start, and end data from a file using the datasets metadata settings. Is a ColumnarDataProvider that uses a DatasetDataProvider as it's source. If `named_columns` is true, will return dictionaries with the keys 'chrom', 'start', 'end'.
62598fa67b25080760ed73a5
class StandardRobot(Robot): <NEW_LINE> <INDENT> def update_position_and_clean(self): <NEW_LINE> <INDENT> pos = self.position <NEW_LINE> pos = pos.get_new_position(self.direction, self.speed) <NEW_LINE> if self._room.is_position_valid(pos): <NEW_LINE> <INDENT> self.set_robot_position(pos) <NEW_LINE> priorCleanedState = ...
A StandardRobot is a Robot with the standard movement strategy. At each time-step, a StandardRobot attempts to move in its current direction; when it would hit a wall or furtniture, it *instead* chooses a new direction randomly.
62598fa68c0ade5d55dc360d
class MyConcreteFactory(AbstractFactory): <NEW_LINE> <INDENT> def create_product_X(self): <NEW_LINE> <INDENT> print("Called: my implementation of abstract factory; will return: " + "MyConcreteProductX instance") <NEW_LINE> return MyConcreteProductX() <NEW_LINE> <DEDENT> def create_product_Y(self): <NEW_LIN...
Another concrete implementation for AbstractFactory
62598fa63539df3088ecc1ae
class IAccordion(interface.Interface): <NEW_LINE> <INDENT> pass
Marker interface for the accordion viewlet
62598fa61f037a2d8b9e3fe5
class TestCase(unittest.TestCase): <NEW_LINE> <INDENT> api_class = None <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(TestCase, self).setUp() <NEW_LINE> if self.api_class is None: <NEW_LINE> <INDENT> self.api = falcon.API() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.api = self.api_class() <NEW_LINE> <DE...
Extends :py:mod:`unittest` to support WSGI functional testing. Note: If available, uses :py:mod:`testtools` in lieu of :py:mod:`unittest`. This base class provides some extra plumbing for unittest-style test cases, to help simulate WSGI calls without having to spin up an actual web server. Simply inherit from...
62598fa663d6d428bbee26ab
class HotelRoom(models.Model): <NEW_LINE> <INDENT> _name = 'hotel.room' <NEW_LINE> _description = 'Hotel Room' <NEW_LINE> _order = "sequence, room_type_id, name" <NEW_LINE> name = fields.Char('Room Name', required=True) <NEW_LINE> active = fields.Boolean('Active', default=True) <NEW_LINE> sequence = fields.Integer('Seq...
The rooms for lodging can be for sleeping, usually called rooms, and also for speeches (conference rooms), parking, relax with cafe con leche, spa...
62598fa6462c4b4f79dbb907
class CreateMirror18Test(BaseTest): <NEW_LINE> <INDENT> fixtureGpg = True <NEW_LINE> configOverride = { "ppaDistributorID": "ubuntu", "ppaCodename": "maverick", } <NEW_LINE> runCmd = "aptly mirror create -keyring=aptlytest.gpg mirror18 ppa:gladky-anton/gnuplot" <NEW_LINE> def outputMatchPrepare(_, s): <NEW_LINE> <INDEN...
create mirror: mirror with ppa URL
62598fa60c0af96317c5627c
class Trajectory: <NEW_LINE> <INDENT> SLOW_SPEED = 1.0 <NEW_LINE> FAST_SPEED = 1.4 <NEW_LINE> LINE_DESIRED_DIST = 0.4 <NEW_LINE> R_MIN = 0.1 <NEW_LINE> CURVE_WEIGHT = 1.5 <NEW_LINE> def __init__(self, frameobjects): <NEW_LINE> <INDENT> self.frameobjects = frameobjects <NEW_LINE> <DEDENT> @cachedproperty <NEW_LINE> def ...
Use a FrameInfo object to plan a local trajectory.
62598fa6851cf427c66b81c2
class APIAdvancedSearchView(SearchModelMixin, generics.ListAPIView): <NEW_LINE> <INDENT> filter_backends = (MayanObjectPermissionsFilter,) <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> self.search_model = self.get_search_model() <NEW_LINE> self.serializer_class = self.search_model.serializer <NEW_LINE> if self...
Perform an advanced search operation --- GET: omit_serializer: true parameters: - name: _match_all paramType: query type: string description: When checked, only results that match all fields will be returned. When unchecked results that match at least one field will be retu...
62598fa6e1aae11d1e7ce7a0
class GenericAPIView(APIView, generics.GenericAPIView): <NEW_LINE> <INDENT> pass
Base class for generic API views.
62598fa657b8e32f52508098
class Guard(Enemy): <NEW_LINE> <INDENT> def __init__(self, name, hp, damage): <NEW_LINE> <INDENT> super().__init__(name, hp, damage)
Enemy that stays in one room Attributes: name: name of enemy. hp: health of enemy. damage: damage dealt by enemy location_x: x-coord location_y: y-coord
62598fa67d43ff248742737f
class UfileDownloader: <NEW_LINE> <INDENT> def __init__(self, root_path, config): <NEW_LINE> <INDENT> self._root_path = root_path <NEW_LINE> self._source_map = source_map.SourceMap(config["source_map_name"]) <NEW_LINE> self._download_folder = config["download_folder"] <NEW_LINE> self._image_downloader = image_downloade...
UfileDownloader download ufile images to local. depends on image downloader, SourceMap
62598fa6656771135c48957c
class StyleDependencyError(Exception): <NEW_LINE> <INDENT> pass
Style dependency error.
62598fa6dd821e528d6d8e2f
@cassiopeia.type.core.common.inheritdocs <NEW_LINE> class Mastery(cassiopeia.type.dto.common.CassiopeiaDto): <NEW_LINE> <INDENT> def __init__(self, dictionary): <NEW_LINE> <INDENT> self.masteryId = dictionary.get("masteryId", 0) <NEW_LINE> self.rank = dictionary.get("rank", 0)
masteryId int the ID of the mastery rank int the number of points put into this mastery by the user
62598fa62ae34c7f260aafdb
class Tasks(BaseCommand): <NEW_LINE> <INDENT> def status(self, ref): <NEW_LINE> <INDENT> task = Task(self._gateway, ref) <NEW_LINE> return task.status() <NEW_LINE> <DEDENT> def running(self): <NEW_LINE> <INDENT> return self._gateway.query('/proc/bgtasks', 'status', 'running') <NEW_LINE> <DEDENT> def by_name(self, name)...
Gateway Background Task APIs
62598fa6eab8aa0e5d30bc84
class DedimaniaInvalidCredentials(DedimaniaException): <NEW_LINE> <INDENT> pass
Invalid code or player.
62598fa62c8b7c6e89bd36bf
class AllCommandsReturnNotImplemented(Behaviour): <NEW_LINE> <INDENT> def get_handle_command_function(self, _opid_or_status): <NEW_LINE> <INDENT> return self.operation_not_implemented_response <NEW_LINE> <DEDENT> def operation_not_implemented_response(self, req, _psfile): <NEW_LINE> <INDENT> attributes = self.minimal_a...
A printer which responds to all commands with a not implemented error. There's no real use for this, it's just an example.
62598fa67d847024c075c2be
class Builder(object): <NEW_LINE> <INDENT> def __init__(self, tool=None): <NEW_LINE> <INDENT> if tool is None: <NEW_LINE> <INDENT> raise TypeError("Expected argument 'tool' (pos 1) is missing") <NEW_LINE> <DEDENT> self._tool_name = tool <NEW_LINE> self._tool = None <NEW_LINE> for build_tool in build_tools.values(): <NE...
Class representing a process of building binaries from sources.
62598fa68da39b475be030dc
class QuotaForm(BaseQuotaForm): <NEW_LINE> <INDENT> class Meta(BaseQuotaForm.Meta): <NEW_LINE> <INDENT> model = models.Quota <NEW_LINE> exclude = ('quota',) <NEW_LINE> <DEDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> for field in self.fields.values(): <NEW_LINE> <INDENT> ...
This version of the form class that allows editing of the requested quota values. If the allocation record being edited is in approved state, we pre-fill the requested quota values from the current quota values.
62598fa692d797404e388ae2
class Database(): <NEW_LINE> <INDENT> def __init__(self,data_size,batch_size,entry_type='sequential'): <NEW_LINE> <INDENT> self.max_size = data_size <NEW_LINE> self.size = 0 <NEW_LINE> self.batch_size = batch_size <NEW_LINE> self.insert_index = 0 <NEW_LINE> self.sample_index = 0 <NEW_LINE> self.experience = [] <NEW_LIN...
Database with iterator to generate minibatches.
62598fa663d6d428bbee26ac
class UserProfileManager(BaseUserManager): <NEW_LINE> <INDENT> def create_user(self, email, name, password=None): <NEW_LINE> <INDENT> if not email: <NEW_LINE> <INDENT> raise ValueError('User must have a valid email') <NEW_LINE> <DEDENT> email = self.normalize_email(email) <NEW_LINE> user = self.model(email=email, name=...
Manager for User Profile
62598fa6a8370b77170f02d5
class IArticle(form.Schema, IImageScaleTraversable): <NEW_LINE> <INDENT> dexteritytextindexer.searchable('title') <NEW_LINE> title = schema.TextLine( title=_(u"Title for album"), required=True, ) <NEW_LINE> dexteritytextindexer.searchable('description') <NEW_LINE> description = schema.Text( title=_(u"Description for al...
Normal article
62598fa6cb5e8a47e493c0f5
class Event(Model): <NEW_LINE> <INDENT> DUPLICATE = 1 <NEW_LINE> UNKNOWN_PROBLEM = 2 <NEW_LINE> INCOMPATIBLE_TRAIT = 3 <NEW_LINE> def __init__(self, message_id, event_type, generated, traits, raw): <NEW_LINE> <INDENT> Model.__init__(self, message_id=message_id, event_type=event_type, generated=generated, traits=traits,...
A raw event from the source system. Events have Traits. Metrics will be derived from one or more Events.
62598fa6b7558d589546352a
@logger.init('spreadsheet', 'DEBUG') <NEW_LINE> class Dataframe(base.MatchedDataframe): <NEW_LINE> <INDENT> def __init__(self, *args, **kwds): <NEW_LINE> <INDENT> super(Dataframe, self).__init__(*args, **kwds) <NEW_LINE> self.seen = set() <NEW_LINE> <DEDENT> @logger.call('spreadsheet', 'debug') <NEW_LINE> def __call__(...
Report dataframe creator, an independent report (does not depend on data from other reports).
62598fa6d7e4931a7ef3bf95
class rule_006(token_case): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> token_case.__init__(self, 'component', '006', lTokens) <NEW_LINE> self.groups.append('case::keyword')
This rule checks the **is** keyword has proper case. |configuring_uppercase_and_lowercase_rules_link| **Violation** .. code-block:: vhdl component fifo IS component fifo Is **Fix** .. code-block:: vhdl component fifo is component fifo is
62598fa6167d2b6e312b6e6b
class ExBertEmbeddings(nn.Module): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.word_embeddings = nn.Embedding(config.vocab_size, config.hidden_size, padding_idx=config.pad_token_id) <NEW_LINE> self.position_embeddings = nn.Embedding(config.max_position_embeddin...
Construct the embeddings from word, position and token_type embeddings.
62598fa6d58c6744b42dc252
class CartExcludedTaxModifier(BaseCartModifier): <NEW_LINE> <INDENT> taxes = 1 - 1 / (1 + settings.VALUE_ADDED_TAX / 100) <NEW_LINE> def add_extra_cart_row(self, cart, request): <NEW_LINE> <INDENT> amount = cart.subtotal * self.taxes <NEW_LINE> instance = { 'label': _("{}% VAT incl.").format(settings.VALUE_ADDED_TAX), ...
This tax calculator presumes that unit prices are gross prices, hence also the subtotal, and that the tax is calculated per cart but not added to the cart.
62598fa656ac1b37e63020e8
class FileMetadata(db.Model): <NEW_LINE> <INDENT> __SEP = ".." <NEW_LINE> __NEXT = "./" <NEW_LINE> owner = db.UserProperty() <NEW_LINE> filename = db.StringProperty() <NEW_LINE> uploadedOn = db.DateTimeProperty() <NEW_LINE> source = db.StringProperty() <NEW_LINE> blobkey = db.StringProperty() <NEW_LINE> grep_link = db....
A helper class that will hold metadata for the user's blobs. Specifially, we want to keep track of who uploaded it, where they uploaded it from (right now they can only upload from their computer, but in the future urlfetch would be nice to add), and links to the results of their MR jobs. To enable our querying to sca...
62598fa63617ad0b5ee0604e
class trace: <NEW_LINE> <INDENT> def __init__(self, loglevel = logging.DEBUG, maxlen = 20): <NEW_LINE> <INDENT> self.loglevel = loglevel <NEW_LINE> self.maxlen = maxlen <NEW_LINE> <DEDENT> def abbrev(self, arg): <NEW_LINE> <INDENT> if arg: <NEW_LINE> <INDENT> argstr = repr(arg) <NEW_LINE> if len(argstr) > self.maxlen: ...
Trace decorator class
62598fa699cbb53fe6830dd0
class Tag(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=50) <NEW_LINE> user = models.ForeignKey(get_user_model(), on_delete=models.CASCADE) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name
A Tag in the database
62598fa691af0d3eaad39d0a
class EligibleTransactionVolume(MappingSchema): <NEW_LINE> <INDENT> min_price = SchemaNode(Int(), validator=colander.Range(min=0)) <NEW_LINE> max_price = SchemaNode( Int(), missing=None, validator=colander.Any(colander.Range(min=0)))
{ "min_price": 0, "max_price": 1000 }
62598fa6fff4ab517ebcd6e0
class HTLBRIterator(PyexcelIterator): <NEW_LINE> <INDENT> def __init__(self, reader): <NEW_LINE> <INDENT> self.reader_ref = reader <NEW_LINE> self.current = 0 <NEW_LINE> self.columns = reader.number_of_columns() <NEW_LINE> self.rows = reader.number_of_rows() <NEW_LINE> self.total = self.columns * self.rows <NEW_LINE> <...
Iterate horizontally from top left to bottom right default iterator for Reader class
62598fa60a50d4780f7052d7
class DetectionWithCombinedFollowers(Follower): <NEW_LINE> <INDENT> def __init__(self, image_provider, detector, main_finder, secondary_finder): <NEW_LINE> <INDENT> self.img_provider = image_provider <NEW_LINE> self.detector = detector <NEW_LINE> self.main_finder = main_finder <NEW_LINE> self.secondary_finder = seconda...
Combina los seguidores RGB y D usando la deteccion estatica de profundidad, ya que inserta en los descriptores a las nubes de puntos
62598fa6f548e778e596b4a0
class AutoUpgradeOptions(_messages.Message): <NEW_LINE> <INDENT> autoUpgradeStartTime = _messages.StringField(1) <NEW_LINE> description = _messages.StringField(2) <NEW_LINE> requestedUpgradeStartTime = _messages.StringField(3)
AutoUpgradeOptions defines the set of options for the user to control how the Auto Upgrades will proceed. Fields: autoUpgradeStartTime: [Output only] This field is set when upgrades are about to commence with the approximate start time for the upgrades, in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text...
62598fa6dd821e528d6d8e30
@implement_to_string <NEW_LINE> class Unknown(AbstractModel): <NEW_LINE> <INDENT> TYPE = None <NEW_LINE> display_name = None <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return self.display_name if self.display_name else self.TYPE <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return str(self.__repr__...
This class is used when we can't find a matching object type
62598fa6498bea3a75a57a18
class S3DataStore(DataStore): <NEW_LINE> <INDENT> def __init__(self, bucket, base_key, aws_key=None, aws_secret=None): <NEW_LINE> <INDENT> self._s3_client = boto.connect_s3(aws_access_key_id=aws_key, aws_secret_access_key=aws_secret) <NEW_LINE> self._bucket = self._s3_client.get_bucket(bucket, validate=False) <NEW_LINE...
Uses S3 to store serialized messages.
62598fa6b7558d589546352b
class FakeProvider(RepoProvider): <NEW_LINE> <INDENT> async def get_resolved_ref(self): <NEW_LINE> <INDENT> return "1a2b3c4d5e6f" <NEW_LINE> <DEDENT> async def get_resolved_spec(self): <NEW_LINE> <INDENT> return "fake/repo/1a2b3c4d5e6f" <NEW_LINE> <DEDENT> def get_repo_url(self): <NEW_LINE> <INDENT> return "https://exa...
Fake provider for local testing of the UI
62598fa63d592f4c4edbadc9
class Notify(models.Model): <NEW_LINE> <INDENT> id = UuidField(primary_key=True) <NEW_LINE> client_event = models.BooleanField(default=True) <NEW_LINE> resume_daily_event = models.BooleanField(default=True) <NEW_LINE> change_event = models.BooleanField(default=True) <NEW_LINE> content_type = models.ForeignKey(ContentTy...
Email notification
62598fa62ae34c7f260aafdd
class VLinkUrls(Validator): <NEW_LINE> <INDENT> splitter = re.compile('[ ,]+') <NEW_LINE> id_re = re.compile('^/ea/([^/]+)/') <NEW_LINE> def __init__(self, item, *a, **kw): <NEW_LINE> <INDENT> self.item = item <NEW_LINE> Validator.__init__(self, item, *a, **kw) <NEW_LINE> <DEDENT> def run(self, val): <NEW_LINE> <INDENT...
A comma-separated list of link urls
62598fa6be8e80087fbbef5e
class RequestWelfareGetTitleID: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.I64, 'actor_id_', None, None, ), (2, TType.I32, 'title_id_', None, None, ), ) <NEW_LINE> def __init__(self, actor_id_=None, title_id_=None,): <NEW_LINE> <INDENT> self.actor_id_ = actor_id_ <NEW_LINE> self.title_id_ = title_id_ <NEW_LINE...
Attributes: - actor_id_ - title_id_
62598fa616aa5153ce4003ff
class SensorRecordInstance(): <NEW_LINE> <INDENT> def __init__(self, recordLength, timeInterval): <NEW_LINE> <INDENT> self.recordLength = recordLength <NEW_LINE> self.timeInterval = timeInterval <NEW_LINE> self.currentData = 0 <NEW_LINE> self.currentDataCount = 0 <NEW_LINE> self.data = [] <NEW_LINE> self.dataValid = Fa...
Sensor record for a single sensor type
62598fa638b623060ffa8f93
@tf_export("distribute.experimental.MultiWorkerMirroredStrategy", v1=[]) <NEW_LINE> class CollectiveAllReduceStrategy(distribute_lib.Strategy): <NEW_LINE> <INDENT> def __init__( self, communication=cross_device_ops_lib.CollectiveCommunication.AUTO): <NEW_LINE> <INDENT> super(CollectiveAllReduceStrategy, self).__init__(...
Distribution strategy that uses collective ops for all-reduce. It is similar to MirroredStrategy but it uses collective ops for reduction. By default it uses all local GPUs or CPU for single-worker training. When 'TF_CONFIG' environment variable is given, it parses cluster_spec, task_type and task_id from 'TF_CONFIG...
62598fa60c0af96317c5627f
class RevisionTests(TestCaseBase): <NEW_LINE> <INDENT> fixtures = ['test_users.json'] <NEW_LINE> def test_revision_view(self): <NEW_LINE> <INDENT> d = _create_document() <NEW_LINE> r = d.current_revision <NEW_LINE> r.created = datetime(2011, 1, 1) <NEW_LINE> r.reviewed = datetime(2011, 1, 2) <NEW_LINE> r.save() <NEW_LI...
Tests for the Revision template
62598fa644b2445a339b68ed
class MarkAmphoraBootingInDB(BaseDatabaseTask): <NEW_LINE> <INDENT> def execute(self, amphora_id, compute_id): <NEW_LINE> <INDENT> LOG.debug("Mark BOOTING in DB for amphora: %(amp)s with " "compute id %(id)s", {'amp': amphora_id, 'id': compute_id}) <NEW_LINE> self.amphora_repo.update(db_apis.get_session(), amphora_id, ...
Mark the amphora as booting in the database.
62598fa6a219f33f346c6714
class PatchMaybeReportException(MonkeyPatch): <NEW_LINE> <INDENT> def __call__(self): <NEW_LINE> <INDENT> from opengever.base.sentry import FTW_RAVEN_AVAILABLE <NEW_LINE> if not FTW_RAVEN_AVAILABLE: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> from ftw.raven.reporter import maybe_report_exception as original_maybe_re...
Monkeypatch for ftw.raven.reporter.maybe_report_exception This allows to skip reporting of exceptions that inherit NotReportedException
62598fa61f5feb6acb162b1e
class CacheControl: <NEW_LINE> <INDENT> update_dict = UpdateDict <NEW_LINE> def __init__(self, properties, type): <NEW_LINE> <INDENT> self.properties = properties <NEW_LINE> self.type = type <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def parse(cls, header, updates_to=None, type=None): <NEW_LINE> <INDENT> if updates_to...
Represents the Cache-Control header. By giving a type of ``'request'`` or ``'response'`` you can control what attributes are allowed (some Cache-Control values only apply to requests or responses).
62598fa6167d2b6e312b6e6d
class _MyWindowsException(OSError): <NEW_LINE> <INDENT> pass
An exception type like L{ctypes.WinError}, but available on all platforms.
62598fa6f7d966606f747ee1
class TestBlogApp(unittest.TestCase): <NEW_LINE> <INDENT> def test_initialize_db(self): <NEW_LINE> <INDENT> result = helpers.initialize_db('../data/Database1.json') <NEW_LINE> self.assertIsInstance(result, FileNotFoundError) <NEW_LINE> print("[test_initialize_db] First test case passed") <NEW_LINE> result = helpers.ini...
Class for writing unit test cases
62598fa6d58c6744b42dc253
class GeoIP(_GeoIP): <NEW_LINE> <INDENT> def __init__(self, path=None, cache=0, country=None, city=None, isp=None): <NEW_LINE> <INDENT> super(GeoIP, self).__init__(path=path, cache=cache, country=country, city=city) <NEW_LINE> <DEDENT> def isp(self, query): <NEW_LINE> <INDENT> raise GeoIPException('GeoIP ISP unsupporte...
Add ISP support to GeoIP
62598fa65f7d997b871f935f
class ImageShuffler(Callback): <NEW_LINE> <INDENT> TRAINING_SET = None <NEW_LINE> VALIDATION_SET = None <NEW_LINE> def __init__(self, training_set, validation_set): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.TRAINING_SET = training_set <NEW_LINE> self.VALIDATION_SET = validation_set <NEW_LINE> <DEDENT> def ...
Callback to shuffle/augment unmodified images from ImageSequence and feed the modified versions back to it at the start of each epoch.
62598fa691af0d3eaad39d0c
class Menu_Creditos: <NEW_LINE> <INDENT> def __init__(self, tela): <NEW_LINE> <INDENT> self.tela = tela <NEW_LINE> self.opcao = 1 <NEW_LINE> self.enter = False <NEW_LINE> self.musica = pygame.mixer.Sound("dados/sons/creditos.wav") <NEW_LINE> <DEDENT> def tratar_eventos_menu(self): <NEW_LINE> <INDENT> for evento in pyga...
Classe Menu Creditos
62598fa63cc13d1c6d465669
class EventDisplay(urwid.WidgetWrap): <NEW_LINE> <INDENT> def __init__(self, conf, event, collection=None): <NEW_LINE> <INDENT> self._conf = conf <NEW_LINE> self.collection = collection <NEW_LINE> self.event = event <NEW_LINE> divider = urwid.Divider(' ') <NEW_LINE> lines = [] <NEW_LINE> lines.append(urwid.Text('Title:...
A widget showing one Event()'s details
62598fa61f037a2d8b9e3fe9
class Daos(Dao): <NEW_LINE> <INDENT> def __init__(self, url, **kwargs): <NEW_LINE> <INDENT> self.configure(url, **kwargs) <NEW_LINE> <DEDENT> def configure(self, url, **kwargs): <NEW_LINE> <INDENT> self.chrom_dao = ChromDao(url, **kwargs) <NEW_LINE> self.ld_dao = LdDao(url, **kwargs) <NEW_LINE> self.idcoef_dao = IdCoef...
DAO mother object.
62598fa60a50d4780f7052da
class account_analytic_expense_deprecation_cost(osv.osv): <NEW_LINE> <INDENT> _name = 'account.analytic.expense.deprecation.cost' <NEW_LINE> _description = 'Year deprecation cost' <NEW_LINE> _rec_name = 'department_id' <NEW_LINE> _order = 'department_id' <NEW_LINE> _columns = { 'year_id': fields.many2one( 'account.anal...
Add schedule method and override split method
62598fa67d43ff2487427381
class VerveResponseQuestionCategory(object): <NEW_LINE> <INDENT> def __init__(self, status_code=None, message=None, list=None, data=None, records=None): <NEW_LINE> <INDENT> self.swagger_types = { 'status_code': 'str', 'message': 'str', 'list': 'list[QuestionCategory]', 'data': 'QuestionCategory', 'records': 'int' } <NE...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598fa6be8e80087fbbef60
class task_one(PatternGraphs): <NEW_LINE> <INDENT> def __init__(self, k, minsup, database, subsets): <NEW_LINE> <INDENT> super().__init__(database) <NEW_LINE> self.patterns = {} <NEW_LINE> self.dico_thresh = {} <NEW_LINE> self.k = k <NEW_LINE> self.minsup = minsup <NEW_LINE> self.gid_subsets = subsets <NEW_LINE> self.t...
Finds the frequent (support >= minsup) subgraphs among the positive graphs. This class provides a method to build a feature matrix for each subset.
62598fa68e7ae83300ee8fa0
class Plugin: <NEW_LINE> <INDENT> def __init__(self, file, name, desc, version, state): <NEW_LINE> <INDENT> self.file = file <NEW_LINE> self.name = name <NEW_LINE> self.desc = desc <NEW_LINE> self.version = version <NEW_LINE> self.state = state
Class that defines a plugin with : - his name - his description - his version - his state...
62598fa64a966d76dd5eede1
class Storage(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=256) <NEW_LINE> capacity = models.IntegerField() <NEW_LINE> state = models.IntegerField(default=0) <NEW_LINE> address = models.CharField(max_length=64, null=True) <NEW_LINE> dir = models.CharField(max_length=256, null=True) <NEW_LINE> t...
@model{STORAGE} Class for storages This class controlls cluster's Storage - where Images are stored. Storage is mounted to Node physical machine via web interface.
62598fa6a17c0f6771d5c133
class ServiceHTTPAuthenticationException(colony.ColonyException): <NEW_LINE> <INDENT> message = None
The service HTTP authentication exception class.
62598fa644b2445a339b68ee
class ArcCosNode(FuncNode): <NEW_LINE> <INDENT> funcList.append("ArcCosNode") <NEW_LINE> name ='arccos' <NEW_LINE> func = 'cmath.acos' <NEW_LINE> def __init__(self, arg): <NEW_LINE> <INDENT> super(ArcCosNode, self).__init__(arg) <NEW_LINE> <DEDENT> def diff(self,var): <NEW_LINE> <INDENT> return (Constant(-1)*(Constant(...
Represents the arccosine function
62598fa68e71fb1e983bb9b0
class UnregisteredClass(Exception): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> super(UnregisteredClass, self).__init__("Class <{0}> is not registered".format(name))
docstring for exception UnregisteredClass
62598fa630bbd722464698f7
class Number(Rollable): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> super(Number, self).__init__() <NEW_LINE> self._value = value <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '%s' % (self._value) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '<class %s>(v...
A numeric constant
62598fa6627d3e7fe0e06dab
class FFmpegVideoWriter(VideoWriter): <NEW_LINE> <INDENT> def __init__(self, outpath, fps, size, out_opts=None): <NEW_LINE> <INDENT> self.outpath = outpath <NEW_LINE> self.fps = fps <NEW_LINE> self.size = size <NEW_LINE> self._ffmpeg = FFmpeg( in_opts=[ "-f", "rawvideo", "-vcodec", "rawvideo", "-s", "%dx%d" % self.size...
Class for writing videos using ffmpeg.
62598fa667a9b606de545eca
class ValutaCostiDialog(aw.Dialog): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> if not kwargs.has_key('title') and len(args) < 3: <NEW_LINE> <INDENT> kwargs['title'] = COSTI_FRAME_TITLE <NEW_LINE> <DEDENT> aw.Dialog.__init__(self, *args, **kwargs) <NEW_LINE> self.AddSizedPanel(ValutaCos...
Dialog Valutazione costi di acquisto presenti.
62598fa6f7d966606f747ee3
class DdosProtectionPlan(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, 'resource_guid': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'virtual_networks': {'readonly': True}, }...
A DDoS protection plan in a resource group. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str :param location: Resource location. :type location: st...
62598fa6d58c6744b42dc254