theano/gof/cmodule.py
def module_name_from_dir(dirname, err=True, files=None):
    """
    Scan the contents of a cache directory and return full path of the
    dynamic lib in it.

    """
    if files is None:
        try:
            files = os.listdir(dirname)
        except OSError as e:
            if e.errno == 2 and not err:  # No such file or directory
                return None
    names = [file for file in files
             if file.endswith('.so') or file.endswith('.pyd')]
    if len(names) == 0 and not err:
        return None
    elif len(names) == 1:
        return os.path.join(dirname, names[0])
    else:
        raise ValueError("More than 1 compiled module in this directory:" +
                         dirname)

    Scan the contents of a cache directory and return full path of the
    dynamic lib in it.

    
Scan the contents of a cache directory and return full path of the
dynamic lib in it.
Scan the contents of a cache directory and return full path of the dynamic lib in it .
def module_name_from_dir(dirname, err=True, files=None):
    if files is None:
        try:
            files = os.listdir(dirname)
        except OSError as e:
            if e.errno == 2 and not err:  
                return None
    names = [file for file in files
             if file.endswith('.so') or file.endswith('.pyd')]
    if len(names) == 0 and not err:
        return None
    elif len(names) == 1:
        return os.path.join(dirname, names[0])
    else:
        raise ValueError("More than 1 compiled module in this directory:" +
                         dirname)
def module_name_from_dir ( dirname , err = True , files = None ) : if files is None : try : files = os . listdir ( dirname ) except OSError as e : if e . errno == 2 and not err : return None names = [ file for file in files if file . endswith ( '.so' ) or file . endswith ( '.pyd' ) ] if len ( names ) == 0 and not err : return None elif len ( names ) == 1 : return os . path . join ( dirname , names [ 0 ] ) else : raise ValueError ( "More than 1 compiled module in this directory:" + dirname )
Scan the contents of a cache directory and return full path of the
dynamic lib in it.
Scan the contents of a cache directory and return full path of the dynamic lib in it .
"""
    Scan the contents of a cache directory and return full path of the
    dynamic lib in it.

    """ # No such file or directory
dirname
err
files