code: def get_generator_type(genr):
      
      if genr in _checked_generator_types:
          return _checked_generator_types[genr]
      if not genr.gi_frame is None and 'gen_type' in genr.gi_frame.f_locals:
          return genr.gi_frame.f_locals['gen_type']
      else:
          cllble, nesting, slf = util.get_callable_fq_for_code(genr.gi_code)
          if cllble is None:
              return Generator
          return _funcsigtypes(cllble, slf, nesting[-1] if slf else None,
                  genr.gi_frame.f_globals if not genr.gi_frame is None else None)[1]
docs: Obtains PEP 484 style type of a generator object, i.e. returns a
      typing.Generator object.