<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_instances(self, instances):
 """Load a set of instances into the CLIPS data base. The C equivalent of the CLIPS load-instances command. Instances can be loaded from a string, from a file or from a binary file. """

        instances = instances.encode()

        if os.path.exists(instances):
            try:
                return self._load_instances_binary(instances)
            except CLIPSError:
                return self._load_instances_text(instances)
        else:
            return self._load_instances_string(instances)