code: def get_structure_from_dict(d):
      
  
      species = []
      frac_coords = []
      masses = []
      if 'points' in d:
          for p in d['points']:
              species.append(p['symbol'])
              frac_coords.append(p['coordinates'])
              masses.append(p['mass'])
      elif 'atoms' in d:
          for p in d['atoms']:
              species.append(p['symbol'])
              frac_coords.append(p['position'])
              masses.append(p['mass'])
      else:
          raise ValueError('The dict does not contain structural information')
  
      return Structure(d['lattice'], species, frac_coords,
                       site_properties={"phonopy_masses": masses})
docs: Extracts a structure from the dictionary extracted from the output
      files of phonopy like phonopy.yaml or band.yaml.
      Adds "phonopy_masses" in the site_properties of the structures.
      Compatible with older phonopy versions.