code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class CommentDetailsSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> article = ArticleSerializer(read_only=True) <NEW_LINE> created_by = UserSerializer(read_only=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Comment <NEW_LINE> fields = ['id', 'article', 'created_by', 'edited', 'comment'] <NEW_LIN...
Comment Details serializer.
6259905d63b5f9789fe867a7
class applyPolicyToTarget_IDL_result(object): <NEW_LINE> <INDENT> thrift_spec = ((0, TType.I32, 'success', None, None), (1, TType.STRUCT, 'e', (Shared.ttypes.ExceptionIDL, Shared.ttypes.ExceptionIDL.thrift_spec), None)) <NEW_LINE> def __init__(self, success = None, e = None): <NEW_LINE> <INDENT> self.success = success ...
Attributes: - success - e
6259905d442bda511e95d874
class PatternMatchingPaths: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_inputs(cls): <NEW_LINE> <INDENT> num_patterns = int(input()) <NEW_LINE> pattern_group = PatternGroup() <NEW_LINE> for i in range(num_patterns): <NEW_LINE> <INDENT> pattern = cls.get_input_object(object_type=Pattern) <NEW_LINE> pattern_group...
Driver class for this project
6259905d3617ad0b5ee07781
class Location(object): <NEW_LINE> <INDENT> def is_equivalent(self, location): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> @property <NEW_LINE> def prefix(self): <NEW_LINE> <INDENT> return None
Base class for ARIA locations. Locations are used by :class:`~aria.parser.loading.LoaderSource` to delegate to an appropriate :class:`~aria.parser.loading.Loader`.
6259905d0a50d4780f7068d9
class StatsDiscipline(models.Model): <NEW_LINE> <INDENT> name = models.ForeignKey(Discipline, verbose_name=_('discipline')) <NEW_LINE> value = models.PositiveIntegerField(_('value'), default=0) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return '%s %s' % (self.name, self.value)
Represents the stats of disciplines.
6259905d3d592f4c4edbc511
class CheckFailure(CommandError): <NEW_LINE> <INDENT> pass
Exception raised when the predicates in :attr:`.Command.checks` have failed.
6259905d6e29344779b01c83
class Revision(models.Model): <NEW_LINE> <INDENT> doc = models.ForeignKey('Document', verbose_name="Document") <NEW_LINE> author = models.ForeignKey(settings.AUTH_USER_MODEL) <NEW_LINE> content = models.TextField() <NEW_LINE> created_on = models.DateTimeField(auto_now_add=True) <NEW_LINE> objects = RevisionQuerySet() <...
A revision for a document. Every time a document is edited, a new revision is created.
6259905d2ae34c7f260ac71c
class Point: <NEW_LINE> <INDENT> def __init__(self, initX, initY): <NEW_LINE> <INDENT> self.x = initX <NEW_LINE> self.y = initY <NEW_LINE> <DEDENT> def getX(self): <NEW_LINE> <INDENT> return self.x <NEW_LINE> <DEDENT> def getY(self): <NEW_LINE> <INDENT> return self.y <NEW_LINE> <DEDENT> def get_line_to(self, other): <N...
Point class for representing and manipulating x,y coordinates.
6259905dd268445f2663a677
class Third(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> chrome_driver = os.path.abspath(r"C:\Program Files (x86)\\Google\Chrome\\Application\chromedriver.exe") <NEW_LINE> os.environ["webdriver.chrome.driver"] = chrome_driver <NEW_LINE> self.driver = webdriver.Chrome(chrome_driver) <NEW_...
第三个链接
6259905d30dc7b76659a0d9b
@dependency.requires('federation_api') <NEW_LINE> class IdentityProvider(_ControllerBase): <NEW_LINE> <INDENT> collection_name = 'identity_providers' <NEW_LINE> member_name = 'identity_provider' <NEW_LINE> _mutable_parameters = frozenset(['description', 'enabled']) <NEW_LINE> _public_parameters = frozenset(['id', 'enab...
Identity Provider representation.
6259905d7d847024c075da07
class EnactScheduledChangeView(AdminView): <NEW_LINE> <INDENT> def __init__(self, namespace, table): <NEW_LINE> <INDENT> self.namespace = namespace <NEW_LINE> self.path = "/scheduled_changes/%s/:sc_id/enact" % namespace <NEW_LINE> self.table = table <NEW_LINE> self.sc_table = table.scheduled_changes <NEW_LINE> super(En...
/scheduled_changes/:namespace/:sc_id/enact
6259905db7558d5895464a47
class FtdiMpsseError(FtdiFeatureError): <NEW_LINE> <INDENT> pass
MPSSE mode not supported on FTDI device
6259905d379a373c97d9a65a
class ToTensorNormalize(object): <NEW_LINE> <INDENT> def __call__(self, sample): <NEW_LINE> <INDENT> image_tensor = sample['tensor'] <NEW_LINE> minX = image_tensor.min() <NEW_LINE> maxX = image_tensor.max() <NEW_LINE> image_tensor = (image_tensor - minX) / (maxX - minX) <NEW_LINE> image_tensor = image_tensor.max(axis=0...
Convert ndarrays in sample to Tensors.
6259905dbe8e80087fbc06ba
class Cmd(BaseCmd): <NEW_LINE> <INDENT> name = 'provides' <NEW_LINE> help_text = ("find what upkg provides what file") <NEW_LINE> def build(self): <NEW_LINE> <INDENT> return super(Cmd, self).build()
Docstring for Search
6259905d8da39b475be0481c
class EmailMessageComponent(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.email_account_messages_id = None <NEW_LINE> self.component_type = None <NEW_LINE> self.component_value = None
@summary: Entity class to store the individual email message component such as from,to,body of the email message.
6259905d4e4d562566373a3d
class AIDemand(object): <NEW_LINE> <INDENT> def __init__(self, aiDemandType, aiTargetType, aiTargetID, amount): <NEW_LINE> <INDENT> aiTarget = AITarget(aiTargetType, aiTargetID) <NEW_LINE> self.__aiTarget = aiTarget <NEW_LINE> self.__aiDemandType = aiDemandType <NEW_LINE> self.__amount = amount <NEW_LINE> <DEDENT> def ...
encapsulate AI demand
6259905dd53ae8145f919a97
class Joypad(iMemory): <NEW_LINE> <INDENT> def __init__(self, joypad_driver, interrupt): <NEW_LINE> <INDENT> assert isinstance(joypad_driver, JoypadDriver) <NEW_LINE> assert isinstance(interrupt, Interrupt ) <NEW_LINE> self.driver = joypad_driver <NEW_LINE> self.interrupt = interrupt <NEW_LINE> self.reset() <NEW_LINE> ...
PyBoy GameBoy (TM) Emulator Joypad Input
6259905da79ad1619776b5d8
class DotAttention(BaseAttention): <NEW_LINE> <INDENT> def __init__(self, key_emb_size: int, ctxt_emb_size: int, num_labels: int): <NEW_LINE> <INDENT> super(DotAttention, self).__init__( input_emb_size=ctxt_emb_size, key_emb_size=key_emb_size, output_emb_size=key_emb_size ) <NEW_LINE> self.ctxt_emb_size = ctxt_emb_size...
This computes attention values based on dot products for scores. This class computes num_label attention distributions, one for each label, however the projection network share parameters. Note that the weight in proj_to_label_namespace corresponds to the key for each label. Arguments: key_emb_size (int): The vec...
6259905d7d847024c075da08
class NodesNotAvailable(NodeStateViolation): <NEW_LINE> <INDENT> api_error = httplib.CONFLICT
Requested node(s) are not available to be acquired.
6259905d4f6381625f199fbd
class Editor: <NEW_LINE> <INDENT> document: document.Document <NEW_LINE> drawing: drawing.Drawing <NEW_LINE> _clients: Dict[str, Tuple[str, str]] <NEW_LINE> _colors: List[str] <NEW_LINE> _color_index: int <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.document = document.Document() <NEW_LINE> self.drawing = dr...
Class representing a collaborate-code editor. Instance Attributes: - document: the text document of the editor - drawing: the drawing of the editor
6259905d460517430c432b6d
class Symbol(Expr): <NEW_LINE> <INDENT> __slots__ = '_hash', '_name', 'dshape', '_token' <NEW_LINE> __inputs__ = () <NEW_LINE> def __init__(self, name, dshape, token=None): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> if isinstance(dshape, _strtypes): <NEW_LINE> <INDENT> dshape = datashape.dshape(dshape) <NEW_LINE>...
Symbolic data. The leaf of a Blaze expression Example ------- >>> points = symbol('points', '5 * 3 * {x: int, y: int}')
6259905d32920d7e50bc767d
class SpecMachine(CarBase): <NEW_LINE> <INDENT> def __init__(self, car_type, brand, photo_file_name, carrying, extra): <NEW_LINE> <INDENT> super().__init__(car_type, brand, photo_file_name, carrying) <NEW_LINE> self.extra = extra
Special machine class
6259905d07f4c71912bb0a73
class Validator(GenericValidator): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.regexp = re.compile(r'^\d{2,10}$') <NEW_LINE> <DEDENT> def validate(self, vat_number): <NEW_LINE> <INDENT> if super(Validator, self).validate(vat_number) is False: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> vat...
For rules see /docs/VIES-VAT Validation Routines-v15.0.doc
6259905d442bda511e95d875
class Complex(FSLCommand): <NEW_LINE> <INDENT> _cmd = 'fslcomplex' <NEW_LINE> input_spec = ComplexInputSpec <NEW_LINE> output_spec = ComplexOuputSpec <NEW_LINE> def _parse_inputs(self, skip=None): <NEW_LINE> <INDENT> if skip == None: <NEW_LINE> <INDENT> skip = [] <NEW_LINE> <DEDENT> if self.inputs.real_cartesian: <NEW_...
fslcomplex is a tool for converting complex data Examples -------- >>> cplx = Complex() >>> cplx.inputs.complex_in_file = "complex.nii" >>> cplx.real_polar = True >>> res = cplx.run() # doctest: +SKIP
6259905d627d3e7fe0e084c2
class Attachment: <NEW_LINE> <INDENT> __name__ = "ir.attachment" <NEW_LINE> def _json(self): <NEW_LINE> <INDENT> rv = { 'create_date': self.create_date.isoformat(), "objectType": self.__name__, "id": self.id, "updatedBy": self.uploaded_by._json(), "displayName": self.name, "description": self.description, } <NEW_LINE> ...
Ir Attachment
6259905d99cbb53fe6832517
class TestFeature3(BaseFeature): <NEW_LINE> <INDENT> LABELS = None <NEW_LINE> ATTRIBUTES = None
Some example doc string. References ---------- Doe, J. Nature. (2016). Smith, J. Science. (2010). Other ----- Something else.
6259905de64d504609df9eea
class MaxSizeStringIO(StringIO): <NEW_LINE> <INDENT> def __init__(self, max_size=None, buffer=None): <NEW_LINE> <INDENT> args = [] <NEW_LINE> if buffer is not None: <NEW_LINE> <INDENT> args.append(buffer) <NEW_LINE> <DEDENT> StringIO.__init__(self, *args) <NEW_LINE> self.__max_size = max_size <NEW_LINE> <DEDENT> def wr...
raises a MemoryError when trying to write more than max size
6259905d2ae34c7f260ac71e
class BaseModel(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_json(cls, json_str): <NEW_LINE> <INDENT> return cls.from_dict(json.loads(json_str)) <NEW_LINE> <DEDENT> def to_json(self): <NEW_LINE> <INDENT> return json.dumps(self.to_dict()) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_dict(cls, da...
Superclass responsible for converting json data to/from model
6259905d99cbb53fe6832518
class ConstructFlowEcho(Flow): <NEW_LINE> <INDENT> def constructor(self, data: dict) -> list: <NEW_LINE> <INDENT> arg_string = " ".join(f"-{key} {val}" for (key, val) in data.items()) <NEW_LINE> final_string = [f"ls {arg_string}"] <NEW_LINE> return final_string
This will construct bash script to run Echo command
6259905d7d847024c075da09
class ObjectGroupRight(APIBaseID): <NEW_LINE> <INDENT> relatedObject = fields.EmbeddedField(APIBase) <NEW_LINE> relatedGroup = fields.EmbeddedField(APIBase) <NEW_LINE> relatedRights= fields.ListField(APIBase)
relations between object, group and right (permission)
6259905db7558d5895464a48
class FunctionInstance(AcquisitionFunction.FunctionInstance): <NEW_LINE> <INDENT> def __init__(self, model, desired_extremum, incumbent_cost, xi): <NEW_LINE> <INDENT> super().__init__(model, desired_extremum) <NEW_LINE> self.incumbent_cost = incumbent_cost <NEW_LINE> self.xi = xi <NEW_LINE> self.scale_factor = 1 if des...
Expected Improvement Acquisition function Expected Improvement is related to probability of improvement in that they both compare points with the incumbent (best) trial, making them both improvement based acquisition functions. However EI is vastly superior to PI (which unlike EI is prone to over exploitation and not ...
6259905d55399d3f05627b57
class TestRecombinationError(TestLowLevelSimulate): <NEW_LINE> <INDENT> def test_bad_types(self): <NEW_LINE> <INDENT> self._recombination_probabilities = {} <NEW_LINE> self.assertRaises(TypeError, self.simulate) <NEW_LINE> self._recombination_probabilities = None <NEW_LINE> self.assertRaises(TypeError, self.simulate) <...
Test the list of recombination probabilities to see if bad arguments are caught correctly.
6259905dadb09d7d5dc0bba2
class SlotRegistrationNo(AbsParking): <NEW_LINE> <INDENT> name = "slot_number_for_registration_number" <NEW_LINE> def __init__(self, args): <NEW_LINE> <INDENT> self.registration_no = args[1] <NEW_LINE> <DEDENT> def execute(self, parking_lot=None): <NEW_LINE> <INDENT> for index, slot in enumerate(parking_lot.slots): <NE...
class to leave a particular parking slot
6259905d4e4d562566373a3f
class Gravatar(object): <NEW_LINE> <INDENT> def __init__(self, app=None, size=100, rating='g', default='retro', force_default=False, force_lower=False, use_ssl=False, base_url=None, **kwargs): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> self.rating = rating <NEW_LINE> self.default = default <NEW_LINE> self.force_de...
Simple object for create gravatar link. gravatar = Gravatar(app, size=100, rating='g', default='retro', force_default=False, force_lower=False, use_ssl=False, ...
6259905da79ad1619776b5d9
class CSVModel: <NEW_LINE> <INDENT> fields = {'ID':None,'Password':None,'Text':None} <NEW_LINE> def __init__(self, saved_data): <NEW_LINE> <INDENT> self.saved_data = saved_data <NEW_LINE> self.load_data = {}
CSV Storage
6259905d460517430c432b6e
class Greeter(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def SayHello(request, target, options=(), channel_credentials=None, call_credentials=None, compression=None, wait_for_ready=None, timeout=None, metadata=None): <NEW_LINE> <INDENT> return grpc.experimental.unary_unary(request, target, '/proto.Greeter/Sa...
The greeter service definition.
6259905dfff4ab517ebcee5d
class HazardDetectionLight(CloudMsg): <NEW_LINE> <INDENT> class Request(CloudRequest): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.imageFilepath = '' <NEW_LINE> super(HazardDetectionLight.Request, self).__init__(**kwargs) <NEW_LINE> <DEDENT> def make_payload(self): <NEW_LINE> <INDENT> ret...
Hazard Detection Light Check Cloud Message object
6259905dbaa26c4b54d508de
class MarketingViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> api_name = 'marketing' <NEW_LINE> queryset = Marketing.objects.all() <NEW_LINE> serializer_class = MarketingSerializer <NEW_LINE> permission_classes = (AllowAny,) <NEW_LINE> renderer_classes = [r.CSVRenderer, ] + api_settings.DEFAULT_RENDERER_CLASSES
the marketing view
6259905d1b99ca4002290053
class SrcImplicit(TestSystem): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> TestSystem.__init__(self, **kwargs) <NEW_LINE> pdb_filename = get_data_filename("data/src-implicit/1yi6-minimized.pdb") <NEW_LINE> pdbfile = app.PDBFile(pdb_filename) <NEW_LINE> forcefields_to_use = ['amber99sbildn.xml'...
Src kinase in implicit AMBER 99sb-ildn with OBC GBSA solvent. Examples -------- >>> src = SrcImplicit() >>> system, positions = src.system, src.positions
6259905d07f4c71912bb0a74
class UpdateModelMixin(object): <NEW_LINE> <INDENT> def update(self, request, *args, **kwargs): <NEW_LINE> <INDENT> partial = kwargs.pop('partial', False) <NEW_LINE> self.object = self.get_object_or_none() <NEW_LINE> if self.object is None: <NEW_LINE> <INDENT> created = True <NEW_LINE> save_kwargs = {'force_insert': Tr...
Update a model instance.
6259905da8370b77170f1a06
class PresenceAnalyzerUtilsTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> main.app.config.update({'DATA_CSV': TEST_DATA_CSV}) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_get_data(self): <NEW_LINE> <INDENT> data = utils.get_data() <...
Utility functions tests.
6259905d8e7ae83300eea6c6
class TwitterScraper(twitter.Api): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> super().__init__(consumer_key=config['consumer_key'], consumer_secret=config['consumer_secret_key'], access_token_key=config['access_token'], access_token_secret=config['access_token_secret']) <NEW_LINE> self._sconfig...
Scraps twitter for disaster information. Stores any information in a database.
6259905d4428ac0f6e659b76
class IFeaturedListingsTile(IBaseCollectionTile): <NEW_LINE> <INDENT> directives.order_before(content_uid='*') <NEW_LINE> content_uid = schema.Choice( required=True, source=CatalogSource( object_provides=IFeaturedListings.__identifier__, path={ 'query': [''], 'depth': -1, }, ), title=_(u'Select an existing featured lis...
Configuration schema for a featured listings collection.
6259905d01c39578d7f14253
class SqlCreateOptions(usage.Options): <NEW_LINE> <INDENT> synopsis = '[options] <file>' <NEW_LINE> optFlags = [ ['dump', 'd', 'dump SQL scripts to standrad output'], ['live', 'l', 'live changes to the databse using database config file'] ] <NEW_LINE> def parseArgs(self, file=None): <NEW_LINE> <INDENT> if file is None:...
Sql Create options for mamba-admin tool
6259905d3c8af77a43b68a5d
class IOOptions(_object): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, IOOptions, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, IOOptions, name) <NEW_LINE> __repr__ = _swig_repr <NEW...
Proxy of C++ pythonapi::IOOptions class.
6259905d2c8b7c6e89bd4e27
class VBRAINSDemonWarp(SlicerCommandLine): <NEW_LINE> <INDENT> input_spec = VBRAINSDemonWarpInputSpec <NEW_LINE> output_spec = VBRAINSDemonWarpOutputSpec <NEW_LINE> _cmd = " VBRAINSDemonWarp " <NEW_LINE> _outputs_filenames = {'outputVolume':'outputVolume.nii','outputCheckerboardVolume':'outputCheckerboardVolume.nii','o...
title: Vector Demon Registration (BRAINS) category: Registration description: This program finds a deformation field to warp a moving image onto a fixed image. The images must be of the same signal kind, and contain an image of the same kind of object. This program uses the Thirion Demons warp software in ITK,...
6259905d462c4b4f79dbd03f
class BayesianLogisticRegression(Variational_Loss): <NEW_LINE> <INDENT> def __init__(self, D, hdim_mean, hdim_var, b): <NEW_LINE> <INDENT> super().__init__(D, hdim_mean, hdim_var, b) <NEW_LINE> self.optimizer_mean_0 = optim.Adam(self.nn_mean_0.parameters(),lr=1e-2) <NEW_LINE> self.optimizer_mean_1 = optim.Adam(self.nn_...
Bayesian Logistic Regressor. Parameters: D (int) - number of features (dimension of the input data), which corresponds to the input and output dimension of the Neural Networks. hdim_mean (int) - dimension of the hidden layer for the Neural Networks that compute the mean vector (weights). ...
6259905d004d5f362081fb0b
class WANTestConfigParser(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.config = ConfigParser.RawConfigParser() <NEW_LINE> self.config.read('../tmp/wantest.ini') <NEW_LINE> self.ip_addresses = self.config.get('ping', 'ip_addresses') <NEW_LINE> self.domain_names = self.config.get('nslookup', ...
Parses the WANTest configuration file wantest.ini.
6259905d7d847024c075da0b
class BaseEstimator(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def _get_param_names(cls): <NEW_LINE> <INDENT> from inspect import signature <NEW_LINE> init = getattr(cls.__init__, 'deprecated_original', cls.__init__) <NEW_LINE> if init is object.__init__: <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> init...
Base class for all estimators in scikit-learn Notes ----- All estimators should specify all the parameters that can be set at the class level in their ``__init__`` as explicit keyword arguments (no ``*args`` or ``**kwargs``).
6259905d16aa5153ce401b1d
class ProvisionSchedule(Base, ProvisionFormButtonMixin): <NEW_LINE> <INDENT> _when_to_provision_radio_locator = ( By.CSS_SELECTOR, "input[name='schedule__schedule_type']") <NEW_LINE> _power_on_checkbox_locator = (By.ID, "schedule__vm_auto_start") <NEW_LINE> _retirement_select_locator = (By.ID, "schedule__retirement") <...
Provision wizard - Schedule tab
6259905d3cc13d1c6d466d7a
class ForeignDataWrapper(DbObjectWithOptions): <NEW_LINE> <INDENT> objtype = "FOREIGN DATA WRAPPER" <NEW_LINE> single_extern_file = True <NEW_LINE> @property <NEW_LINE> def allprivs(self): <NEW_LINE> <INDENT> return 'U' <NEW_LINE> <DEDENT> def to_map(self, no_owner, no_privs): <NEW_LINE> <INDENT> wrapper = self._base_m...
A foreign data wrapper definition
6259905d7d847024c075da0c
class MPISlave(MPIBatchWorker): <NEW_LINE> <INDENT> def __init__(self, estimator, scorer, fit_params): <NEW_LINE> <INDENT> super(MPISlave, self).__init__(estimator, scorer, fit_params) <NEW_LINE> <DEDENT> def _run_grid_search(self): <NEW_LINE> <INDENT> self._data_X, self._data_y = comm.bcast(None, root=0) <NEW_LINE> wo...
Receives task from root node and sends results back
6259905d9c8ee82313040ca7
class CT_HdrFtr(BaseOxmlElement): <NEW_LINE> <INDENT> p = ZeroOrMore('w:p', successors=()) <NEW_LINE> tbl = ZeroOrMore('w:tbl', successors=())
`w:hdr` and `w:ftr`, the root element for header and footer part respectively
6259905dac7a0e7691f73b1c
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 an email address') <NEW_LINE> <DEDENT> email = self.normalize_email(email) <NEW_LINE> user = self.model(email=email, na...
Manager for USER PROFILES
6259905d4f6381625f199fbf
class SettingsTestCase(ModoTestCase): <NEW_LINE> <INDENT> def test_get_settings(self): <NEW_LINE> <INDENT> url = reverse("core:parameters") <NEW_LINE> response = self.ajax_get(url) <NEW_LINE> for app in ["core", "admin", "limits"]: <NEW_LINE> <INDENT> self.assertIn('data-app="{}"'.format(app), response["content"]) <NEW...
Settings tests.
6259905d460517430c432b6f
class Position: <NEW_LINE> <INDENT> _CHRONO = 0 <NEW_LINE> @classmethod <NEW_LINE> def _Get_id(cls): <NEW_LINE> <INDENT> cls._CHRONO += 1 <NEW_LINE> return cls._CHRONO <NEW_LINE> <DEDENT> def __init__(self, x, y): <NEW_LINE> <INDENT> self._id = self._Get_id() <NEW_LINE> self._position = (x,y) <NEW_LINE> <DEDENT> def __...
Classe définissant une position pour un objet RoadItem
6259905d32920d7e50bc7680
class ListProject(CommandResource): <NEW_LINE> <INDENT> cmd_columns = _COMMAND_COLUMNS <NEW_LINE> http_resource = _HTTP_RESOURCE <NEW_LINE> pk_column = _PK_COLUMN <NEW_LINE> @staticmethod <NEW_LINE> def add_known_arguments(parser): <NEW_LINE> <INDENT> return ListCommand.add_args(parser)
List all the RBAC Projects
6259905d45492302aabfdb13
class RawPropertiesEndpoints(BasePropertiesEndpoints): <NEW_LINE> <INDENT> def __init__(self, host, port, account_id, auth_token, version=DEFAULT_API_VERSION, secure=SECURE, **kwargs): <NEW_LINE> <INDENT> super(RawPropertiesEndpoints, self).__init__(host, port, account_id, auth_token, version, secure, **kwargs) <NEW_LI...
RawProperties endpoints. Args: host (str): Exabyte API hostname. port (int): Exabyte API port number. account_id (str): account ID. auth_token (str): authentication token. version (str): Exabyte API version. secure (bool): whether to use secure http protocol (https vs http). kwargs (dict): ...
6259905d7d43ff2487427f2d
class NodeType(type): <NEW_LINE> <INDENT> def __new__(cls, name, bases, attrs): <NEW_LINE> <INDENT> newslots = [] <NEW_LINE> assert len(bases) == 1, 'multiple inheritance not allowed' <NEW_LINE> for attr in 'fields', 'attributes': <NEW_LINE> <INDENT> names = attrs.get(attr, ()) <NEW_LINE> storage = [] <NEW_LINE> storag...
A metaclass for nodes that handles field and attribute inheritance.
6259905d63d6d428bbee3da5
class TagAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ['id', 'name', 'status_google', 'status_yandex', 'status_instagram']
Class to display the tags in the admin panel. Attributes: list_display: Set which fields are displayed on the change list page of the admin.
6259905d4428ac0f6e659b78
class TensorDataset(DatasetSource): <NEW_LINE> <INDENT> def __init__(self, tensors): <NEW_LINE> <INDENT> super(TensorDataset, self).__init__() <NEW_LINE> with ops.name_scope("tensors"): <NEW_LINE> <INDENT> tensors = nest.pack_sequence_as(tensors, [ sparse_tensor_lib.SparseTensor.from_value(t) if sparse_tensor_lib.is_sp...
A `Dataset` with a single element, viz. a nested structure of tensors.
6259905dcb5e8a47e493cca3
class PurchaseLineTax(ModelSQL): <NEW_LINE> <INDENT> __name__ = 'purchase.line-account.tax' <NEW_LINE> _table = 'purchase_line_account_tax' <NEW_LINE> line = fields.Many2One('purchase.line', 'Purchase Line', ondelete='CASCADE', select=True, required=True, domain=[('type', '=', 'line')]) <NEW_LINE> tax = fields.Many2One...
Purchase Line - Tax
6259905d7047854f463409fb
class BasePostProcessor(object): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> def __init__(self, dedisperser): <NEW_LINE> <INDENT> self._dedisperser = dedisperser <NEW_LINE> <DEDENT> @property <NEW_LINE> def dedisperser(self): <NEW_LINE> <INDENT> return self._dedisperser <NEW_LINE> <DEDENT> @abc.abstractm...
Abstract base class for post processors. All post processors must inherit from this class. When sub-classing, only keyword arguments may be added to the constructor.
6259905d004d5f362081fb0c
class LOOT_353: <NEW_LINE> <INDENT> pass
Psionic Probe
6259905d8e7ae83300eea6c9
class DocumentTokenizer(object): <NEW_LINE> <INDENT> def __init__(self, sent_tokenizer=None, word_tokenizer=None): <NEW_LINE> <INDENT> if not sent_tokenizer: <NEW_LINE> <INDENT> self.sent_tokenizer = DefaultSentenceTokenizer() <NEW_LINE> <DEDENT> if not word_tokenizer: <NEW_LINE> <INDENT> self.word_tokenizer = Treebank...
Used to split a document into sentences and tokens. Returns a list of lists TODO
6259905d16aa5153ce401b1f
class AROrderSelectionResults(object): <NEW_LINE> <INDENT> def __init__(self, model, ics, trend, seasonal, period): <NEW_LINE> <INDENT> self._model = model <NEW_LINE> self._ics = ics <NEW_LINE> self._trend = trend <NEW_LINE> self._seasonal = seasonal <NEW_LINE> self._period = period <NEW_LINE> aic = sorted(ics, key=lam...
Results from an AR order selection Contains the information criteria for all fitted model orders.
6259905d55399d3f05627b5b
class GUITestResult(unittest.TestResult): <NEW_LINE> <INDENT> def __init__(self, callback): <NEW_LINE> <INDENT> unittest.TestResult.__init__(self) <NEW_LINE> self.callback = callback <NEW_LINE> <DEDENT> def addError(self, test, err): <NEW_LINE> <INDENT> unittest.TestResult.addError(self, test, err) <NEW_LINE> self.call...
A TestResult that makes callbacks to its associated GUI TestRunner. Used by BaseGUITestRunner. Need not be created directly.
6259905d498bea3a75a5911b
class RawSql(Sql): <NEW_LINE> <INDENT> def __init__(self, text, data = {}): <NEW_LINE> <INDENT> self.text = text <NEW_LINE> Sql.__init__(self, data) <NEW_LINE> <DEDENT> def to_raw(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def copy(self): <NEW_LINE> <INDENT> return RawSql(self.text, copy.copy(self.data)...
Simply saves a string, and also some data. This is in contrast with `Sql`, which may save the query in a more abstract way.
6259905d8a43f66fc4bf37c9
class AsynRecord(EpicsRecordDeviceCommonAll): <NEW_LINE> <INDENT> ascii_output = Component(EpicsSignal, ".AOUT", kind="hinted") <NEW_LINE> binary_output = Component(EpicsSignal, ".BOUT", kind="normal") <NEW_LINE> end_of_message_reason = Component(EpicsSignalRO, ".EOMR", kind="config") <NEW_LINE> input_format = Componen...
EPICS asyn record support in ophyd .. index:: Ophyd Device; synApps AsynRecord :see: https://epics.anl.gov/modules/soft/asyn/R4-36/asynRecord.html :see: https://github.com/epics-modules/asyn :see: https://epics.anl.gov/modules/soft/asyn/
6259905d3cc13d1c6d466d7c
class Text: <NEW_LINE> <INDENT> def __init__(self, content, config: Config = DefaultConfig()): <NEW_LINE> <INDENT> self.tokenizer: TokenizerBase = utils.load_class(config.tokenizer_class)(config) <NEW_LINE> self.spellcheck: BoSpell = BoSpell(config=config) <NEW_LINE> self.content: str = content <NEW_LINE> self.tokens: ...
Class Text represents the corrected text.
6259905d379a373c97d9a660
class PhotoSizeEmpty(TLObject): <NEW_LINE> <INDENT> __slots__: List[str] = ["type"] <NEW_LINE> ID = 0xe17e23c <NEW_LINE> QUALNAME = "types.PhotoSizeEmpty" <NEW_LINE> def __init__(self, *, type: str) -> None: <NEW_LINE> <INDENT> self.type = type <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def read(data: BytesIO, *args:...
This object is a constructor of the base type :obj:`~pyrogram.raw.base.PhotoSize`. Details: - Layer: ``122`` - ID: ``0xe17e23c`` Parameters: type: ``str``
6259905d7d847024c075da0e
class GroupsTable(groups_tables.GroupsTable): <NEW_LINE> <INDENT> roles = tables.Column( lambda obj: ", ".join(getattr(obj, 'roles', [])), verbose_name=_('Roles'), form_field=forms.CharField( widget=forms.Textarea(attrs={'rows': 4}), required=False)) <NEW_LINE> class Meta(object): <NEW_LINE> <INDENT> name = "groupstabl...
Display groups of the project.
6259905db57a9660fecd30b7
class NumberedListItem(elements._BlockElementContainingBlock_PrefixGrouped): <NEW_LINE> <INDENT> HTML_OUTER_TAGS = ('<ol>', '</ol>') <NEW_LINE> HTML_TAGS = ('<li>', '</li>')
A numbered list item:: #. List item 1. List item
6259905da219f33f346c7e41
class LoadFeedError(TweetFeederError): <NEW_LINE> <INDENT> def __init__(self, msg): <NEW_LINE> <INDENT> super(LoadFeedError, self).__init__(type(self).__name__, msg)
Raised when you fail to load from the tweet feed.
6259905dd7e4931a7ef3d6a2
class DDeltaStar(metric.Metric): <NEW_LINE> <INDENT> def _compute(self, tolerance, verbose=False): <NEW_LINE> <INDENT> del tolerance <NEW_LINE> assert self.env.q_values is not None, 'Q-Values have not been computed.' <NEW_LINE> self.metric = np.max(np.abs(self.env.q_values[:, None, :] - self.env.q_values[None, :, :]), ...
Implementation of the d_{\Delta^*} metric.
6259905d009cb60464d02b71
class CurrencyConverter: <NEW_LINE> <INDENT> ACCURACY = 2 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._usd_rate = requests.get( 'https://www.cbr-xml-daily.ru/daily_json.js' ).json()['Valute']['USD']['Value'] <NEW_LINE> <DEDENT> def calculate(self, usd_amount: float) -> float: <NEW_LINE> <INDENT> return roun...
Конвертер валют USD -> RUB Актуальный курс по ЦБ подгружается при инициализации
6259905d38b623060ffaa36d
class Bet: <NEW_LINE> <INDENT> def __init__(self, outcome, amount): <NEW_LINE> <INDENT> self.outcome = outcome <NEW_LINE> self.amount = amount <NEW_LINE> <DEDENT> def win_amount(self): <NEW_LINE> <INDENT> return self.outcome.win_amount(self.amount) + self.amount <NEW_LINE> <DEDENT> def lose_amount(self): <NEW_LINE> <IN...
A Bet is an amount that a player has wagered on an outcome Args: outcome (str): outcome the bet is made on amount (str): how much money is bet on the outcome
6259905d435de62698e9d441
class struct_stream(bin_methods): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def parse(cls, f: BinaryIO) -> Any: <NEW_LINE> <INDENT> return cls(*struct.unpack(cls.PACK, f.read(struct.calcsize(cls.PACK)))) <NEW_LINE> <DEDENT> def stream(self, f): <NEW_LINE> <INDENT> f.write(struct.pack(self.PACK, self))
Create a class that can parse and stream itself based on a struct.pack template string.
6259905d4e4d562566373a44
class bugenhagenAorticBR(AorticBaroreceptor): <NEW_LINE> <INDENT> solutionMemoryFields = ["HR_p","HR_s","delta"] <NEW_LINE> solutionMemoryFieldsToSave = ["HR_p","HR_s","delta"] <NEW_LINE> solutionMemoryFields.extend(AorticBaroreceptor.solutionMemoryFields) <NEW_LINE> solutionMemoryFieldsToSave.extend(AorticBarorece...
for models of the AorticBaroreceptors Aortic Baroreceptor models with strain input and period of the heart cycle as output
6259905d67a9b606de5475bf
class Heuristic3Bot(MinimaxBot): <NEW_LINE> <INDENT> def __init__(self, number, time_limit=4, name=None): <NEW_LINE> <INDENT> if name is None: <NEW_LINE> <INDENT> name = "Heuristic3 Minimax" <NEW_LINE> <DEDENT> MinimaxBot.__init__(self, number, time_limit, name=name) <NEW_LINE> self.player_type = 'h2 minimax' <NEW_LINE...
Minimax bot that plays using the H3 Heuristic
6259905d0a50d4780f7068dd
class Solution2: <NEW_LINE> <INDENT> def combinationSum2(self, candidates: List[int], target: int) -> List[List[int]]: <NEW_LINE> <INDENT> ans = [] <NEW_LINE> cand_counter = Counter(candidates) <NEW_LINE> candidates = list(set(candidates)) <NEW_LINE> n = len(candidates) - 1 <NEW_LINE> def comb_sum2(sol: List[int], idx,...
Rum time: 108ms Slightly Faster than Solution1 Time Complexity: O(n**2)
6259905d63d6d428bbee3da6
class PairwiseScore(models.Model): <NEW_LINE> <INDENT> holder = models.ForeignKey(Person, related_name='holder') <NEW_LINE> partner = models.ForeignKey(Person, related_name='partner') <NEW_LINE> score = models.DecimalField(max_digits=16, decimal_places=15) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return 'S...
Score between a pair of Person objects The score is higher the more recently the pair have had lunch
6259905d63b5f9789fe867af
class StateDeclined(base.State): <NEW_LINE> <INDENT> name = "Declined" <NEW_LINE> def enter_state(self, request, application): <NEW_LINE> <INDENT> application.decline() <NEW_LINE> <DEDENT> def view(self, request, application, label, roles, actions): <NEW_LINE> <INDENT> if label is None and 'is_applicant'...
This application declined.
6259905d442bda511e95d878
class DeleteWordListInputSet(InputSet): <NEW_LINE> <INDENT> def set_APIKey(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'APIKey', value) <NEW_LINE> <DEDENT> def set_Password(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'Password', value) <NEW_LINE> <DEDENT> def set_Username(self, value): <...
An InputSet with methods appropriate for specifying the inputs to the DeleteWordList Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
6259905dbaa26c4b54d508e3
class Character(DeviceType): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return "char"
Type of Character devices.
6259905d627d3e7fe0e084c8
class GoogleBPEVocab(Vocab): <NEW_LINE> <INDENT> def __init__(self, max_size, vocab_file=None): <NEW_LINE> <INDENT> import sentencepiece as spm <NEW_LINE> self.spm = spm <NEW_LINE> self.max_size = max_size <NEW_LINE> self.vocab_file = vocab_file <NEW_LINE> self.sp = spm.SentencePieceProcessor() <NEW_LINE> <DEDENT> def ...
Don't use this until this issue is fixed. https://github.com/google/sentencepiece/issues/318
6259905da17c0f6771d5d6c1
class DefensiveAgent(RAgent): <NEW_LINE> <INDENT> def registerInitialState(self, gameState): <NEW_LINE> <INDENT> RAgent.registerInitialState(self, gameState) <NEW_LINE> self.percepter=JointParticleFilter() <NEW_LINE> self.percepter.initialize(gameState,self) <NEW_LINE> <DEDENT> def getFeatures(self, gameState, action):...
A reflex agent that keeps its side Pacman-free. Again, this is to give you an idea of what a defensive agent could be like. It is not the best or only way to make such an agent.
6259905d45492302aabfdb16
class ScriptSettings(object): <NEW_LINE> <INDENT> def __init__(self, func_name: str): <NEW_LINE> <INDENT> self.func_name = func_name <NEW_LINE> self.env = os.environ['env'] <NEW_LINE> self.env_variables = self.create_env_vairables() <NEW_LINE> <DEDENT> def create_env_vairables(self) -> Dict[str, str]: <NEW_LINE> <INDEN...
Settings for the files in scripts folder.
6259905dcb5e8a47e493cca4
@tf_export("RandomShuffleQueue") <NEW_LINE> class RandomShuffleQueue(QueueBase): <NEW_LINE> <INDENT> def __init__(self, capacity, min_after_dequeue, dtypes, shapes=None, names=None, seed=None, shared_name=None, name="random_shuffle_queue"): <NEW_LINE> <INDENT> dtypes = _as_type_list(dtypes) <NEW_LINE> shapes = _as_shap...
A queue implementation that dequeues elements in a random order. See @{tf.QueueBase} for a description of the methods on this class. @compatibility(eager) Queues are not compatible with eager execution. Instead, please use `tf.data` to get data into your model. @end_compatibility
6259905d21a7993f00c675aa
@keys.assign(seq=seqs.LEFT_SQUARE_BRACKET, modes=_MODES_MOTION) <NEW_LINE> class ViGotoOpeningBracket(ViMotionDef): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> ViMotionDef.__init__(self, *args, **kwargs) <NEW_LINE> self.scroll_into_view = True <NEW_LINE> self.updates_xpos = True <NEW_LI...
Vim: `[`
6259905d004d5f362081fb0d
class TstClient(object): <NEW_LINE> <INDENT> def __init__(self, client, db): <NEW_LINE> <INDENT> self.client = client <NEW_LINE> self.db = db <NEW_LINE> <DEDENT> def get_valid_page(self, url): <NEW_LINE> <INDENT> response = self.client.get(url, follow_redirects=True) <NEW_LINE> assert response.status_code == 200, "GET ...
Utility class for tests
6259905dd486a94d0ba2d605
class PasswordProperty(object): <NEW_LINE> <INDENT> def __get__(self, instance, owner): <NEW_LINE> <INDENT> if instance: <NEW_LINE> <INDENT> return Password(instance) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> <DEDENT> def __set__(self, instance, value): <NEW_LINE> <INDENT> instance.s...
This is the password attribute of User. When set, it writes to user.password_sha512 and user.salt. When get, it returns a Password object.
6259905d097d151d1a2c26ab
class Mirror(Object): <NEW_LINE> <INDENT> def __init__(self, hash=None, mirrors=None, status=None): <NEW_LINE> <INDENT> self.hash = hash <NEW_LINE> self.mirrors = mirrors <NEW_LINE> self.status = status
Mirror or file replica settings. Attributes: hash (str): mirrors (int): number of file replicas. status (str): current file replica status.
6259905d16aa5153ce401b21
class posture(object): <NEW_LINE> <INDENT> implements(IVocabularyFactory) <NEW_LINE> def __call__(self, context=None): <NEW_LINE> <INDENT> items = ( SimpleTerm(value='standing', title=_(u'standing')), SimpleTerm(value='crouching', title=_(u'crouching')), SimpleTerm(value='lying', title=_(u'lying')), SimpleTerm(value='s...
posture
6259905df548e778e596cbc8
class AttributesTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_version(self): <NEW_LINE> <INDENT> self.assertTrue( steenzout.object.version() == steenzout.object.__version__ )
steenzout.object package test cases.
6259905d4f6381625f199fc1
class AssessmentPartSearch(abc_assessment_authoring_searches.AssessmentPartSearch, osid_searches.OsidSearch): <NEW_LINE> <INDENT> @utilities.arguments_not_none <NEW_LINE> def search_among_assessment_parts(self, bank_ids): <NEW_LINE> <INDENT> raise errors.Unimplemented() <NEW_LINE> <DEDENT> @utilities.arguments_not_none...
The search interface for governing assessment part searches.
6259905d8da39b475be04824
class ListBudgetsAsyncPager: <NEW_LINE> <INDENT> def __init__( self, method: Callable[..., Awaitable[budget_service.ListBudgetsResponse]], request: budget_service.ListBudgetsRequest, response: budget_service.ListBudgetsResponse, *, metadata: Sequence[Tuple[str, str]] = () ): <NEW_LINE> <INDENT> self._method = method <N...
A pager for iterating through ``list_budgets`` requests. This class thinly wraps an initial :class:`google.cloud.billing.budgets_v1beta1.types.ListBudgetsResponse` object, and provides an ``__aiter__`` method to iterate through its ``budgets`` field. If there are more pages, the ``__aiter__`` method will make additio...
6259905d460517430c432b71
class Alien(Sprite): <NEW_LINE> <INDENT> def __init__( self, input_ai_settings, input_screen): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.ai_settings = input_ai_settings <NEW_LINE> self.screen = input_screen <NEW_LINE> self.image = pygame.image.load('images/alien.bmp') <NEW_LINE> self.rect = self.image.get_...
Create an alien ship at the top of the screen
6259905dbaa26c4b54d508e4
class ExtractFeaturesTestCase(unittest.TestCase): <NEW_LINE> <INDENT> pass
Class for UniTests of different methods in extract_features module
6259905d379a373c97d9a663
class ApiLogInTests(TestCase): <NEW_LINE> <INDENT> fixtures = ['test_data'] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.api = APIMiddleware() <NEW_LINE> <DEDENT> def testBasicAuthentication(self): <NEW_LINE> <INDENT> request = HttpRequest() <NEW_LINE> credentials = 'johndoe:foobar'.encode('base64') <NEW_LINE> ...
Test log in of Django users via Basic auth.
6259905d24f1403a926863ed