Check if specific_tag parameter is valid.

        :param list specific_tag: list of specific tag to check
974362
def _check_filter_specific_tag(self, specific_tag: list):
        
        if isinstance(specific_tag, list):
            if len(specific_tag) > 0:
                specific_tag = ",".join(specific_tag)
            else:
                specific_tag = ""
        else:
            raise TypeError("'specific_tag' expects a list")
        return specific_tag
317944
def matches_tags?(tag_expr)
      Cucumber::Core::Gherkin::TagExpression.new(tag_expr).evaluate(
        tags.map { |tag| Cucumber::Core::Ast::Tag.new(nil, tag) }
      )
    end
773114
def _taglist(self, other_model=None, queryset=None):
        
        from taggit.models import TaggedItem
        filter = None
        if queryset is not None:
            filter = set()
            for item in queryset.all():
                filter.update(item.tags.all())
            filter = set([tag.id for tag in filter])
        elif other_model is not None:
            filter = set(TaggedItem.objects.filter(
                content_type__model=other_model.__name__.lower()
            ).values_list('tag_id', flat=True))
        tags = set(TaggedItem.objects.filter(
            content_type__model=self.model.__name__.lower()
        ).values_list('tag_id', flat=True))
        if filter is not None:
            tags = tags.intersection(filter)
        return list(tags)
413073
def check_item_type_uniqueness(tag, previous_tags):
    
    fail = False
    #If the tag is being created...
    if not tag.id:
        #... and the new item type is different from previous item types (for
        #example, different from the first of them), fail
        fail = previous_tags and tag.item_type != previous_tags[0].item_type
    #If the tag is being modifying...
    else:
        #... but there is only one previous tag (the one that is being
        #modifying), do not fail
        fail = previous_tags.count() > 1 and \
               tag.item_type != previous_tags[0].item_type
    return fail
34692
def assert_valid_input(cls, tag):
        """"""

        # Fail on unexpected types.
        if not cls.is_tag(tag):
            raise TypeError("Expected a BeautifulSoup 'Tag', but instead recieved type {}".format(type(tag)))
1104625
public boolean isValid() {
    if (mValues.isEmpty()) {
      return false;
    }

    // Check required tags
    for (Tag tag : REQUIRED_TAGS) {
      if (!mValues.containsKey(tag)) {
        return false;
      }
    }

    return true;
  }
230556
def get_actual_tag
      supported_tags = @bbtree.current_node[:definition][:supported_tags]

      supported_tags.each do |tag|
        regex_list = @dictionary[tag][:url_matches]

        regex_list.each do |regex|
          return tag if regex =~ @ti.text
        end
      end
      :tag_not_found
    end
23264
def validate_list(self, value):
        
        if len(value) > self.max_items:
            raise ValidationError(
                u'list must not contain more than {max_items} items.'.format(max_items=self.max_items)
            )

        if all(isinstance(item, six.string_types) for item in value) is False:
            raise ValidationError(u'list must only contain strings.')

        return value
682884
private boolean validateTopicTags(final IOptionsNode optionsNode, final List<String> tagNames) {
        boolean valid = true;
        if (!tagNames.isEmpty()) {
            final List<TagWrapper> tags = new ArrayList<TagWrapper>();
            for (final String tagName : tagNames) {
                // Check if the app should be shutdown
                if (isShuttingDown.get()) {
                    shutdown.set(true);
                    return false;
                }
                // Get the tag from the database
                TagWrapper tag = null;
                try {
                    tag = tagProvider.getTagByName(tagName);
                } catch (NotFoundException e) {

                }

                // Check that it exists
                if (tag != null) {
                    tags.add(tag);
                } else {
                    log.error(
                            String.format(ProcessorConstants.ERROR_TAG_NONEXIST_MSG, optionsNode.getLineNumber(), tagName, optionsNode.getText()));
                    valid = false;
                }
            }

            // Check that the mutex value entered is correct
            final Map<Integer, List<TagWrapper>> mapping = EntityUtilities.getCategoryMappingFromTagList(tags);
            for (final Entry<Integer, List<TagWrapper>> catEntry : mapping.entrySet()) {
                final CategoryWrapper cat = categoryProvider.getCategory(catEntry.getKey());
                final List<TagWrapper> catTags = catEntry.getValue();

                // Check if the app should be shutdown
                if (isShuttingDown.get()) {
                    shutdown.set(true);
                    return false;
                }

                // Check that only one tag has been set if the category is mutually exclusive
                if (cat.isMutuallyExclusive() && catTags.size() > 1) {
                    final String errorMsg;
                    if (optionsNode instanceof Level) {
                        final String baseErrorMsg = String.format(ProcessorConstants.ERROR_LEVEL_TOO_MANY_CATS_MSG,
                                ((Level) optionsNode).getLevelType().getTitle(), cat.getName(), optionsNode.getText());
                        if (((Level) optionsNode).getLevelType() == LevelType.BASE) {
                            errorMsg = baseErrorMsg;
                        } else {
                            errorMsg = String.format(ProcessorConstants.LINE, optionsNode.getLineNumber()) + baseErrorMsg;
                        }
                    } else {
                        errorMsg = String.format(ProcessorConstants.ERROR_TOPIC_TOO_MANY_CATS_MSG, optionsNode.getLineNumber(), cat.getName(),
                                optionsNode.getText());
                    }
                    log.error(errorMsg);
                    valid = false;
                }

                // Check that the tag isn't a type or writer
                if (cat.getId().equals(serverEntities.getWriterCategoryId())) {
                    final String errorMsg;
                    if (optionsNode instanceof Level) {
                        final String baseErrorMsg = String.format(ProcessorConstants.ERROR_LEVEL_WRITER_AS_TAG_MSG,
                                ((Level) optionsNode).getLevelType().getTitle(), optionsNode.getText());
                        if (((Level) optionsNode).getLevelType() == LevelType.BASE) {
                            errorMsg = baseErrorMsg;
                        } else {
                            errorMsg = String.format(ProcessorConstants.LINE, optionsNode.getLineNumber()) + baseErrorMsg;
                        }
                    } else {
                        errorMsg = String.format(ProcessorConstants.ERROR_TOPIC_WRITER_AS_TAG_MSG, optionsNode.getLineNumber(),
                                optionsNode.getText());
                    }
                    log.error(errorMsg);
                    valid = false;
                }

                // Check that the tag isn't a topic type
                if (cat.getId().equals(serverEntities.getTypeCategoryId())) {
                    final String errorMsg;
                    if (optionsNode instanceof Level) {
                        final String baseErrorMsg = String.format(ProcessorConstants.ERROR_LEVEL_TYPE_AS_TAG_MSG,
                                ((Level) optionsNode).getLevelType().getTitle(), optionsNode.getText());
                        if (((Level) optionsNode).getLevelType() == LevelType.BASE) {
                            errorMsg = baseErrorMsg;
                        } else {
                            errorMsg = String.format(ProcessorConstants.LINE, optionsNode.getLineNumber()) + baseErrorMsg;
                        }
                    } else {
                        errorMsg = String.format(ProcessorConstants.ERROR_TOPIC_TYPE_AS_TAG_MSG, optionsNode.getLineNumber(),
                                optionsNode.getText());
                    }
                    log.error(errorMsg);
                    valid = false;
                }
            }
        }
        return valid;
    }
