Required for windows systems - functions defined in libutils.def.
964421
def export_symbols(*path):
    
    lines = open(os.path.join(*path), 'r').readlines()[2:]
    return [s.strip() for s in lines if s.strip() != '']
1291215
def dependencies(dist, recursive=False, info=False):
    """"""

    def case_sorted(items):
        """Return unique list sorted in case-insensitive order."""
        return sorted(set(items), key=lambda i: i.lower())

    def requires(distribution):
        """Return the requirements for a distribution."""
        if recursive:
            req = set(pkg_resources.require(distribution.project_name))
            req.remove(distribution)
            return {r.as_requirement() for r in req}
        return distribution.requires()

    def modifier(distribution):
        """Return project's name or full requirement string."""
        return str(distribution) if info else distribution.project_name

    return case_sorted(modifier(r) for r in requires(dist))
515246
def make_funcs(dataset, setdir, store):
    """"""
    return {
        'cat': lambda *lists: [x for lst in lists for x in lst],
        'comments': lambda: None,
        'detail_route': detail_route,
        'format': lambda fmt, *args: fmt.format(*args),
        'get': partial(getnode, dataset, setdir, store),
        'join': lambda sep, *args: sep.join([x for x in args if x]),
        'len': len,
        'link': (lambda href, title, target=None:
                 {'href': href or "",
                  'title': title or "",
                  'target': '_blank' if target is None else target}),
        'list': lambda *x: filter(None, list(x)),
        'max': max,
        'min': min,
        'status': lambda: ['#STATUS#'],
        'sum': sum,
        'tags': lambda: ['#TAGS#'],
        'trace': print_trace,
    }
1189842
def build_funcs(modules):
        
        kernel32 = ['kernel32_']
        try:
            kernel32 += remove_dups(modules['kernel32'])
        except KeyError:
            if len(modules) and 'LoadLibraryA' not in kernel32:
                kernel32.insert(1, 'LoadLibraryA')
        if len(modules) > 1 and 'LoadLibraryA' not in kernel32:
            kernel32.insert(1, 'LoadLibraryA')
        if 'GetProcAddress' not in kernel32:
            kernel32.insert(1, 'GetProcAddress')
        logging.debug('kernel32: %s', kernel32)
        for module, funcs in modules.items():
            logging.debug('%s: %s', module, funcs)
            if module != 'kernel32':
                kernel32.extend([module + '_'] + remove_dups(funcs))
        return kernel32
202779
def requirements(fname):
        
        packages = Setup.read(fname, fail_silently=True).split('\n')
        packages = (p.strip() for p in packages)
        packages = (p for p in packages if p and not p.startswith('#'))
        return list(packages)
1307679
def custom_function(func, input_files, output_file):
    
    from .modules import utils

    return {
        'dependencies_fn': utils.no_dependencies,
        'compiler_fn': func,
        'input': input_files,
        'output': output_file,
        'kwargs': {},
    }
