def count_models(block):
    """Count models in structure file block.

    :param block:  PDBx data block
    :type block:  [str]
    :return:  number of models in block
    :rtype:  int
    """
    atom_obj = block.get_object("atom_site")
    model_num = []
    for i in range(atom_obj.row_count):
        tmp = atom_obj.get_value("pdbx_PDB_model_num", i)
        if tmp not in model_num:
            model_num.append(tmp)
    return model_num