306326
def keys_are_valid(self, tag_value):
        """"""
        for key in ScheduleParser.raw_data(tag_value):
            if key not in ('on', 'off', 'tz'):
                return False
        return True
933951
def _check_list_weights(parameter, name):
    '''
    
    '''
    if not isinstance(parameter, list):
        raise ValueError('%s must be formatted with a list of tuples' % name)
    weight = np.sum([val[1] for val in parameter])
    if fabs(weight - 1.) > 1E-8:
        raise ValueError('%s weights do not sum to 1.0!' % name)
    return parameter
492349
def validate_scanner_list(ctx, param, value):
    
    if not value:
        return None

    valid_groups = ctx.obj.scanner_groups
    scanners = [x.strip() for x in value.split(',')]

    if 'all' in scanners:
        return ['all']

    scanner_ids = []
    for scanner in scanners:
        if scanner.isdigit():
            scanner_ids.append(scanner)
        elif scanner in valid_groups:
            scanner_ids += ctx.obj.scanner_group_map[scanner]
        else:
            raise click.BadParameter('Invalid scanner "{0}" provided. Must be a valid group or numeric ID.'
                                     .format(scanner))

    return scanner_ids
411630
def is_list_of_list(item):
    
    if (
        type(item) in (list, tuple)
        and len(item)
        and isinstance(item[0], (list, tuple))
    ):
        return True
    return False
709579
def _get_tag(repo, name):
    '''
    
    '''
    try:
        return [x for x in _all_tags(repo) if x[0] == name][0]
    except IndexError:
        return False
1134253
def _tag_matches(tags, filter):
        """"""
        for tag_name, tag_value in filter.items():
            # using _sentinel as I'm not sure that "None"
            # could be used, because it could be a valid
            # series_tags value : when a series has no such tag
            # then I think it's set to /null/None/.. TBC..
            series_tag_value = tags.get(tag_name, _sentinel)
            if series_tag_value != tag_value:
                return False

        return True
166615
def _has_tag(version, debug=False):
    
    cmd = sh.git.bake('show-ref', '--verify', '--quiet',
                      "refs/tags/{}".format(version))
    try:
        util.run_command(cmd, debug=debug)
        return True
    except sh.ErrorReturnCode:
        return False
532486
def check_valid(self):
		
		for k,input in self.inputs.items():
			if k in self.valid_opts:
				for param in self.valid_opts[k]:
					if param is None or input is None:
						return True
					elif type(param) is str and '+' in param:
						if re.search(r'^'+param,str(input)):
							return True
					elif type(param) is bool and type(input) is bool:
						return True
					elif type(param) is list and type(input) is list:
						return True
					else:
						if str(input).lower() == str(param):
							return True
				raise ValueError("Invalid input for '%s' parameter. Options are: %s" % (k,' '.join(["'%s'," % str(o) for o in self.valid_opts[k]]) ))
			else:
				raise ValueError("Invalid parameter for '%s'. Params are: %s" % (self.__class__.__name__,', '.join(["'%s'" % p for p in self.valid_opts.keys()]) ))