code: def lex(filename):
      
      with io.open(filename, mode='r', encoding='utf-8') as f:
          it = _lex_file_object(f)
          it = _balance_braces(it, filename)
          for token, line, quoted in it:
              yield (token, line, quoted)
docs: Generates tokens from an nginx config file