code: def normalize_to_sharded_file_pattern(spec_or_pattern):
      """Take a sharding spec or sharding file pattern and return a sharded pattern.
  
      The input can be a sharding spec(e.g '/some/file@10') or a sharded file
      pattern (e.g. '/some/file-?????-of-00010)
  
      Args:
        spec_or_pattern: str. A sharded file specification or sharded file pattern.
  
      Returns:
        A sharded file pattern.
      """
      try:
          basename, num_shards, suffix = parse_sharded_file_spec(
              spec_or_pattern
          )
      except ShardError:
          return spec_or_pattern
      return generate_sharded_file_pattern(basename, num_shards, suffix)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import os
  import re
  from typing import List, Tuple
  from etils import epath
  import six
label_desc: Use image node_id 6 for calling a global function with example usage: normalize_to_sharded_file_pattern(spec_or_pattern) and returns: generate_sharded_file_pattern, spec_or_pattern