code: def ensure_iterable(inst):
      
      if isinstance(inst, string_types):
          return [inst]
      elif not isinstance(inst, collections.Iterable):
          return [inst]
      else:
          return inst
docs: Wraps scalars or string types as a list, or returns the iterable instance.