Extend guest validity
---------------------
return true on success
required parameter <guest_id> = 24 char string; _id value of the guest to extend validity
329969
public function extend_guest_validity($guest_id)
    {
        if (!$this->is_loggedin) {
            return false;
        }

        $payload  = ['_id' => $guest_id, 'cmd' => 'extend'];
        $response = $this->exec_curl('/api/s/' . $this->site . '/cmd/hotspot', $payload);

        return $this->process_response_boolean($response);
    }
224199
def start_guest(userid):
    
    # Check the power state before starting guest.
    power_state_info = client.send_request('guest_get_power_state', userid)
    print("\nPower state is: %s." % power_state_info['output'])

    # start guest.
    guest_start_info = client.send_request('guest_start', userid)

    if guest_start_info['overallRC']:
        raise RuntimeError('Failed to start guest %s!\n%s' % 
                           (userid, guest_start_info))
    else:
        print("Succeeded to start guest %s!" % userid)

    # Check the power state after starting guest.
    power_state_info = client.send_request('guest_get_power_state', userid)
    print("Power state is: %s." % power_state_info['output'])

    if guest_start_info['overallRC']:
        print("Guest_start error: %s" % guest_start_info)
1331203
def receivable_id(self, receivable_id):
        

        if receivable_id is None:
            raise ValueError("Invalid value for `receivable_id`, must not be `None`")
        if len(receivable_id) < 1:
            raise ValueError("Invalid value for `receivable_id`, length must be greater than or equal to `1`")

        self._receivable_id = receivable_id
