code: def s_permutations(seq):
      items = [[]]
      for j in seq:
          new_items = []
          for i, item in enumerate(items):
              if i % 2:
                  # step up
                  new_items += [
                      item[:i] + [j] + item[i:]
                      for i in range(len(item) + 1)
                  ]
              else:
                  # step down
                  new_items += [
                      item[:i] + [j] + item[i:]
                      for i in range(len(item), -1, -1)
                  ]
          items = new_items
  
      return [
          (tuple(item), -1 if i % 2 else 1)
          for i, item in enumerate(items)
      ]
  
label_desc: Use image node_id 1 for calling a global function with example usage: s_permutations(seq) and returns: unknown