code: def _find_Generic_super_origin(subclass, superclass_origin):
      
      stack = [subclass]
      param_map = {}
      while len(stack) > 0:
          bs = stack.pop()
          if is_Generic(bs):
              if not bs.__origin__ is None and len(bs.__origin__.__parameters__) > 0:
                  for i in range(len(bs.__args__)):
                      ors = bs.__origin__.__parameters__[i]
                      if bs.__args__[i] != ors and isinstance(bs.__args__[i], TypeVar):
                          param_map[ors] = bs.__args__[i]
              if (bs.__origin__ is superclass_origin or \
                      (bs.__origin__ is None and bs is superclass_origin)):
                  prms = []
                  try:
                      if len(bs.__origin__.__parameters__) > len(bs.__parameters__):
                          prms.extend(bs.__origin__.__parameters__)
                      else:
                          prms.extend(bs.__parameters__)
                  except:
                      prms.extend(bs.__parameters__)
                  for i in range(len(prms)):
                      while prms[i] in param_map:
                          prms[i] = param_map[prms[i]]
                  return prms
              try:
                  stack.extend(bs.__orig_bases__)
              except AttributeError:
                  stack.extend(bs.__bases__)
      return None
docs: Helper for _issubclass_Generic.