772587
def set_extensions_for_student_quiz_submissions(self, user_id, course_id, extend_from_end_at=None, extend_from_now=None, extra_attempts=None, extra_time=None, manually_unlocked=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - course_id
        """ID"""
        path["course_id"] = course_id

        # REQUIRED - user_id
        """The ID of the user we want to add quiz extensions for."""
        data["user_id"] = user_id

        # OPTIONAL - extra_attempts
        """Number of times the student is allowed to re-take the quiz over the
        multiple-attempt limit. This is limited to 1000 attempts or less."""
        if extra_attempts is not None:
            data["extra_attempts"] = extra_attempts

        # OPTIONAL - extra_time
        """The number of extra minutes to allow for all attempts. This will
        add to the existing time limit on the submission. This is limited to
        10080 minutes (1 week)"""
        if extra_time is not None:
            data["extra_time"] = extra_time

        # OPTIONAL - manually_unlocked
        """Allow the student to take the quiz even if it's locked for
        everyone else."""
        if manually_unlocked is not None:
            data["manually_unlocked"] = manually_unlocked

        # OPTIONAL - extend_from_now
        """The number of minutes to extend the quiz from the current time. This is
        mutually exclusive to extend_from_end_at. This is limited to 1440
        minutes (24 hours)"""
        if extend_from_now is not None:
            data["extend_from_now"] = extend_from_now

        # OPTIONAL - extend_from_end_at
        """The number of minutes to extend the quiz beyond the quiz's current
        ending time. This is mutually exclusive to extend_from_now. This is
        limited to 1440 minutes (24 hours)"""
        if extend_from_end_at is not None:
            data["extend_from_end_at"] = extend_from_end_at

        self.logger.debug("POST /api/v1/courses/{course_id}/quiz_extensions with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("POST", "/api/v1/courses/{course_id}/quiz_extensions".format(**path), data=data, params=params, no_data=True)
169345
def validate_options!
      raise PosInvalid.new('Missing pos_id parameter') if pos_id.nil? || pos_id == 0
      raise PosInvalid.new('Missing pos_auth_key parameter') if pos_auth_key.nil? || pos_auth_key == ''
      raise PosInvalid.new('Missing key1 parameter') if key1.nil? || key1 == ''
      raise PosInvalid.new('Missing key2 parameter') if key2.nil? || key2 == ''
      raise PosInvalid.new("Invalid variant parameter, expected one of these: #{TYPES.join(', ')}") unless TYPES.include?(variant)
      raise PosInvalid.new("Invalid encoding parameter, expected one of these: #{ENCODINGS.join(', ')}") unless ENCODINGS.include?(encoding)
    end
1321158
def set_guest_access(self, allow_guests):
        """"""
        guest_access = "can_join" if allow_guests else "forbidden"
        try:
            self.client.api.set_guest_access(self.room_id, guest_access)
            self.guest_access = allow_guests
            return True
        except MatrixRequestError:
            return False
85883
def modifier_id=(modifier_id)
      if modifier_id.nil?
        fail ArgumentError, "modifier_id cannot be nil"
      end

      if modifier_id.to_s.length < 1
        fail ArgumentError, "invalid value for 'modifier_id', the character length must be great than or equal to 1."
      end

      @modifier_id = modifier_id
    end
989423
def expand_param(key, value)
      param = uri_escape(key.to_s).gsub('%3D', '=') # handle :"updated_at=>" or :"person_id!=" parameters
      param << '=' unless key['=']
      param << typecast(value)
      param
    end
386968
def extra_hosts(self, value):
        
        if value is None:
            self._extra_hosts = value
        elif isinstance(value, list):
            # TODO: better validation
            self._extra_hosts = value
        elif isinstance(value, dict):
            converted_extra_hosts = []
            for k, v in sorted(six.iteritems(value)):
                if not is_valid_hostname(k):
                    raise ValueError("each key in extra hosts is required to be a valid hostname. {0} was passed".format(k))

                if not is_valid_ip(v):
                    raise ValueError("each value in extra hosts is required to be a valid ip address. {0} was passed".format(v))

                converted_extra_hosts.append('{0}:{1}'.format(k, v))

            self._extra_hosts = converted_extra_hosts
        else:
            raise TypeError("extra hosts must be a dict, list, or None. {0} was passed".format(value))
436238
def require_valid(self):
        
        expired = self.get_expired()
        valid = self.exclude(pk__in=expired)
        valid_expired = expired.bulk_refresh()
        return valid_expired | valid
1102302
def expand(self, id_user):
        """"""
        CmtCOLLAPSED.query.filter(db.and_(
            CmtCOLLAPSED.id_bibrec == self.id_bibrec,
            CmtCOLLAPSED.id_cmtRECORDCOMMENT == self.id,
            CmtCOLLAPSED.id_user == id_user)).delete(synchronize_session=False)
505016
def reference_id=(reference_id)

      if !reference_id.nil? && reference_id.to_s.length > 40
        fail ArgumentError, "invalid value for 'reference_id', the character length must be smaller than or equal to 40."
      end

      @reference_id = reference_id
    end
1259809
public static function check() {
		if (R::count("user") < 1) {
			$pwdbname             = setup::getValidation("password");
			$userdbname           = setup::getValidation("username");
			$guest                = R::dispense("user");
			$guest->{$userdbname} = "guest";
			$guest->{$pwdbname}   = "";
			$guest->role          = role::get("guest");
			R::store($guest);
		}
	}
1173452
function ensureID(options, prop, callback) {
  if(options[prop]) {
    return callback();
  }

  options.guid(function(err, id) {
    if(err) {
      return callback(err);
    }
    options[prop] = id;
    callback();
  });
}
1014045
def pre_populate_buyer_email=(pre_populate_buyer_email)

      if !pre_populate_buyer_email.nil? && pre_populate_buyer_email.to_s.length > 254
        fail ArgumentError, "invalid value for 'pre_populate_buyer_email', the character length must be smaller than or equal to 254."
      end

      @pre_populate_buyer_email = pre_populate_buyer_email
    end
428026
def _check_load_parameters(self, **kwargs):
        

        if 'partition' in kwargs:
            msg = "'partition' is not allowed as a load parameter. Vcmp " \
                "guests are accessed by name."
            raise DisallowedReadParameter(msg)
        super(Virtual_Disk, self)._check_load_parameters(**kwargs)
860217
def id(self, id):
        

        if id is None:
            raise ValueError("Invalid value for `id`, must not be `None`")
        if len(id) > 255:
            raise ValueError("Invalid value for `id`, length must be less than `255`")

        self._id = id