Compute and return values (req, editable, comments) for use in
    FrozenRequirement.from_dist().
162329
def get_requirement_info(dist):
    # type: (Distribution) -> RequirementInfo
    
    if not dist_is_editable(dist):
        return (None, False, [])

    location = os.path.normcase(os.path.abspath(dist.location))

    from pipenv.patched.notpip._internal.vcs import vcs, RemoteNotFoundError
    vc_type = vcs.get_backend_type(location)

    if not vc_type:
        req = dist.as_requirement()
        logger.debug(
            'No VCS found for editable requirement {!r} in: {!r}', req,
            location,
        )
        comments = [
            '# Editable install with no version control ({})'.format(req)
        ]
        return (location, True, comments)

    try:
        req = vc_type.get_src_requirement(location, dist.project_name)
    except RemoteNotFoundError:
        req = dist.as_requirement()
        comments = [
            '# Editable {} install with no remote ({})'.format(
                vc_type.__name__, req,
            )
        ]
        return (location, True, comments)

    except BadCommand:
        logger.warning(
            'cannot determine version of editable source in %s '
            '(%s command not found in path)',
            location,
            vc_type.name,
        )
        return (None, True, [])

    except InstallationError as exc:
        logger.warning(
            "Error when trying to get requirement for VCS system %s, "
            "falling back to uneditable format", exc
        )
    else:
        if req is not None:
            return (req, True, [])

    logger.warning(
        'Could not determine repository location of %s', location
    )
    comments = ['## !! Could not determine repository location']

    return (None, False, comments)
191955
def _get_abstract_dist_for(self, req):
        # type: (InstallRequirement) -> DistAbstraction
        
        assert self.require_hashes is not None, (
            "require_hashes should have been set in Resolver.resolve()"
        )

        if req.editable:
            return self.preparer.prepare_editable_requirement(
                req, self.require_hashes, self.use_user_site, self.finder,
            )

        # satisfied_by is only evaluated by calling _check_skip_installed,
        # so it must be None here.
        assert req.satisfied_by is None
        skip_reason = self._check_skip_installed(req)

        if req.satisfied_by:
            return self.preparer.prepare_installed_requirement(
                req, self.require_hashes, skip_reason
            )

        upgrade_allowed = self._is_upgrade_allowed(req)
        abstract_dist = self.preparer.prepare_linked_requirement(
            req, self.session, self.finder, upgrade_allowed,
            self.require_hashes
        )

        # NOTE
        # The following portion is for determining if a certain package is
        # going to be re-installed/upgraded or not and reporting to the user.
        # This should probably get cleaned up in a future refactor.

        # req.req is only avail after unpack for URL
        # pkgs repeat check_if_exists to uninstall-on-upgrade
        # (#14)
        if not self.ignore_installed:
            req.check_if_exists(self.use_user_site)

        if req.satisfied_by:
            should_modify = (
                self.upgrade_strategy != "to-satisfy-only" or
                self.force_reinstall or
                self.ignore_installed or
                req.link.scheme == 'file'
            )
            if should_modify:
                self._set_req_to_reinstall(req)
            else:
                logger.info(
                    'Requirement already satisfied (use --upgrade to upgrade):'
                    ' %s', req,
                )

        return abstract_dist
737464
def _compute(self):
        
        src_path = self.ctx.src_path
        if not src_path.exists:
            return NONE
        if src_path.is_null:
            return None
        try:
            if self.parse:
                value = self.parse(src_path)
            else:
                value = self._parse(src_path)
            return value
        except (SourceError, ValueError), ex:
            self.ctx.errors.invalid(str(ex))
            return ERROR
1223545
def _retf(ins):
    
    output = _float_oper(ins.quad[1])
    output.append('#pragma opt require a,bc,de')
    output.append('jp %s' % str(ins.quad[2]))
    return output
509200
def _range(self, xloc, cache):
        
        uloc = numpy.zeros((2, len(self)))
        for dist in evaluation.sorted_dependencies(self, reverse=True):
            if dist not in self.inverse_map:
                continue
            idx = self.inverse_map[dist]
            xloc_ = xloc[idx].reshape(1, -1)
            uloc[:, idx] = evaluation.evaluate_bound(
                dist, xloc_, cache=cache).flatten()
        return uloc
577979
def _get_val(other):
    
    assert isinstance(other, (numbers.Number, SymbolNUMBER, SymbolCONST))
    if isinstance(other, SymbolNUMBER):
        return other.value

    if isinstance(other, SymbolCONST):
        return other.expr.value

    return other
1156336
def _key_from_req(req):
    """"""
    if hasattr(req, 'key'):
        # from pkg_resources, such as installed dists for pip-sync
        key = req.key
    else:
        # from packaging, such as install requirements from requirements.txt
        key = req.name

    key = key.replace('_', '-').lower()
    return key
506138
def cost(self, i, j):
        """"""
        return dist(self.endpoints[i][1], self.endpoints[j][0])
800109
def get_dist(dist):
    
    from scipy import stats

    dc = getattr(stats, dist, None)
    if dc is None:
        e = "Statistical distribution `{}` is not in scipy.stats.".format(dist)
        raise ValueError(e)
    return dc
984077
def matches(self, requirement):
    """"""
    try:
      requirement = self.parse_requirement(requirement, self._interpreter)
    except ValueError as e:
      raise self.UnknownRequirement(str(e))
    return self.distribution in requirement
145036
def _compute_distance(cls, dists, coeffs):
        
        return coeffs['b3']*np.log10(np.sqrt(dists.rjb**2. + coeffs['b4']**2.))
1355510
def get_dependants(cls, dist):
        """"""
        for package in cls.installed_distributions:
            for requirement_package in package.requires():
                requirement_name = requirement_package.project_name
                # perform case-insensitive matching
                if requirement_name.lower() == dist.lower():
                    yield package
382812
def cume_dist(expr, sort=None, ascending=True):
    
    return _rank_op(expr, CumeDist, types.float64, sort=sort, ascending=ascending)
232231
def _dist_kw_arg(self, k):
        
        if self._dist_kw_args is not None:
            return {
                key:self._dist_kw_args[key][k,:]
                for key in self._dist_kw_args.keys()
            }
        else:
            return {}
591072
def dist_from_args(ctx, args):
    
    return Distribution.get_distribution(
        ctx,
        name=args.dist_name,
        recipes=split_argument_list(args.requirements),
        ndk_api=args.ndk_api,
        force_build=args.force_build,
        require_perfect_match=args.require_perfect_match,
        allow_replace_dist=args.allow_replace_dist)
1141330
def update(self, dist):
        
        assert isinstance(dist, DDist)
        for k, c in iteritems(dist.counts):
            self.counts[k] += c
        self.total += dist.total
721972
def fromAttr2(start, ang, dist):
    
    sx, sy = start
    dx = cos(ang) * dist
    dy = sin(ang) * dist
    return sx, sy, sx + dx, sy + dy