code: def guess_language(file_name, local_file):
      
  
      lexer = None
  
      language = get_language_from_extension(file_name)
      if language:
          lexer = get_lexer(language)
      else:
          lexer = smart_guess_lexer(file_name, local_file)
          if lexer:
              language = u(lexer.name)
  
      return language, lexer
docs: Guess lexer and language for a file.
  
      Returns a tuple of (language_str, lexer_obj).