code: def clean_networks(networks: Iterable[str] = None) -> Optional[Iterable[str]]:
      
      if not networks:
          return networks
      if not isinstance(networks, list):
          raise TypeError("networks parameter must be a list.")
  
      result = []
      for n in networks:
          if isinstance(n, str):
              n = {"Target": n}
          result.append(n)
      return result
docs: Cleans the values inside `networks`
      Returns a new list