def get_tsites(cif):
    from ase.geometry import get_distances
    tsites = []
    tpos = []
    (z, alllines) = fix_cif(cif)
    si = [atom.index for atom in z if (atom.symbol != 'O')]
    (start, end, order) = get_atom_lines(alllines)
    for line in alllines[start:(end + 1)]:
        if (('Si' in line) or ('T' 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]]
            if ('Si' in temp_label):
                temp_label = temp_label.replace('Si', 'T')
            tsites.append(temp_label)
            pos = [float(line[order[2]]), float(line[order[3]]), float(line[order[4]])]
            tpos.append([round(num, 2) for num in pos])
    tpos = np.array(tpos)
    pos = z[si].get_scaled_positions()
    tinds = []
    tmults = []
    t_class = []
    for tp in tpos:
        for (i, p) in enumerate(pos):
            p = [round(num, 2) for num in p]
            diff = abs((tp - p))
            if (sum(diff) <= 0.03):
                tinds.append(si[i])
    for i in range(1, len(tsites)):
        tmults.append((tinds[i] - tinds[(i - 1)]))
    tmults.append(((si[(- 1)] - tinds[(- 1)]) + 1))
    n = len(si)
    sn = sum(tmults)
    if (n != sn):
        print('Something Went Wrong With T Sites')
    return (tsites, tmults, tinds)
def get_tsites(cif):
    from ase.geometry import get_distances
    tsites = []
    tpos = []
    (z, alllines) = fix_cif(cif)
    si = [atom.index for atom in z if (atom.symbol != 'O')]
    (start, end, order) = get_atom_lines(alllines)
    for line in alllines[start:(end + 1)]:
        if (('Si' in line) or ('T' 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]]
            if ('Si' in temp_label):
                temp_label = temp_label.replace('Si', 'T')
            tsites.append(temp_label)
            pos = [float(line[order[2]]), float(line[order[3]]), float(line[order[4]])]
            tpos.append([round(num, 2) for num in pos])
    tpos = np.array(tpos)
    pos = z[si].get_scaled_positions()
    tinds = []
    tmults = []
    t_class = []
    for tp in tpos:
        for (i, p) in enumerate(pos):
            p = [round(num, 2) for num in p]
            diff = abs((tp - p))
            if (sum(diff) <= 0.03):
                tinds.append(si[i])
    for i in range(1, len(tsites)):
        tmults.append((tinds[i] - tinds[(i - 1)]))
    tmults.append(((si[(- 1)] - tinds[(- 1)]) + 1))
    n = len(si)
    sn = sum(tmults)
    if (n != sn):
        print('Something Went Wrong With T Sites')
    return (tsites, tmults, tinds)