697239
def cxx(source, libraries=[]):
    
    """
    path = _cc_build_shared_lib(source, '.cc', libraries)
    return ctypes.cdll.LoadLibrary(path)
23276
function findFunctions(optionFunctions, defaultDir) {
  var allFunctions = [];
  optionFunctions = toArray(optionFunctions);
  optionFunctions.forEach(function (fn, i) {
    if (typeof fn === 'function') {
      allFunctions.push(fn);
      return;
    }
    if (typeof fn !== 'string') {
      throw new Error('function must be a string or array');
    }
    var m = requireMaybe(fn);
    if (!m) {
      m = requireMaybe(path.join(process.cwd(), fn));
    }
    if (!m) {
      m = requireMaybe(path.join('..', defaultDir, fn));
    }
    if (!m) {
      throw new Error('did not find function or problem loading function: ' + fn);
    }
    if (typeof m !== 'function') {
      throw new Error('function module must export a function');
    }
    allFunctions.push(m);
  });
  return allFunctions;
}
155235
function makeRequireFunction() {
    const Module = this.constructor;
    const self = this;

    function require(path) {
        try {
            exports.requireDepth += 1;
            return self.require(path);
        } finally {
            exports.requireDepth -= 1;
        }
    }

    function resolve(request) {
        return Module._resolveFilename(request, self);
    }

    require.resolve = resolve;

    require.main = process.mainModule;

    // Enable support to add extra extension types.
    require.extensions = Module._extensions;

    require.cache = Module._cache;

    return require;
}
1070037
def load_builtins(self):
        """"""
        for raw_name in dir(builtins):
            if not raw_name.startswith('__'):

                if raw_name.startswith('_'):
                    function_name = raw_name[1:]
                else:
                    function_name = raw_name

                builtin_function = FunctionSymbol(
                    Function(function_name, getattr(builtins, raw_name))
                )
                self.table[function_name] = builtin_function
586392
function define(path, factoryOrObject, options) {
        /*
        $_mod.def('/baz$3.0.0/lib/index', function(require, exports, module, __filename, __dirname) {
            // module source code goes here
        });
        */

        var globals = options && options.globals;

        definitions[path] = factoryOrObject;

        if (globals) {
            var target = win || global;
            for (var i=0;i<globals.length; i++) {
                var globalVarName = globals[i];
                var globalModule = loadedGlobalsByRealPath[path] = requireModule(path);
                target[globalVarName] = globalModule.exports;
            }
        }
    }
304815
def depends(func):
    
    from jcvi.apps.base import need_update, listify

    infile = "infile"
    outfile = "outfile"

    def wrapper(*args, **kwargs):
        assert outfile in kwargs, \
            "You need to specify `outfile=` on function call"
        if infile in kwargs:
            infilename = listify(kwargs[infile])
            for x in infilename:
                assert op.exists(x), \
                    "The specified infile `{0}` does not exist".format(x)

        outfilename = kwargs[outfile]
        if need_update(infilename, outfilename):
            return func(*args, **kwargs)
        else:
            msg = "File `{0}` exists. Computation skipped." \
                .format(outfilename)
            logging.debug(msg)

        outfilename = listify(outfilename)

        for x in outfilename:
            assert op.exists(x), \
                "Something went wrong, `{0}` not found".format(x)

        return outfilename

    return wrapper
792618
def driver_needed(func):
    

    def wrapped(self, *args):
        if not self.driver:
            raise AttributeError("No driver passed to object")

        return func(self, *args)

    return wrapped
1125500
def func(nargs: Optional[int] = None, nouts: Optional[int] = None, ndefs: Optional[int] = None):
    
    return lambda f: wraps(f)(WrappedFunction(f, nargs=nargs, nouts=nouts, ndefs=ndefs))
89053
def functions(self):
        
        if self._functions is None:
            self._functions = FunctionList(self._version, service_sid=self._solution['sid'], )
        return self._functions
958124
def getLibraryFiles(self, engineRoot, delimiter=' '):
		
		return delimiter.join(self.resolveRoot(self.libs, engineRoot))
1247357
def load():
    
    if 'Windows' == platform.system():
        # Possible scenarios here
        #   1. Run from source, DLLs are in pyzbar directory
        #       cdll.LoadLibrary() imports DLLs in repo root directory
        #   2. Wheel install into CPython installation
        #       cdll.LoadLibrary() imports DLLs in package directory
        #   3. Wheel install into virtualenv
        #       cdll.LoadLibrary() imports DLLs in package directory
        #   4. Frozen
        #       cdll.LoadLibrary() imports DLLs alongside executable
        fname, dependencies = _windows_fnames()

        def load_objects(directory):
            # Load dependencies before loading libzbar dll
            deps = [
                cdll.LoadLibrary(str(directory.joinpath(dep)))
                for dep in dependencies
            ]
            libzbar = cdll.LoadLibrary(str(directory.joinpath(fname)))
            return deps, libzbar

        try:
            dependencies, libzbar = load_objects(Path(''))
        except OSError:
            dependencies, libzbar = load_objects(Path(__file__).parent)
    else:
        # Assume a shared library on the path
        path = find_library('zbar')
        if not path:
            raise ImportError('Unable to find zbar shared library')
        libzbar = cdll.LoadLibrary(path)
        dependencies = []

    return libzbar, dependencies