code: def generator_checker_py2(gen, gen_type, bound_Generic, bound_typevars,
              bound_typevars_readonly, follow_fwd_refs, _recursion_check):
      
      initialized = False
      sn = None
      while True:
          a = gen.send(sn)
          if initialized or not a is None:
              if not gen_type.__args__[0] is Any and \
                      not _isinstance(a, gen_type.__args__[0], bound_Generic, bound_typevars,
                              bound_typevars_readonly, follow_fwd_refs, _recursion_check):
                  tpa = deep_type(a)
                  msg = _make_generator_error_message(tpa, gen, gen_type.__args__[0],
                          'has incompatible yield type')
                  _raise_typecheck_error(msg, True, a, tpa, gen_type.__args__[0])
  # 				raise pytypes.ReturnTypeError(_make_generator_error_message(tpa, gen,
  # 						gen_type.__args__[0], 'has incompatible yield type'))
          initialized  = True
          sn = yield a
          if not gen_type.__args__[1] is Any and \
                  not _isinstance(sn, gen_type.__args__[1], bound_Generic, bound_typevars,
                          bound_typevars_readonly, follow_fwd_refs, _recursion_check):
              tpsn = deep_type(sn)
              msg = _make_generator_error_message(tpsn, gen, gen_type.__args__[1],
                      'has incompatible send type')
              _raise_typecheck_error(msg, False, sn, tpsn, gen_type.__args__[1])
docs: Builds a typechecking wrapper around a Python 2 style generator object.