Return the base CLB for a given DU
178552
def base(self, du):
        """"""
        parameter = 'base'
        if parameter not in self._by:
            self._by[parameter] = {}
            for clb in self.upi.values():
                if clb.floor == 0:
                    self._by[parameter][clb.du] = clb
        return self._by[parameter][du]
143537
def get_cl_start(self, addr):
        """"""
        return addr >> self.backend.cl_bits << self.backend.cl_bits
242243
def _bin(g):
    """"""
    new_rules = []
    for rule in g.rules:
        if len(rule.rhs) > 2:
            new_rules += _split(rule)
        else:
            new_rules.append(rule)
    return Grammar(new_rules)
1361284
def _get_deps(deps, tree_base, saltenv='base'):
    '''
    
    '''
    deps_list = ''
    if deps is None:
        return deps_list
    if not isinstance(deps, list):
        raise SaltInvocationError(
            '\'deps\' must be a Python list or comma-separated string'
        )
    for deprpm in deps:
        parsed = _urlparse(deprpm)
        depbase = os.path.basename(deprpm)
        dest = os.path.join(tree_base, depbase)
        if parsed.scheme:
            __salt__['cp.get_url'](deprpm, dest, saltenv=saltenv)
        else:
            shutil.copy(deprpm, dest)

        deps_list += ' {0}'.format(dest)

    return deps_list
879586
def get_dependencies_from_decl(decl, recursive=True):
    
    result = []
    if isinstance(decl, typedef.typedef_t) or \
            isinstance(decl, variable.variable_t):
        return [dependency_info_t(decl, decl.decl_type)]
    if isinstance(decl, namespace.namespace_t):
        if recursive:
            for d in decl.declarations:
                result.extend(get_dependencies_from_decl(d))
        return result
    if isinstance(decl, calldef.calldef_t):
        if decl.return_type:
            result.append(
                dependency_info_t(decl, decl.return_type, hint="return type"))
        for arg in decl.arguments:
            result.append(dependency_info_t(decl, arg.decl_type))
        for exc in decl.exceptions:
            result.append(dependency_info_t(decl, exc, hint="exception"))
        return result
    if isinstance(decl, class_declaration.class_t):
        for base in decl.bases:
            result.append(
                dependency_info_t(
                    decl,
                    base.related_class,
                    base.access_type,
                    "base class"))
        if recursive:
            for access_type in class_declaration.ACCESS_TYPES.ALL:
                result.extend(
                    __find_out_member_dependencies(
                        decl.get_members(access_type), access_type))
        return result
    return result
706950
def derive_configuration(cls):
        
        base_params = cls.base.__parameters__
        if hasattr(cls.type, '__args__'):
            # typing as of commit abefbe4
            tvars = {p: p for p in base_params}
            types = {}
            for t in iter_generic_bases(cls.type):
                if t is cls.base:
                    type_vars = tuple(tvars[p] for p in base_params)
                    parameters = (types.get(tvar, tvar) for tvar in type_vars)
                    break
                if t.__args__:
                    for arg, tvar in zip(t.__args__, t.__origin__.__parameters__):
                        if isinstance(arg, typing.TypeVar):
                            tvars[tvar] = tvars.get(arg, arg)
                        else:
                            types[tvar] = arg
        else:
            # typing 3.5.0
            tvars = [None] * len(base_params)
            for t in iter_generic_bases(cls.type):
                for i, p in enumerate(t.__parameters__):
                    if tvars[i] is None and isinstance(p, typing.TypeVar):
                        tvars[i] = p
                if all(tvars):
                    type_vars = tvars
                    parameters = cls.type.__parameters__
                    break
        cls.type_vars = type_vars
        cls.parameters = tuple(normalize_type(p, 1) for p in parameters)
610369
def find_deps_cli():
    '''
    
    '''
    cmdline_args = sys.argv[1:]
    with CmdlineParser.global_instance(cmdline_args) as cp:
        return find_deps(cp.get_task_obj(), upstream().family)
