Checks to see if the inputed tag is valid or not.
        
        :param      tag | <str>
        
        :return     <bool>
775251
def isTagValid( self, tag ):
        
        if ( self._options is not None and \
             not nativestring(tag) in self._options \
             and not self.isInsertAllowed() ):
            return False
        
        elif ( self.isUnique() and self.hasTag(tag) ):
            return False
        
        return True
469089
def ok_tags(tags: dict) -> bool:
        

        if not tags:
            return True
        depth = 0
        queue = [(i, depth+1) for i in tags.values() if isinstance(i, dict)]
        max_depth = 0
        while queue and max_depth < 2:
            sub, depth = queue.pop()
            max_depth = max(max_depth, depth)
            queue = queue + [(i, depth+1) for i in sub.values() if isinstance(i, dict)]

        return max_depth < 2 and all(isinstance(k, str) and isinstance(tags[k], str) for k in tags)
702703
private static function validateTag($tag)
    {
        if (!is_string($tag)) {
            throw new \InvalidArgumentException(sprintf('RouteTags have to be strings, %s given', is_object($tag) ? get_class($tag) : gettype($tag)), 1512553153);
        }
        if (preg_match(self::PATTERN_TAG, $tag) !== 1) {
            throw new \InvalidArgumentException(sprintf('The given string "%s" is not a valid tag', $tag), 1511807639);
        }
    }
76715
private function validateTag($tag)
    {
        if (!preg_match('/[.0-9a-z]{3,3}|[.0-9A-Z]{3,3}/', $tag)) {
            throw new InvalidMARCspecException(
                InvalidMARCspecException::FS.
                InvalidMARCspecException::FTAG,
                $tag
            );
        }

        return true;
    }
802403
function isHTMLTag(html) {
    if (typeof HTMLElement === 'object') {
        return (html && (html instanceof HTMLElement));
    }

    return !!(html && html.nodeType && html.nodeType === 1);
}
814612
def is_tagged(required_tags, has_tags):
    """"""
    if not required_tags and not has_tags:
        return True
    elif not required_tags:
        return False

    found_tags = []
    for tag in required_tags:
        if tag in has_tags:
            found_tags.append(tag)

    return len(found_tags) == len(required_tags)
1090737
def validate_condition!(condition, tag)
      tag = VersionString.new(tag)
      tag.validate!("The version condition, #{condition}, is not valid!")
      tag
    end
1103162
private static void validateTags(String[] tagList, ArrayList<String> validList, ArrayList<String> invalidList) {
        for (String tag : tagList) {
            tag = tag.trim();
            if (tag.contains("\\") || tag.contains(" ") || tag.contains("\n") || tag.contains("-") || tag.equals("")) {
                invalidList.add(tag);
            } else {
                validList.add(tag);
            }
        }
    }
703464
def itemFromTag( self, tag ):
        
        for row in range(self.count() - 1):
            item = self.item(row)
            if ( item and item.text() == tag ):
                return item
        return None
1159740
def tag_mode(self, tag_mode):
        
        allowed_values = ["all", "top", "custom"]  # noqa: E501
        if tag_mode not in allowed_values:
            raise ValueError(
                "Invalid value for `tag_mode` ({0}), must be one of {1}"  # noqa: E501
                .format(tag_mode, allowed_values)
            )

        self._tag_mode = tag_mode
849308
def sanitize_tag(tag)
      if @require_valid_tags &&
         (!tag.is_a?(String) || tag == '' || convert_to_utf8(tag) != tag)
        return nil
      end
      tag = convert_to_utf8(tag.to_s)
      tag = '_' if tag == ''
      tag
    end
1086481
def is_on_tag(self) -> bool:
        
        if self.get_current_tag():
            LOGGER.debug('latest commit is tagged')
            return True

        LOGGER.debug('latest commit is NOT tagged')
        return False
799050
def validate_tag(self, key, value):
        
        if key == 'owner':
            return validate_email(value, self.partial_owner_match)
        elif key == self.gdpr_tag:
            return value in self.gdpr_tag_values
        else:
            return True
28811
def _validate_user_inputs(self, attributes=None, event_tags=None):
    

    if attributes and not validator.are_attributes_valid(attributes):
      self.logger.error('Provided attributes are in an invalid format.')
      self.error_handler.handle_error(exceptions.InvalidAttributeException(enums.Errors.INVALID_ATTRIBUTE_FORMAT))
      return False

    if event_tags and not validator.are_event_tags_valid(event_tags):
      self.logger.error('Provided event tags are in an invalid format.')
      self.error_handler.handle_error(exceptions.InvalidEventTagException(enums.Errors.INVALID_EVENT_TAG_FORMAT))
      return False

    return True
252973
def _in_tag(self, tagname, attributes=None):
        
        node = self.cur_node
        while not node is None:
            if node.tag == tagname:
                if attributes and node.attrib == attributes:
                    return True

                elif attributes:
                    return False

                return True

            node = node.getparent()
        return False
1141090
def find_by_tag(self, tag) -> Dict[str, Set[Parameter]]:
        
        return self.tags[tag]
1311361
def _validate_tag_sets(tag_sets):
    
    if tag_sets is None:
        return tag_sets

    if not isinstance(tag_sets, list):
        raise TypeError((
            "Tag sets %r invalid, must be a list") % (tag_sets,))
    if len(tag_sets) == 0:
        raise ValueError((
            "Tag sets %r invalid, must be None or contain at least one set of"
            " tags") % (tag_sets,))

    for tags in tag_sets:
        if not isinstance(tags, Mapping):
            raise TypeError(
                "Tag set %r invalid, must be an instance of dict, "
                "bson.son.SON or other type that inherits from "
                "collection.Mapping" % (tags,))

    return tag_sets