code: def get_coordinates_xyz(filename):
      
  
      f = open(filename, 'r')
      V = list()
      atoms = list()
      n_atoms = 0
  
      # Read the first line to obtain the number of atoms to read
      try:
          n_atoms = int(f.readline())
      except ValueError:
          exit("error: Could not obtain the number of atoms in the .xyz file.")
  
      # Skip the title line
      f.readline()
  
      # Use the number of atoms to not read beyond the end of a file
      for lines_read, line in enumerate(f):
  
          if lines_read == n_atoms:
              break
  
          atom = re.findall(r'[a-zA-Z]+', line)[0]
          atom = atom.upper()
  
          numbers = re.findall(r'[-]?\d+\.\d*(?:[Ee][-\+]\d+)?', line)
          numbers = [float(number) for number in numbers]
  
          # The numbers are not valid unless we obtain exacly three
          if len(numbers) >= 3:
              V.append(np.array(numbers)[:3])
              atoms.append(atom)
          else:
              exit("Reading the .xyz file failed in line {0}. Please check the format.".format(lines_read + 2))
  
      f.close()
      atoms = np.array(atoms)
      V = np.array(V)
      return atoms, V
docs: Get coordinates from filename and return a vectorset with all the
      coordinates, in XYZ format.
  
      Parameters
      ----------
      filename : string
          Filename to read
  
      Returns
      -------
      atoms : list
          List of atomic types
      V : array
          (N,3) where N is number of atoms