code: def create(self):
          
          payload = {'type': self._type}
          if self._ddoc_id and self._ddoc_id != '':
              if isinstance(self._ddoc_id, STRTYPE):
                  if self._ddoc_id.startswith('_design/'):
                      payload['ddoc'] = self._ddoc_id[8:]
                  else:
                      payload['ddoc'] = self._ddoc_id
              else:
                  raise CloudantArgumentError(122, self._ddoc_id)
          if self._name and self._name != '':
              if isinstance(self._name, STRTYPE):
                  payload['name'] = self._name
              else:
                  raise CloudantArgumentError(123, self._name)
          self._def_check()
          payload['index'] = self._def
  
          if self._partitioned:
              payload['partitioned'] = True
  
          headers = {'Content-Type': 'application/json'}
          resp = self._r_session.post(
              self.index_url,
              data=json.dumps(payload, cls=self._database.client.encoder),
              headers=headers
          )
          resp.raise_for_status()
          self._ddoc_id = response_to_json_dict(resp)['id']
          self._name = response_to_json_dict(resp)['name']
docs: Creates the current index in the remote database.