<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove_defaults(self, type_or_string):
 """ Removes template defaults from a templated class instantiation. For example: .. code-block:: c++ std::vector< int, std::allocator< int > > will become: .. code-block:: c++ std::vector< int > """


        name = type_or_string
        if not utils.is_str(type_or_string):
            name = self.class_declaration(type_or_string).name
        if not self.remove_defaults_impl:
            return name
        no_defaults = self.remove_defaults_impl(name)
        if not no_defaults:
            return name
        return no_defaults