code: def parse_geosearch_generic(response, **options):
      """
      Parse the response of 'GEOSEARCH', GEORADIUS' and 'GEORADIUSBYMEMBER'
      commands according to 'withdist', 'withhash' and 'withcoord' labels.
      """
      try:
          if options["store"] or options["store_dist"]:
              # `store` and `store_dist` cant be combined
              # with other command arguments.
              # relevant to 'GEORADIUS' and 'GEORADIUSBYMEMBER'
              return response
      except (
          KeyError
      ):  # it means the command was sent via execute_command
          return response
  
      if type(response) != list:
          response_list = [response]
      else:
          response_list = response
  
      if (
          not options["withdist"]
          and not options["withcoord"]
          and not options["withhash"]
      ):
          # just a bunch of places
          return response_list
  
      cast = {
          "withdist": float,
          "withcoord": lambda ll: (float(ll[0]), float(ll[1])),
          "withhash": int,
      }
  
      # zip all output results with each casting function to get
      # the properly native Python value.
      f = [lambda x: x]
      f += [
          cast[o]
          for o in ["withdist", "withhash", "withcoord"]
          if options[o]
      ]
      return [
          list(map(lambda fv: fv[0](fv[1]), zip(f, r)))
          for r in response_list
      ]
  
imports: import datetime
  from redis.utils import str_if_bytes
label_desc: Use image node_id 42 for calling a global function with example usage: parse_geosearch_generic(response) and returns: unknown, response_list, response, response