Check if the given string is IPA valid.

    If the given string is not IPA valid,
    print the invalid characters.

    :param str string: the string to act upon
    :param dict vargs: the command line arguments
492867
def command_check(string, vargs):
    
    is_valid = is_valid_ipa(string)
    print(is_valid)
    if not is_valid:
        valid_chars, invalid_chars = remove_invalid_ipa_characters(
            unicode_string=string,
            return_invalid=True
        )
        print_invalid_chars(invalid_chars, vargs)
40165
def ports_str_check_failed(port_str):
    

    pattern = r'[^TU:0-9, \-]'
    if (
        re.search(pattern, port_str)
        or port_str.count('T') > 1
        or port_str.count('U') > 1
        or port_str.count(':') < (port_str.count('T') + port_str.count('U'))
    ):
        return True
    return False
925079
def is_valid_uid(uid):
    
    pattern = r'^[A-Za-z][A-Za-z0-9]{10}$'
    if not isinstance(uid, string_types):
        return False
    return bool(re.compile(pattern).match(uid))
626586
def validate_symbol(text):
    

    match_list = __RE_SYMBOL.findall(preprocess(text))
    if match_list:
        raise InvalidCharError("invalid symbols found: {}".format(match_list))
190060
def make_valid_string(self, string=''):
        
        if not self.is_valid_str(string):
            if string in self.val_map and not self.allow_dups:
                raise IndexError("Value {} has already been given to the sanitizer".format(string))
            internal_name = super(_NameSanitizer, self).make_valid_string()
            self.val_map[string] = internal_name
            return internal_name
        else:
            if self.map_valid:
                self.val_map[string] = string
            return string
178384
def is_unicode_string(string):
    
    if string is None:
        return None
    if PY2:
        return isinstance(string, unicode)
    return isinstance(string, str)
94672
def get_string(self, input_string):
        

        if input_string in ('--input', '--outname', '--framework'):

            # was the flag set?
            try:
                index = self.args.index(input_string) + 1
            except ValueError:
                # it wasn't, so if it's required, exit
                if input_string in self.required:
                    print("\n {flag} is required".format(input_string))
                    print_short_help()
                    sys.exit(1)
                # it wasn't, if its optional, return the default
                else:
                    return None

                    # the flag was set, so check if a value was set, otherwise exit
            try:
                if self.args[index] in self.flags:
                    print("\n {flag} was set but a value was not specified".format(flag=input_string))
                    print_short_help()
                    sys.exit(1)
            except IndexError:
                print("\n {flag} was set but a value was not specified".format(input_string))
                print_short_help()
                sys.exit(1)

            # a value was set, so check and assign the appropriate value or exit
            if input_string == '--input':
                return os.path.abspath(self.args[index])
            elif input_string == '--outname':
                return format(self.args[index])
624315
def _ensure_unicode_string(string):
        
        if not isinstance(string, six.text_type):
            string = string.decode('utf-8')
        return string
1369979
def parse_vars_and_interpolations(self, string):
        
        # Shortcut: if there are no #s or $s in the string in the first place,
        # it must not have anything of interest.
        if '#' not in string and '$' not in string:
            return Literal(String.unquoted(string))
        return self.parse_expression(
            string, 'goal_interpolated_literal_with_vars')
678424
def validate_args(**args):
	
	if not args['query']:
		print("\nMissing required query argument.")
		sys.exit()

	for key in DEFAULTS:
		if key not in args:
			args[key] = DEFAULTS[key]

	return args
1087001
def parse_string(str_, validate=False):
    
    result = pattern.parseString(str_)[0]
    if validate:
        result.validate()
    return result
657919
def can_map_ipa_string(self, ipa_string):
        
        canonical = [(c.canonical_representation, ) for c in ipa_string]
        split = split_using_dictionary(canonical, self, self.max_key_length, single_char_parsing=False)
        for sub in split:
            if not sub in self.ipa_canonical_representation_to_mapped_str:
                return False
        return True
1294084
def is_valid_variable_name(string_to_check):
    

    try:

        parse('{} = None'.format(string_to_check))
        return True

    except (SyntaxError, ValueError, TypeError):

        return False
855275
def vowels(self):
        
        return IPAString(ipa_chars=[c for c in self.ipa_chars if c.is_vowel])
491594
def print_invalid_chars(invalid_chars, vargs):
    
    if len(invalid_chars) > 0:
        if vargs["print_invalid"]:
            print(u"".join(invalid_chars))
        if vargs["unicode"]:
            for u_char in sorted(set(invalid_chars)):
                print(u"'%s'\t%s\t%s" % (u_char, hex(ord(u_char)), unicodedata.name(u_char, "UNKNOWN")))
492871
def validates_to_be_string_or_symbol!(value)
      case
      when value.nil?, value == "", value == :""
        raise ArgumentError, "#{value} is empty string or symbol"
      when !value.is_a?(String) && !value.is_a?(Symbol)
        raise ArgumentError, "#{value} is not string or symbol"
      else
        true
      end
    end
667004
def check_is_a_string(var, allow_none=False):
    
    if not is_a_string(var, allow_none=allow_none):
        raise TypeError("var must be a string, however type(var) is {}"
                        .format(type(var)))