code: def read_file(name):
      
      cur_path = os.path.dirname(__file__)
      exts = ('txt', 'rst')
      for ext in exts:
          path = os.path.join(cur_path, '.'.join((name, ext)))
          if os.path.exists(path):
              with open(path, 'rt') as file_obj:
                  return file_obj.read()
  
      return ''
docs: Read file name (without extension) to string.