parameters: (self, class_type_node, subclass_instance)
return_statement: return super(target_father_class, subclass_instance)
docstring: Analyze super and return a class instance.
docstring_summary: Analyze super and return a class instance.
docstring_tokens: Analyze super and return a class instance .
function: def analyze_super(self, class_type_node, subclass_instance):
          """Analyze super and return a class instance."""
          sub_class = type(subclass_instance)
          if class_type_node is None:
              return super(sub_class, subclass_instance)
          if isinstance(class_type_node, ast.Name):
              class_name = getattr(class_type_node, 'id')
          elif isinstance(class_type_node, ast.Attribute):
              class_name = getattr(class_type_node, 'attr')
          else:
              raise ValueError(f"The first argument of 'super()' must be a class type, "
                               f"but got {class_type_node.__class__.__name__}.")
  
          target_father_class = None
          for class_element in sub_class.mro():
              if class_element.__name__ == class_name:
                  target_father_class = class_element
                  break
          if target_father_class is None:
              raise ValueError(f"The second argument of 'super()' must be 'self', "
                               f"but got {subclass_instance}.")
          return super(target_father_class, subclass_instance)
function_tokens: def analyze_super ( self , class_type_node , subclass_instance ) : sub_class = type ( subclass_instance ) if class_type_node is None : return super ( sub_class , subclass_instance ) if isinstance ( class_type_node , ast . Name ) : class_name = getattr ( class_type_node , 'id' ) elif isinstance ( class_type_node , ast . Attribute ) : class_name = getattr ( class_type_node , 'attr' ) else : raise ValueError ( f"The first argument of 'super()' must be a class type, " f"but got {class_type_node.__class__.__name__}." ) target_father_class = None for class_element in sub_class . mro ( ) : if class_element . __name__ == class_name : target_father_class = class_element break if target_father_class is None : raise ValueError ( f"The second argument of 'super()' must be 'self', " f"but got {subclass_instance}." ) return super ( target_father_class , subclass_instance )