docs: def expand_pattern(pattern: str) -> List[str]:
      '''This function expand patterns against the current namespace
      and return a list of filenames'''
      ofiles = []
      sz = None
      res = glob_wildcards(pattern, [])
      sz = None
      wildcard = [{}]
      for key in res.keys():
          if key not in env.sos_dict:
              raise ValueError(f'Undefined variable {key} in pattern {pattern}')
          if not isinstance(env.sos_dict[key], str) and isinstance(
                  env.sos_dict[key], collections.Sequence):
              if sz is None:
                  sz = len(env.sos_dict[key])
                  wildcard = [copy.deepcopy(wildcard[0]) for x in range(sz)]
              elif sz != len(env.sos_dict[key]):
                  raise ValueError(
                      f'Variables in output pattern should have the same length (other={sz}, len({key})={len(env.sos_dict[key])})'
                  )
              for idx, value in enumerate(env.sos_dict[key]):
                  wildcard[idx][key] = value
          else:
              for v in wildcard:
                  v[key] = env.sos_dict[key]
      #
      for card in wildcard:
          ofiles.append(
              apply_wildcards(
                  pattern,
                  card,
                  fill_missing=False,
                  fail_dynamic=False,
                  dynamic_fill=None,
                  keep_dynamic=False))
      return ofiles