Ensure the given argument is a valid message ID

 @param id [String] message ID
 @return true if valid
 @raise Wavefront::Exceptions::InvalidMessageId if not valid
501526
def wf_message_id?(id)
      return true if id.is_a?(String) && id =~ /^\w+::\w+$/
      raise Wavefront::Exception::InvalidMessageId
    end
750935
function Invalid(message, code_id) {
    Error.call(this);
    this.message = message || "invalid";
    this.code_id = code_id || null;
    this.statusCode = 403;
}
540642
def is_img_id_valid(img_id):
    
    t = re.sub(r'[^a-z0-9_:\-\.]', '', img_id, re.IGNORECASE)
    t = re.sub(r'\.+', '.', t)
    if img_id != t or img_id.count(':') != 1:
        return False
    profile, base_name = img_id.split(':', 1)
    if not profile or not base_name:
        return False
    try:
        get_profile_configs(profile)
    except ValueError:
        return False
    return True
1021747
def get_message(self, message_id):
        

        for message in self.messages:
            if message.id == message_id:
                return message

        raise ArgumentError("Message ID not found", message_id=message_id)
77043
private static boolean idsAreEqual(String id, UIComponent cmp)
    {
        if (id.equals(cmp.getId()))
        {
            return true;
        }

        return false;
    }
110579
def validate
      raise ArgumentError.new('No vuln_id.') unless @vuln_id
      raise ArgumentError.new('No scope.') unless @scope
      raise ArgumentError.new('No reason.') unless @reason

      case @scope
      when Scope::ALL_INSTANCES
        @asset_id = @port = @vuln_key = nil
      when Scope::ALL_INSTANCES_ON_A_SPECIFIC_ASSET
        raise ArgumentError.new('No asset_id.') unless @asset_id
        @port = @vuln_key = nil
      when Scope::SPECIFIC_INSTANCE_OF_SPECIFIC_ASSET
        raise ArgumentError.new('No asset_id.') unless @asset_id
        raise ArgumentError.new('Port or vuln_key is required.') unless @port || @vuln_key
      when Scope::ALL_INSTANCES_IN_A_SPECIFIC_SITE
        raise ArgumentError.new('No site_id.') unless @site_id
      else
        raise ArgumentError.new("Invalid scope: #{@scope}")
      end
    end
1017737
def transaction_id=(transaction_id)
      if transaction_id.nil?
        fail ArgumentError, "transaction_id cannot be nil"
      end

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

      @transaction_id = transaction_id
    end
1007600
def type_id=(id)
      type_id = id.to_i

      raise InvalidShippingTypeError,
        "invalid #{id.inspect} type id" unless TYPE.value?(type_id)

      @type_id = type_id
      @type_name = TYPE.key(type_id)
    end
1243311
def delete_message(self, message):
        

        message_id = message.object_id if isinstance(message,
                                                     Message) else message

        if message_id is None:
            raise RuntimeError('Provide a valid Message or a message id')

        url = self.build_url(
            self._endpoints.get('message').format(id=message_id))

        response = self.con.delete(url)

        return bool(response)
251664
private boolean isValidUuid(final String id) {

		if (id != null) {

			if (id.length() != 32) {
				return false;
			}

			return UUID_PATTERN.matcher(id).matches();
		}

		return false;
	}
447985
def valid_id(opts, id_):
    '''
    
    '''
    try:
        if any(x in id_ for x in ('/', '\\', str('\0'))):
            return False
        return bool(clean_path(opts['pki_dir'], id_))
    except (AttributeError, KeyError, TypeError, UnicodeDecodeError):
        return False
633957
def parse_custom_id_from(flow)
      custom_id = flow.id
      if custom_id
        unless custom_id.is_a?(String) || custom_id.is_a?(Integer)
          raise InvalidArgumentError,
                'Provided ID must be a string or an integer'
        end
        custom_id = custom_id.to_s
        if custom_id.length > MAX_ID_SIZE
          raise InvalidArgumentError,
                "Provided Id must not exceed #{MAX_ID_SIZE} bytes"
        end
      end
      custom_id
    end
268309
public static void checkMessageId(int messageId, AisMessageType... messageTypes) {
		boolean found = false;
		for (AisMessageType messageType : messageTypes) {
			if (messageType.getId() == messageId)
				found = true;
		}
		if (!found) {
			StringBuffer s = new StringBuffer();
			for (AisMessageType messageType : messageTypes) {
				if (s.length() > 0)
					s.append(",");
				s.append(messageType.getId() + "");
			}
			checkArgument(found, "messageId must be in [" + s + "]  but was " + messageId);
		}
	}
750355
public static ErrorCode isIdValid(String id) {
        if (!isMustFieldValid(id, idRegEx)) {
            return ErrorCode.SERVICE_INSTANCE_ID_FORMAT_ERROR;
        }
        return ErrorCode.OK;
    }
133459
def message_id(self) -> Optional[UnstructuredHeader]:
        """"""
        try:
            return cast(UnstructuredHeader, self[b'message-id'][0])
        except (KeyError, IndexError):
            return None
788578
private void checkMessageID(Message message) {
        if (!MessageUtils.isOutbound(message)) return;

        AddressingProperties maps =
                ContextUtils.retrieveMAPs(message, false, MessageUtils.isOutbound(message));
        if (maps == null) {
            maps = new AddressingProperties();
        }
        if (maps.getMessageID() == null) {
            String messageID = ContextUtils.generateUUID();
            boolean isRequestor = ContextUtils.isRequestor(message);
            maps.setMessageID(ContextUtils.getAttributedURI(messageID));
            ContextUtils.storeMAPs(maps, message, ContextUtils.isOutbound(message), isRequestor);
        }
    }
1236948
@Override
	public String isValidID(String id) {
		Data data;
		try {
			data = identities.find(id, identities.reuse());
		} catch (IOException e) {
			return getName() + " could not lookup " + id + ": " + e.getLocalizedMessage();
		}
		return data==null?id + "is not an Identity in " + getName():null;
	}