code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class GlasgowConfig: <NEW_LINE> <INDENT> size = 64 <NEW_LINE> _encoding = "<1s16sI16s2H" <NEW_LINE> def __init__(self, revision, serial, bitstream_size=0, bitstream_id=b"\x00"*16, voltage_limit=None): <NEW_LINE> <INDENT> self.revision = revision <NEW_LINE> self.serial = serial <NEW_LINE> self.bitstream_size = bitstre...
Glasgow EEPROM configuration data. :ivar int size: Total size of configuration block (currently 64). :ivar str[1] revision: Revision letter, ``A``-``Z``. :ivar str[16] serial: Serial number, in ISO 8601 format. :ivar int bitstream_size: Size of bitstream flashed to ICE_MEM, or 0 if there isn't one. ...
62598fc17cff6e4e811b5c89
class Process(object): <NEW_LINE> <INDENT> def __init__(self, name, is_signal): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.is_signal = is_signal <NEW_LINE> self.systematics = {} <NEW_LINE> <DEDENT> def apply_systematic(self, other): <NEW_LINE> <INDENT> syst_name, syst_value = other.systematic, other.value <NE...
Represents a specific process (Zjets) in a category One can inplace-multiply a nuisance tuple to register that nuisance affects this process. >>> proc = Process('a_process', False) >>> proc.is_signal False >>> proc.name 'a_process' >>> my_nuisance = Nuisance('a_syst', 'lnN') >>> proc.apply_systematic(my_nuisance(1.05...
62598fc19f288636728189ae
class ArchiveCoverage(ShellCommand): <NEW_LINE> <INDENT> flunkOnFailure = True <NEW_LINE> description = ["arch cov"] <NEW_LINE> name = "arch cov" <NEW_LINE> COMMAND_TEMPL = 'rm cov-*.tar.bz2 ; VER=`python setup.py --name`-`python setup.py --version` ; export VER ; coverage html ; mv .coverage "coverage-${VER}" && mv .c...
Put coverage results into an archive for transport.
62598fc13346ee7daa33777b
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 email address") <NEW_LINE> <DEDENT> email = self.normalize_email(email) <NEW_LINE> user = self.model(email=email, name=...
Custom Manager for user profiles
62598fc13d592f4c4edbb123
class Weapon(Item): <NEW_LINE> <INDENT> def __init__(self, damage=10, damage_type='smashing', name='WEAPON', description='THIS IS A WEAPON', weight=1.0, value=10, slot='hand', reqs={'level':0,'class':None}): <NEW_LINE> <INDENT> super().__init__(name=name, description=description, weight=weight, value=value, slot=slot, ...
Base class for weapons. Inherits from 'Item' Attributes: damage {int} -- Amount of damage this weapon does. (default: {10}) damage_type {str} -- Type of damage this weapon does. (default: {'smashing'}) Returns: [type] -- [description]
62598fc1377c676e912f6ea6
@LinkState.register(_type=1116) <NEW_LINE> class UnidirectDelayVar(TLV): <NEW_LINE> <INDENT> TYPE_STR = 'unidirect_delay_var' <NEW_LINE> @classmethod <NEW_LINE> def unpack(cls, data): <NEW_LINE> <INDENT> value = int(binascii.b2a_hex(data), 16) <NEW_LINE> return cls(value=value)
Unidirectional Delay Variation
62598fc17d847024c075c622
class NoStartTeacher(Convai2Teacher): <NEW_LINE> <INDENT> def __init__(self, opt, shared=None): <NEW_LINE> <INDENT> super().__init__(opt, shared) <NEW_LINE> self.num_exs = sum(len(d['dialogue']) - 1 for d in self.data) <NEW_LINE> self.all_eps = self.data + [d for d in self.data if len(d['dialogue']) > 2] <NEW_LINE> sel...
Same as default teacher, but it doesn't contain __SILENCE__ entries. If we are the first speaker, then the first utterance is skipped.
62598fc13317a56b869be683
class Tag(object): <NEW_LINE> <INDENT> def __init__(self, tag_name, commit): <NEW_LINE> <INDENT> self.tag_name = tag_name <NEW_LINE> self.commit = commit <NEW_LINE> <DEDENT> def delete(self): <NEW_LINE> <INDENT> git('tag', '-d', self.tag_name) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.tag_n...
Static label for a commit. Attributes: tag_name: the name of this tag. commit: the commit this tag labels.
62598fc17c178a314d78d705
class ServerFunCateg(models.Model): <NEW_LINE> <INDENT> server_categ_name = models.CharField(max_length = 60) <NEW_LINE> delmark = models.CharField(max_length = 10, default = False) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.server_categ_name
docstring for ServerFunCateg
62598fc1be7bc26dc9251f8f
class File(system.Item): <NEW_LINE> <INDENT> __image__ = "desktop/images/document.gif" <NEW_LINE> __props__ = system.Item.__props__ + ('file',) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> system.Item.__init__(self) <NEW_LINE> self.file = datatypes.RequiredFile() <NEW_LINE> <DEDENT> def get_size(self): <NEW_LINE>...
Simple file object @ivar file: The file data type @type file: L{RequiredFile<porcupine.datatypes.RequiredFile>}
62598fc157b8e32f52508251
class OnAccessMutant(metaclass=_MetaImmutableMutant): <NEW_LINE> <INDENT> __slots__ = ('__wrapped_object__', '__wrapped_mutator__')
A class that proxies everything to another object. The quirk that it can change the proxied object on every access witha mutator function. But this object doesn't have to be constant: it's reevaluated on every access by calling the provided callable. Usage: OnAccessMutant(initial_object, callable_mutator) where: calla...
62598fc18a349b6b436864a4
class WorkflowTemplate(_messages.Message): <NEW_LINE> <INDENT> @encoding.MapUnrecognizedFields('additionalProperties') <NEW_LINE> class LabelsValue(_messages.Message): <NEW_LINE> <INDENT> class AdditionalProperty(_messages.Message): <NEW_LINE> <INDENT> key = _messages.StringField(1) <NEW_LINE> value = _messages.StringF...
A Cloud Dataproc workflow template resource. Messages: LabelsValue: Optional. The labels to associate with this template. These labels will be propagated to all jobs and clusters created by the workflow instance.Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.or...
62598fc121bff66bcd722ed1
class _MyFormatter(logging.Formatter): <NEW_LINE> <INDENT> def format(self, record): <NEW_LINE> <INDENT> format_orig = self._fmt <NEW_LINE> if record.levelno == logging.DEBUG: <NEW_LINE> <INDENT> self._fmt = " %(msg)s" <NEW_LINE> <DEDENT> elif record.levelno == logging.INFO: <NEW_LINE> <INDENT> self._fmt = "%(msg)s" <...
Logging Formatter
62598fc17d43ff2487427538
class Meta: <NEW_LINE> <INDENT> app_label = "toolbox" <NEW_LINE> verbose_name = "Licentie" <NEW_LINE> verbose_name_plural = "Licenties"
Change display of model in Django admin
62598fc126068e7796d4cbc2
class ResetPasswordEmail(BaseModel): <NEW_LINE> <INDENT> email_code: str <NEW_LINE> user_phone: str <NEW_LINE> new_password: str <NEW_LINE> confirm_password: str
通过邮箱重置密码
62598fc17cff6e4e811b5c8b
class Marker(BaseElement, ViewBox, Presentation): <NEW_LINE> <INDENT> elementname = 'marker' <NEW_LINE> def __init__(self, insert=None, size=None, orient=None, **extra): <NEW_LINE> <INDENT> super(Marker, self).__init__(**extra) <NEW_LINE> if insert: <NEW_LINE> <INDENT> self['refX'] = insert[0] <NEW_LINE> self['refY'] =...
The **marker** element defines the graphics that is to be used for drawing arrowheads or polymarkers on a given **path**, **line**, **polyline** or **polygon** element. Add Marker definitions to a **defs** section, preferred to the **defs** section of the **main drawing**.
62598fc12c8b7c6e89bd3a29
class APIgetStatusCodeDeckCard(APITestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.get_method_endpoints = [ reverse('flashcards:flashcards_api:deck_list'), reverse('flashcards:flashcards_api:card_list'), ] <NEW_LINE> <DEDENT> def test_flashcards_endpoint_get_method(self): <NEW_LINE> <INDENT> c =...
Tests API endpoint response status codes
62598fc197e22403b383b171
class GPXException(Exception): <NEW_LINE> <INDENT> pass
Exception used for invalid GPX files. Is is used when the XML file is valid but something is wrong with the GPX data.
62598fc1851cf427c66b851d
class ProbablyAlive(Rule): <NEW_LINE> <INDENT> labels = [_("On date:")] <NEW_LINE> name = _('People probably alive') <NEW_LINE> description = _("Matches people without indications of death that are not too old") <NEW_LINE> category = _('General filters') <NEW_LINE> def prepare(self,db): <NEW_LINE> <INDE...
People probably alive
62598fc155399d3f0562677e
class Clipboard(common.AbstractWindowsCommand, sessions.SessionsMixin): <NEW_LINE> <INDENT> def calculate(self): <NEW_LINE> <INDENT> kernel_space = utils.load_as(self._config) <NEW_LINE> sesses = dict((int(session.SessionId), session) for session in self.session_spaces(kernel_space) ) <NEW_LINE> session_handles = {} <N...
Extract the contents of the windows clipboard
62598fc192d797404e388c96
class ProductIdentifier (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 = pyxb.namespace.ExpandedName(Namespace, 'ProductIdentifier') <NEW_L...
Complex type {urn:rocs.001.001.06}ProductIdentifier with content type ELEMENT_ONLY
62598fc17c178a314d78d707
class UseOldRepo(LoginRequiredMixin, View): <NEW_LINE> <INDENT> def get(self, request, repo_name, *args, **kwargs): <NEW_LINE> <INDENT> user = request.user <NEW_LINE> repo_name = self.kwargs['repo_name'] <NEW_LINE> old_repo_obj = OldRepoSetUp(user, repo_name) <NEW_LINE> return_dict = old_repo_obj.use_old_repo() <NEW_LI...
UseOldRepo to register a repo on already created Repository. Example: Triggers when: User clicks on one of the already created repository clamining that the repo contains the required files. Tasks: * View for logged in users only. * Select any repo from the repo list * Make some earlier checks...
62598fc1ff9c53063f51a8b6
class Paraboloid(QuadricGM): <NEW_LINE> <INDENT> def __init__(self, a=1., b=None): <NEW_LINE> <INDENT> if b is None: <NEW_LINE> <INDENT> b = a <NEW_LINE> <DEDENT> QuadricGM.__init__(self) <NEW_LINE> self.a = 1./(a**2) <NEW_LINE> self.b = 1./(b**2) <NEW_LINE> <DEDENT> def _normals(self, hits, directs): <NEW_LINE> <INDEN...
Implements the geometry of a circular paraboloid surface
62598fc1ad47b63b2c5a7abf
class BankSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Bank <NEW_LINE> fields = ('id', 'name', 'rank')
@class BankSerializer @brief Serializer for Bank
62598fc1796e427e5384e9fe
class Emptyfy(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "object.emptyfy" <NEW_LINE> bl_label = "Emptify" <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> return context.active_object is not None <NEW_LINE> <DEDENT> def execute(self, context): <NEW_LINE> <INDENT> main(context) <N...
Tooltip
62598fc126068e7796d4cbc4
class TestServicesVrrp(BaseActionTestCase): <NEW_LINE> <INDENT> action_cls = services_vrrp <NEW_LINE> def test_action(self): <NEW_LINE> <INDENT> action = self.get_action_instance() <NEW_LINE> mock_callback = MockCallback() <NEW_LINE> kwargs = { 'ip_version': '4', 'ip': '', 'username': '', 'password': '', 'port': '22', ...
Test holder class
62598fc176e4537e8c3ef80f
class class_hierarchy(root): <NEW_LINE> <INDENT> def __init__(self, hierarchy): <NEW_LINE> <INDENT> super(class_hierarchy, self).__init__("class", hierarchy)
Represent a name scope hierarchy. The class hierarchy represents things that in C++ would equate to using a ``::`` to gain access to. This includes: - Classes and structs (:class:`hierarchies.clike <testing.hierarchies.clike>`). - Enums (:class:`hierarchies.enum <testing.hierarchies.enum>`). - Namespaces (:class:`hi...
62598fc1fff4ab517ebcda4f
class TestUpload(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> filename = "sample_file.txt" <NEW_LINE> test_dir = os.path.dirname(os.path.realpath(__file__)) <NEW_LINE> filepath = os.path.join(test_dir, filename) <NEW_LINE> warnings.simplefilter("ignore", ResourceWarning) <NEW_LINE> u = U...
Test cases for AWS connectivity
62598fc12c8b7c6e89bd3a2b
class Post: <NEW_LINE> <INDENT> class Body(RepoCommitBody): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> class Header(Schema): <NEW_LINE> <INDENT> X_GitHub_Media_Type = fields.String(data_key='X-GitHub-Media-Type', description='You can check the current version of media type in responses.\n') <NEW_LINE> Accept = fields...
Create a Commit.
62598fc13d592f4c4edbb126
class Affine1d(Module): <NEW_LINE> <INDENT> def __init__(self, num_features: int, bias: bool = True, device=None, dtype=None) -> None: <NEW_LINE> <INDENT> factory_kwargs = {'device': device, 'dtype': dtype} <NEW_LINE> super(Affine1d, self).__init__() <NEW_LINE> self.num_features = num_features <NEW_LINE> self.weight = ...
Computes the transformation out = weight * input + bias where * is the elementwise multiplication. This is similar to the scaling and translation given by parameters gamma and beta in batch norm
62598fc1aad79263cf42ea3f
class EvalResult(): <NEW_LINE> <INDENT> def __init__(self, e_name, e_result): <NEW_LINE> <INDENT> self.e_name = e_name <NEW_LINE> self.e_result = e_result <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> ret = "EVAL ALG NAME: " <NEW_LINE> ret += self.e_name + "\n" <NEW_LINE> ret += "EVAL RESULT:\n\n" <N...
Stores and displays a single evaluation algorithm result.
62598fc1f9cc0f698b1c5405
class CustomRequest(WSGIRequest): <NEW_LINE> <INDENT> node = None
Class to maintain an active Client/Server instance.
62598fc13617ad0b5ee063b1
class LoginWithTenant(Login): <NEW_LINE> <INDENT> if _regions_supported(): <NEW_LINE> <INDENT> region = region_field <NEW_LINE> <DEDENT> username = forms.CharField(max_length="20", widget=forms.TextInput(attrs={'readonly': 'readonly'})) <NEW_LINE> tenant = forms.CharField(widget=forms.HiddenInput())
Exactly like :class:`.Login` but includes the tenant id as a field so that the process of choosing a default tenant is bypassed.
62598fc123849d37ff85131d
class InvalidLogFormatException(DebugError): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> super(InvalidLogFormatException, self).__init__(message)
A log format expression was invalid.
62598fc1956e5f7376df57b3
class BaseNEncoding(Encoding): <NEW_LINE> <INDENT> def __init__(self, categorical_columns = None, base = 2, return_df = False, delete_original_columns=True): <NEW_LINE> <INDENT> if base<1 or base>10: <NEW_LINE> <INDENT> raise ValueError("Either base is less than 1 or greater than 10 or n is less than 0") <NEW_LINE> <DE...
class to perform BaseNEncoding on Categorical Variables Initialization Variabes: categorical_columns: list of categorical columns from the dataframe or list of indexes of caategorical columns for numpy ndarray base: base number return_df: boolean if True: returns pandas dataframe on transformation else: return ...
62598fc1283ffb24f3cf3aef
class ChainLightning(Spell): <NEW_LINE> <INDENT> name = "Chain Lightning" <NEW_LINE> level = 6 <NEW_LINE> casting_time = "1 action" <NEW_LINE> components = ('V', 'S', 'M') <NEW_LINE> materials = "a bit of fur; a piece of amber, glass, or a crystal rod; and three silver pins" <NEW_LINE> duration = "Instantaneous" <NEW_L...
You create a bolt of lightning that arcs toward a target of your choice that you can see within range. Three bolts then leap from that target to as many as three other targets, each of which must be within 30 feet of the first target. A target can be a creature or an object and can be targeted by only one of the bolts....
62598fc17cff6e4e811b5c8f
class CurrentProfileSync_Enum (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin): <NEW_LINE> <INDENT> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'CurrentProfileSync.Enum') <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('/home/afcastel/hmc_rest_api/code/pmc.schema.pcm-8.8.5.0/schema...
An atomic simple type.
62598fc1a05bb46b3848aad7
class SpecArithmetic(object): <NEW_LINE> <INDENT> def search_peak(self, xdata, ydata): <NEW_LINE> <INDENT> ydata = numpy.array(ydata, copy=False) <NEW_LINE> ymax = ydata[numpy.isfinite(ydata)].max() <NEW_LINE> idx = self.__give_index(ymax, ydata) <NEW_LINE> return xdata[idx], ymax, idx <NEW_LINE> <DEDENT> def search_co...
This class tries to mimic SPEC operations. Correct peak positions and fwhm information have to be made via a fit.
62598fc1dc8b845886d53826
class ApplicationGatewayRewriteRuleSet(SubResource): <NEW_LINE> <INDENT> _validation = { 'etag': {'readonly': True}, 'provisioning_state': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'rewrite_rule...
Rewrite rule set of an application gateway. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :param name: Name of the rewrite rule set that is unique within an Application Gateway. :type name: str :ivar etag: A unique read-only string that c...
62598fc13d592f4c4edbb128
class BotCommand(BaseType): <NEW_LINE> <INDENT> def __init__(self, command, description): <NEW_LINE> <INDENT> self.command = command <NEW_LINE> self.description = description
This object represents a bot command. Parameters ---------- command : String Text of the command, 1-32 characters. Can contain only lowercase English letters, digits and underscores. description : String Description of the command, 3-256 characters.
62598fc1f9cc0f698b1c5406
class SaveTool(Tool): <NEW_LINE> <INDENT> pass
*toolbar icon*: |save_icon| The save tool is an action. When activated, the tool opens a download dialog which allows to save an image reproduction of the plot in PNG format. If automatic download is not support by a web browser, the tool falls back to opening the generated image in a new tab or window. User then can ...
62598fc10fa83653e46f5151
class EQLFastRCNNOutputLayers(FastRCNNOutputLayers): <NEW_LINE> <INDENT> def __init__(self, input_size, num_classes, cls_agnostic_bbox_reg, box_dim=4, prior_prob=0.001): <NEW_LINE> <INDENT> super(FastRCNNOutputLayers, self).__init__() <NEW_LINE> if not isinstance(input_size, int): <NEW_LINE> <INDENT> input_size = np.pr...
Two linear layers for predicting Fast R-CNN outputs: (1) proposal-to-detection box regression deltas (2) classification scores
62598fc18a349b6b436864aa
class Vote(models.Model): <NEW_LINE> <INDENT> YES = 1 <NEW_LINE> NO = 2 <NEW_LINE> ABSTAIN = 3 <NEW_LINE> ABSENT = 4 <NEW_LINE> VOTES = ( (YES, 'Yes'), (NO, 'No'), (ABSTAIN, 'Abstain'), (ABSENT, 'Absent') ) <NEW_LINE> msp = models.ForeignKey(MSP) <NEW_LINE> division = models.ForeignKey(Division) <NEW_LINE> vote = model...
represents an msp's vote for a division
62598fc1ad47b63b2c5a7ac3
class CreateDatabaseFromBackupRequest(_messages.Message): <NEW_LINE> <INDENT> backup = _messages.StringField(1) <NEW_LINE> name = _messages.StringField(2)
A CreateDatabaseFromBackupRequest object. Fields: backup: Required. Name of the backup from which to restore. Values are of the form `projects/<project>/instances/<instance>/backups/<backup>`. name: Required. Name of the database to create and restore to. This database must not already exist. The instance...
62598fc1adb09d7d5dc0a7ea
class AbsorbMulIntoMultiThreshold(Transformation): <NEW_LINE> <INDENT> def apply(self, model): <NEW_LINE> <INDENT> graph = model.graph <NEW_LINE> node_ind = 0 <NEW_LINE> graph_modified = False <NEW_LINE> for n in graph.node: <NEW_LINE> <INDENT> node_ind += 1 <NEW_LINE> if ( n.op_type == "Mul" and not model.is_fork_node...
Absorb preceding Mul ops into MultiThreshold by updating the threshold values. Only *positive* scalar/1D mul vectors can be absorbed.
62598fc12c8b7c6e89bd3a2f
class ConfigureDialog(QtWidgets.QDialog): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> QtWidgets.QDialog.__init__(self, parent) <NEW_LINE> self._ui = Ui_Dialog() <NEW_LINE> self._ui.setupUi(self) <NEW_LINE> self._previousIdentifier = '' <NEW_LINE> self.identifierOccursCount = None <NEW_LINE>...
Configure dialog to present the user with the options to configure this step.
62598fc14c3428357761a529
class SimpleFormatExportOptionsForm(SimpleFormatForm): <NEW_LINE> <INDENT> TERMINATOR_DEFAULT = "LF" <NEW_LINE> TERMINATOR_CHOICES = [("LF", "Linux (LF)"), ("CRLF", "Windows (CRLF)"), ("CR", "Mac (CR)"), ("", "Other:")] <NEW_LINE> TERMINATOR_CHARACTER_MAP = { "LF": "\n", "CRLF": "\r\n", "CR": "\r" } <NEW_LINE> line_ter...
Presents the user with common options used to export simple formatted data.
62598fc13346ee7daa33777f
class BusinessCardOCRRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ImageBase64 = None <NEW_LINE> self.ImageUrl = None <NEW_LINE> self.Config = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.ImageBase64 = params.get("ImageBase64") <NEW_LINE> s...
BusinessCardOCR请求参数结构体
62598fc155399d3f05626784
class AdminCodeDatabase(Database): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Database.__init__(self) <NEW_LINE> self.connect('regionDB', 'AdminCode') <NEW_LINE> <DEDENT> def find(self, **conds): <NEW_LINE> <INDENT> projection = conds.get('projection') <NEW_LINE> if projection is None: <NEW_LINE> <INDE...
AdminDatabase类用来处理区域行政区划
62598fc1377c676e912f6eaa
class CombinedCriteria(Criterion): <NEW_LINE> <INDENT> def __init__(self, *criteria): <NEW_LINE> <INDENT> super(CombinedCriteria, self).__init__() <NEW_LINE> self._criteria = criteria <NEW_LINE> <DEDENT> def name(self): <NEW_LINE> <INDENT> names = (criterion.name() for criterion in self._criteria) <NEW_LINE> return '__...
Meta criterion that combines several criteria into a new one. Considers images as adversarial that are considered adversarial by all sub-criteria that are combined by this criterion. Instead of using this class directly, it is possible to combine criteria like this: criteria1 & criteria2 Parameters ---------- *crite...
62598fc171ff763f4b5e79ea
class ContentFileField(CharField): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.filename = kwargs.pop('filename', 'file.txt') <NEW_LINE> super().__init__(**kwargs) <NEW_LINE> <DEDENT> def to_internal_value(self, data): <NEW_LINE> <INDENT> return ContentFile(data.encode('utf-8'), name=self....
Serializer field that deserializes text into a ContentFile.
62598fc14a966d76dd5ef143
class AltitudeDuringCabinAltitudeWarningMax(KeyPointValueNode): <NEW_LINE> <INDENT> units = ut.FT <NEW_LINE> def derive(self, cab_warn=M('Cabin Altitude Warning'), airborne=S('Airborne'), alt=P('Altitude STD Smoothed')): <NEW_LINE> <INDENT> warns = np.ma.clump_unmasked(np.ma.masked_equal(cab_warn.array, 0)) <NEW_LINE> ...
The maximum aircraft altitude when the Cabin Altitude Warning was sounding.
62598fc17047854f4633f641
class NestedForeignKeySourceModelViewSet(NestedResourceMixin, viewsets.ModelViewSet): <NEW_LINE> <INDENT> parent_model = TargetModel <NEW_LINE> model = ForeignKeySourceModel
/targets/<target_pk>/sources/
62598fc1956e5f7376df57b5
class ListProposals(ListView): <NEW_LINE> <INDENT> paginate_by = 50 <NEW_LINE> context_object_name = 'proposal' <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> place = get_object_or_404(Space, url=self.kwargs['space_name']) <NEW_LINE> objects = Proposal.objects.all().filter(space=place.id).order_by('pub_date') <...
List all proposals stored whithin a space. Inherits from django :class:`ListView` generic view. :rtype: Object list :context: proposal
62598fc15fc7496912d483b2
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, default=datetime.utcnow(), ) <NEW_LINE> user_id = db.Column( db...
An individual message ("warble").
62598fc14f88993c371f0641
class NoteList(NoteResource, ModelListResource): <NEW_LINE> <INDENT> ARGS = NOTE_ARGS <NEW_LINE> def post(self): <NEW_LINE> <INDENT> args = self._parse_request() <NEW_LINE> book = Book.api_get_or_404(args['book_id']) <NEW_LINE> new_note = Note.create(text=args['text'], book=book) <NEW_LINE> result = { 'result': self._s...
Generic set of views for the note list endpoint.
62598fc1a8370b77170f0650
class Cluster(): <NEW_LINE> <INDENT> def __init__(self, coords, count, triangles): <NEW_LINE> <INDENT> self.coords = coords <NEW_LINE> self.count = count <NEW_LINE> self.triangles = triangles <NEW_LINE> self.color=False
A class for point clusters.
62598fc1099cdd3c63675519
class GFFParser(_AbstractMapReduceGFF): <NEW_LINE> <INDENT> def __init__(self, line_adjust_fn=None, create_missing=True): <NEW_LINE> <INDENT> _AbstractMapReduceGFF.__init__(self, create_missing=create_missing) <NEW_LINE> self._line_adjust_fn = line_adjust_fn <NEW_LINE> <DEDENT> def _gff_process(self, gff_files, limit_i...
Local GFF parser providing standardized parsing of GFF3 and GFF2 files.
62598fc121bff66bcd722ed9
class alias(Command): <NEW_LINE> <INDENT> context = 'browser' <NEW_LINE> resolve_macros = False <NEW_LINE> def execute(self): <NEW_LINE> <INDENT> if not self.arg(1) or not self.arg(2): <NEW_LINE> <INDENT> self.fm.notify('Syntax: alias <newcommand> <oldcommand>', bad=True) <NEW_LINE> return <NEW_LINE> <DEDENT> self.fm.c...
:alias <newcommand> <oldcommand> Copies the oldcommand as newcommand.
62598fc13d592f4c4edbb12d
@TestDataGenerator.RegisterClass <NEW_LINE> class IdentityTestDataGenerator(TestDataGenerator): <NEW_LINE> <INDENT> NAME = 'identity' <NEW_LINE> def __init__(self, output_directory_prefix, copy_with_identity): <NEW_LINE> <INDENT> TestDataGenerator.__init__(self, output_directory_prefix) <NEW_LINE> self._copy_with_ident...
Generator that adds no noise. Both the noisy and the reference signals are the input signal.
62598fc192d797404e388c9a
class _FactoryWrapper: <NEW_LINE> <INDENT> def __init__(self, factory_or_path): <NEW_LINE> <INDENT> self.factory = None <NEW_LINE> self.module = self.name = '' <NEW_LINE> if isinstance(factory_or_path, type): <NEW_LINE> <INDENT> self.factory = factory_or_path <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if not (isinst...
Handle a 'factory' arg. Such args can be either a Factory subclass, or a fully qualified import path for that subclass (e.g 'myapp.factories.MyFactory').
62598fc17d847024c075c62c
class NativeWindow(MarshalByRefObject,IWin32Window): <NEW_LINE> <INDENT> def AssignHandle(self,handle): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def CreateHandle(self,cp): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def DefWndProc(self,m): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def DestroyHandle(self): <NEW_...
Provides a low-level encapsulation of a window handle and a window procedure. NativeWindow()
62598fc1956e5f7376df57b6
class Decorator(object): <NEW_LINE> <INDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> return self.required()(*args, **kwargs) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def required(cls): <NEW_LINE> <INDENT> def decorator(func): <NEW_LINE> <INDENT> @functools.wraps(func) <NEW_LINE> def wrapper(self, *a...
Protorpc method decorators. Reads the Authorization header, or authorization query paramater, and exposes self.session.
62598fc15fdd1c0f98e5e203
class RESTBaseAPI(RESTApi): <NEW_LINE> <INDENT> def __init__(self, app, config, mount): <NEW_LINE> <INDENT> RESTApi.__init__(self, app, config, mount) <NEW_LINE> self.formats = [ ('application/json', JSONFormat()) ] <NEW_LINE> if not os.path.exists(config.cachedir) or not os.path.isdir(config.cachedir): <NEW_LINE> <IND...
The UserFileCache REST API module
62598fc1bf627c535bcb1717
class Operation(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, 'origin': {'key': 'origin', 'type': 'str'}, 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, 'service_specification': {'key': '...
Key Vault REST API operation definition. :param name: Operation name: {provider}/{resource}/{operation}. :type name: str :param display: Display metadata associated with the operation. :type display: ~azure.mgmt.keyvault.v2019_09_01.models.OperationDisplay :param origin: The origin of operations. :type origin: str :pa...
62598fc1a219f33f346c6a78
class GooglePlacesSearchResult(object): <NEW_LINE> <INDENT> def __init__(self, query_instance, response): <NEW_LINE> <INDENT> self._places = [] <NEW_LINE> for place in response['results']: <NEW_LINE> <INDENT> self._places.append(Place(query_instance, place)) <NEW_LINE> <DEDENT> self._html_attributions = response['html_...
Wrapper around the Google Places API query JSON response.
62598fc199fddb7c1ca62f25
class InventoryDict(dict): <NEW_LINE> <INDENT> def __iter__(self): <NEW_LINE> <INDENT> self._iter_next_list = sorted(self.keys()) <NEW_LINE> self._iter_next_list.reverse() <NEW_LINE> return(iter(self._iter_next, None)) <NEW_LINE> <DEDENT> def _iter_next(self): <NEW_LINE> <INDENT> if (len(self._iter_next_list)>0): <NEW_...
Default implementation of class to store resources in Inventory Key properties of this class are: - has add(resource) method - is iterable and results given in alphanumeric order by resource.uri
62598fc2d486a94d0ba2c242
class _IndexMaps(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.keypath_value_id = defaultdict(lambda: defaultdict(list)) <NEW_LINE> self.value_id_keypath = defaultdict(lambda: defaultdict(list)) <NEW_LINE> self.values = {}
Helper to hold the index dictionaries.
62598fc2a05bb46b3848aadd
class Ward(BaseEstimator): <NEW_LINE> <INDENT> def __init__(self, n_clusters=2, memory=Memory(cachedir=None, verbose=0), connectivity=None, copy=True, n_components=None): <NEW_LINE> <INDENT> self.n_clusters = n_clusters <NEW_LINE> self.memory = memory <NEW_LINE> self.copy = copy <NEW_LINE> self.n_components = n_compone...
Ward hierarchical clustering: constructs a tree and cuts it. Parameters ---------- n_clusters : int or ndarray The number of clusters. connectivity : sparse matrix. connectivity matrix. Defines for each sample the neigbhoring samples following a given structure of the data. Defaut is None, i.e, the hi...
62598fc24527f215b58ea140
class StatsClientBase(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._prefix = None <NEW_LINE> <DEDENT> def close(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def _send(self, *args, **kwargs): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> de...
A Base class for various statsd clients.
62598fc24c3428357761a52d
class CLHEP2110(clhep.Clhep): <NEW_LINE> <INDENT> def __init__(self, system): <NEW_LINE> <INDENT> super(CLHEP2110, self).__init__("clhep-2.1.1.0", system, "clhep-2.1.1.0.tgz")
Clhep 2.1.1.0, install package.
62598fc23d592f4c4edbb12e
class FlatList(list): <NEW_LINE> <INDENT> @property <NEW_LINE> def data(self): <NEW_LINE> <INDENT> return list(self) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '<{}: {}>'.format(self.__class__.__name__, list(self))
This class inherits from list and has the same interface as a list-type. However, there is a 'data'-attribute introduced, that is required for the encoding of the list! The fields of the encoding-Schema must match the fields of the Object to be encoded!
62598fc255399d3f05626788
class GroupNorm1d(_GroupNorm): <NEW_LINE> <INDENT> pass
Dragon does not use separate backend functions.
62598fc2e1aae11d1e7ce95e
class Sources(object): <NEW_LINE> <INDENT> openapi_types = { 'links': 'ResourceMembersLinks', 'sources': 'list[Source]' } <NEW_LINE> attribute_map = { 'links': 'links', 'sources': 'sources' } <NEW_LINE> def __init__(self, links=None, sources=None): <NEW_LINE> <INDENT> self._links = None <NEW_LINE> self._sources = None ...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62598fc23317a56b869be689
class PylonsLoader(BaseLoader): <NEW_LINE> <INDENT> def read_configuration(self): <NEW_LINE> <INDENT> self.configured = True <NEW_LINE> return PylonsSettingsProxy() <NEW_LINE> <DEDENT> def on_worker_init(self): <NEW_LINE> <INDENT> self.import_default_modules()
Pylons celery loader Maps the celery config onto pylons.config
62598fc27c178a314d78d711
class ContentHandler(ResponseHandler): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def accepts(content_type): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def replacer(cls, response_data, path): <NEW_LINE> <INDENT> return path <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def dumps(data,...
A subclass of ResponseHandlers that adds content handling.
62598fc24f88993c371f0643
class HeatClient(base.DriverBase): <NEW_LINE> <INDENT> def __init__(self, params): <NEW_LINE> <INDENT> super(HeatClient, self).__init__(params) <NEW_LINE> self.fake_stack_create = { "id": "3095aefc-09fb-4bc7-b1f0-f21a304e864c", "links": [ { "href": " ", "rel": "self" } ] } <NEW_LINE> self.fake_stack_get = { "capabiliti...
Heat V1 driver.
62598fc2ec188e330fdf8b06
class FanBase(device_base.DeviceBase): <NEW_LINE> <INDENT> DEVICE_TYPE = "fan" <NEW_LINE> FAN_DIRECTION_INTAKE = "intake" <NEW_LINE> FAN_DIRECTION_EXHAUST = "exhaust" <NEW_LINE> STATUS_LED_COLOR_GREEN = "green" <NEW_LINE> STATUS_LED_COLOR_AMBER = "amber" <NEW_LINE> STATUS_LED_COLOR_RED = "red" <NEW_LINE> STATUS_LED_COL...
Abstract base class for interfacing with a fan module
62598fc2bf627c535bcb1719
class AjaxListView(AjaxMultipleObjectTemplateResponseMixin, BaseListView): <NEW_LINE> <INDENT> pass
Allows Ajax pagination of a list of objects. You can use this class-based view in place of *ListView* in order to recreate the behaviour of the *page_template* decorator. For instance, assume you have this code (taken from Django docs):: from django.conf.urls.defaults import * from django.views.generic impor...
62598fc221bff66bcd722edd
class AppPatch(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'application_id': {'readonly': True}, 'state': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'AppSkuInfo'}, 'identity': {'key': 'identity', 'type': 'SystemAssigne...
The description of the IoT Central application. Variables are only populated by the server, and will be ignored when sending a request. :param tags: A set of tags. Instance tags. :type tags: dict[str, str] :param sku: A valid instance SKU. :type sku: ~azure.mgmt.iotcentral.models.AppSkuInfo :param identity: The manag...
62598fc24527f215b58ea142
class UserSave(models.Model): <NEW_LINE> <INDENT> lab_proxy = models.ForeignKey(LabProxy) <NEW_LINE> user = models.ForeignKey(User) <NEW_LINE> save_file = models.FileField(blank=True, null=True, upload_to='edx/labster/lab/save') <NEW_LINE> created_at = models.DateTimeField(default=timezone.now) <NEW_LINE> modified_at =...
SavePoint need to be linked to LabProxy instead of Lab The way we designed the system, many courses could use same lab, with different set of questions.
62598fc2dc8b845886d5382e
class TestFileItem(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> logging.basicConfig() <NEW_LINE> logging.getLogger("wetransfer-python-sdk").setLevel(logging.DEBUG) <NEW_LINE> self.mock_handler = MockLoggingHandler() <NEW_LINE> LOGGER.addHandler(self.mock_handler) <NEW_LINE> self.temp_file = tempf...
Test class to host main tests for File class in items package.
62598fc260cbc95b063645b0
class BitStore(object): <NEW_LINE> <INDENT> def __init__(self, shape, device, store=None): <NEW_LINE> <INDENT> if store is not None: <NEW_LINE> <INDENT> self.store = store <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.store = torch.zeros(shape, dtype=torch.long).to(device) <NEW_LINE> <DEDENT> <DEDENT> def push(sel...
Efficiently stores information with non-integer number of bits (up to 16).
62598fc24428ac0f6e658798
class ManagerNotExecutingError(ManagerError): <NEW_LINE> <INDENT> pass
Base class for Yarely Manager thread execution errors.
62598fc266656f66f7d5a666
class Adapter(object): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> @abc.abstractproperty <NEW_LINE> def name(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def start_scan(self, timeout_sec): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> ...
Base class for a BLE network adapter.
62598fc223849d37ff851327
class DataManager(list): <NEW_LINE> <INDENT> def __init__(self, backend): <NEW_LINE> <INDENT> self.backend = backend <NEW_LINE> self.convert = BFConvertWrapper(self.backend) <NEW_LINE> <DEDENT> def load(self, fpath): <NEW_LINE> <INDENT> def is_microscopy_item(fpath): <NEW_LINE> <INDENT> l = fpath.split('.') <NEW_LINE> ...
Class for managing :class:`jicimagelib.image.ImageCollection` instances.
62598fc27047854f4633f647
class not_in_offical(Exception): <NEW_LINE> <INDENT> pass
This package is not in official repoisitories
62598fc2be7bc26dc9251f96
class Partner(osv.Model): <NEW_LINE> <INDENT> _inherit = 'res.partner' <NEW_LINE> _columns = { 'instructor' : fields.boolean(string="Instructor"), } <NEW_LINE> _defaults = { 'instructor' : False, }
Heredado de res.partner
62598fc2adb09d7d5dc0a7f2
class Top25SmoothPageSet(page_set_module.PageSet): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Top25SmoothPageSet, self).__init__( user_agent_type='desktop', archive_data_file='data/top_25_smooth.json', bucket=page_set_module.PARTNER_BUCKET) <NEW_LINE> self.AddUserStory(_CreatePageClassWithSmoothI...
Pages hand-picked for 2012 CrOS scrolling tuning efforts.
62598fc2bf627c535bcb171b
class SQLAlchemyBinding(object): <NEW_LINE> <INDENT> def __init__(self, provider, session, user=None, client=None, token=None, grant=None, current_user=None): <NEW_LINE> <INDENT> if user: <NEW_LINE> <INDENT> user_binding = UserBinding(user, session) <NEW_LINE> provider.usergetter(user_binding.get) <NEW_LINE> <DEDENT> i...
Configures the given :class:`OAuth2Provider` instance with the required getters and setters for persistence with SQLAlchemy. An example of using all models:: oauth = OAuth2Provider(app) SQLAlchemyBinding(oauth, session, user=User, client=Client, token=Token, grant=Grant, current_user=cu...
62598fc2ec188e330fdf8b08
class ShowdownPokemon(object): <NEW_LINE> <INDENT> schema = { 'name':'', 'hp':0, 'maxhp':0, 'ability':'', 'item':'', 'stats':[0], 'state':'', 'status':[''] } <NEW_LINE> STATES = ['active', 'fainted'] <NEW_LINE> STATUSES = [] <NEW_LINE> @classmethod <NEW_LINE> @schema_validated <NEW_LINE> def from_team_icon(cls, poke_el...
A class to get dict representations of pokemon from PS
62598fc2099cdd3c6367551c
class AnyValue: <NEW_LINE> <INDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def __ne__(self, other): <NEW_LINE> <INDENT> return False
Pseudo-value that returns True when compared to any other object. This object can be used for example to store parameters in resultsets. One concrete usage example is the following: let's assume that a user runs an experiment using various strategies under different values of a specific parameter and that the user kn...
62598fc2cc40096d6161a313
class USCTListFilterTestCase(EmployeeAdminFilterTestCase): <NEW_LINE> <INDENT> def test_lookups(self): <NEW_LINE> <INDENT> usct_regiment = RegimentFactory(usct=True) <NEW_LINE> usct_employee = EmployeeFactory(last_name='Dodge') <NEW_LINE> usct_employee.regiments.add(usct_regiment) <NEW_LINE> vrc_regiment = RegimentFact...
Test list filter for membership in a USCT regiment
62598fc25fdd1c0f98e5e208
class Address ( BaseModel ): <NEW_LINE> <INDENT> id = models.AutoField(primary_key=True, db_column='ID_SITE_ADDRESS') <NEW_LINE> street = models.CharField(max_length=50, null=True, blank=True, db_column='STREET', verbose_name = _('Street'), help_text = _('Street')) <NEW_LINE> city = models.CharField(max_length=20, db_c...
Address model. It can store only cities and countries or sholw addresses with geo spatial information. **Attributes** * ``id`` : Primary key * ``street`` :CharField(50) : Street address. * ``city``:CharField(20) : City. * ``region``:CharField(20) : Region. * ``zipCode``:CharField(20) : Zip code. * ``country``:CharFie...
62598fc266656f66f7d5a668
class TidePoolAlreadyBoundError(TidePoolException): <NEW_LINE> <INDENT> pass
Attempted to bind a bound TidePool
62598fc2283ffb24f3cf3afa
class MaterialForm(ModelForm): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(MaterialForm, self).__init__(*args, **kwargs) <NEW_LINE> self.fields['unidad'].empty_label = "Seleccione la unidad" <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> model = Material <NEW_LINE> fields = [...
docstring
62598fc27047854f4633f649
class Resource(Model): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'},...
An azure resource object. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Azure resource Id :vartype id: str :ivar name: Azure resource name :vartype name: str :ivar type: Azure resource type :vartype type: str :param location: Resource location :type location: str :p...
62598fc2a8370b77170f0657
class WebAPIScopeDictionary(object): <NEW_LINE> <INDENT> def __init__(self, root_resource): <NEW_LINE> <INDENT> self.resource_trees = {root_resource} <NEW_LINE> self._update_lock = threading.Lock() <NEW_LINE> self._scope_dict = {} <NEW_LINE> <DEDENT> @property <NEW_LINE> def scope_dict(self): <NEW_LINE> <INDENT> if not...
A Web API scope dictionary. This class knows how to build a list of available scopes from the WebAPI resource tree at runtime. By default, it will only have to walk the API tree once, after which the value can be cached.
62598fc2956e5f7376df57b9
class BaseConfig(object): <NEW_LINE> <INDENT> DEBUG = False <NEW_LINE> CSRF_ENABLED = True <NEW_LINE> SECRET_KEY = os.getenv('SECRET') <NEW_LINE> SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL')
Base configuration class.
62598fc28a349b6b436864b4
class Solution4: <NEW_LINE> <INDENT> def reverseBits(self, n: int) -> int: <NEW_LINE> <INDENT> ret, power = 0, 31 <NEW_LINE> while n: <NEW_LINE> <INDENT> ret += (n & 1) << power <NEW_LINE> n >>= 1 <NEW_LINE> power -= 1 <NEW_LINE> <DEDENT> return ret
Bit by Bit Algorithm: The key idea is that for a bit that is situated at the index i, after the reversion, its position should be 31-i (note: the index starts from zero). * We iterate through the bit string of the input integer, from right to left (i.e. n = n >> 1). To retrieve the right-most bit of an integer, we a...
62598fc25fc7496912d483b6