_id
stringlengths
2
7
title
stringlengths
1
88
partition
stringclasses
3 values
text
stringlengths
75
19.8k
language
stringclasses
1 value
meta_information
dict
q13000
new_deploy
train
def new_deploy(py_ver: PyVer, release_target: ReleaseTarget): """Job for deploying package to pypi""" cache_file = f'app_{py_ver.name}.tar' template = yaml.safe_load(f""" machine: image: circleci/classic:201710-02 steps: - attach_workspace: at: {cache_dir} - checkout ...
python
{ "resource": "" }
q13001
generate_docker_file
train
def generate_docker_file(py_ver: PyVer): """Templated docker files""" with open(os.path.join(script_templates_root, 'Dockerfile')) as fh: return fh.read().format(py_ver=py_ver, author=author_file)
python
{ "resource": "" }
q13002
generate_docker_targets
train
def generate_docker_targets(): """Write all templated container engine files""" output = {} for py_ver in python_versions.values(): filepath = os.path.join(container_config_root, py_ver.docker_file) output[filepath] = generate_docker_file(py_ver) filepath = os.path.join(container_con...
python
{ "resource": "" }
q13003
main
train
def main(output_path=None): """Writes out new python build system This is needed because CircleCI does not support build matrices nor parameterisation of cache paths or other aspects of their config There's also the added bonus of validating the yaml as we go. Additionally, we template and wr...
python
{ "resource": "" }
q13004
GlobalSignCredentials.passphrase
train
def passphrase(self, passphrase): """ Sets the passphrase of this GlobalSignCredentials. The passphrase to decrypt the private key in case it is encrypted. Empty if the private key is not encrypted. :param passphrase: The passphrase of this GlobalSignCredentials. :type: str ...
python
{ "resource": "" }
q13005
git_url_ssh_to_https
train
def git_url_ssh_to_https(url): """Convert a git url url will look like https://github.com/ARMmbed/mbed-cloud-sdk-python.git or git@github.com:ARMmbed/mbed-cloud-sdk-python.git we want: https://${GITHUB_TOKEN}@github.com/ARMmbed/mbed-cloud-sdk-python-private.git """ path = url.split(...
python
{ "resource": "" }
q13006
zip_unicode
train
def zip_unicode(output, version): """Zip the Unicode files.""" zipper = zipfile.ZipFile(os.path.join(output, 'unicodedata', '%s.zip' % version), 'w', zipfile.ZIP_DEFLATED) target = os.path.join(output, 'unicodedata', version) print('Zipping %s.zip...' % version) for root, dirs, files in os.walk(t...
python
{ "resource": "" }
q13007
unzip_unicode
train
def unzip_unicode(output, version): """Unzip the Unicode files.""" unzipper = zipfile.ZipFile(os.path.join(output, 'unicodedata', '%s.zip' % version)) target = os.path.join(output, 'unicodedata', version) print('Unzipping %s.zip...' % version) os.makedirs(target) for f in unzipper.namelist()...
python
{ "resource": "" }
q13008
download_unicodedata
train
def download_unicodedata(version, output=HOME, no_zip=False): """Download Unicode data scripts and blocks.""" files = [ 'UnicodeData.txt', 'Scripts.txt', 'Blocks.txt', 'PropList.txt', 'DerivedCoreProperties.txt', 'DerivedNormalizationProps.txt', 'Compositi...
python
{ "resource": "" }
q13009
get_unicodedata
train
def get_unicodedata(version, output=HOME, no_zip=False): """Ensure we have Unicode data to generate Unicode tables.""" target = os.path.join(output, 'unicodedata', version) zip_target = os.path.join(output, 'unicodedata', '%s.zip' % version) if not os.path.exists(target) and os.path.exists(zip_target)...
python
{ "resource": "" }
q13010
_SearchParser.process_quotes
train
def process_quotes(self, text): """Process quotes.""" escaped = False in_quotes = False current = [] quoted = [] i = _util.StringIter(text) iter(i) for t in i: if not escaped and t == "\\": escaped = True elif escap...
python
{ "resource": "" }
q13011
_SearchParser.verbose_comment
train
def verbose_comment(self, t, i): """Handle verbose comments.""" current = [] escaped = False try: while t != "\n": if not escaped and t == "\\": escaped = True current.append(t) elif escaped: ...
python
{ "resource": "" }
q13012
_SearchParser.get_unicode_property
train
def get_unicode_property(self, i): """Get Unicode property.""" index = i.index prop = [] value = [] try: c = next(i) if c.upper() in _ASCII_LETTERS: prop.append(c) elif c != '{': raise SyntaxError("Unicode prope...
python
{ "resource": "" }
q13013
_SearchParser.get_named_unicode
train
def get_named_unicode(self, i): """Get Unicode name.""" index = i.index value = [] try: if next(i) != '{': raise ValueError("Named Unicode missing '{' %d!" % (i.index - 1)) c = next(i) while c != '}': value.append(c) ...
python
{ "resource": "" }
q13014
_SearchParser.normal
train
def normal(self, t, i): """Handle normal chars.""" current = [] if t == "\\": try: t = next(i) current.extend(self.reference(t, i)) except StopIteration: current.append(t) elif t == "(": current.extend(...
python
{ "resource": "" }
q13015
_SearchParser.posix_props
train
def posix_props(self, prop, in_group=False): """ Insert POSIX properties. Posix style properties are not as forgiving as Unicode properties. Case does matter, and whitespace and '-' and '_' will not be tolerated. """ try: if self.is_bytes or not sel...
python
{ "resource": "" }
q13016
_SearchParser.unicode_name
train
def unicode_name(self, name, in_group=False): """Insert Unicode value by its name.""" value = ord(_unicodedata.lookup(name)) if (self.is_bytes and value > 0xFF): value = "" if not in_group and value == "": return '[^%s]' % ('\x00-\xff' if self.is_bytes else _unip...
python
{ "resource": "" }
q13017
_SearchParser.unicode_props
train
def unicode_props(self, props, value, in_group=False, negate=False): """ Insert Unicode properties. Unicode properties are very forgiving. Case doesn't matter and `[ -_]` will be stripped out. """ # `'GC = Some_Unpredictable-Category Name' -> 'gc=someunpredictablecatego...
python
{ "resource": "" }
q13018
_ReplaceParser.parse_format_index
train
def parse_format_index(self, text): """Parse format index.""" base = 10 prefix = text[1:3] if text[0] == "-" else text[:2] if prefix[0:1] == "0": char = prefix[-1] if char == "b": base = 2 elif char == "o": base = 8 ...
python
{ "resource": "" }
q13019
_ReplaceParser.handle_format
train
def handle_format(self, t, i): """Handle format.""" if t == '{': t = self.format_next(i) if t == '{': self.get_single_stack() self.result.append(t) else: field, text = self.get_format(t, i) self.handle_f...
python
{ "resource": "" }
q13020
_ReplaceParser.get_octal
train
def get_octal(self, c, i): """Get octal.""" index = i.index value = [] zero_count = 0 try: if c == '0': for x in range(3): if c != '0': break value.append(c) c = next(...
python
{ "resource": "" }
q13021
_ReplaceParser.parse_octal
train
def parse_octal(self, text, i): """Parse octal value.""" value = int(text, 8) if value > 0xFF and self.is_bytes: # Re fails on octal greater than `0o377` or `0xFF` raise ValueError("octal escape value outside of range 0-0o377!") else: single = self.ge...
python
{ "resource": "" }
q13022
_ReplaceParser.get_named_unicode
train
def get_named_unicode(self, i): """Get named Unicode.""" index = i.index value = [] try: if next(i) != '{': raise SyntaxError("Named Unicode missing '{'' at %d!" % (i.index - 1)) c = next(i) while c != '}': value.append...
python
{ "resource": "" }
q13023
_ReplaceParser.parse_named_unicode
train
def parse_named_unicode(self, i): """Parse named Unicode.""" value = ord(_unicodedata.lookup(self.get_named_unicode(i))) single = self.get_single_stack() if self.span_stack: text = self.convert_case(chr(value), self.span_stack[-1]) value = ord(self.convert_case(t...
python
{ "resource": "" }
q13024
_ReplaceParser.get_wide_unicode
train
def get_wide_unicode(self, i): """Get narrow Unicode.""" value = [] for x in range(3): c = next(i) if c == '0': value.append(c) else: # pragma: no cover raise SyntaxError('Invalid wide Unicode character at %d!' % (i.index - 1)...
python
{ "resource": "" }
q13025
_ReplaceParser.parse_unicode
train
def parse_unicode(self, i, wide=False): """Parse Unicode.""" text = self.get_wide_unicode(i) if wide else self.get_narrow_unicode(i) value = int(text, 16) single = self.get_single_stack() if self.span_stack: text = self.convert_case(chr(value), self.span_stack[-1]) ...
python
{ "resource": "" }
q13026
_ReplaceParser.get_byte
train
def get_byte(self, i): """Get byte.""" value = [] for x in range(2): c = next(i) if c.lower() in _HEX: value.append(c) else: # pragma: no cover raise SyntaxError('Invalid byte character at %d!' % (i.index - 1)) return ...
python
{ "resource": "" }
q13027
_ReplaceParser.parse_bytes
train
def parse_bytes(self, i): """Parse byte.""" value = int(self.get_byte(i), 16) single = self.get_single_stack() if self.span_stack: text = self.convert_case(chr(value), self.span_stack[-1]) value = ord(self.convert_case(text, single)) if single is not None else or...
python
{ "resource": "" }
q13028
_ReplaceParser.format_next
train
def format_next(self, i): """Get next format char.""" c = next(i) return self.format_references(next(i), i) if c == '\\' else c
python
{ "resource": "" }
q13029
_ReplaceParser.format_references
train
def format_references(self, t, i): """Handle format references.""" octal = self.get_octal(t, i) if octal: value = int(octal, 8) if value > 0xFF and self.is_bytes: # Re fails on octal greater than `0o377` or `0xFF` raise ValueError("octal e...
python
{ "resource": "" }
q13030
_ReplaceParser.span_case
train
def span_case(self, i, case): """Uppercase or lowercase the next range of characters until end marker is found.""" # A new \L, \C or \E should pop the last in the stack. if self.span_stack: self.span_stack.pop() if self.single_stack: self.single_stack.pop() ...
python
{ "resource": "" }
q13031
_ReplaceParser.convert_case
train
def convert_case(self, value, case): """Convert case.""" if self.is_bytes: cased = [] for c in value: if c in _ASCII_LETTERS: cased.append(c.lower() if case == _LOWER else c.upper()) else: cased.append(c) ...
python
{ "resource": "" }
q13032
_ReplaceParser.single_case
train
def single_case(self, i, case): """Uppercase or lowercase the next character.""" # Pop a previous case if we have consecutive ones. if self.single_stack: self.single_stack.pop() self.single_stack.append(case) try: t = next(i) if self.use_forma...
python
{ "resource": "" }
q13033
_ReplaceParser.get_single_stack
train
def get_single_stack(self): """Get the correct single stack item to use.""" single = None while self.single_stack: single = self.single_stack.pop() return single
python
{ "resource": "" }
q13034
_ReplaceParser.handle_format_group
train
def handle_format_group(self, field, text): """Handle format group.""" # Handle auto incrementing group indexes if field == '': if self.auto: field = str(self.auto_index) text[0] = (_util.FMT_FIELD, field) self.auto_index += 1 ...
python
{ "resource": "" }
q13035
_ReplaceParser.handle_group
train
def handle_group(self, text, capture=None, is_format=False): """Handle groups.""" if capture is None: capture = tuple() if self.is_bytes else '' if len(self.result) > 1: self.literal_slots.append("".join(self.result)) if is_format: self.liter...
python
{ "resource": "" }
q13036
ReplaceTemplate._get_group_index
train
def _get_group_index(self, index): """Find and return the appropriate group index.""" g_index = None for group in self.groups: if group[0] == index: g_index = group[1] break return g_index
python
{ "resource": "" }
q13037
ReplaceTemplate._get_group_attributes
train
def _get_group_attributes(self, index): """Find and return the appropriate group case.""" g_case = (None, None, -1) for group in self.group_slots: if group[0] == index: g_case = group[1] break return g_case
python
{ "resource": "" }
q13038
_to_bstr
train
def _to_bstr(l): """Convert to byte string.""" if isinstance(l, str): l = l.encode('ascii', 'backslashreplace') elif not isinstance(l, bytes): l = str(l).encode('ascii', 'backslashreplace') return l
python
{ "resource": "" }
q13039
format_string
train
def format_string(m, l, capture, is_bytes): """Perform a string format.""" for fmt_type, value in capture[1:]: if fmt_type == FMT_ATTR: # Attribute l = getattr(l, value) elif fmt_type == FMT_INDEX: # Index l = l[value] elif fmt_type == FMT...
python
{ "resource": "" }
q13040
StringIter.rewind
train
def rewind(self, count): """Rewind index.""" if count > self._index: # pragma: no cover raise ValueError("Can't rewind past beginning!") self._index -= count
python
{ "resource": "" }
q13041
get_requirements
train
def get_requirements(): """Load list of dependencies.""" install_requires = [] with open("requirements/project.txt") as f: for line in f: if not line.startswith("#"): install_requires.append(line.strip()) return install_requires
python
{ "resource": "" }
q13042
get_unicodedata
train
def get_unicodedata(): """Download the `unicodedata` version for the given Python version.""" import unicodedata fail = False uver = unicodedata.unidata_version path = os.path.join(os.path.dirname(__file__), 'tools') fp, pathname, desc = imp.find_module('unidatadownload', [path]) try: ...
python
{ "resource": "" }
q13043
generate_unicode_table
train
def generate_unicode_table(): """Generate the Unicode table for the given Python version.""" uver = get_unicodedata() fail = False path = os.path.join(os.path.dirname(__file__), 'tools') fp, pathname, desc = imp.find_module('unipropgen', [path]) try: unipropgen = imp.load_module('unipro...
python
{ "resource": "" }
q13044
_cached_replace_compile
train
def _cached_replace_compile(pattern, repl, flags, pattern_type): """Cached replace compile.""" return _bregex_parse._ReplaceParser().parse(pattern, repl, bool(flags & FORMAT))
python
{ "resource": "" }
q13045
_get_cache_size
train
def _get_cache_size(replace=False): """Get size of cache.""" if not replace: size = _cached_search_compile.cache_info().currsize else: size = _cached_replace_compile.cache_info().currsize return size
python
{ "resource": "" }
q13046
_apply_replace_backrefs
train
def _apply_replace_backrefs(m, repl=None, flags=0): """Expand with either the `ReplaceTemplate` or compile on the fly, or return None.""" if m is None: raise ValueError("Match is None!") else: if isinstance(repl, ReplaceTemplate): return repl.expand(m) elif isinstance(re...
python
{ "resource": "" }
q13047
_assert_expandable
train
def _assert_expandable(repl, use_format=False): """Check if replace template is expandable.""" if isinstance(repl, ReplaceTemplate): if repl.use_format != use_format: if use_format: raise ValueError("Replace not compiled as a format replace") else: ...
python
{ "resource": "" }
q13048
compile_search
train
def compile_search(pattern, flags=0, **kwargs): """Compile with extended search references.""" return _regex.compile(_apply_search_backrefs(pattern, flags), flags, **kwargs)
python
{ "resource": "" }
q13049
expandf
train
def expandf(m, format): # noqa A002 """Expand the string using the format replace pattern or function.""" _assert_expandable(format, True) return _apply_replace_backrefs(m, format, flags=FORMAT)
python
{ "resource": "" }
q13050
subfn
train
def subfn(pattern, format, string, *args, **kwargs): # noqa A002 """Wrapper for `subfn`.""" flags = args[4] if len(args) > 4 else kwargs.get('flags', 0) is_replace = _is_replace(format) is_string = isinstance(format, (str, bytes)) if is_replace and not format.use_format: raise ValueError("...
python
{ "resource": "" }
q13051
Bregex._auto_compile
train
def _auto_compile(self, template, use_format=False): """Compile replacements.""" is_replace = _is_replace(template) is_string = isinstance(template, (str, bytes)) if is_replace and use_format != template.use_format: raise ValueError("Compiled replace cannot be a format objec...
python
{ "resource": "" }
q13052
Bregex.search
train
def search(self, string, *args, **kwargs): """Apply `search`.""" return self._pattern.search(string, *args, **kwargs)
python
{ "resource": "" }
q13053
Bregex.match
train
def match(self, string, *args, **kwargs): """Apply `match`.""" return self._pattern.match(string, *args, **kwargs)
python
{ "resource": "" }
q13054
Bregex.fullmatch
train
def fullmatch(self, string, *args, **kwargs): """Apply `fullmatch`.""" return self._pattern.fullmatch(string, *args, **kwargs)
python
{ "resource": "" }
q13055
Bregex.split
train
def split(self, string, *args, **kwargs): """Apply `split`.""" return self._pattern.split(string, *args, **kwargs)
python
{ "resource": "" }
q13056
Bregex.splititer
train
def splititer(self, string, *args, **kwargs): """Apply `splititer`.""" return self._pattern.splititer(string, *args, **kwargs)
python
{ "resource": "" }
q13057
Bregex.findall
train
def findall(self, string, *args, **kwargs): """Apply `findall`.""" return self._pattern.findall(string, *args, **kwargs)
python
{ "resource": "" }
q13058
Bregex.finditer
train
def finditer(self, string, *args, **kwargs): """Apply `finditer`.""" return self._pattern.finditer(string, *args, **kwargs)
python
{ "resource": "" }
q13059
Bregex.sub
train
def sub(self, repl, string, *args, **kwargs): """Apply `sub`.""" return self._pattern.sub(self._auto_compile(repl), string, *args, **kwargs)
python
{ "resource": "" }
q13060
_SearchParser.get_posix
train
def get_posix(self, i): """Get POSIX.""" index = i.index value = ['['] try: c = next(i) if c != ':': raise ValueError('Not a valid property!') else: value.append(c) c = next(i) if c == '^...
python
{ "resource": "" }
q13061
_ReplaceParser.regex_parse_template
train
def regex_parse_template(self, template, pattern): """ Parse template for the regex module. Do NOT edit the literal list returned by _compile_replacement_helper as you will edit the original cached value. Copy the values instead. """ groups = [] ...
python
{ "resource": "" }
q13062
ReplaceTemplate.expand
train
def expand(self, m): """Using the template, expand the string.""" if m is None: raise ValueError("Match is None!") sep = m.string[:0] if isinstance(sep, bytes) != self._bytes: raise TypeError('Match string type does not match expander string type!') text...
python
{ "resource": "" }
q13063
uniformat
train
def uniformat(value): """Convert a Unicode char.""" if value in GROUP_ESCAPES: # Escape characters that are (or will be in the future) problematic c = "\\x%02x\\x%02x" % (0x5c, value) elif value <= 0xFF: c = "\\x%02x" % value elif value <= 0xFFFF: c = "\\u%04x" % value ...
python
{ "resource": "" }
q13064
create_span
train
def create_span(unirange, is_bytes=False): """Clamp the Unicode range.""" if len(unirange) < 2: unirange.append(unirange[0]) if is_bytes: if unirange[0] > MAXASCII: return None if unirange[1] > MAXASCII: unirange[1] = MAXASCII return [x for x in range(uni...
python
{ "resource": "" }
q13065
not_explicitly_defined
train
def not_explicitly_defined(table, name, is_bytes=False): """Compose a table with the specified entry name of values not explicitly defined.""" all_chars = ALL_ASCII if is_bytes else ALL_CHARS s = set() for k, v in table.items(): s.update(v) if name in table: table[name] = list(set(t...
python
{ "resource": "" }
q13066
char2range
train
def char2range(d, is_bytes=False, invert=True): """Convert the characters in the dict to a range in string form.""" fmt = bytesformat if is_bytes else uniformat maxrange = MAXASCII if is_bytes else MAXUNICODE for k1 in sorted(d.keys()): v1 = d[k1] if not isinstance(v1, list): ...
python
{ "resource": "" }
q13067
gen_ccc
train
def gen_ccc(output, ascii_props=False, append=False, prefix=""): """Generate `canonical combining class` property.""" obj = {} with codecs.open(os.path.join(HOME, 'unicodedata', UNIVERSION, 'DerivedCombiningClass.txt'), 'r', 'utf-8') as uf: for line in uf: if not line.startswith('#'): ...
python
{ "resource": "" }
q13068
gen_age
train
def gen_age(output, ascii_props=False, append=False, prefix=""): """Generate `age` property.""" obj = {} all_chars = ALL_ASCII if ascii_props else ALL_CHARS with codecs.open(os.path.join(HOME, 'unicodedata', UNIVERSION, 'DerivedAge.txt'), 'r', 'utf-8') as uf: for line in uf: if not ...
python
{ "resource": "" }
q13069
gen_nf_quick_check
train
def gen_nf_quick_check(output, ascii_props=False, append=False, prefix=""): """Generate quick check properties.""" categories = [] nf = {} all_chars = ALL_ASCII if ascii_props else ALL_CHARS file_name = os.path.join(HOME, 'unicodedata', UNIVERSION, 'DerivedNormalizationProps.txt') with codecs.o...
python
{ "resource": "" }
q13070
gen_bidi
train
def gen_bidi(output, ascii_props=False, append=False, prefix=""): """Generate `bidi class` property.""" bidi_class = {} max_range = MAXASCII if ascii_props else MAXUNICODE with codecs.open(os.path.join(HOME, 'unicodedata', UNIVERSION, 'UnicodeData.txt'), 'r', 'utf-8') as uf: for line in uf: ...
python
{ "resource": "" }
q13071
gen_uposix
train
def gen_uposix(table, posix_table): """Generate the posix table and write out to file.""" # `Alnum: [\p{L&}\p{Nd}]` s = set(table['l']['c'] + table['n']['d']) posix_table["posixalnum"] = list(s) # `Alpha: [\p{L&}]` s = set(table['l']['c']) posix_table["posixalpha"] = list(s) # `ASCII:...
python
{ "resource": "" }
q13072
set_version
train
def set_version(version): """Set version.""" global UNIVERSION global UNIVERSION_INFO if version is None: version = unicodedata.unidata_version UNIVERSION = version UNIVERSION_INFO = tuple([int(x) for x in UNIVERSION.split('.')])
python
{ "resource": "" }
q13073
get_posix_property
train
def get_posix_property(value, mode=POSIX): """Retrieve the posix category.""" if mode == POSIX_BYTES: return unidata.ascii_posix_properties[value] elif mode == POSIX_UNICODE: return unidata.unicode_binary[ ('^posix' + value[1:]) if value.startswith('^') else ('posix' + value) ...
python
{ "resource": "" }
q13074
get_gc_property
train
def get_gc_property(value, is_bytes=False): """Get `GC` property.""" obj = unidata.ascii_properties if is_bytes else unidata.unicode_properties if value.startswith('^'): negate = True value = value[1:] else: negate = False value = unidata.unicode_alias['generalcategory'].g...
python
{ "resource": "" }
q13075
get_binary_property
train
def get_binary_property(value, is_bytes=False): """Get `BINARY` property.""" obj = unidata.ascii_binary if is_bytes else unidata.unicode_binary if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['binary'].get(negated, negated) else: value = unidat...
python
{ "resource": "" }
q13076
get_canonical_combining_class_property
train
def get_canonical_combining_class_property(value, is_bytes=False): """Get `CANONICAL COMBINING CLASS` property.""" obj = unidata.ascii_canonical_combining_class if is_bytes else unidata.unicode_canonical_combining_class if value.startswith('^'): negated = value[1:] value = '^' + unidata.un...
python
{ "resource": "" }
q13077
get_east_asian_width_property
train
def get_east_asian_width_property(value, is_bytes=False): """Get `EAST ASIAN WIDTH` property.""" obj = unidata.ascii_east_asian_width if is_bytes else unidata.unicode_east_asian_width if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['eastasianwidth'].get(ne...
python
{ "resource": "" }
q13078
get_grapheme_cluster_break_property
train
def get_grapheme_cluster_break_property(value, is_bytes=False): """Get `GRAPHEME CLUSTER BREAK` property.""" obj = unidata.ascii_grapheme_cluster_break if is_bytes else unidata.unicode_grapheme_cluster_break if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias[...
python
{ "resource": "" }
q13079
get_line_break_property
train
def get_line_break_property(value, is_bytes=False): """Get `LINE BREAK` property.""" obj = unidata.ascii_line_break if is_bytes else unidata.unicode_line_break if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['linebreak'].get(negated, negated) else: ...
python
{ "resource": "" }
q13080
get_sentence_break_property
train
def get_sentence_break_property(value, is_bytes=False): """Get `SENTENCE BREAK` property.""" obj = unidata.ascii_sentence_break if is_bytes else unidata.unicode_sentence_break if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['sentencebreak'].get(negated, ne...
python
{ "resource": "" }
q13081
get_word_break_property
train
def get_word_break_property(value, is_bytes=False): """Get `WORD BREAK` property.""" obj = unidata.ascii_word_break if is_bytes else unidata.unicode_word_break if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['wordbreak'].get(negated, negated) else: ...
python
{ "resource": "" }
q13082
get_hangul_syllable_type_property
train
def get_hangul_syllable_type_property(value, is_bytes=False): """Get `HANGUL SYLLABLE TYPE` property.""" obj = unidata.ascii_hangul_syllable_type if is_bytes else unidata.unicode_hangul_syllable_type if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['hanguls...
python
{ "resource": "" }
q13083
get_indic_syllabic_category_property
train
def get_indic_syllabic_category_property(value, is_bytes=False): """Get `INDIC SYLLABIC CATEGORY` property.""" obj = unidata.ascii_indic_syllabic_category if is_bytes else unidata.unicode_indic_syllabic_category if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_al...
python
{ "resource": "" }
q13084
get_decomposition_type_property
train
def get_decomposition_type_property(value, is_bytes=False): """Get `DECOMPOSITION TYPE` property.""" obj = unidata.ascii_decomposition_type if is_bytes else unidata.unicode_decomposition_type if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['decompositionty...
python
{ "resource": "" }
q13085
get_nfc_quick_check_property
train
def get_nfc_quick_check_property(value, is_bytes=False): """Get `NFC QUICK CHECK` property.""" obj = unidata.ascii_nfc_quick_check if is_bytes else unidata.unicode_nfc_quick_check if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['nfcquickcheck'].get(negated...
python
{ "resource": "" }
q13086
get_nfd_quick_check_property
train
def get_nfd_quick_check_property(value, is_bytes=False): """Get `NFD QUICK CHECK` property.""" obj = unidata.ascii_nfd_quick_check if is_bytes else unidata.unicode_nfd_quick_check if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['nfdquickcheck'].get(negated...
python
{ "resource": "" }
q13087
get_nfkc_quick_check_property
train
def get_nfkc_quick_check_property(value, is_bytes=False): """Get `NFKC QUICK CHECK` property.""" obj = unidata.ascii_nfkc_quick_check if is_bytes else unidata.unicode_nfkc_quick_check if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['nfkcquickcheck'].get(ne...
python
{ "resource": "" }
q13088
get_nfkd_quick_check_property
train
def get_nfkd_quick_check_property(value, is_bytes=False): """Get `NFKD QUICK CHECK` property.""" obj = unidata.ascii_nfkd_quick_check if is_bytes else unidata.unicode_nfkd_quick_check if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['nfkdquickcheck'].get(ne...
python
{ "resource": "" }
q13089
get_numeric_type_property
train
def get_numeric_type_property(value, is_bytes=False): """Get `NUMERIC TYPE` property.""" obj = unidata.ascii_numeric_type if is_bytes else unidata.unicode_numeric_type if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['numerictype'].get(negated, negated) ...
python
{ "resource": "" }
q13090
get_numeric_value_property
train
def get_numeric_value_property(value, is_bytes=False): """Get `NUMERIC VALUE` property.""" obj = unidata.ascii_numeric_values if is_bytes else unidata.unicode_numeric_values if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['numericvalue'].get(negated, negat...
python
{ "resource": "" }
q13091
get_age_property
train
def get_age_property(value, is_bytes=False): """Get `AGE` property.""" obj = unidata.ascii_age if is_bytes else unidata.unicode_age if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['age'].get(negated, negated) else: value = unidata.unicode_alias...
python
{ "resource": "" }
q13092
get_joining_type_property
train
def get_joining_type_property(value, is_bytes=False): """Get `JOINING TYPE` property.""" obj = unidata.ascii_joining_type if is_bytes else unidata.unicode_joining_type if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['joiningtype'].get(negated, negated) ...
python
{ "resource": "" }
q13093
get_joining_group_property
train
def get_joining_group_property(value, is_bytes=False): """Get `JOINING GROUP` property.""" obj = unidata.ascii_joining_group if is_bytes else unidata.unicode_joining_group if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['joininggroup'].get(negated, negated...
python
{ "resource": "" }
q13094
get_script_property
train
def get_script_property(value, is_bytes=False): """Get `SC` property.""" obj = unidata.ascii_scripts if is_bytes else unidata.unicode_scripts if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['script'].get(negated, negated) else: value = unidata....
python
{ "resource": "" }
q13095
get_script_extension_property
train
def get_script_extension_property(value, is_bytes=False): """Get `SCX` property.""" obj = unidata.ascii_script_extensions if is_bytes else unidata.unicode_script_extensions if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['script'].get(negated, negated) ...
python
{ "resource": "" }
q13096
get_block_property
train
def get_block_property(value, is_bytes=False): """Get `BLK` property.""" obj = unidata.ascii_blocks if is_bytes else unidata.unicode_blocks if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['block'].get(negated, negated) else: value = unidata.uni...
python
{ "resource": "" }
q13097
get_bidi_property
train
def get_bidi_property(value, is_bytes=False): """Get `BC` property.""" obj = unidata.ascii_bidi_classes if is_bytes else unidata.unicode_bidi_classes if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['bidiclass'].get(negated, negated) else: value...
python
{ "resource": "" }
q13098
get_bidi_paired_bracket_type_property
train
def get_bidi_paired_bracket_type_property(value, is_bytes=False): """Get `BPT` property.""" obj = unidata.ascii_bidi_paired_bracket_type if is_bytes else unidata.unicode_bidi_paired_bracket_type if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['bidipairedbr...
python
{ "resource": "" }
q13099
get_vertical_orientation_property
train
def get_vertical_orientation_property(value, is_bytes=False): """Get `VO` property.""" obj = unidata.ascii_vertical_orientation if is_bytes else unidata.unicode_vertical_orientation if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['verticalorientation'].get...
python
{ "resource": "" }