code: def maybe_generate_sharded_filenames(filespec):
      """Potentially expands sharded filespec into a list of paths.
  
      This function takes in a potentially sharded filespec and expands it into a
      list containing the full set of corresponding concrete sharded file paths. If
      the input filespec is not sharded then a list containing just that file path
      is returned. This function is useful, for example, when the input to a binary
      can either be sharded or not.
  
      Args:
        filespec: String. A potentially sharded filespec to expand.
  
      Returns:
        A list of file paths.
  
      Raises:
        TypeError: if filespec is not in valid string_types.
      """
      if not isinstance(filespec, six.string_types):
          raise TypeError("Invalid filespec: %s" % filespec)
      if is_sharded_file_spec(filespec):
          return generate_sharded_filenames(filespec)
      else:
          return [filespec]
  
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 11 for calling a global function with example usage: maybe_generate_sharded_filenames(filespec) and returns: generate_sharded_filenames, list