code: def create(self, name, **params):
          
          if not isinstance(name, basestring):
              raise InvalidNameException("%s is not a valid name for an entity." % name)
          if 'namespace' in params:
              namespace = params.pop('namespace')
              params['owner'] = namespace.owner
              params['app'] = namespace.app
              params['sharing'] = namespace.sharing
          response = self.post(name=name, **params)
          atom = _load_atom(response, XNAME_ENTRY)
          if atom is None:
              # This endpoint doesn't return the content of the new
              # item. We have to go fetch it ourselves.
              return self[name]
          else:
              entry = atom.entry
              state = _parse_atom_entry(entry)
              entity = self.item(
                  self.service,
                  self._entity_path(state),
                  state=state)
              return entity
docs: Creates a new entity in this collection.
  
          This function makes either one or two roundtrips to the
          server, depending on the type of entities in this
          collection, plus at most two more if
          the ``autologin`` field of :func:`connect` is set to ``True``.
  
          :param name: The name of the entity to create.
          :type name: ``string``
          :param namespace: A namespace, as created by the :func:`splunklib.binding.namespace`
              function (optional).  You can also set ``owner``, ``app``, and
              ``sharing`` in ``params``.
          :type namespace: A :class:`splunklib.data.Record` object with keys ``owner``, ``app``,
              and ``sharing``.
          :param params: Additional entity-specific arguments (optional).
          :type params: ``dict``
          :return: The new entity.
          :rtype: A subclass of :class:`Entity`, chosen by :meth:`Collection.self.item`.
  
          **Example**::
  
              import splunklib.client as client
              s = client.connect(...)
              applications = s.apps
              new_app = applications.create("my_fake_app")