def METHOD_NAME(num_atoms, symbols=None):
    expanded_symbols = []
    is_symbols = True
    if symbols is None:
        is_symbols = False
    else:
        if len(symbols) != len(num_atoms):
            is_symbols = False
        else:
            for s in symbols:
                if s not in symbol_map:
                    is_symbols = False
                    break
    if is_symbols:
        for s, num in zip(symbols, num_atoms):
            expanded_symbols += [
                symbol_map[s],
            ] * num
    else:
        for i, num in enumerate(num_atoms):
            expanded_symbols += [
                i + 1,
            ] * num
    return expanded_symbols