code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
@skip_unless_lms <NEW_LINE> @mock.patch(PROGRAMS_UTILS_MODULE + '.get_programs') <NEW_LINE> class TestProgramDetails(ProgramsApiConfigMixin, CatalogIntegrationMixin, SharedModuleStoreTestCase): <NEW_LINE> <INDENT> program_uuid = str(uuid4()) <NEW_LINE> password = 'test' <NEW_LINE> url = reverse('program_details_view', ... | Unit tests for the program details page. | 62598ee9009cb60464cffc51 |
class MasternodesWidget(QWidget): <NEW_LINE> <INDENT> def __init__(self, manager, parent=None): <NEW_LINE> <INDENT> super(MasternodesWidget, self).__init__(parent) <NEW_LINE> self.manager = manager <NEW_LINE> self.model = MasternodesModel(self.manager) <NEW_LINE> self.proxy_model = QSortFilterProxyModel() <NEW_LINE> se... | Widget that displays masternodes. | 62598ee94428ac0f6e656c55 |
class RegisterView(CreateView): <NEW_LINE> <INDENT> template_name = 'auths/register.html' <NEW_LINE> form_class = RegisterForm <NEW_LINE> def get_success_url(self): <NEW_LINE> <INDENT> messages.success(self.request, _("Succesful register.")) <NEW_LINE> return reverse('auths:login') | Register | 62598ee9bd1bec0571e1444c |
class NoisyNOTGate(SelfInverseLocalNoiseBase): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return "PNOT" <NEW_LINE> <DEDENT> @property <NEW_LINE> def matrix(self): <NEW_LINE> <INDENT> rnd = self.noise()*0.5 <NEW_LINE> return np.matrix([[-1j*sin(rnd), cos(rnd)], [ cos(rnd), -1j*sin(rnd)]]) | NOT Gate + random rotation in X gate class | 62598ee9cad5886f8bdc3a05 |
class NombreMoustiquqiresImpregneesInsecticidesLongueDureeMILD(IndicatorTable): <NEW_LINE> <INDENT> name = "Tableau 16" <NEW_LINE> title = " " <NEW_LINE> caption = ("Nombre de Moustiquaires imprégnées d’Insecticides de " "Longue Durée (MILD) distribuées") <NEW_LINE> rendering_type = 'table' <NEW_LINE> INDICATORS = [ g... | Tableau: Nombre de Moustiquaires imprégnées d’Insecticides
de Longue Durée (MILD) distribuées | 62598ee967a9b606de5446d1 |
class FieldCalculator(): <NEW_LINE> <INDENT> def __init__( self, messageManager, iface ): <NEW_LINE> <INDENT> self.msg = messageManager <NEW_LINE> self.iface = iface <NEW_LINE> <DEDENT> def calculate( self, layer, fieldName, expression ): <NEW_LINE> <INDENT> if ( layer.featureCount() == 0 ): <NEW_LINE> <INDENT> self.ms... | Class to perform field calculations on existing features.
Not the core of the plugin, but a helpful option.
Adapted from QGIS/python/plugins/processing/algs/qgis/FieldsCalculator.py | 62598ee999fddb7c1ca62186 |
@cli_description('Biased Y v. X (bias FLOAT >= 0)') <NEW_LINE> class BiasedYXErrorModel(SimpleErrorModel): <NEW_LINE> <INDENT> def __init__(self, bias): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> if not (bias >= 0 and math.isfinite(bias)): <NEW_LINE> <INDENT> raise ValueError('{} valid bias values are number >= 0'.fo... | Implements a biased-Y-X error model.
In addition to the members defined in :class:`qecsim.model.ErrorModel`, it provides the following method:
* Get bias: :meth:`bias`.
The probability distribution for a given error probability p is:
* 1 - p: I (i.e. no error)
* rx * (1 - ry): X
* ry * (1 - rx): Y
* rx * ry: Z
whe... | 62598ee98e7ae83300ee7792 |
class TruncateMixin(MinimalHandler): <NEW_LINE> <INDENT> truncate_error = False <NEW_LINE> truncate_verify_reject = False <NEW_LINE> @classmethod <NEW_LINE> def using(cls, truncate_error=None, **kwds): <NEW_LINE> <INDENT> subcls = super(TruncateMixin, cls).using(**kwds) <NEW_LINE> if truncate_error is not None: <NEW_LI... | PasswordHash mixin which provides a method
that will check if secret would be truncated,
and can be configured to throw an error.
.. warning::
Hashers using this mixin will generally need to override
the default PasswordHash.truncate_error policy of "True",
and will similarly want to override .truncate_ve... | 62598ee967a9b606de5446d2 |
class PrivateIPAddress(Model): <NEW_LINE> <INDENT> _attribute_map = { 'ip_address': {'key': 'ipAddress', 'type': 'str'}, 'subnet_resource_id': {'key': 'subnetResourceId', 'type': 'str'}, } <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(PrivateIPAddress, self).__init__(**kwargs) <NEW_LINE> self.ip_ad... | A private IP address bound to the availability group listener.
:param ip_address: Private IP address bound to the availability group
listener.
:type ip_address: str
:param subnet_resource_id: Subnet used to include private IP.
:type subnet_resource_id: str | 62598ee907f4c71912badb59 |
class LoginView(KnoxLoginView): <NEW_LINE> <INDENT> permission_classes = (permissions.AllowAny,) <NEW_LINE> def post(self, request, format=None): <NEW_LINE> <INDENT> serializer = AuthTokenSerializer(data=request.data) <NEW_LINE> serializer.is_valid(raise_exception=True) <NEW_LINE> user = serializer.validated_data['user... | API endpoint to log users in | 62598ee9fff4ab517ebcbedb |
class RealDownloadMiddleware(BaseDownloadMiddleware): <NEW_LINE> <INDENT> def is_download_response(self, response): <NEW_LINE> <INDENT> if super(RealDownloadMiddleware, self).is_download_response(response): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return response.file.url or response.file.name <NEW_LINE> <DEDENT> e... | Download middleware that cannot handle virtual files. | 62598ee98da39b475be018af |
class NewSession: <NEW_LINE> <INDENT> def __init__(self, device: Device): <NEW_LINE> <INDENT> self._device = device <NEW_LINE> <DEDENT> def connect(self) -> None: <NEW_LINE> <INDENT> self._device.connect() <NEW_LINE> <DEDENT> def disconnect(self) -> None: <NEW_LINE> <INDENT> self._device.disconnect() <NEW_LINE> <DEDENT... | Class provides interfaces to interact with the device. | 62598ee9f7d966606f7466f5 |
class Movie(): <NEW_LINE> <INDENT> def __init__(self,movie_title,movie_storyline,poster_image,trailer_youtube,release_date): <NEW_LINE> <INDENT> self.title = movie_title <NEW_LINE> self.storyline = movie_storyline <NEW_LINE> self.poster_image_url = poster_image <NEW_LINE> self.trailer_youtube_url = trailer_youtube <NEW... | This class provides a method of storing movie related information and allows the viewer of the page to see the movie trailer. | 62598ee93539df3088eca9b6 |
class BasicBlock(_BaseBlock): <NEW_LINE> <INDENT> expansion = 1 <NEW_LINE> def _create_operations(self, in_planes, out_planes, stride, dim): <NEW_LINE> <INDENT> self.conv1 = conv3x3(in_planes, out_planes, stride, dim=dim) <NEW_LINE> self.bn1 = BatchNormXd(out_planes) <NEW_LINE> self.relu = nn.ReLU(inplace=True) <NEW_LI... | -- The basic residual layer block for 18 and 34 layer network, and the
-- The bottleneck residual layer for 50, 101, and 152 layer networks | 62598ee9442bda511e95ab66 |
class Adapter(Target, Adaptee): <NEW_LINE> <INDENT> def request(self) -> str: <NEW_LINE> <INDENT> return f"Adapter: (TRANSLATED) {self.specific_request()[::-1]}" | Адаптер делает интерфейс Адаптируемого класса совместимым с целевым
интерфейсом благодаря множественному наследованию. | 62598ee90c0af96317c54aa1 |
class ModuleContactListDB(models.Model): <NEW_LINE> <INDENT> owner = models.ForeignKey( Client ) <NEW_LINE> list_name = models.CharField( max_length=120, verbose_name=_(u'Title') ) <NEW_LINE> origin = models.IntegerField( choices=FIELD_TO_CHOOSE, null=False ) <NEW_LINE> destination = models.IntegerField( choices=FIELD_... | ContactList module model | 62598ee97d847024c075aad2 |
class wiz_mo_repair_operations(models.TransientModel): <NEW_LINE> <INDENT> _name = 'wiz.mo.repair.operations' <NEW_LINE> _description = 'Wiz manufacturing order for repair operations' <NEW_LINE> _rec_name = 'rl_id' <NEW_LINE> _order = 'sequence asc' <NEW_LINE> wiz_mo_repair_id = fields.Many2one('wiz.mo.repair', string=... | Wiz manufacturing order for repair operations | 62598ee9a8370b77170eeae8 |
class SCS84DisableTransition(FixedTransition): <NEW_LINE> <INDENT> command_attributes = {'tlmsid': 'CODISASX'} <NEW_LINE> command_params = {'codisas1': 84} <NEW_LINE> state_keys = ['scs84'] <NEW_LINE> transition_key = 'scs84' <NEW_LINE> transition_val = 'DISA' | SCS-84 disable | 62598ee999cbb53fe682f5b6 |
class UnitOptionsNode(OptionsNode): <NEW_LINE> <INDENT> def create_options_dict(self, items={}): <NEW_LINE> <INDENT> class FakeOptionsDict(dict): <NEW_LINE> <INDENT> def set_node_info(self, node_info): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def transform_items(self, functions, recursive=True): <NEW_LINE> <INDENT>... | This is OptionsNode decoupled from the OptionsDict and
OrphanNodeInfo implementations for unit testing purposes. | 62598ee901c39578d7f114ae |
class Entry(Location): <NEW_LINE> <INDENT> baseclass() <NEW_LINE> implements(IMenuEntryViewlet) <NEW_LINE> context(Interface) <NEW_LINE> params = None <NEW_LINE> available = True <NEW_LINE> def __init__(self, context, request, view, manager): <NEW_LINE> <INDENT> self.view = self.__parent__ = view <NEW_LINE> self.contex... | The menu entry viewlet
template may be provided as an attribute or will be search as an
adapter of the menu and the request to IPageTemplate | 62598ee9f9cc0f698b1c4650 |
class StringContains(SubstringMatcher): <NEW_LINE> <INDENT> def __init__(self, substring): <NEW_LINE> <INDENT> super(StringContains, self).__init__(substring) <NEW_LINE> <DEDENT> def _matches(self, item): <NEW_LINE> <INDENT> if not hasmethod(item, 'find'): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> return ite... | Matches if the item is a string that contains a given substring. | 62598ee98e71fb1e983ba171 |
class PrimerSequence( object ): <NEW_LINE> <INDENT> def __init__( self, seqID, seqLength, sequence ): <NEW_LINE> <INDENT> self.seqID = seqID <NEW_LINE> self.seqLength = seqLength <NEW_LINE> self.matchedSubSequences = [ ] <NEW_LINE> self.sequence = sequence <NEW_LINE> <DEDENT> def addMatch( self, match ): <NEW_LINE> <IN... | record sequence data, and store matched parts of the sequence | 62598ee92c8b7c6e89bd1ec5 |
class Node: <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> self.link = None | A class to create a node with the given value | 62598ee976e4537e8c3edcbd |
class InputLayer(Layer): <NEW_LINE> <INDENT> def __init__(self, dshape): <NEW_LINE> <INDENT> super().__init__('input', 'input') <NEW_LINE> self.dshape = [None, *dshape] <NEW_LINE> <DEDENT> def __call__(self, input_, train=False): <NEW_LINE> <INDENT> super().__call__(input_) <NEW_LINE> return input_ <NEW_LINE> <DEDENT> ... | Input Layer | 62598ee9d6c5a102081e0836 |
class Id(test.CleanTestCase): <NEW_LINE> <INDENT> model = Task <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.register() <NEW_LINE> <DEDENT> def make(self): <NEW_LINE> <INDENT> return Task(id=genid(), name='pluto').save() <NEW_LINE> <DEDENT> def testCreate(self): <NEW_LINE> <INDENT> t1 = self.make() <NEW_LINE> ti... | Test primary key when it is not an AutoField.
Use the manager for convenience. | 62598ee9cc0a2c1114479708 |
class BSD500Patches40(ResidualData): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(BSD500Patches40, self).__init__(*args, **kwargs) <NEW_LINE> self.images = H5FDataset(mode='train') | BSD 500. | 62598ee94428ac0f6e656c58 |
class ServerVirtualInterfaceController(wsgi.Controller): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.compute_api = compute.API(skip_policy_check=True) <NEW_LINE> self.network_api = network.API(skip_policy_check=True) <NEW_LINE> super(ServerVirtualInterfaceController, self).__init__() <NEW_LINE> <DE... | The instance VIF API controller for the OpenStack API.
| 62598ee98c0ade5d55dc2a04 |
class Libtool(Package): <NEW_LINE> <INDENT> homepage = "https://www.gnu.org/software/libtool/" <NEW_LINE> url = "http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz" <NEW_LINE> version('2.4.2' , 'd2f3b7d4627e69e13514a40e72a24d50') <NEW_LINE> def install(self, spec, prefix): <NEW_LINE> <INDENT> configure("--prefi... | libtool -- library building part of autotools | 62598ee95fc7496912d475f5 |
class Sampler: <NEW_LINE> <INDENT> def __init__(self, weights): <NEW_LINE> <INDENT> n = len(weights) <NEW_LINE> self.table = [[i, None, None] for i in range(n)] <NEW_LINE> total = sum(weights) <NEW_LINE> num_type = type(total) <NEW_LINE> zero = num_type(0) <NEW_LINE> one = num_type(1) <NEW_LINE> small = [] <NEW_LINE> l... | Sampler based on Vose's algorithm for the alias method. See
http://www.keithschwarz.com/darts-dice-coins/ for a good explanation.
The general idea is that we store a table of triples (base, alternate, p).
base. We then pick a triple uniformly at random, and choose its alternate
value with probability p and else choose... | 62598ee9cad5886f8bdc3a07 |
class Notes(ViewSet): <NEW_LINE> <INDENT> def list(self, request): <NEW_LINE> <INDENT> notes = Note.objects.all() <NEW_LINE> serializer = NoteSerializer( notes, many=True, context={'request': request}) <NEW_LINE> return Response(serializer.data) <NEW_LINE> <DEDENT> def retrieve(self, request, pk=None): <NEW_LINE> <INDE... | Responsible for GET | 62598ee94f88993c371ef869 |
class TargetWeights: <NEW_LINE> <INDENT> NONE = 'none' <NEW_LINE> LINEAR = 'linear' <NEW_LINE> STEP = 'step' <NEW_LINE> def __init__(self, args): <NEW_LINE> <INDENT> self.args = args <NEW_LINE> <DEDENT> def get_weight(self, i): <NEW_LINE> <INDENT> if not self.args.target_weights or self.args.target_weights == Model.Tar... | Политка установки весов
| 62598ee97d43ff248742677e |
class Calculator: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def add(arg1,arg2): <NEW_LINE> <INDENT> return(arg1+arg2) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def sub(arg1,arg2): <NEW_LINE> <INDENT> return(arg1-arg2) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def mul(arg1,arg2): <NEW_LINE> <INDENT> return (arg... | Simple class implementing a calculator with basic operations. | 62598ee916aa5153ce3fec04 |
class SphereBivariateSpline(_BivariateSplineBase): <NEW_LINE> <INDENT> def __call__(self, theta, phi): <NEW_LINE> <INDENT> theta = np.asarray(theta) <NEW_LINE> phi = np.asarray(phi) <NEW_LINE> if (theta.size == 0) and (phi.size == 0): <NEW_LINE> <INDENT> return array([]) <NEW_LINE> <DEDENT> if theta.min() < 0. or theta... | Bivariate spline s(x,y) of degrees 3 on a sphere, calculated from a
given set of data points (theta,phi,r).
See Also
--------
bisplrep, bisplev : an older wrapping of FITPACK
UnivariateSpline : a similar class for univariate spline interpolation
SmoothUnivariateSpline :
to create a BivariateSpline through the give... | 62598ee9e76e3b2f99fd713c |
class PostForm(Form): <NEW_LINE> <INDENT> title = StringField('Title', [DataRequired(), Length(max=255)]) <NEW_LINE> text = TextAreaField('Blog Content', [DataRequired()]) | Form vaildator for comment. | 62598ee9d486a94d0ba2a6d3 |
class UserSolverIDF(UserSolver): <NEW_LINE> <INDENT> def __init__(self, num_design, num_state, num_real_ceq, allocator=None): <NEW_LINE> <INDENT> self.num_real_design = num_design <NEW_LINE> self.num_real_ceq = num_real_ceq <NEW_LINE> super(UserSolverIDF, self).__init__( self.num_real_design + num_state, num_state, sel... | A modified base class for multidisciplinary problems that adopt the
IDF (individual discipline feasible) formulation for disciplinary
coupling.
Parameters
----------
num_real_design : int
Size of the design space, NOT including target state variables
num_state : int
Number of state variables
num_real_ceq : int... | 62598ee93539df3088eca9b8 |
class NewGameForm(messages.Message): <NEW_LINE> <INDENT> user_name = messages.StringField(1, required=True) <NEW_LINE> attempts = messages.IntegerField(2) | Used to create a new game | 62598ee96aa9bd52df0d35b7 |
class PtrNet(nn.Module): <NEW_LINE> <INDENT> def __init__(self,d_input=128,d_hidden=128,num_layer=1,bi=False,dropout=0,bias=True,name='gru'): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.encoder=Encoder(d_input,d_hidden,num_layer,bi,dropout,name) <NEW_LINE> self.decoder=Decoder(d_input,d_hidden,step=2,dropout... | Pointer Net | 62598ee97d847024c075aad4 |
class OrderStatus(Base): <NEW_LINE> <INDENT> def is_paid(self): <NEW_LINE> <INDENT> if self.is_successful() and self.order_status == '2': <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> return False <NEW_LINE> <DEDENT> @property <NEW_LINE> def rejection_reason(self): <NEW_LINE> <INDENT> return self.action_code_desc... | getOrderStatus/getOrderStatusExtended response model
| 62598ee985dfad0860cbedeb |
class MoneyPropped(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> transformed = _transform_init_kwargs(type(self), kwargs) <NEW_LINE> super(MoneyPropped, self).__init__(*args, **kwargs) <NEW_LINE> _check_transformed_types(self, transformed) | Mixin for transforming MoneyProperty init parameters.
Add this mixin as (first) base for the class that has
`MoneyProperty` properties and this will make its `__init__`
transform passed kwargs to the fields specified in the
`MoneyProperty`. | 62598ee92eb69b55b15a070d |
@workflow_protocol() <NEW_LINE> class GenerateReleaseRestraints(_GenerateRestraints): <NEW_LINE> <INDENT> host_coordinate_path = InputAttribute( docstring="The file path to a coordinate file which contains the solvated" "host molecule and has the anchor dummy atoms added.", type_hint=str, default_value=UNDEFINED, ) <NE... | Generates the restraint values to apply during the 'release' phase from a set
of restraint schema definitions and makes them easily accessible for the protocols
which will apply them to the parameterized system. | 62598ee92ae34c7f260a97ee |
class Send(Form): <NEW_LINE> <INDENT> address = TextField(validators=[Required(), Length(min=26)], description='Address') <NEW_LINE> amount = IntegerField(validators=[Required(), NumberRange(min=5000, max=2100000000000000)], description='Amount') | Wallet send form. | 62598ee932920d7e50bc4733 |
class next(unittest.TestCase): <NEW_LINE> <INDENT> def test_hasNext(self): <NEW_LINE> <INDENT> expected = 1 <NEW_LINE> item = 2 <NEW_LINE> l = KaoList([item, expected]) <NEW_LINE> self.assertEqual(expected, l.next(item)) <NEW_LINE> <DEDENT> def test_noItem(self): <NEW_LINE> <INDENT> item = 2 <NEW_LINE> l = KaoList() <N... | Test cases of next | 62598ee956ac1b37e63008f4 |
class TestCollection(base.BaseCollection): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def _get_message(): <NEW_LINE> <INDENT> return proto_pb2.TestCollection() | Image collection protocol buffer transformer. | 62598ee91f037a2d8b9e280e |
class Statemachine(object): <NEW_LINE> <INDENT> def __init__(self, item, item_state_attr, init_state=None, request=None): <NEW_LINE> <INDENT> self._item = item <NEW_LINE> self._item_state_attr = item_state_attr <NEW_LINE> self._request = request <NEW_LINE> self._root = self.setup() <NEW_LINE> self._current = self._root... | A state machine, is a mathematical model of computation used to
design sequential logic circuits for items of a module. It is
conceived as an abstract machine that can be in one of a finite
number of states. The machine is in only one state at a time; the
state it is in at any given time is called the current state. I... | 62598ee91b99ca400228e891 |
class LOAD_BUILD_CLASS(StackInstruction): <NEW_LINE> <INDENT> n_push = 1 | Pushes builtins.__build_class__() onto the stack. It is later called by
CALL_FUNCTION to construct a class. | 62598ee9fff4ab517ebcbede |
class DescribeCCSelfDefinePolicyResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Total = None <NEW_LINE> self.Policys = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Total = params.get("Total") <NEW_LINE> if pa... | DescribeCCSelfDefinePolicy response structure.
| 62598ee992d797404e387efe |
class EnvCanadaOilExcelFile(object): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.wb = load_workbook(self.name, data_only=True) <NEW_LINE> self.wb.get_sheet_names() <NEW_LINE> self.db_sheet = self.wb.get_sheet_by_name('Database') <NEW_LINE> self.col_indexes = self._... | A specialized file reader for the Environment Canada oil spreadsheet.
- This is an Excel spreadsheet with an .xlsx extension. We can use
the third party openpyxl package to reach the content.
- The first column in the file contains the names of oil property
categories.
- The second column in the file contains the ... | 62598ee967a9b606de5446d5 |
class TensorPortWithDefault(TensorPort): <NEW_LINE> <INDENT> def __init__(self, default_value, dtype, shape, name, doc_string=None, shape_string=None): <NEW_LINE> <INDENT> self.default_value = default_value <NEW_LINE> super().__init__(dtype, shape, name, doc_string=doc_string, shape_string=shape_string) <NEW_LINE> <DED... | TensorPort that also defines a default value. | 62598ee98e7ae83300ee7796 |
@functools.total_ordering <NEW_LINE> class _lt: <NEW_LINE> <INDENT> __slots__ = ['_source'] <NEW_LINE> def __init__(self, source): <NEW_LINE> <INDENT> self._source = source <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return _._get_translation(self._source) <NEW_LINE> <DEDENT> def __eq__(self, other): <NE... | Lazy code translation
Similar to GettextAlias but the translation lookup will be done only at
__str__ execution.
A code using translated global variables such as:
LABEL = _lt("User")
def _compute_label(self):
context = {'lang': self.partner_id.lang}
self.user_label = LABEL
works as expected (unlike the cla... | 62598ee967a9b606de5446d6 |
class DummyObject(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> for k, v in kwargs.items(): <NEW_LINE> <INDENT> if not k.startswith('_'): <NEW_LINE> <INDENT> setattr(self, k, v) | Generic object for testing. | 62598ee9435de62698e9a4dc |
class LanguageLoop(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(LanguageLoop, self).__init__() <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def next(item: Language): <NEW_LINE> <INDENT> if item == Language.EN: <NEW_LINE> <INDENT> return Language.DE <NEW_LINE> <DEDENT> elif item == Language... | LanguageLoop Class. | 62598ee960cbc95b06362a44 |
class GuiHandler(QObject, logging.Handler): <NEW_LINE> <INDENT> message = Signal(str) <NEW_LINE> def __init__(self, level=logging.NOTSET, parent=None): <NEW_LINE> <INDENT> logging.Handler.__init__(self, level=level) <NEW_LINE> QObject.__init__(self, parent=parent) <NEW_LINE> <DEDENT> def emit(self, record): <NEW_LINE> ... | Handler for PyDM Applications
A composite of a QObject and a logging handler. This can be added to a
``logging.Logger`` object just like any standard ``logging.Handler`` and
will emit logging messages as Signals
.. code:: python
# Create a log and GuiHandler
logger = logging.getLogger()
ui_handler = GuiH... | 62598ee9627d3e7fe0e05591 |
class Html5libParser(HTMLParser, IParser): <NEW_LINE> <INDENT> defaults = {'etree': ElementTree} <NEW_LINE> def __init__(self, api='etree'): <NEW_LINE> <INDENT> implementation = self.defaults.get(api, None) <NEW_LINE> HTMLParser.__init__(self, tree=treebuilders.getTreeBuilder(api, implementation)) <NEW_LINE> <DEDENT> d... | Parser using html5lib.
Note that it is not available on every systems. | 62598ee9097d151d1a2bf723 |
class survey_ExportResponses(S3Method): <NEW_LINE> <INDENT> def apply_method(self, r, **attr): <NEW_LINE> <INDENT> if r.representation != "xls": <NEW_LINE> <INDENT> r.error(501, current.error.BAD_FORMAT) <NEW_LINE> <DEDENT> series_id = self.record_id <NEW_LINE> if series_id is None: <NEW_LINE> <INDENT> r.error(405, cur... | Download all responses in a Spreadsheet | 62598ee9e76e3b2f99fd713e |
class OSC(object): <NEW_LINE> <INDENT> MINUTELY = 1 <NEW_LINE> HOURLY = 2 <NEW_LINE> DAYLY = 3 <NEW_LINE> replication_name = { 1: "minute", 2: "hour", 3: "day" } <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._periodicty = self.HOURLY <NEW_LINE> <DEDENT> @property <NEW_LINE> def periodicty(self): <NEW_LINE> <I... | To manage the the OSM changes files | 62598ee96e29344779afed3c |
class PyPLS(object): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> options = self._get_options() <NEW_LINE> sources = 0 <NEW_LINE> total_errors = 0 <NEW_LINE> total_files = 0 <NEW_LINE> total_size = 0 <NEW_LINE> total_start = time.time() <NEW_LINE> for source in options.playlist: <NEW_LINE> <INDENT> sources +=... | Playlist stats calculator main class | 62598ee90c0af96317c54aa4 |
class Mock(object): <NEW_LINE> <INDENT> schema = { 'type': 'array', 'items': { 'type': 'object', 'properties': { 'title': {'type': 'string'}, 'url': {'type': 'string'} }, 'required': ['title'] } } <NEW_LINE> def on_task_input(self, task, config): <NEW_LINE> <INDENT> entries = [] <NEW_LINE> for line in config: <NEW_LINE... | Allows adding mock input entries.
Example::
mock:
- {title: foobar, url: http://some.com }
- {title: mock, url: http://another.com }
If url is not given a random url pointing to localhost will be generated. | 62598ee97cff6e4e811b40f6 |
class CustomUser(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> email = models.EmailField(_('email address'), unique=True) <NEW_LINE> is_staff = models.BooleanField(default=False) <NEW_LINE> is_superuser = models.BooleanField(default=False) <NEW_LINE> is_active = models.BooleanField(default=True) <NEW_LINE> d... | User additional information | 62598ee97d847024c075aad6 |
class TestPersistentSessionWrapper(TestCase): <NEW_LINE> <INDENT> def test_savorSessionCookie(self): <NEW_LINE> <INDENT> request = FakeRequest(headers={'host': 'example.com'}) <NEW_LINE> resource = PersistentSessionWrapper( None, None, domains=['example.org', 'example.com']) <NEW_LINE> resource.savorSessionCookie(reque... | Tests for L{PersistentSessionWrapper}. | 62598ee9e5267d203ee6a00e |
class ColorTheme(object): <NEW_LINE> <INDENT> def get_accent(self, index): <NEW_LINE> <INDENT> raise NotImplementedError() | interface | 62598ee955399d3f05624c3d |
class CloudBuildGrpcTransport(object): <NEW_LINE> <INDENT> _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) <NEW_LINE> def __init__( self, channel=None, credentials=None, address="cloudbuild.googleapis.com:443" ): <NEW_LINE> <INDENT> if channel is not None and credentials is not None: <NEW_LINE> <IND... | gRPC transport class providing stubs for
google.devtools.cloudbuild.v1 CloudBuild API.
The transport provides access to the raw gRPC stubs,
which can be used to take advantage of advanced
features of gRPC. | 62598ee93c8af77a43b672b8 |
class TestFragmentEngineCython(TestFragmentEnginePython): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.FragmentEngine = magma.fragmentation_cy.FragmentEngine | Run test with cython version of FragmentEngine | 62598ee9090684286d592a65 |
class Channel(AWSProperty): <NEW_LINE> <INDENT> props: PropsDictType = { "channelId": (str, False), "channelUri": (str, True), } | `Channel <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codeguruprofiler-profilinggroup-channel.html>`__ | 62598ee923849d37ff84f7bf |
class BertTextMatchTwoTower(BaseTextMatch): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(BertTextMatchTwoTower, self).__init__(**kwargs) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def get_input_tensor_schema(): <NEW_LINE> <INDENT> return "input_ids_a:int:64,input_mask_a:int:64,segment_i... | Text Match model based on BERT-like pretrained models, Two tower for learning embeddings
.. highlight:: python
.. code-block:: python
default_param_dict = {
"pretrain_model_name_or_path": "pai-bert-base-zh",
"num_labels": 2
} | 62598ee94527f215b58e8610 |
class Region(Base, DBObject): <NEW_LINE> <INDENT> id = Column(Integer, primary_key=True) <NEW_LINE> name = Column(Unicode, nullable=False, unique=True) <NEW_LINE> @classmethod <NEW_LINE> def create_new(cls, name): <NEW_LINE> <INDENT> return cls(name=name) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def by_name(cls, nam... | Represents a "Region" a group of hosts with good connectivity | 62598ee9a79ad16197768725 |
class Extension(mixins.ConfigObject, mixins.TranslatorObject): <NEW_LINE> <INDENT> __TRANSLATOR_METHODS__ = ['init', 'initPage', 'preExecute', 'postExecute', 'preRead', 'postRead', 'preTokenize', 'postTokenize', 'preRender', 'postRender', 'preWrite', 'postWrite'] <NEW_LINE> @staticmethod <NEW_LINE> def defaultConfig():... | Base class for creating extensions. An extension is simply a mechanism to allow for
the creation of reader/renderer components to be added to the translation process.
All aspects of the MooseDocs system rely on Extension objects. These extensions are passed
to the Translator object. The translator calls the extend met... | 62598ee9167d2b6e312b56a2 |
class ClassType(vocab_element.VocabElement, metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> def __eq__(self, other) -> bool: <NEW_LINE> <INDENT> return ( isinstance(other, ClassType) and other.index == self.index and other.name == self.name ) <NEW_LINE> <DEDENT> def __hash__(self) -> int: <NEW_LINE> <INDENT> return self.in... | Instances of ``ClassType`` specify a particular class that is used in a knowledge graph. | 62598ee94428ac0f6e656c5b |
class SetPresetMergeModeWithNoData(TestMixins.SetWithNoDataMixin, OptionalParameterTestFixture): <NEW_LINE> <INDENT> PID = 'PRESET_MERGEMODE' | Set PRESET_MERGEMODE without any data. | 62598ee9e64d504609df8743 |
@gin.configurable <NEW_LINE> class SimpleNormalRecommender(recommender.BaseRecommender): <NEW_LINE> <INDENT> def __init__(self, config, slate_doc_means = None, normal_scale = 0.5): <NEW_LINE> <INDENT> recommender.BaseRecommender.__init__(self, config) <NEW_LINE> self._num_topics = config['num_topics'] <NEW_LINE> if sla... | A recommender recommends normally distributed documents. | 62598ee95fdd1c0f98e5c6ab |
class GetPublicResourcesRequest(APIRequest): <NEW_LINE> <INDENT> url = "https://cloud-api.yandex.net/v1/disk/resources/public" <NEW_LINE> method = "GET" <NEW_LINE> def __init__(self, session, offset=0, limit=20, preview_size=None, preview_crop=None, type=None, fields=None, **kwargs): <NEW_LINE> <INDENT> APIRequest.__in... | A request to get a list of public resources.
:param session: an instance of :any:`requests.Session` with prepared headers
:param offset: offset from the beginning of the list
:param limit: maximum number of elements in the list
:param preview_size: size of the file preview
:param preview_crop: `bool`, cut the preview ... | 62598ee991f36d47f2230228 |
class get_dashboard_grantees_args(object): <NEW_LINE> <INDENT> def __init__(self, session=None, dashboard_id=None,): <NEW_LINE> <INDENT> self.session = session <NEW_LINE> self.dashboard_id = dashboard_id <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(ipro... | Attributes:
- session
- dashboard_id | 62598ee910dbd63aa1c6f27e |
class TestComposeRawhideMashStart(Base): <NEW_LINE> <INDENT> expected_title = "compose.rawhide.mash.start" <NEW_LINE> expected_subti = "Started mashing Fedora Rawhide compose" <NEW_LINE> expected_objects = set(['rawhide/primary']) <NEW_LINE> msg = { "i": 1, "timestamp": 1344447839.891876, "topic": "org.fedoraproject.pr... | The `release engineering
<https://fedoraproject.org/wiki/ReleaseEngineering>`_ "compose" scripts
used to produce these messages when they
**started mashing**
the rawhide compose. They were published
for both primary and secondary architectures. The example here is of a
**primary** arch message (the empty string signif... | 62598ee967a9b606de5446d7 |
class FeedEndpointTestCase(TestCase): <NEW_LINE> <INDENT> maxDiff = None <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> Feed.objects.create( name='World Health Organization (WHO)', feed_url='https://www.who.int/feeds/entity/csr/don/en/rss.xml' ) <NEW_LINE> <DEDENT> def test_get(self): <NEW_LINE> <INDENT> response = se... | RSS Feed sources | 62598ee960cbc95b06362a47 |
class DOAJDepositAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ('id', 'article', 'identifier', 'date_time', 'success') <NEW_LINE> list_filter = ('article', 'article__journal', 'success') <NEW_LINE> search_fields = ('identifier', 'article__title') <NEW_LINE> ordering = ('-date_time',) | Displays objects in the Django admin interface. | 62598ee9b7558d5895461d4f |
class Block(abc.ABC): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.grad_cache = {} <NEW_LINE> self.training_mode = True <NEW_LINE> <DEDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> return self.forward(*args, **kwargs) <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def forward(sel... | A block is some computation element in a network architecture which
supports automatic differentiation using forward and backward functions. | 62598ee95fcc89381b2654ab |
class Cliente(models.Model): <NEW_LINE> <INDENT> persona = models.OneToOneField(Person) <NEW_LINE> direccion = models.CharField(max_length=50, blank=True) <NEW_LINE> ciudad = models.CharField(max_length=50, blank=True) <NEW_LINE> email = models.EmailField('E-mail', blank=True) <NEW_LINE> telefono = models.IntegerField(... | Modelo Cliente. | 62598ee93d592f4c4edb9600 |
class Location(object): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.name = None <NEW_LINE> if 'name' in kwargs: <NEW_LINE> <INDENT> self.name = kwargs['name'] <NEW_LINE> <DEDENT> self.local_ip_address = None <NEW_LINE> if 'local_ip_address' in kwargs: <NEW_LINE> <INDENT> self.local_ip_add... | The location model that includes network information. | 62598ee90c0af96317c54aa6 |
class Definition(namedtuple('Definition', [ 'nunja_model_id', 'uri_template', 'uri_template_json', 'uri_template_tmpl', 'uri_template_json_tmpl', 'css_class', 'config', 'context', ])): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> def __new__( cls, nunja_model_id, uri_template, uri_template_json=None, json_cache_suffix... | A frozen definition for the construction of the model/schema.
nunja_model_id
The id of the element - will be persisted into the template
as the id for the container node. This should be equivalent to
xml:id (i.e. unique across all resource(s) provided at a given
URI/IRI).
uri_template
This is the... | 62598ee9d486a94d0ba2a6d8 |
class EmbeddedSkipList(AuthSkipList): <NEW_LINE> <INDENT> nodeclass = EmbeddedNode <NEW_LINE> def from_elem(self, elem): <NEW_LINE> <INDENT> key = sha256(elem.serialize()).digest() <NEW_LINE> candidates = self.conn.scan(self.table, Range(srow=key, erow=key)) <NEW_LINE> try: <NEW_LINE> <INDENT> first = next(candidates) ... | A class for an authenticated skip list embedded in an Accumulo
instance. Most of the work on the actual embedding is in the
node class, found in embeddednode.py | 62598ee95fdd1c0f98e5c6ac |
class UserInfoSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> cluster = serializers.SerializerMethodField('number_of_clusters') <NEW_LINE> escience_token = serializers.RelatedField() <NEW_LINE> id = serializers.SerializerMethodField('get_ember_id') <NEW_LINE> clusters = ClusterInfoSerializer(many=True) <NE... | Serializer for UserInfo object with cluster and escience_token
added fields. | 62598ee92c8b7c6e89bd1ecb |
class TestConditions(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 testConditions(self): <NEW_LINE> <INDENT> pass | Conditions unit test stubs | 62598ee971ff763f4b5e5e67 |
class CTD_ANON_35 (pyxb.binding.basis.complexTypeDefinition): <NEW_LINE> <INDENT> _TypeDefinition = None <NEW_LINE> _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY <NEW_LINE> _Abstract = False <NEW_LINE> _ExpandedName = None <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('/mnt/work/Bl... | Angular velocity about the Y axis | 62598ee956b00c62f0fb0fdb |
class V1NonResourceRule(object): <NEW_LINE> <INDENT> openapi_types = { 'non_resource_urls': 'list[str]', 'verbs': 'list[str]' } <NEW_LINE> attribute_map = { 'non_resource_urls': 'nonResourceURLs', 'verbs': 'verbs' } <NEW_LINE> def __init__(self, non_resource_urls=None, verbs=None, local_vars_configuration=None): <NEW_L... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598ee9379a373c97d97700 |
class CreateBackup(show.ShowOne): <NEW_LINE> <INDENT> log = logging.getLogger(__name__ + '.CreateBackup') <NEW_LINE> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(CreateBackup, self).get_parser(prog_name) <NEW_LINE> parser.add_argument( 'volume', metavar='<volume>', help='The name or ID of the vol... | Create backup command | 62598ee92ae34c7f260a97f2 |
class AgencyEndpoint(BaseMuckRockClient, BaseEndpointMixin): <NEW_LINE> <INDENT> endpoint = "agency" <NEW_LINE> def filter( self, name=None, status=None, jurisdiction_id=None, requires_proxy=None ): <NEW_LINE> <INDENT> params = {} <NEW_LINE> if name: <NEW_LINE> <INDENT> params['name'] = name <NEW_LINE> <DEDENT> if stat... | Methods for collecting agencies. | 62598ee932920d7e50bc4736 |
class MovingSkipsAtQuality(MovingMetric): <NEW_LINE> <INDENT> def __init__( self, scores_higher_is_better=False, labels_higher_is_better=False ): <NEW_LINE> <INDENT> self.scores_higher_is_better = scores_higher_is_better <NEW_LINE> self.labels_higher_is_better = labels_higher_is_better <NEW_LINE> <DEDENT> def eval(self... | Computes Quality of skipped examples vs fraction of skips.
| 62598ee94428ac0f6e656c5e |
class OrderPoints(object): <NEW_LINE> <INDENT> def __init__(self, nIter=500000, minTemp=1.0e-9, nToPrint=0): <NEW_LINE> <INDENT> self.nIter = int(nIter) <NEW_LINE> self.minTemp = float(minTemp) <NEW_LINE> self.nToPrint = int(nToPrint) <NEW_LINE> <DEDENT> def computeEnergy(self, azAltList): <NEW_LINE> <INDENT> absDiff =... | Reorder a collection of points so they can be traversed quickly.
To use:
- Construct an OrderPoints
- Call the object as a function with your list of points
Credits:
Thanks to Richard J. Wagner for the simulated annealing code
Largely copied from generateCMMData | 62598ee94f88993c371ef86c |
class SMPacketClientNSCGSR(SMPacket): <NEW_LINE> <INDENT> command = smcommand.SMClientCommand.NSCGSR <NEW_LINE> _payload = [ (smencoder.SMPayloadType.MSN, "first_player_feet", None), (smencoder.SMPayloadType.LSN, "second_player_feet", None), (smencoder.SMPayloadType.MSN, "first_player_difficulty", None), (smencoder.SMP... | Client command 003 (Game Start Request)
This command is called once after most loading is done, and again
immediately before the sound starts.
The server has to respond with a SMPacketServerNSCGSR, if not the
client will freeze.
:param int first_player_feet: Primary player feet (0 for no player)
:param int second_pl... | 62598ee94c342835776189ee |
class Popen(): <NEW_LINE> <INDENT> def __init__(self, args, log, queue='vshort', **kwargs): <NEW_LINE> <INDENT> self.pid = None <NEW_LINE> self.jobname = basename(args) <NEW_LINE> self._stdout = log + '.o' <NEW_LINE> self._stderr = log + '.e' <NEW_LINE> try: <NEW_LINE> <INDENT> remove(self._stdout) <NEW_LINE> <DEDENT> ... | Create a subprocess in the LSF cluster.
Parameters
----------
args : str
script to run
stdin=None
stdout=None
stderr=None,
shell=False,
cwd=None,
env=None
start_new_session=False
# any other parameters will probably mess up Popen
memlim : memory limit in MB
queue : vshort
Methods
-------
'args'
'communicate' ... | 62598ee97d847024c075aad9 |
class FakeGetBasicInfoResponse(object): <NEW_LINE> <INDENT> status = 'fackStatus' <NEW_LINE> def read(self): <NEW_LINE> <INDENT> return FAKE_RES_DETAIL_DATA_GETBASIC_INFO | Fake GetBasicInfo response. | 62598ee9e1aae11d1e7cdbc5 |
class Point(NamedTuple): <NEW_LINE> <INDENT> x: int <NEW_LINE> y: int <NEW_LINE> def __add__(self, other): <NEW_LINE> <INDENT> return Point(self.x + other.x, self.y + other.y) | 2D Point | 62598ee991f36d47f2230229 |
class _LoggerHook(tf.train.SessionRunHook): <NEW_LINE> <INDENT> def begin(self): <NEW_LINE> <INDENT> self._step = -1 <NEW_LINE> self._start_time = time.time() <NEW_LINE> self.loss=[] <NEW_LINE> <DEDENT> def before_run(self, run_context): <NEW_LINE> <INDENT> self._step += 1 <NEW_LINE> return tf.train.SessionRunArgs(loss... | Logs loss and runtime. | 62598ee907f4c71912badb60 |
class Residue(): <NEW_LINE> <INDENT> pdb = [] <NEW_LINE> atoms = dict() <NEW_LINE> def __init__(self, num, name): <NEW_LINE> <INDENT> self.num = int(num) <NEW_LINE> self.name = name <NEW_LINE> self.charges = [] <NEW_LINE> self.element = "unknown" <NEW_LINE> self.canonical = None <NEW_LINE> <DEDENT> def __str__(self): <... | The atoms belonging to the residue are stored within the dictionary
Residue.atoms, where individual atoms are accessed using their integer
values from the .pdb file as the key. | 62598ee98e7ae83300ee779a |
class Deprecated(BaseConfigOption): <NEW_LINE> <INDENT> def __init__(self, moved_to=None, message='', option_type=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.default = None <NEW_LINE> self.moved_to = moved_to <NEW_LINE> self.message = message or ( 'The configuration option {} has been deprecated and '... | Deprecated Config Option
Raises a warning as the option is deprecated. Uses `message` for the
warning. If `move_to` is set to the name of a new config option, the value
is moved to the new option on pre_validation. If `option_type` is set to a
ConfigOption instance, then the value is validated against that type. | 62598ee960cbc95b06362a48 |
@add_metaclass(ParametrizeTestsMeta) <NEW_LINE> class LidstoneBigramTests(unittest.TestCase): <NEW_LINE> <INDENT> score_tests = [ ("d", ["c"], 1.1 / 1.8), ("a", None, 2.1 / 14.8), ("z", None, 0.1 / 14.8), ("y", None, 3.1 / 14.8), ] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> vocab, training_text = _prepare_test_dat... | unit tests for Lidstone class | 62598ee9fff4ab517ebcbee2 |
class Response: <NEW_LINE> <INDENT> @property <NEW_LINE> def status(self): <NEW_LINE> <INDENT> return 200 <NEW_LINE> <DEDENT> async def json(self): <NEW_LINE> <INDENT> return { "data": [ { "attributes": { "count": 2, "enabled": True, "name": "testing", "response": { "action": False, "message": [ { "data": "testing!", "... | Fake API response. | 62598ee9627d3e7fe0e05595 |
class Url(ABC): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def compose(self) -> str: <NEW_LINE> <INDENT> pass | Represent the abstraction of url. | 62598ee9097d151d1a2bf727 |
@has_fields <NEW_LINE> class ExtensiblePresentation(Presentation): <NEW_LINE> <INDENT> @primitive_dict_field() <NEW_LINE> def _extensions(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @cachedmethod <NEW_LINE> def _get_extension(self, name, default=None): <NEW_LINE> <INDENT> extensions = self._extensions <NEW_LINE... | A presentation that supports an optional ``_extensions`` dict field. | 62598ee90a50d4780f703ab1 |
class CompositeGate: <NEW_LINE> <INDENT> def __init__(self, n_qubit=1): <NEW_LINE> <INDENT> self.n_qubit = n_qubit <NEW_LINE> self.sequence = [] <NEW_LINE> <DEDENT> def add_gate(self, gate, t0=None, dt=None, align='center'): <NEW_LINE> <INDENT> if not isinstance(gate, list): <NEW_LINE> <INDENT> gate = [gate] <NEW_LINE>... | Multiple gates in one object.
Parameters
----------
n_qubit : int
Number of qubits involved in the composite gate (the default is 1).
Attributes
----------
sequence : list of :obj:`BaseGate`
Holds the gates involved. | 62598ee9f548e778e5969c97 |
class ConfigParseTokenizer: <NEW_LINE> <INDENT> def text_to_blocks(self, text): <NEW_LINE> <INDENT> for line in text.splitlines(): <NEW_LINE> <INDENT> cleared_line = line.lstrip() <NEW_LINE> if cleared_line.startswith( ('name=', 'src=', 'dst=', 'opt=')): <NEW_LINE> <INDENT> yield cleared_line <NEW_LINE> <DEDENT> <DEDEN... | . | 62598ee9435de62698e9a4e1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.