'Read in any state from the file at file_path.
When ``merge=True``, any state specified only in-memory will be
preserved. Any state specified on-disk will be set in-memory, even if an
in-memory setting already exists.
:param file_path: The path where the state should be read from. It must
exist but it can be empty.
:type file_path: string
:param merge: If true, merge the on-disk state with the in-memory
state. If false, replace the in-memory state with the
on-disk state.
:type merge: bool
Warning: This method is intentionally concurrency-unsafe. It makes no
attempt to control concurrent access to the file at ``file_path``.'

def read_from_file(self, file_path, merge=True):

    if (os.path.getsize(file_path) == 0):
        on_disk_state = {}
    else:
        on_disk_state = pickle.load(open(file_path))
    if merge:
        for (namespace, namespace_dict) in on_disk_state.iteritems():
            in_memory_namespace = self._state.setdefault(namespace, {})
            for (name, value) in namespace_dict.iteritems():
                if (name in in_memory_namespace):
                    if (in_memory_namespace[name] != value):
                        logging.info('Persistent    value    of    %s.%s    from    %s    overridding    existing    in-memory    value', namespace, name, file_path)
                        in_memory_namespace[name] = value
                    else:
                        logging.debug('Value    of    %s.%s    is    unchanged,    skipping    import', namespace, name)
                else:
                    logging.debug('Importing    %s.%s    from    state    file    %s', namespace, name, file_path)
                    in_memory_namespace[name] = value
    else:
        self._state = on_disk_state
    with_backing_lock(self.__class__._write_to_backing_file)(self)
