Given a path to a library, load it.
764373
def load(self,path):
        """"""
        try:
            # Darwin requires dlopen to be called with mode RTLD_GLOBAL instead
            # of the default RTLD_LOCAL.  Without this, you end up with
            # libraries not being loadable, resulting in "Symbol not found"
            # errors
            if sys.platform == 'darwin':
                return ctypes.CDLL(path, ctypes.RTLD_GLOBAL)
            else:
                return ctypes.cdll.LoadLibrary(path)
        except OSError,e:
            raise ImportError(e)
794311
def load(cls, path, base=None):
        ''''''
        base = base or os.getcwd()
        absolute = os.path.abspath(path)
        parent = os.path.dirname(absolute)
        name, _, _ = os.path.basename(absolute).rpartition('.py')
        fobj, path, description = imp.find_module(name, [parent])
        try:
            imp.load_module(name, fobj, path, description)
        finally:
            if fobj:
                fobj.close()
        # Manipulate the full names of the tasks to be relative to the provided
        # base
        relative, _, _ = os.path.relpath(path, base).rpartition('.py')
        for task in cls._cache:
            parts = relative.split(os.path.sep)
            parts.append(task.name)
            # If it's either in shovel.py, or folder/__init__.py, then we
            # should consider it as being at one level above that file
            parts = [part.strip('.') for part in parts if part not in
                ('shovel', '.shovel', '__init__', '.', '..', '')]
            task.fullname = '.'.join(parts)
            logger.debug('Found task %s in %s' % (task.fullname, task.module))
        return cls.clear()
66604
def load_dir(self, path):
        

        def visit_path(arg, dirname, names):
            for name in names:
                fpath = os.path.join(dirname, name)
                new_path = fpath[len(path):]
                if os.path.isfile(fpath):
                    content = open(fpath, "rb").read()
                    self.touch(new_path, content)
                else:
                    self.mkdir(new_path)

        os.path.walk(path, visit_path, None)
70005
def load_path(self, path):
        

        if not foundations.common.path_exists(path):
            return False

        if os.path.isfile(path):
            if path in self.list_files():
                self.set_current_editor(path)
            else:
                self.load_file(path)
        else:
            if not path in self.list_projects():
                self.add_project(path)
        return True
1051028
def load(self, relpath, rsc=None, mode='r', useFilepath=None):
        
        filepath = self.find(relpath, rsc, useFilepath=useFilepath)
        
        # parse a resource object
        if filepath.startswith(':'):
            return QtCore.QFile(filepath)
        
        # parse a filepath
        elif os.path.isfile(filepath):
            return open(filepath, mode)
        
        # return an unknown object
        else:
            return None
381475
def load(self, path):
        
        # Get the object
        DB = joblib.load(path)
        
        # Load the attributes
        self.catalog   = DB.catalog
        self.n_sources = DB.n_sources
        self.name      = DB.name
        self.history   = DB.history
        
        del DB
1369981
def get_library(path=None, root=None, db=None):
    import ambry.library as _l
    """"""

    rc = config(path=path, root=root, db=db )

    return _l.new_library(rc)
150726
def load(cls, path, base=None):
        ''''''
        obj = cls()
        obj.read(path, base)
        return obj
686524
def load_library_handle(libname, path):
    """"""

    if path is None or path in ['None', 'none']:
        # Either could not find a library via ctypes or
        # user-configuration-file, or we could not find it in any of the
        # default locations, or possibly the user intentionally does not want
        # one of the libraries to load.
        return None

    try:
        if os.name == "nt":
            opj_lib = ctypes.windll.LoadLibrary(path)
        else:
            opj_lib = ctypes.CDLL(path)
    except (TypeError, OSError):
        msg = 'The {libname} library at {path} could not be loaded.'
        msg = msg.format(path=path, libname=libname)
        warnings.warn(msg, UserWarning)
        opj_lib = None

    return opj_lib
11946
def _load_lib():
    """"""
    lib_path = _find_lib_path()
    lib = ctypes.cdll.LoadLibrary(lib_path[0])
    # DMatrix functions
    lib.MXGetLastError.restype = ctypes.c_char_p
    return lib
1163683
def load(filepath):
        '''
        
        '''

        try:
            with open(filepath, "r") as fh:
                source = fh.read()
        except Exception as e:
            return None, e
        return source, None
1196807
def load_context(context, file_path=None):
    """"""
    if not file_path:
        file_path = _get_context_filepath()
    if os.path.exists(file_path):
        with io.open(file_path, encoding='utf-8') as f:
            for line in f:
                execute(line, context)
1455
def load(self, project: typing.Union[projects.Project, None]):
        """"""
        self._project = project
200128
def load(self, filepath):
        """"""
        with open(filepath, 'rb') as fd:
            num_keys = struct.unpack(">i", fd.read(4))[0]
            for i in range(num_keys):
                row, value, kind = struct.unpack('>ifb', fd.read(9))
                self.keys.append(TrackKey(row, value, kind))
154944
def load(path):
    
    f = open(path, 'rb')
    try:
        return pickle.load(f)
    finally:
        f.close()
579889
def load(cls, path):
        
        auth = cls()
        with open(path) as fd:
            for pubkey in itertools.imap(str.strip, fd):
                # skip empty lines
                if not pubkey:
                    continue
                auth.add(pubkey)
        return auth
1059152
def _load_lib():
    """"""
    lib_path = libinfo.find_lib_path()
    lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_LOCAL)
    # DMatrix functions
    lib.MXGetLastError.restype = ctypes.c_char_p
    return lib