code: def from_dict(cls, tree_dict, previous=None):
          
          instance = cls(tree_dict['tree_type'])
  
          fitted = tree_dict['fitted']
          instance.fitted = fitted
          if fitted:
              instance.level = tree_dict['level']
              instance.n_nodes = tree_dict['n_nodes']
              instance.tau_matrix = np.array(tree_dict['tau_matrix'])
              instance.previous_tree = cls._deserialize_previous_tree(tree_dict, previous)
              instance.edges = [Edge.from_dict(edge) for edge in tree_dict['edges']]
  
          return instance
docs: Create a new instance from a dictionary.