docs: def wc_dict2lha(wc, skip_redundant=True, skip_zero=True):
      """Convert a a dictionary of Wilson coefficients into
      a dictionary that pylha can convert into a DSixTools WC output file."""
      d = OrderedDict()
      for name, (block, i) in WC_dict_0f.items():
          if block not in d:
              d[block] = defaultdict(list)
          if wc[name] != 0:
              d[block]['values'].append([i, wc[name].real])
      for name in definitions.WC_keys_2f:
          reblock = 'WC'+name.upper()
          imblock = 'IMWC'+name.upper()
          if reblock not in d:
              d[reblock] = defaultdict(list)
          if imblock not in d:
              d[imblock] = defaultdict(list)
          for i in range(3):
              for j in range(3):
                  if (i, j) in definitions.redundant_elements[name] and skip_redundant:
                      # skip redundant elements
                      continue
                  if wc[name][i, j].real != 0 or not skip_zero:
                      d[reblock]['values'].append([i+1, j+1, float(wc[name][i, j].real)])
                  if wc[name][i, j].imag != 0 or not skip_zero:
                      # omit Im parts that have to vanish by symmetry
                      if (i, j) not in definitions.vanishing_im_parts[name]:
                          d[imblock]['values'].append([i+1, j+1, float(wc[name][i, j].imag)])
      for name in definitions.WC_keys_4f:
          reblock = 'WC'+name.upper()
          imblock = 'IMWC'+name.upper()
          if reblock not in d:
              d[reblock] = defaultdict(list)
          if imblock not in d:
              d[imblock] = defaultdict(list)
          for i in range(3):
              for j in range(3):
                  for k in range(3):
                      for l in range(3):
                          if (i, j, k, l) in definitions.redundant_elements[name] and skip_redundant:
                              # skip redundant elements
                              continue
                          if wc[name][i, j, k, l].real != 0 or not skip_zero:
                              d[reblock]['values'].append([i+1, j+1, k+1, l+1, float(wc[name][i, j, k, l].real)])
                          if wc[name][i, j, k, l].imag != 0 or not skip_zero:
                              # omit Im parts that have to vanish by symmetry
                              if (i, j, k, l) not in definitions.vanishing_im_parts[name]:
                                  d[imblock]['values'].append([i+1, j+1, k+1, l+1, float(wc[name][i, j, k, l].imag)])
      # remove empty blocks
      empty = []
      for block in d:
          if d[block] == {}:
              empty.append(block)
      for block in empty:
          del d[block]
      return {'BLOCK': d}