code: def edit_profile(db, uuid, **kwargs):
      
      with db.connect() as session:
          uidentity = find_unique_identity(session, uuid)
  
          if not uidentity:
              raise NotFoundError(entity=uuid)
          if not uidentity.profile:
              uidentity.profile = Profile()
  
          try:
              edit_profile_db(session, uidentity, **kwargs)
          except ValueError as e:
              raise InvalidValueError(e)
docs: Edit unique identity profile.
  
      This function allows to edit or update the profile information of the
      unique identity identified by 'uuid'. When there is not a profile
      for the given 'uuid', a new one will be created.
  
      The values to update are given as keyword arguments. The allowed
      keys are listed below (other keywords will be ignored):
  
         - 'name' : name of the unique identity
         - 'email' : email address of the unique identity
         - 'gender' : gender of the unique identity
         - 'gender_acc' : gender accuracy (range of 0 to 100; by default, set to 100)
         - 'is_bot' : boolean value to determine whether a unique identity is
               a bot or not. By default, this value is initialized to
               False.
         - 'country_code' : ISO-3166 country code
  
      :raises NotFoundError: raised when either the unique identity
          or the country code do not exist in the registry.
      :raises InvalidValueError: raised when is_bot does not have a boolean
          value.