code: def get_constructor(typ,
                      allow_inheritance=False  # type: bool
                      ):
      
      if allow_inheritance:
          return typ.__init__
      else:
          # check that the constructor is really defined here
          if '__init__' in typ.__dict__:
              return typ.__init__
          else:
              raise Exception('No explicit constructor was found for class ' + str(typ))
docs: Utility method to return the unique constructor (__init__) of a type
  
      :param typ: a type
      :param allow_inheritance: if True, the constructor will be returned even if it is not defined in this class
      (inherited). By default this is set to False: an exception is raised when no constructor is explicitly defined in
      the class
      :return: the found constructor