parameters: (base_paths, library_name, required_version)
return_statement: return _find_file(base_paths, _library_paths(), filepattern)
docstring: Returns first valid path to the requested library.
docstring_summary: Returns first valid path to the requested library.
docstring_tokens: Returns first valid path to the requested library .
function: def _find_library(base_paths, library_name, required_version):
    """Returns first valid path to the requested library."""
    if _is_windows():
      filepattern = library_name + ".lib"
    elif _is_macos():
      filepattern = "%s*.dylib" % (".".join(["lib" + library_name] +
                                            required_version.split(".")[:1]))
    else:
      filepattern = ".".join(["lib" + library_name, "so"] +
                             required_version.split(".")[:1]) + "*"
    return _find_file(base_paths, _library_paths(), filepattern)
function_tokens: def _find_library ( base_paths , library_name , required_version ) : if _is_windows ( ) : filepattern = library_name + ".lib" elif _is_macos ( ) : filepattern = "%s*.dylib" % ( "." . join ( [ "lib" + library_name ] + required_version . split ( "." ) [ : 1 ] ) ) else : filepattern = "." . join ( [ "lib" + library_name , "so" ] + required_version . split ( "." ) [ : 1 ] ) + "*" return _find_file ( base_paths , _library_paths ( ) , filepattern )