Loads the object from a pickle file.

        Args:
            filepath: Filename or directory name. It filepath is a directory, we
                scan the directory tree starting from filepath and we
                read the first pickle database. Raise RuntimeError if multiple
                databases are found.

def pickle_load(cls, filepath):
        """
        Loads the object from a pickle file.

        Args:
            filepath: Filename or directory name. It filepath is a directory, we
                scan the directory tree starting from filepath and we
                read the first pickle database. Raise RuntimeError if multiple
                databases are found.
        """
        if os.path.isdir(filepath):
            # Walk through each directory inside path and find the pickle database.
            for dirpath, dirnames, filenames in os.walk(filepath):
                fnames = [f for f in filenames if f == cls.PICKLE_FNAME]
                if fnames:
                    if len(fnames) == 1:
                        filepath = os.path.join(dirpath, fnames[0])
                        break  # Exit os.walk
                    else:
                        err_msg = "Found multiple databases:\n %s" % str(fnames)
                        raise RuntimeError(err_msg)
            else:
                err_msg = "Cannot find %s inside directory %s" % (cls.PICKLE_FNAME, filepath)
                raise ValueError(err_msg)

        with open(filepath, "rb") as fh:
            new = pickle.load(fh)

        # new.flows is a list of strings with the workdir of the flows (see __getstate__).
        # Here we read the Flow from the pickle file so that we have
        # and up-to-date version and we set the flow in visitor_mode
        from .flows import Flow
        flow_workdirs, new.flows = new.flows, []
        for flow in map(Flow.pickle_load, flow_workdirs):
            new.add_flow(flow)

        return new