def get_osites(cif):
    from ase.geometry import get_distances
    osites = []
    opos = []
    (z, alllines) = fix_cif(cif)
    (start, end, order) = get_atom_lines(alllines)
    for line in alllines[start:(end + 1)]:
        if ('O' in line):
            line = line.split()
            temp_label = line[order[0]]
            if (not any((str.isdigit(c) for c in temp_label))):
                temp_label = line[order[1]]
            osites.append(temp_label)
            pos = [float(line[order[2]]), float(line[order[3]]), float(line[order[4]])]
            opos.append([round(num, 2) for num in pos])
    opos = np.array(opos)
    pos = z.get_scaled_positions()
    oinds = []
    omults = []
    o_class = []
    si = [atom.index for atom in z if (atom.symbol == 'Si')]
    o = [atom.index for atom in z if (atom.symbol == 'O')]
    o_pos = z[o].get_scaled_positions()
    for op in opos:
        for (i, p) in enumerate(o_pos):
            p = np.array([round(num, 2) for num in p])
            diff = abs((op - p))
            if (sum(diff) <= 0.02):
                oinds.append(o[i])
    for i in range(1, len(osites)):
        omults.append((oinds[i] - oinds[(i - 1)]))
    omults.append(((o[(- 1)] - oinds[(- 1)]) + 1))
    n = len(o)
    sn = sum(omults)
    if (n != sn):
        print('Something Went Wrong With O Sites')
    return (osites, omults, oinds)
def get_osites(cif):
    from ase.geometry import get_distances
    osites = []
    opos = []
    (z, alllines) = fix_cif(cif)
    (start, end, order) = get_atom_lines(alllines)
    for line in alllines[start:(end + 1)]:
        if ('O' in line):
            line = line.split()
            temp_label = line[order[0]]
            if (not any((str.isdigit(c) for c in temp_label))):
                temp_label = line[order[1]]
            osites.append(temp_label)
            pos = [float(line[order[2]]), float(line[order[3]]), float(line[order[4]])]
            opos.append([round(num, 2) for num in pos])
    opos = np.array(opos)
    pos = z.get_scaled_positions()
    oinds = []
    omults = []
    o_class = []
    si = [atom.index for atom in z if (atom.symbol == 'Si')]
    o = [atom.index for atom in z if (atom.symbol == 'O')]
    o_pos = z[o].get_scaled_positions()
    for op in opos:
        for (i, p) in enumerate(o_pos):
            p = np.array([round(num, 2) for num in p])
            diff = abs((op - p))
            if (sum(diff) <= 0.02):
                oinds.append(o[i])
    for i in range(1, len(osites)):
        omults.append((oinds[i] - oinds[(i - 1)]))
    omults.append(((o[(- 1)] - oinds[(- 1)]) + 1))
    n = len(o)
    sn = sum(omults)
    if (n != sn):
        print('Something Went Wrong With O Sites')
    return (osites, omults, oinds)