<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def library_line(self, file_name):
 """ Specifies GULP library file to read species and potential parameters. If using library don't specify species and potential in the input file and vice versa. Make sure the elements of structure are in the library file. Args: file_name: Name of GULP library file Returns: GULP input string specifying library option """

        gulplib_set = lambda: 'GULP_LIB' in os.environ.keys()
        readable = lambda f: os.path.isfile(f) and os.access(f, os.R_OK)

        #dirpath, fname = os.path.split(file_name)
        #if dirpath:  # Full path specified
        #    if readable(file_name):
        #        gin = 'library ' + file_name
        #    else:
        #        raise GulpError('GULP Library not found')
        #else:
        #    fpath = os.path.join(os.getcwd(), file_name)  # Check current dir
        #    if readable(fpath):
        #        gin = 'library ' + fpath
        #    elif gulplib_set():
        #        fpath = os.path.join(os.environ['GULP_LIB'], file_name)
        #        if readable(fpath):
        #            gin = 'library ' + file_name
        #        else:
        #            raise GulpError('GULP Library not found')
        #    else:
        #        raise GulpError('GULP Library not found')
        #gin += "\n"
        #return gin

        gin = ""
        dirpath, fname = os.path.split(file_name)
        if dirpath and readable(file_name):  # Full path specified
            gin = 'library ' + file_name
        else:
            fpath = os.path.join(os.getcwd(), file_name)  # Check current dir
            if readable(fpath):
                gin = 'library ' + fpath
            elif gulplib_set():         # Check the GULP_LIB path
                fpath = os.path.join(os.environ['GULP_LIB'], file_name)
                if readable(fpath):
                    gin = 'library ' + file_name
        if gin:
            return gin + "\n"
        else:
            raise GulpError('GULP Library not found')