code: def application(self, id=None, manifest=None, name=None):
          
  
          modify = False
          found = False
  
          # Try to find application by name or id
          if name and id:
              found = self.get_application(id=id)
              if not found.name == name:
                  modify = True
          elif id:
              found = self.get_application(id=id)
              name = found.name
          elif name:
              try:
                  found = self.get_application(name=name)
              except exceptions.NotFoundError:
                  pass
  
          # If found - compare parameters
          if found:
              if manifest and not manifest == found.manifest:
                  modify = True
  
          # We need to update application
          if found and modify:
              found.update(name=name, manifest=manifest)
          if not found:
              created = self.create_application(name=name, manifest=manifest)
  
          return found or created
docs: Smart method. Creates, picks or modifies application.
          If application found by name or id and manifest not changed: return app.
          If app found by id, but other parameters differs: change them.
          If no application found, create.