<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_instances(self, filter_function=IPlugin):
 """ Gets instances out of the internal state using the default filter supplied in filter_function. By default, it is the class IPlugin. Can optionally pass in a list or tuple of classes in for `filter_function` which will accomplish the same goal. lastly, a callable can be passed in, however it is up to the user to determine if the objects are instances or not. """

        if isinstance(filter_function, (list, tuple)):
            return self._get_instance(filter_function)
        elif inspect.isclass(filter_function):
            return self._get_instance(filter_function)
        elif filter_function is None:
            return self.plugins
        else:
            return filter_function(self.plugins)