544015
function findAtDecl (decls, prop) {
  const foundDecls = decls.filter((decl) => {
    return (isPlainObject(decl) &&
          Object.keys(decl).length > 0 &&
          Object.keys(decl)[0] === `@${prop}`) || decl === `@${prop}`
  })

  if (foundDecls.length === 0) { return }

  const decl = foundDecls[0]

  return isPlainObject(decl) ? Object.values(decl)[0] : true
}
380426
def _get_deps(self, tree, include_punct, representation, universal):
        """"""
        if universal:
            converter = self.universal_converter

            if self.universal_converter == self.converter:
                import warnings
                warnings.warn("This jar doesn't support universal "
                              "dependencies, falling back to Stanford "
                              "Dependencies. To suppress this message, "
                              "call with universal=False")
        else:
            converter = self.converter

        if include_punct:
            egs = converter(tree, self.acceptFilter)
        else:
            egs = converter(tree)

        if representation == 'basic':
            deps = egs.typedDependencies()
        elif representation == 'collapsed':
            deps = egs.typedDependenciesCollapsed(True)
        elif representation == 'CCprocessed':
            deps = egs.typedDependenciesCCprocessed(True)
        else:
            # _raise_on_bad_representation should ensure that this
            # assertion doesn't fail
            assert representation == 'collapsedTree'
            deps = egs.typedDependenciesCollapsedTree()
        return self._listify(deps)
588976
def ddb_path(self):
        """"""
        # Lazy property to avoid multiple calls to has_abiext.
        try:
            return self._ddb_path
        except AttributeError:
            path = self.outdir.has_abiext("DDB")
            if path: self._ddb_path = path
            return path
1060856
def _c_base_var(self):
        """"""
        if self.opts.no_structs:
            return self.name
        return 'windll->{}.{}'.format(
            self.name, self.opts.base
        )
604267
function(depName, depLoad){
				var parsed = baseHelpers.parseModuleName(depLoad.name);
				var res;
				if( parsed.packageName !== "can-util" ) {
					res = baseNormalize.apply(this, arguments);
				} else {
					res = "set-"+parsed.packageName+"/"+parsed.modulePath
				}
				return res;
			}
526979
def depend(*args):
    
    def decfunc(cls):
        if not 'depends' in cls.__dict__:
            cls.depends = []
        cls.depends.extend(list(args))
        for a in args:
            if not hasattr(a, 'referencedBy'):
                a.referencedBy = []
            a.referencedBy.append(cls)
        return cls
    return decfunc
630670
def from_cli(cls, opt, strain):
        
        return cls(strain, segment_length=opt.segment_length,
                   segment_start_pad=opt.segment_start_pad,
                   segment_end_pad=opt.segment_end_pad,
                   trigger_start=opt.trig_start_time,
                   trigger_end=opt.trig_end_time,
                   filter_inj_only=opt.filter_inj_only,
                   injection_window=opt.injection_window,
                   allow_zero_padding=opt.allow_zero_padding)
1193738
def get_command(self, ctx, name):
        """"""
        env = ctx.ensure_object(environment.Environment)
        env.load()

        # Do alias lookup (only available for root commands)
        if len(self.path) == 0:
            name = env.resolve_alias(name)

        new_path = list(self.path)
        new_path.append(name)
        module = env.get_command(*new_path)
        if isinstance(module, types.ModuleType):
            return CommandLoader(*new_path, help=module.__doc__ or '')
        else:
            return module
1346715
def cmp(cls, v1: 'VersionBase', v2: 'VersionBase') -> int:
        
        # TODO types checking
        if v1._version > v2._version:
            return 1
        elif v1._version == v2._version:
            return 0
        else:
            return -1
765968
def _get_cl_version(p, config):
    
    if not p.get("has_cl_version", True):
        return ""
    try:
        prog = config_utils.get_program(p["cmd"], config)
    except config_utils.CmdNotFound:

        localpy_cmd = os.path.join(os.path.dirname(sys.executable), p["cmd"])
        if os.path.exists(localpy_cmd):
            prog = localpy_cmd
        else:
            return ""
    args = p.get("args", "")

    cmd = "{prog} {args}"
    subp = subprocess.Popen(cmd.format(**locals()), stdout=subprocess.PIPE,
                            stderr=subprocess.STDOUT,
                            shell=True)
    with contextlib.closing(subp.stdout) as stdout:
        if p.get("stdout_flag"):
            v = _parse_from_stdoutflag(stdout, p["stdout_flag"])
        elif p.get("paren_flag"):
            v = _parse_from_parenflag(stdout, p["paren_flag"])
        else:
            lines = [l.strip() for l in str(stdout.read()).split("\n") if l.strip()]
            v = lines[-1]
    if v.endswith("."):
        v = v[:-1]
    return v