parameters: (filename, paths, cwd)
docstring: Checks the provided paths relative to cwd for a certain filename
docstring_summary: Checks the provided paths relative to cwd for a certain filename
docstring_tokens: Checks the provided paths relative to cwd for a certain filename
function: def find_file_in_paths(filename, paths, cwd):
          """Checks the provided paths relative to cwd for a certain filename"""
          if not os.path.isdir(cwd):
              cwd = os.path.dirname(cwd)
          if isinstance(paths, str):
              paths = (p for p in paths.split(':') if p)
  
          for path in paths:
              path = os.path.expanduser(path)
              if not os.path.isabs(path):
                  path = os.path.normpath(os.path.join(cwd, path))
              file_path = os.path.join(path, filename)
              if os.path.exists(os.path.normpath(file_path)):
                  return file_path
function_tokens: def find_file_in_paths ( filename , paths , cwd ) : if not os . path . isdir ( cwd ) : cwd = os . path . dirname ( cwd ) if isinstance ( paths , str ) : paths = ( p for p in paths . split ( ':' ) if p ) for path in paths : path = os . path . expanduser ( path ) if not os . path . isabs ( path ) : path = os . path . normpath ( os . path . join ( cwd , path ) ) file_path = os . path . join ( path , filename ) if os . path . exists ( os . path . normpath ( file_path ) ) : return file_path