Check that a potential group member is valid in the JSS.
 Arg must be an id or name.
 An exception is raised if the device doesn't exist.

 @return [Hash{:id=>Integer,:name=>String}] the valid id and name
347315
def check_member(m)
      potential_members = self.class::MEMBER_CLASS.map_all_ids_to(:name, api: @api)
      if m.to_s =~ /^\d+$/
        return { id: m.to_i, name: potential_members[m] } if potential_members.key?(m.to_i)
      else
        return { name: m, id: potential_members.invert[m] } if potential_members.value?(m)
      end
      raise JSS::NoSuchItemError, "No #{self.class::MEMBER_CLASS::RSRC_OBJECT_KEY} matching '#{m}' in the JSS."
    end
509254
def oid(name)
      module_parts = name.to_str.split("::")
      if module_parts.length == 1
        parse_oid(@by_name, name.to_str)
      elsif module_parts.length == 2
        module_name = module_parts[0]
        oid = module_parts[1]
        module_hash = @by_module_by_name[module_name]
        if module_hash
          parse_oid(module_hash, oid)
        else
          raise ModuleNotLoadedError, "module '#{module_name}' not loaded"
        end
      else
        raise ArgumentError, "invalid format: #{name.to_str}"
      end
    end
18009
def wf_webhook_id?(id)
      return true if id.is_a?(String) && id =~ /^[a-zA-Z0-9]{16}$/
      raise Wavefront::Exception::InvalidWebhookId
    end
210935
def valid?(argument)
      if argument.nil? and options[:required]
        raise Templater::TooFewArgumentsError
      elsif not argument.nil?
        if options[:as] == :hash and not argument.is_a?(Hash)
          raise Templater::MalformattedArgumentError, "Expected the argument to be a Hash, but was '#{argument.inspect}'"
        elsif options[:as] == :array and not argument.is_a?(Array)
          raise Templater::MalformattedArgumentError, "Expected the argument to be an Array, but was '#{argument.inspect}'"
        end
           
        invalid = catch :invalid do
          block.call(argument) if block
          throw :invalid, :not_invalid
        end
        raise Templater::ArgumentError, invalid unless invalid == :not_invalid
      end
    end
150062
def check_args(hash)
        if !hash.include? :hostname
          raise ArgumentError, "You must provide a hostname"
        elsif !hash.include? :service_name
          raise ArgumentError, "You must provide a service name"
        elsif !hash.include? :return_code
          raise ArgumentError, "You must provide a return code"
        elsif !hash.include? :status
          raise ArgumentError, "You must provide a status"
        end
      end
332956
def field_ok?(field)
      raise JSS::InvalidDataError, "Field elements must be hashes with :name, :type, and possibly :choices" unless field.kind_of? Hash
      raise JSS::InvalidDataError, "Fields require names" if field[:name].to_s.empty?
      raise JSS::InvalidDataError, "Fields :type must be one of: :#{FIELD_TYPES.join(', :')}" unless FIELD_TYPES.include? field[:type].to_sym

      if field[:type].to_sym == :menu
        unless field[:choices].kind_of? Array and  field[:choices].reject{|c| c.kind_of? String}.empty?
          raise JSS::InvalidDataError, "Choices for menu fields must be an Array of Strings"
        end # unless
      else
        field[:choices] = []
      end # if type -- menu
      true
    end
438177
function getAppendId(sHash){
			var iIndex = jQuery.inArray(currentHash, hashHistory),
				i, sHistory;
			if (iIndex > -1) {
				for (i = 0 ; i < iIndex + 1 ; i++) {
					sHistory = hashHistory[i];
					if (sHistory.slice(0, sHistory.length - 2) === sHash) {
						return uid();
					}
				}
			}

			return "";
		}
758014
def valid?
      valid = true

      rules.each_pair do |field, rules|
        if ! @obj.respond_to?(field)
          raise InvalidKey, "cannot validate non-existent field '#{field}'"
        end

        rules.each do |r|
          if ! r.valid_value?(@obj.send(field))
            valid = false
            errors[field] = {:rule => r.error_key, :params => r.params}
            break
          end
        end
      end

      @valid = valid
    end
169707
def usable_id(cls, id):
        
        try:
            # id is maybe a sshkey name
            qry_id = cls.from_name(id)
            if not qry_id:
                qry_id = int(id)
        except DuplicateResults as exc:
            cls.error(exc.errors)
        except Exception:
            qry_id = None

        if not qry_id:
            msg = 'unknown identifier %s' % id
            cls.error(msg)

        return qry_id
337539
def hash_id(self):
        
        div = self.soup.find('div', class_='zm-profile-header-op-btns')
        if div is not None:
            return div.button['data-id']
        else:
            ga = self.soup.find('script', attrs={'data-name': 'ga_vars'})
            return json.loads(ga.text)['user_hash']
217484
def _validate(cls, group_name):
        
        if group_name and not cls._group_name_regex.match(group_name):
            raise ArgumentError("'%s': Illegal group name" % (group_name,))
        if group_name and len(group_name) > 255:
            raise ArgumentError("'%s': Group name is too long" % (group_name,))
1353600
def id_hash(id, organization)
      {
        id: id,
        provider: organization.oauth_provider,
        realm: organization.oauth_uid
      }
    end
510107
def id(self):
        
        m = re.match(r'You are not authorized to access bug #(\d+)',
                     self.message)
        return m.group(1)
692146
def hash_key(self):
        
        if self.conf.message_id:
            message_id = self.message.get('Message-Id')
            if message_id:
                return message_id.strip()
            logger.error(
                "No Message-ID in {}: {}".format(self.path, self.header_text))
            raise MissingMessageID

        return hashlib.sha224(self.canonical_headers).hexdigest()
446724
function isValidID(id) {
  return id === '' || (
    id.charAt(0) === SEPARATOR && id.charAt(id.length - 1) !== SEPARATOR
  );
}
291408
def valid?(request)
      begin
        valid!(request)
      rescue AlexaVerifier::BaseError => e
        puts e

        return false
      end

      true
    end
368693
def valid_params?(name, size)
      return raise TypeError.new("A 'name' should be a string") if name.class != String
      return raise TypeError.new("A 'size' should be an integer") if size.class != Integer

      true
    end