input: from typing import List, Any
  
  
  def find_mode(values: List[Any]) -> Any:
      """ Find the mode of a given list of values. The mode is the value that
      appears most frequently in the list. If there are multiple modes, the
      function will return the first one encountered in the list.
      >>> find_mode([1, 2, 3, 2, 4, 2])
      2
      >>> find_mode(['a', 'b', 'b', 'c', 'a'])
      'a'
      """
      max_count = 0
      mode = values[0]
      count = {}
      for item in values:
          if item in count:
              count[item] += 1
          else:
              count[item] = 1
          if count[item] > max_count:
              max_count = count[item]
              mode = item
      return mode
output:     max_count = 0
      mode = values[0]
      count = {}
      for item in values:
          if item in count:
              count[item] += 1
          else:
              count[item] = 1
          if count[item] > max_count:
              max_count = count[item]
              mode = item
      return mode