partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
test | multiline_import | Return True if import is spans multiples lines. | autoflake.py | def multiline_import(line, previous_line=''):
"""Return True if import is spans multiples lines."""
for symbol in '()':
if symbol in line:
return True
# Ignore doctests.
if line.lstrip().startswith('>'):
return True
return multiline_statement(line, previous_line) | def multiline_import(line, previous_line=''):
"""Return True if import is spans multiples lines."""
for symbol in '()':
if symbol in line:
return True
# Ignore doctests.
if line.lstrip().startswith('>'):
return True
return multiline_statement(line, previous_line) | [
"Return",
"True",
"if",
"import",
"is",
"spans",
"multiples",
"lines",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L247-L257 | [
"def",
"multiline_import",
"(",
"line",
",",
"previous_line",
"=",
"''",
")",
":",
"for",
"symbol",
"in",
"'()'",
":",
"if",
"symbol",
"in",
"line",
":",
"return",
"True",
"# Ignore doctests.",
"if",
"line",
".",
"lstrip",
"(",
")",
".",
"startswith",
"(... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | multiline_statement | Return True if this is part of a multiline statement. | autoflake.py | def multiline_statement(line, previous_line=''):
"""Return True if this is part of a multiline statement."""
for symbol in '\\:;':
if symbol in line:
return True
sio = io.StringIO(line)
try:
list(tokenize.generate_tokens(sio.readline))
return previous_line.rstrip().e... | def multiline_statement(line, previous_line=''):
"""Return True if this is part of a multiline statement."""
for symbol in '\\:;':
if symbol in line:
return True
sio = io.StringIO(line)
try:
list(tokenize.generate_tokens(sio.readline))
return previous_line.rstrip().e... | [
"Return",
"True",
"if",
"this",
"is",
"part",
"of",
"a",
"multiline",
"statement",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L260-L271 | [
"def",
"multiline_statement",
"(",
"line",
",",
"previous_line",
"=",
"''",
")",
":",
"for",
"symbol",
"in",
"'\\\\:;'",
":",
"if",
"symbol",
"in",
"line",
":",
"return",
"True",
"sio",
"=",
"io",
".",
"StringIO",
"(",
"line",
")",
"try",
":",
"list",
... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | filter_from_import | Parse and filter ``from something import a, b, c``.
Return line without unused import modules, or `pass` if all of the
module in import is unused. | autoflake.py | def filter_from_import(line, unused_module):
"""Parse and filter ``from something import a, b, c``.
Return line without unused import modules, or `pass` if all of the
module in import is unused.
"""
(indentation, imports) = re.split(pattern=r'\bimport\b',
strin... | def filter_from_import(line, unused_module):
"""Parse and filter ``from something import a, b, c``.
Return line without unused import modules, or `pass` if all of the
module in import is unused.
"""
(indentation, imports) = re.split(pattern=r'\bimport\b',
strin... | [
"Parse",
"and",
"filter",
"from",
"something",
"import",
"a",
"b",
"c",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L274-L304 | [
"def",
"filter_from_import",
"(",
"line",
",",
"unused_module",
")",
":",
"(",
"indentation",
",",
"imports",
")",
"=",
"re",
".",
"split",
"(",
"pattern",
"=",
"r'\\bimport\\b'",
",",
"string",
"=",
"line",
",",
"maxsplit",
"=",
"1",
")",
"base_module",
... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | break_up_import | Return line with imports on separate lines. | autoflake.py | def break_up_import(line):
"""Return line with imports on separate lines."""
assert '\\' not in line
assert '(' not in line
assert ')' not in line
assert ';' not in line
assert '#' not in line
assert not line.lstrip().startswith('from')
newline = get_line_ending(line)
if not newline... | def break_up_import(line):
"""Return line with imports on separate lines."""
assert '\\' not in line
assert '(' not in line
assert ')' not in line
assert ';' not in line
assert '#' not in line
assert not line.lstrip().startswith('from')
newline = get_line_ending(line)
if not newline... | [
"Return",
"line",
"with",
"imports",
"on",
"separate",
"lines",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L307-L327 | [
"def",
"break_up_import",
"(",
"line",
")",
":",
"assert",
"'\\\\'",
"not",
"in",
"line",
"assert",
"'('",
"not",
"in",
"line",
"assert",
"')'",
"not",
"in",
"line",
"assert",
"';'",
"not",
"in",
"line",
"assert",
"'#'",
"not",
"in",
"line",
"assert",
... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | filter_code | Yield code with unused imports removed. | autoflake.py | def filter_code(source, additional_imports=None,
expand_star_imports=False,
remove_all_unused_imports=False,
remove_duplicate_keys=False,
remove_unused_variables=False,
ignore_init_module_imports=False,
):
"""Yield code ... | def filter_code(source, additional_imports=None,
expand_star_imports=False,
remove_all_unused_imports=False,
remove_duplicate_keys=False,
remove_unused_variables=False,
ignore_init_module_imports=False,
):
"""Yield code ... | [
"Yield",
"code",
"with",
"unused",
"imports",
"removed",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L330-L411 | [
"def",
"filter_code",
"(",
"source",
",",
"additional_imports",
"=",
"None",
",",
"expand_star_imports",
"=",
"False",
",",
"remove_all_unused_imports",
"=",
"False",
",",
"remove_duplicate_keys",
"=",
"False",
",",
"remove_unused_variables",
"=",
"False",
",",
"ign... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | get_messages_by_line | Return dictionary that maps line number to message. | autoflake.py | def get_messages_by_line(messages):
"""Return dictionary that maps line number to message."""
line_messages = {}
for message in messages:
line_messages[message.lineno] = message
return line_messages | def get_messages_by_line(messages):
"""Return dictionary that maps line number to message."""
line_messages = {}
for message in messages:
line_messages[message.lineno] = message
return line_messages | [
"Return",
"dictionary",
"that",
"maps",
"line",
"number",
"to",
"message",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L414-L419 | [
"def",
"get_messages_by_line",
"(",
"messages",
")",
":",
"line_messages",
"=",
"{",
"}",
"for",
"message",
"in",
"messages",
":",
"line_messages",
"[",
"message",
".",
"lineno",
"]",
"=",
"message",
"return",
"line_messages"
] | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | filter_star_import | Return line with the star import expanded. | autoflake.py | def filter_star_import(line, marked_star_import_undefined_name):
"""Return line with the star import expanded."""
undefined_name = sorted(set(marked_star_import_undefined_name))
return re.sub(r'\*', ', '.join(undefined_name), line) | def filter_star_import(line, marked_star_import_undefined_name):
"""Return line with the star import expanded."""
undefined_name = sorted(set(marked_star_import_undefined_name))
return re.sub(r'\*', ', '.join(undefined_name), line) | [
"Return",
"line",
"with",
"the",
"star",
"import",
"expanded",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L422-L425 | [
"def",
"filter_star_import",
"(",
"line",
",",
"marked_star_import_undefined_name",
")",
":",
"undefined_name",
"=",
"sorted",
"(",
"set",
"(",
"marked_star_import_undefined_name",
")",
")",
"return",
"re",
".",
"sub",
"(",
"r'\\*'",
",",
"', '",
".",
"join",
"(... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | filter_unused_import | Return line if used, otherwise return None. | autoflake.py | def filter_unused_import(line, unused_module, remove_all_unused_imports,
imports, previous_line=''):
"""Return line if used, otherwise return None."""
if multiline_import(line, previous_line):
return line
is_from_import = line.lstrip().startswith('from')
if ',' in line... | def filter_unused_import(line, unused_module, remove_all_unused_imports,
imports, previous_line=''):
"""Return line if used, otherwise return None."""
if multiline_import(line, previous_line):
return line
is_from_import = line.lstrip().startswith('from')
if ',' in line... | [
"Return",
"line",
"if",
"used",
"otherwise",
"return",
"None",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L428-L453 | [
"def",
"filter_unused_import",
"(",
"line",
",",
"unused_module",
",",
"remove_all_unused_imports",
",",
"imports",
",",
"previous_line",
"=",
"''",
")",
":",
"if",
"multiline_import",
"(",
"line",
",",
"previous_line",
")",
":",
"return",
"line",
"is_from_import"... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | filter_unused_variable | Return line if used, otherwise return None. | autoflake.py | def filter_unused_variable(line, previous_line=''):
"""Return line if used, otherwise return None."""
if re.match(EXCEPT_REGEX, line):
return re.sub(r' as \w+:$', ':', line, count=1)
elif multiline_statement(line, previous_line):
return line
elif line.count('=') == 1:
split_line ... | def filter_unused_variable(line, previous_line=''):
"""Return line if used, otherwise return None."""
if re.match(EXCEPT_REGEX, line):
return re.sub(r' as \w+:$', ':', line, count=1)
elif multiline_statement(line, previous_line):
return line
elif line.count('=') == 1:
split_line ... | [
"Return",
"line",
"if",
"used",
"otherwise",
"return",
"None",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L456-L476 | [
"def",
"filter_unused_variable",
"(",
"line",
",",
"previous_line",
"=",
"''",
")",
":",
"if",
"re",
".",
"match",
"(",
"EXCEPT_REGEX",
",",
"line",
")",
":",
"return",
"re",
".",
"sub",
"(",
"r' as \\w+:$'",
",",
"':'",
",",
"line",
",",
"count",
"=",... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | filter_duplicate_key | Return '' if first occurrence of the key otherwise return `line`. | autoflake.py | def filter_duplicate_key(line, message, line_number, marked_line_numbers,
source, previous_line=''):
"""Return '' if first occurrence of the key otherwise return `line`."""
if marked_line_numbers and line_number == sorted(marked_line_numbers)[0]:
return ''
return line | def filter_duplicate_key(line, message, line_number, marked_line_numbers,
source, previous_line=''):
"""Return '' if first occurrence of the key otherwise return `line`."""
if marked_line_numbers and line_number == sorted(marked_line_numbers)[0]:
return ''
return line | [
"Return",
"if",
"first",
"occurrence",
"of",
"the",
"key",
"otherwise",
"return",
"line",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L479-L485 | [
"def",
"filter_duplicate_key",
"(",
"line",
",",
"message",
",",
"line_number",
",",
"marked_line_numbers",
",",
"source",
",",
"previous_line",
"=",
"''",
")",
":",
"if",
"marked_line_numbers",
"and",
"line_number",
"==",
"sorted",
"(",
"marked_line_numbers",
")"... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | dict_entry_has_key | Return True if `line` is a dict entry that uses `key`.
Return False for multiline cases where the line should not be removed by
itself. | autoflake.py | def dict_entry_has_key(line, key):
"""Return True if `line` is a dict entry that uses `key`.
Return False for multiline cases where the line should not be removed by
itself.
"""
if '#' in line:
return False
result = re.match(r'\s*(.*)\s*:\s*(.*),\s*$', line)
if not result:
... | def dict_entry_has_key(line, key):
"""Return True if `line` is a dict entry that uses `key`.
Return False for multiline cases where the line should not be removed by
itself.
"""
if '#' in line:
return False
result = re.match(r'\s*(.*)\s*:\s*(.*),\s*$', line)
if not result:
... | [
"Return",
"True",
"if",
"line",
"is",
"a",
"dict",
"entry",
"that",
"uses",
"key",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L488-L510 | [
"def",
"dict_entry_has_key",
"(",
"line",
",",
"key",
")",
":",
"if",
"'#'",
"in",
"line",
":",
"return",
"False",
"result",
"=",
"re",
".",
"match",
"(",
"r'\\s*(.*)\\s*:\\s*(.*),\\s*$'",
",",
"line",
")",
"if",
"not",
"result",
":",
"return",
"False",
... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | is_literal_or_name | Return True if value is a literal or a name. | autoflake.py | def is_literal_or_name(value):
"""Return True if value is a literal or a name."""
try:
ast.literal_eval(value)
return True
except (SyntaxError, ValueError):
pass
if value.strip() in ['dict()', 'list()', 'set()']:
return True
# Support removal of variables on the rig... | def is_literal_or_name(value):
"""Return True if value is a literal or a name."""
try:
ast.literal_eval(value)
return True
except (SyntaxError, ValueError):
pass
if value.strip() in ['dict()', 'list()', 'set()']:
return True
# Support removal of variables on the rig... | [
"Return",
"True",
"if",
"value",
"is",
"a",
"literal",
"or",
"a",
"name",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L513-L526 | [
"def",
"is_literal_or_name",
"(",
"value",
")",
":",
"try",
":",
"ast",
".",
"literal_eval",
"(",
"value",
")",
"return",
"True",
"except",
"(",
"SyntaxError",
",",
"ValueError",
")",
":",
"pass",
"if",
"value",
".",
"strip",
"(",
")",
"in",
"[",
"'dic... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | useless_pass_line_numbers | Yield line numbers of unneeded "pass" statements. | autoflake.py | def useless_pass_line_numbers(source):
"""Yield line numbers of unneeded "pass" statements."""
sio = io.StringIO(source)
previous_token_type = None
last_pass_row = None
last_pass_indentation = None
previous_line = ''
for token in tokenize.generate_tokens(sio.readline):
token_type = t... | def useless_pass_line_numbers(source):
"""Yield line numbers of unneeded "pass" statements."""
sio = io.StringIO(source)
previous_token_type = None
last_pass_row = None
last_pass_indentation = None
previous_line = ''
for token in tokenize.generate_tokens(sio.readline):
token_type = t... | [
"Yield",
"line",
"numbers",
"of",
"unneeded",
"pass",
"statements",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L529-L561 | [
"def",
"useless_pass_line_numbers",
"(",
"source",
")",
":",
"sio",
"=",
"io",
".",
"StringIO",
"(",
"source",
")",
"previous_token_type",
"=",
"None",
"last_pass_row",
"=",
"None",
"last_pass_indentation",
"=",
"None",
"previous_line",
"=",
"''",
"for",
"token"... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | filter_useless_pass | Yield code with useless "pass" lines removed. | autoflake.py | def filter_useless_pass(source):
"""Yield code with useless "pass" lines removed."""
try:
marked_lines = frozenset(useless_pass_line_numbers(source))
except (SyntaxError, tokenize.TokenError):
marked_lines = frozenset()
sio = io.StringIO(source)
for line_number, line in enumerate(si... | def filter_useless_pass(source):
"""Yield code with useless "pass" lines removed."""
try:
marked_lines = frozenset(useless_pass_line_numbers(source))
except (SyntaxError, tokenize.TokenError):
marked_lines = frozenset()
sio = io.StringIO(source)
for line_number, line in enumerate(si... | [
"Yield",
"code",
"with",
"useless",
"pass",
"lines",
"removed",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L564-L574 | [
"def",
"filter_useless_pass",
"(",
"source",
")",
":",
"try",
":",
"marked_lines",
"=",
"frozenset",
"(",
"useless_pass_line_numbers",
"(",
"source",
")",
")",
"except",
"(",
"SyntaxError",
",",
"tokenize",
".",
"TokenError",
")",
":",
"marked_lines",
"=",
"fr... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | get_indentation | Return leading whitespace. | autoflake.py | def get_indentation(line):
"""Return leading whitespace."""
if line.strip():
non_whitespace_index = len(line) - len(line.lstrip())
return line[:non_whitespace_index]
else:
return '' | def get_indentation(line):
"""Return leading whitespace."""
if line.strip():
non_whitespace_index = len(line) - len(line.lstrip())
return line[:non_whitespace_index]
else:
return '' | [
"Return",
"leading",
"whitespace",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L577-L583 | [
"def",
"get_indentation",
"(",
"line",
")",
":",
"if",
"line",
".",
"strip",
"(",
")",
":",
"non_whitespace_index",
"=",
"len",
"(",
"line",
")",
"-",
"len",
"(",
"line",
".",
"lstrip",
"(",
")",
")",
"return",
"line",
"[",
":",
"non_whitespace_index",... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | get_line_ending | Return line ending. | autoflake.py | def get_line_ending(line):
"""Return line ending."""
non_whitespace_index = len(line.rstrip()) - len(line)
if not non_whitespace_index:
return ''
else:
return line[non_whitespace_index:] | def get_line_ending(line):
"""Return line ending."""
non_whitespace_index = len(line.rstrip()) - len(line)
if not non_whitespace_index:
return ''
else:
return line[non_whitespace_index:] | [
"Return",
"line",
"ending",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L586-L592 | [
"def",
"get_line_ending",
"(",
"line",
")",
":",
"non_whitespace_index",
"=",
"len",
"(",
"line",
".",
"rstrip",
"(",
")",
")",
"-",
"len",
"(",
"line",
")",
"if",
"not",
"non_whitespace_index",
":",
"return",
"''",
"else",
":",
"return",
"line",
"[",
... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | fix_code | Return code with all filtering run on it. | autoflake.py | def fix_code(source, additional_imports=None, expand_star_imports=False,
remove_all_unused_imports=False, remove_duplicate_keys=False,
remove_unused_variables=False, ignore_init_module_imports=False):
"""Return code with all filtering run on it."""
if not source:
return source
... | def fix_code(source, additional_imports=None, expand_star_imports=False,
remove_all_unused_imports=False, remove_duplicate_keys=False,
remove_unused_variables=False, ignore_init_module_imports=False):
"""Return code with all filtering run on it."""
if not source:
return source
... | [
"Return",
"code",
"with",
"all",
"filtering",
"run",
"on",
"it",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L595-L624 | [
"def",
"fix_code",
"(",
"source",
",",
"additional_imports",
"=",
"None",
",",
"expand_star_imports",
"=",
"False",
",",
"remove_all_unused_imports",
"=",
"False",
",",
"remove_duplicate_keys",
"=",
"False",
",",
"remove_unused_variables",
"=",
"False",
",",
"ignore... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | fix_file | Run fix_code() on a file. | autoflake.py | def fix_file(filename, args, standard_out):
"""Run fix_code() on a file."""
encoding = detect_encoding(filename)
with open_with_encoding(filename, encoding=encoding) as input_file:
source = input_file.read()
original_source = source
isInitFile = os.path.basename(filename) == '__init__.py'
... | def fix_file(filename, args, standard_out):
"""Run fix_code() on a file."""
encoding = detect_encoding(filename)
with open_with_encoding(filename, encoding=encoding) as input_file:
source = input_file.read()
original_source = source
isInitFile = os.path.basename(filename) == '__init__.py'
... | [
"Run",
"fix_code",
"()",
"on",
"a",
"file",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L627-L668 | [
"def",
"fix_file",
"(",
"filename",
",",
"args",
",",
"standard_out",
")",
":",
"encoding",
"=",
"detect_encoding",
"(",
"filename",
")",
"with",
"open_with_encoding",
"(",
"filename",
",",
"encoding",
"=",
"encoding",
")",
"as",
"input_file",
":",
"source",
... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | detect_encoding | Return file encoding. | autoflake.py | def detect_encoding(filename, limit_byte_check=-1):
"""Return file encoding."""
try:
with open(filename, 'rb') as input_file:
encoding = _detect_encoding(input_file.readline)
# Check for correctness of encoding.
with open_with_encoding(filename, encoding) as input_fi... | def detect_encoding(filename, limit_byte_check=-1):
"""Return file encoding."""
try:
with open(filename, 'rb') as input_file:
encoding = _detect_encoding(input_file.readline)
# Check for correctness of encoding.
with open_with_encoding(filename, encoding) as input_fi... | [
"Return",
"file",
"encoding",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L681-L693 | [
"def",
"detect_encoding",
"(",
"filename",
",",
"limit_byte_check",
"=",
"-",
"1",
")",
":",
"try",
":",
"with",
"open",
"(",
"filename",
",",
"'rb'",
")",
"as",
"input_file",
":",
"encoding",
"=",
"_detect_encoding",
"(",
"input_file",
".",
"readline",
")... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | _detect_encoding | Return file encoding. | autoflake.py | def _detect_encoding(readline):
"""Return file encoding."""
try:
from lib2to3.pgen2 import tokenize as lib2to3_tokenize
encoding = lib2to3_tokenize.detect_encoding(readline)[0]
return encoding
except (LookupError, SyntaxError, UnicodeDecodeError):
return 'latin-1' | def _detect_encoding(readline):
"""Return file encoding."""
try:
from lib2to3.pgen2 import tokenize as lib2to3_tokenize
encoding = lib2to3_tokenize.detect_encoding(readline)[0]
return encoding
except (LookupError, SyntaxError, UnicodeDecodeError):
return 'latin-1' | [
"Return",
"file",
"encoding",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L696-L703 | [
"def",
"_detect_encoding",
"(",
"readline",
")",
":",
"try",
":",
"from",
"lib2to3",
".",
"pgen2",
"import",
"tokenize",
"as",
"lib2to3_tokenize",
"encoding",
"=",
"lib2to3_tokenize",
".",
"detect_encoding",
"(",
"readline",
")",
"[",
"0",
"]",
"return",
"enco... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | _split_comma_separated | Return a set of strings. | autoflake.py | def _split_comma_separated(string):
"""Return a set of strings."""
return set(text.strip() for text in string.split(',') if text.strip()) | def _split_comma_separated(string):
"""Return a set of strings."""
return set(text.strip() for text in string.split(',') if text.strip()) | [
"Return",
"a",
"set",
"of",
"strings",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L726-L728 | [
"def",
"_split_comma_separated",
"(",
"string",
")",
":",
"return",
"set",
"(",
"text",
".",
"strip",
"(",
")",
"for",
"text",
"in",
"string",
".",
"split",
"(",
"','",
")",
"if",
"text",
".",
"strip",
"(",
")",
")"
] | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | is_python_file | Return True if filename is Python file. | autoflake.py | def is_python_file(filename):
"""Return True if filename is Python file."""
if filename.endswith('.py'):
return True
try:
with open_with_encoding(
filename,
None,
limit_byte_check=MAX_PYTHON_FILE_DETECTION_BYTES) as f:
text = f.rea... | def is_python_file(filename):
"""Return True if filename is Python file."""
if filename.endswith('.py'):
return True
try:
with open_with_encoding(
filename,
None,
limit_byte_check=MAX_PYTHON_FILE_DETECTION_BYTES) as f:
text = f.rea... | [
"Return",
"True",
"if",
"filename",
"is",
"Python",
"file",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L731-L751 | [
"def",
"is_python_file",
"(",
"filename",
")",
":",
"if",
"filename",
".",
"endswith",
"(",
"'.py'",
")",
":",
"return",
"True",
"try",
":",
"with",
"open_with_encoding",
"(",
"filename",
",",
"None",
",",
"limit_byte_check",
"=",
"MAX_PYTHON_FILE_DETECTION_BYTE... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | is_exclude_file | Return True if file matches exclude pattern. | autoflake.py | def is_exclude_file(filename, exclude):
"""Return True if file matches exclude pattern."""
base_name = os.path.basename(filename)
if base_name.startswith('.'):
return True
for pattern in exclude:
if fnmatch.fnmatch(base_name, pattern):
return True
if fnmatch.fnmatch... | def is_exclude_file(filename, exclude):
"""Return True if file matches exclude pattern."""
base_name = os.path.basename(filename)
if base_name.startswith('.'):
return True
for pattern in exclude:
if fnmatch.fnmatch(base_name, pattern):
return True
if fnmatch.fnmatch... | [
"Return",
"True",
"if",
"file",
"matches",
"exclude",
"pattern",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L754-L766 | [
"def",
"is_exclude_file",
"(",
"filename",
",",
"exclude",
")",
":",
"base_name",
"=",
"os",
".",
"path",
".",
"basename",
"(",
"filename",
")",
"if",
"base_name",
".",
"startswith",
"(",
"'.'",
")",
":",
"return",
"True",
"for",
"pattern",
"in",
"exclud... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | match_file | Return True if file is okay for modifying/recursing. | autoflake.py | def match_file(filename, exclude):
"""Return True if file is okay for modifying/recursing."""
if is_exclude_file(filename, exclude):
return False
if not os.path.isdir(filename) and not is_python_file(filename):
return False
return True | def match_file(filename, exclude):
"""Return True if file is okay for modifying/recursing."""
if is_exclude_file(filename, exclude):
return False
if not os.path.isdir(filename) and not is_python_file(filename):
return False
return True | [
"Return",
"True",
"if",
"file",
"is",
"okay",
"for",
"modifying",
"/",
"recursing",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L769-L777 | [
"def",
"match_file",
"(",
"filename",
",",
"exclude",
")",
":",
"if",
"is_exclude_file",
"(",
"filename",
",",
"exclude",
")",
":",
"return",
"False",
"if",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"filename",
")",
"and",
"not",
"is_python_file",
"("... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | find_files | Yield filenames. | autoflake.py | def find_files(filenames, recursive, exclude):
"""Yield filenames."""
while filenames:
name = filenames.pop(0)
if recursive and os.path.isdir(name):
for root, directories, children in os.walk(name):
filenames += [os.path.join(root, f) for f in children
... | def find_files(filenames, recursive, exclude):
"""Yield filenames."""
while filenames:
name = filenames.pop(0)
if recursive and os.path.isdir(name):
for root, directories, children in os.walk(name):
filenames += [os.path.join(root, f) for f in children
... | [
"Yield",
"filenames",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L780-L794 | [
"def",
"find_files",
"(",
"filenames",
",",
"recursive",
",",
"exclude",
")",
":",
"while",
"filenames",
":",
"name",
"=",
"filenames",
".",
"pop",
"(",
"0",
")",
"if",
"recursive",
"and",
"os",
".",
"path",
".",
"isdir",
"(",
"name",
")",
":",
"for"... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | _main | Return exit status.
0 means no error. | autoflake.py | def _main(argv, standard_out, standard_error):
"""Return exit status.
0 means no error.
"""
import argparse
parser = argparse.ArgumentParser(description=__doc__, prog='autoflake')
parser.add_argument('-c', '--check', action='store_true',
help='return error code if change... | def _main(argv, standard_out, standard_error):
"""Return exit status.
0 means no error.
"""
import argparse
parser = argparse.ArgumentParser(description=__doc__, prog='autoflake')
parser.add_argument('-c', '--check', action='store_true',
help='return error code if change... | [
"Return",
"exit",
"status",
"."
] | myint/autoflake | python | https://github.com/myint/autoflake/blob/68fea68646922b920d55975f9f2adaeafd84df4f/autoflake.py#L797-L858 | [
"def",
"_main",
"(",
"argv",
",",
"standard_out",
",",
"standard_error",
")",
":",
"import",
"argparse",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"__doc__",
",",
"prog",
"=",
"'autoflake'",
")",
"parser",
".",
"add_argument",
... | 68fea68646922b920d55975f9f2adaeafd84df4f |
test | ObtainLeaseResponsePayload.read | Read the data encoding the ObtainLease response payload and decode it
into its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting a read method; usually a BytearrayStream
object.
kmip_version (... | kmip/core/messages/payloads/obtain_lease.py | def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the ObtainLease response payload and decode it
into its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting ... | def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the ObtainLease response payload and decode it
into its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting ... | [
"Read",
"the",
"data",
"encoding",
"the",
"ObtainLease",
"response",
"payload",
"and",
"decode",
"it",
"into",
"its",
"constituent",
"parts",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/obtain_lease.py#L254-L299 | [
"def",
"read",
"(",
"self",
",",
"input_stream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"ObtainLeaseResponsePayload",
",",
"self",
")",
".",
"read",
"(",
"input_stream",
",",
"kmip_version",
"=",
"kmip... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | ObtainLeaseResponsePayload.write | Write the data encoding the ObtainLease response payload to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayStream
object.
kmip_version (KMIPVersion): An enumeration defin... | kmip/core/messages/payloads/obtain_lease.py | def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the ObtainLease response payload to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a Bytearr... | def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the ObtainLease response payload to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a Bytearr... | [
"Write",
"the",
"data",
"encoding",
"the",
"ObtainLease",
"response",
"payload",
"to",
"a",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/obtain_lease.py#L301-L339 | [
"def",
"write",
"(",
"self",
",",
"output_stream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"local_stream",
"=",
"utils",
".",
"BytearrayStream",
"(",
")",
"if",
"self",
".",
"_unique_identifier",
":",
"self",
".",
... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | CancelRequestPayload.write | Write the data encoding the Cancel request payload to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayStream
object.
kmip_version (KMIPVersion): An enumeration defining th... | kmip/core/messages/payloads/cancel.py | def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the Cancel request payload to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayStre... | def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the Cancel request payload to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayStre... | [
"Write",
"the",
"data",
"encoding",
"the",
"Cancel",
"request",
"payload",
"to",
"a",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/cancel.py#L103-L131 | [
"def",
"write",
"(",
"self",
",",
"output_stream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"local_stream",
"=",
"utils",
".",
"BytearrayStream",
"(",
")",
"if",
"self",
".",
"_asynchronous_correlation_value",
":",
"sel... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | CancelResponsePayload.read | Read the data encoding the Cancel response payload and decode it into
its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting a read method; usually a BytearrayStream
object.
kmip_version (KMIPV... | kmip/core/messages/payloads/cancel.py | def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the Cancel response payload and decode it into
its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting a rea... | def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the Cancel response payload and decode it into
its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting a rea... | [
"Read",
"the",
"data",
"encoding",
"the",
"Cancel",
"response",
"payload",
"and",
"decode",
"it",
"into",
"its",
"constituent",
"parts",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/cancel.py#L237-L281 | [
"def",
"read",
"(",
"self",
",",
"input_stream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"CancelResponsePayload",
",",
"self",
")",
".",
"read",
"(",
"input_stream",
",",
"kmip_version",
"=",
"kmip_vers... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | Name.create | Returns a Name object, populated with the given value and type | kmip/core/attributes.py | def create(cls, name_value, name_type):
'''
Returns a Name object, populated with the given value and type
'''
if isinstance(name_value, Name.NameValue):
value = name_value
elif isinstance(name_value, str):
value = cls.NameValue(name_value)
els... | def create(cls, name_value, name_type):
'''
Returns a Name object, populated with the given value and type
'''
if isinstance(name_value, Name.NameValue):
value = name_value
elif isinstance(name_value, str):
value = cls.NameValue(name_value)
els... | [
"Returns",
"a",
"Name",
"object",
"populated",
"with",
"the",
"given",
"value",
"and",
"type"
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/attributes.py#L157-L186 | [
"def",
"create",
"(",
"cls",
",",
"name_value",
",",
"name_type",
")",
":",
"if",
"isinstance",
"(",
"name_value",
",",
"Name",
".",
"NameValue",
")",
":",
"value",
"=",
"name_value",
"elif",
"isinstance",
"(",
"name_value",
",",
"str",
")",
":",
"value"... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | Digest.read | Read the data encoding the Digest object and decode it into its
constituent parts.
Args:
istream (Stream): A data stream containing encoded object data,
supporting a read method; usually a BytearrayStream object.
kmip_version (KMIPVersion): An enumeration definin... | kmip/core/attributes.py | def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the Digest object and decode it into its
constituent parts.
Args:
istream (Stream): A data stream containing encoded object data,
supporting a read method; usually a ... | def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the Digest object and decode it into its
constituent parts.
Args:
istream (Stream): A data stream containing encoded object data,
supporting a read method; usually a ... | [
"Read",
"the",
"data",
"encoding",
"the",
"Digest",
"object",
"and",
"decode",
"it",
"into",
"its",
"constituent",
"parts",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/attributes.py#L899-L919 | [
"def",
"read",
"(",
"self",
",",
"istream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"Digest",
",",
"self",
")",
".",
"read",
"(",
"istream",
",",
"kmip_version",
"=",
"kmip_version",
")",
"tstream",... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | Digest.write | Write the data encoding the Digest object to a stream.
Args:
ostream (Stream): A data stream in which to encode object data,
supporting a write method; usually a BytearrayStream object.
kmip_version (KMIPVersion): An enumeration defining the KMIP
version ... | kmip/core/attributes.py | def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the Digest object to a stream.
Args:
ostream (Stream): A data stream in which to encode object data,
supporting a write method; usually a BytearrayStream object.
... | def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the Digest object to a stream.
Args:
ostream (Stream): A data stream in which to encode object data,
supporting a write method; usually a BytearrayStream object.
... | [
"Write",
"the",
"data",
"encoding",
"the",
"Digest",
"object",
"to",
"a",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/attributes.py#L921-L940 | [
"def",
"write",
"(",
"self",
",",
"ostream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"tstream",
"=",
"BytearrayStream",
"(",
")",
"self",
".",
"hashing_algorithm",
".",
"write",
"(",
"tstream",
",",
"kmip_version",
... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | Digest.create | Construct a Digest object from provided digest values.
Args:
hashing_algorithm (HashingAlgorithm): An enumeration representing
the hash algorithm used to compute the digest. Optional,
defaults to HashingAlgorithm.SHA_256.
digest_value (byte string): The b... | kmip/core/attributes.py | def create(cls,
hashing_algorithm=HashingAlgorithmEnum.SHA_256,
digest_value=b'',
key_format_type=KeyFormatTypeEnum.RAW):
"""
Construct a Digest object from provided digest values.
Args:
hashing_algorithm (HashingAlgorithm): An enumeratio... | def create(cls,
hashing_algorithm=HashingAlgorithmEnum.SHA_256,
digest_value=b'',
key_format_type=KeyFormatTypeEnum.RAW):
"""
Construct a Digest object from provided digest values.
Args:
hashing_algorithm (HashingAlgorithm): An enumeratio... | [
"Construct",
"a",
"Digest",
"object",
"from",
"provided",
"digest",
"values",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/attributes.py#L1003-L1039 | [
"def",
"create",
"(",
"cls",
",",
"hashing_algorithm",
"=",
"HashingAlgorithmEnum",
".",
"SHA_256",
",",
"digest_value",
"=",
"b''",
",",
"key_format_type",
"=",
"KeyFormatTypeEnum",
".",
"RAW",
")",
":",
"algorithm",
"=",
"HashingAlgorithm",
"(",
"hashing_algorit... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | ApplicationSpecificInformation.read | Read the data encoding the ApplicationSpecificInformation object and
decode it into its constituent parts.
Args:
istream (Stream): A data stream containing encoded object data,
supporting a read method; usually a BytearrayStream object.
kmip_version (KMIPVersion)... | kmip/core/attributes.py | def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the ApplicationSpecificInformation object and
decode it into its constituent parts.
Args:
istream (Stream): A data stream containing encoded object data,
supporting a... | def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the ApplicationSpecificInformation object and
decode it into its constituent parts.
Args:
istream (Stream): A data stream containing encoded object data,
supporting a... | [
"Read",
"the",
"data",
"encoding",
"the",
"ApplicationSpecificInformation",
"object",
"and",
"decode",
"it",
"into",
"its",
"constituent",
"parts",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/attributes.py#L1154-L1176 | [
"def",
"read",
"(",
"self",
",",
"istream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"ApplicationSpecificInformation",
",",
"self",
")",
".",
"read",
"(",
"istream",
",",
"kmip_version",
"=",
"kmip_versi... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | ApplicationSpecificInformation.write | Write the data encoding the ApplicationSpecificInformation object to a
stream.
Args:
ostream (Stream): A data stream in which to encode object data,
supporting a write method; usually a BytearrayStream object.
kmip_version (KMIPVersion): An enumeration defining t... | kmip/core/attributes.py | def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the ApplicationSpecificInformation object to a
stream.
Args:
ostream (Stream): A data stream in which to encode object data,
supporting a write method; usually a By... | def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the ApplicationSpecificInformation object to a
stream.
Args:
ostream (Stream): A data stream in which to encode object data,
supporting a write method; usually a By... | [
"Write",
"the",
"data",
"encoding",
"the",
"ApplicationSpecificInformation",
"object",
"to",
"a",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/attributes.py#L1178-L1200 | [
"def",
"write",
"(",
"self",
",",
"ostream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"tstream",
"=",
"BytearrayStream",
"(",
")",
"self",
".",
"application_namespace",
".",
"write",
"(",
"tstream",
",",
"kmip_version... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | ApplicationSpecificInformation.create | Construct an ApplicationSpecificInformation object from provided data
and namespace values.
Args:
application_namespace (str): The name of the application namespace.
application_data (str): Application data related to the namespace.
Returns:
ApplicationSpeci... | kmip/core/attributes.py | def create(cls, application_namespace, application_data):
"""
Construct an ApplicationSpecificInformation object from provided data
and namespace values.
Args:
application_namespace (str): The name of the application namespace.
application_data (str): Application... | def create(cls, application_namespace, application_data):
"""
Construct an ApplicationSpecificInformation object from provided data
and namespace values.
Args:
application_namespace (str): The name of the application namespace.
application_data (str): Application... | [
"Construct",
"an",
"ApplicationSpecificInformation",
"object",
"from",
"provided",
"data",
"and",
"namespace",
"values",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/attributes.py#L1257-L1280 | [
"def",
"create",
"(",
"cls",
",",
"application_namespace",
",",
"application_data",
")",
":",
"namespace",
"=",
"ApplicationNamespace",
"(",
"application_namespace",
")",
"data",
"=",
"ApplicationData",
"(",
"application_data",
")",
"return",
"ApplicationSpecificInforma... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | DerivationParameters.read | Read the data encoding the DerivationParameters struct and decode it
into its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting a read method; usually a BytearrayStream
object.
kmip_version (K... | kmip/core/attributes.py | def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the DerivationParameters struct and decode it
into its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting a... | def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the DerivationParameters struct and decode it
into its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting a... | [
"Read",
"the",
"data",
"encoding",
"the",
"DerivationParameters",
"struct",
"and",
"decode",
"it",
"into",
"its",
"constituent",
"parts",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/attributes.py#L1443-L1493 | [
"def",
"read",
"(",
"self",
",",
"input_stream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"DerivationParameters",
",",
"self",
")",
".",
"read",
"(",
"input_stream",
",",
"kmip_version",
"=",
"kmip_versi... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | DerivationParameters.write | Write the data encoding the DerivationParameters struct to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayStream
object.
kmip_version (KMIPVersion): An enumeration defini... | kmip/core/attributes.py | def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the DerivationParameters struct to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a Bytearra... | def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the DerivationParameters struct to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a Bytearra... | [
"Write",
"the",
"data",
"encoding",
"the",
"DerivationParameters",
"struct",
"to",
"a",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/attributes.py#L1495-L1540 | [
"def",
"write",
"(",
"self",
",",
"output_stream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"local_stream",
"=",
"BytearrayStream",
"(",
")",
"if",
"self",
".",
"_cryptographic_parameters",
":",
"self",
".",
"_cryptogra... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | GetRequestPayload.read | Read the data encoding the Get request payload and decode it into its
constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting a read method; usually a BytearrayStream
object.
kmip_version (KMIPVersi... | kmip/core/messages/payloads/get.py | def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the Get request payload and decode it into its
constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting a read me... | def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the Get request payload and decode it into its
constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting a read me... | [
"Read",
"the",
"data",
"encoding",
"the",
"Get",
"request",
"payload",
"and",
"decode",
"it",
"into",
"its",
"constituent",
"parts",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/get.py#L159-L218 | [
"def",
"read",
"(",
"self",
",",
"input_stream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"GetRequestPayload",
",",
"self",
")",
".",
"read",
"(",
"input_stream",
",",
"kmip_version",
"=",
"kmip_version"... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | GetRequestPayload.write | Write the data encoding the Get request payload to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayStream
object.
kmip_version (KMIPVersion): An enumeration defining the K... | kmip/core/messages/payloads/get.py | def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the Get request payload to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayStream
... | def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the Get request payload to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayStream
... | [
"Write",
"the",
"data",
"encoding",
"the",
"Get",
"request",
"payload",
"to",
"a",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/get.py#L220-L260 | [
"def",
"write",
"(",
"self",
",",
"output_stream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"local_stream",
"=",
"utils",
".",
"BytearrayStream",
"(",
")",
"if",
"self",
".",
"_unique_identifier",
"is",
"not",
"None",... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | GetResponsePayload.read | Read the data encoding the Get response payload and decode it
into its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting a read method; usually a BytearrayStream
object.
kmip_version (KMIPVers... | kmip/core/messages/payloads/get.py | def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the Get response payload and decode it
into its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting a read m... | def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the Get response payload and decode it
into its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting a read m... | [
"Read",
"the",
"data",
"encoding",
"the",
"Get",
"response",
"payload",
"and",
"decode",
"it",
"into",
"its",
"constituent",
"parts",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/get.py#L414-L470 | [
"def",
"read",
"(",
"self",
",",
"input_stream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"GetResponsePayload",
",",
"self",
")",
".",
"read",
"(",
"input_stream",
",",
"kmip_version",
"=",
"kmip_version... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | GetResponsePayload.write | Write the data encoding the Get response payload to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayStream
object.
kmip_version (KMIPVersion): An enumeration defining the ... | kmip/core/messages/payloads/get.py | def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the Get response payload to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayStream... | def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the Get response payload to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayStream... | [
"Write",
"the",
"data",
"encoding",
"the",
"Get",
"response",
"payload",
"to",
"a",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/get.py#L472-L515 | [
"def",
"write",
"(",
"self",
",",
"output_stream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"local_stream",
"=",
"utils",
".",
"BytearrayStream",
"(",
")",
"if",
"self",
".",
"object_type",
":",
"self",
".",
"_objec... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | SignatureVerifyRequestPayload.read | Read the data encoding the SignatureVerify request payload and decode
it into its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting a read method; usually a BytearrayStream
object.
kmip_versio... | kmip/core/messages/payloads/signature_verify.py | def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the SignatureVerify request payload and decode
it into its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporti... | def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the SignatureVerify request payload and decode
it into its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporti... | [
"Read",
"the",
"data",
"encoding",
"the",
"SignatureVerify",
"request",
"payload",
"and",
"decode",
"it",
"into",
"its",
"constituent",
"parts",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/signature_verify.py#L251-L321 | [
"def",
"read",
"(",
"self",
",",
"input_stream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"SignatureVerifyRequestPayload",
",",
"self",
")",
".",
"read",
"(",
"input_stream",
",",
"kmip_version",
"=",
"k... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | SignatureVerifyRequestPayload.write | Write the data encoding the SignatureVerify request payload to a
stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayStream
object.
kmip_version (KMIPVersion): An enumer... | kmip/core/messages/payloads/signature_verify.py | def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the SignatureVerify request payload to a
stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usuall... | def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the SignatureVerify request payload to a
stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usuall... | [
"Write",
"the",
"data",
"encoding",
"the",
"SignatureVerify",
"request",
"payload",
"to",
"a",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/signature_verify.py#L323-L381 | [
"def",
"write",
"(",
"self",
",",
"output_stream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"local_stream",
"=",
"utils",
".",
"BytearrayStream",
"(",
")",
"if",
"self",
".",
"_unique_identifier",
":",
"self",
".",
... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | SignatureVerifyResponsePayload.read | Read the data encoding the SignatureVerify response payload and decode
it into its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting a read method; usually a BytearrayStream
object.
kmip_versi... | kmip/core/messages/payloads/signature_verify.py | def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the SignatureVerify response payload and decode
it into its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, support... | def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the SignatureVerify response payload and decode
it into its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, support... | [
"Read",
"the",
"data",
"encoding",
"the",
"SignatureVerify",
"response",
"payload",
"and",
"decode",
"it",
"into",
"its",
"constituent",
"parts",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/signature_verify.py#L568-L630 | [
"def",
"read",
"(",
"self",
",",
"input_stream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"SignatureVerifyResponsePayload",
",",
"self",
")",
".",
"read",
"(",
"input_stream",
",",
"kmip_version",
"=",
"... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | KmipEngine.process_request | Process a KMIP request message.
This routine is the main driver of the KmipEngine. It breaks apart and
processes the request header, handles any message errors that may
result, and then passes the set of request batch items on for
processing. This routine is thread-safe, allowing multip... | kmip/services/server/engine.py | def process_request(self, request, credential=None):
"""
Process a KMIP request message.
This routine is the main driver of the KmipEngine. It breaks apart and
processes the request header, handles any message errors that may
result, and then passes the set of request batch item... | def process_request(self, request, credential=None):
"""
Process a KMIP request message.
This routine is the main driver of the KmipEngine. It breaks apart and
processes the request header, handles any message errors that may
result, and then passes the set of request batch item... | [
"Process",
"a",
"KMIP",
"request",
"message",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/server/engine.py#L189-L310 | [
"def",
"process_request",
"(",
"self",
",",
"request",
",",
"credential",
"=",
"None",
")",
":",
"self",
".",
"_client_identity",
"=",
"[",
"None",
",",
"None",
"]",
"header",
"=",
"request",
".",
"request_header",
"# Process the protocol version",
"self",
"."... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | KmipEngine.build_error_response | Build a simple ResponseMessage with a single error result.
Args:
version (ProtocolVersion): The protocol version the response
should be addressed with.
reason (ResultReason): An enumeration classifying the type of
error occurred.
message (str)... | kmip/services/server/engine.py | def build_error_response(self, version, reason, message):
"""
Build a simple ResponseMessage with a single error result.
Args:
version (ProtocolVersion): The protocol version the response
should be addressed with.
reason (ResultReason): An enumeration cla... | def build_error_response(self, version, reason, message):
"""
Build a simple ResponseMessage with a single error result.
Args:
version (ProtocolVersion): The protocol version the response
should be addressed with.
reason (ResultReason): An enumeration cla... | [
"Build",
"a",
"simple",
"ResponseMessage",
"with",
"a",
"single",
"error",
"result",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/server/engine.py#L324-L347 | [
"def",
"build_error_response",
"(",
"self",
",",
"version",
",",
"reason",
",",
"message",
")",
":",
"batch_item",
"=",
"messages",
".",
"ResponseBatchItem",
"(",
"result_status",
"=",
"contents",
".",
"ResultStatus",
"(",
"enums",
".",
"ResultStatus",
".",
"O... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | KmipEngine._process_template_attribute | Given a kmip.core TemplateAttribute object, extract the attribute
value data into a usable dictionary format. | kmip/services/server/engine.py | def _process_template_attribute(self, template_attribute):
"""
Given a kmip.core TemplateAttribute object, extract the attribute
value data into a usable dictionary format.
"""
attributes = {}
if len(template_attribute.names) > 0:
raise exceptions.ItemNotFoun... | def _process_template_attribute(self, template_attribute):
"""
Given a kmip.core TemplateAttribute object, extract the attribute
value data into a usable dictionary format.
"""
attributes = {}
if len(template_attribute.names) > 0:
raise exceptions.ItemNotFoun... | [
"Given",
"a",
"kmip",
".",
"core",
"TemplateAttribute",
"object",
"extract",
"the",
"attribute",
"value",
"data",
"into",
"a",
"usable",
"dictionary",
"format",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/server/engine.py#L529-L574 | [
"def",
"_process_template_attribute",
"(",
"self",
",",
"template_attribute",
")",
":",
"attributes",
"=",
"{",
"}",
"if",
"len",
"(",
"template_attribute",
".",
"names",
")",
">",
"0",
":",
"raise",
"exceptions",
".",
"ItemNotFound",
"(",
"\"Attribute templates... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | KmipEngine._get_attributes_from_managed_object | Given a kmip.pie object and a list of attribute names, attempt to get
all of the existing attribute values from the object. | kmip/services/server/engine.py | def _get_attributes_from_managed_object(self, managed_object, attr_names):
"""
Given a kmip.pie object and a list of attribute names, attempt to get
all of the existing attribute values from the object.
"""
attr_factory = attribute_factory.AttributeFactory()
retrieved_att... | def _get_attributes_from_managed_object(self, managed_object, attr_names):
"""
Given a kmip.pie object and a list of attribute names, attempt to get
all of the existing attribute values from the object.
"""
attr_factory = attribute_factory.AttributeFactory()
retrieved_att... | [
"Given",
"a",
"kmip",
".",
"pie",
"object",
"and",
"a",
"list",
"of",
"attribute",
"names",
"attempt",
"to",
"get",
"all",
"of",
"the",
"existing",
"attribute",
"values",
"from",
"the",
"object",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/server/engine.py#L576-L625 | [
"def",
"_get_attributes_from_managed_object",
"(",
"self",
",",
"managed_object",
",",
"attr_names",
")",
":",
"attr_factory",
"=",
"attribute_factory",
".",
"AttributeFactory",
"(",
")",
"retrieved_attributes",
"=",
"list",
"(",
")",
"if",
"not",
"attr_names",
":",... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | KmipEngine._get_attribute_from_managed_object | Get the attribute value from the kmip.pie managed object. | kmip/services/server/engine.py | def _get_attribute_from_managed_object(self, managed_object, attr_name):
"""
Get the attribute value from the kmip.pie managed object.
"""
if attr_name == 'Unique Identifier':
return str(managed_object.unique_identifier)
elif attr_name == 'Name':
names = l... | def _get_attribute_from_managed_object(self, managed_object, attr_name):
"""
Get the attribute value from the kmip.pie managed object.
"""
if attr_name == 'Unique Identifier':
return str(managed_object.unique_identifier)
elif attr_name == 'Name':
names = l... | [
"Get",
"the",
"attribute",
"value",
"from",
"the",
"kmip",
".",
"pie",
"managed",
"object",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/server/engine.py#L627-L719 | [
"def",
"_get_attribute_from_managed_object",
"(",
"self",
",",
"managed_object",
",",
"attr_name",
")",
":",
"if",
"attr_name",
"==",
"'Unique Identifier'",
":",
"return",
"str",
"(",
"managed_object",
".",
"unique_identifier",
")",
"elif",
"attr_name",
"==",
"'Name... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | KmipEngine._set_attributes_on_managed_object | Given a kmip.pie object and a dictionary of attributes, attempt to set
the attribute values on the object. | kmip/services/server/engine.py | def _set_attributes_on_managed_object(self, managed_object, attributes):
"""
Given a kmip.pie object and a dictionary of attributes, attempt to set
the attribute values on the object.
"""
for attribute_name, attribute_value in six.iteritems(attributes):
object_type = ... | def _set_attributes_on_managed_object(self, managed_object, attributes):
"""
Given a kmip.pie object and a dictionary of attributes, attempt to set
the attribute values on the object.
"""
for attribute_name, attribute_value in six.iteritems(attributes):
object_type = ... | [
"Given",
"a",
"kmip",
".",
"pie",
"object",
"and",
"a",
"dictionary",
"of",
"attributes",
"attempt",
"to",
"set",
"the",
"attribute",
"values",
"on",
"the",
"object",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/server/engine.py#L721-L742 | [
"def",
"_set_attributes_on_managed_object",
"(",
"self",
",",
"managed_object",
",",
"attributes",
")",
":",
"for",
"attribute_name",
",",
"attribute_value",
"in",
"six",
".",
"iteritems",
"(",
"attributes",
")",
":",
"object_type",
"=",
"managed_object",
".",
"_o... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | KmipEngine._set_attribute_on_managed_object | Set the attribute value on the kmip.pie managed object. | kmip/services/server/engine.py | def _set_attribute_on_managed_object(self, managed_object, attribute):
"""
Set the attribute value on the kmip.pie managed object.
"""
attribute_name = attribute[0]
attribute_value = attribute[1]
if self._attribute_policy.is_attribute_multivalued(attribute_name):
... | def _set_attribute_on_managed_object(self, managed_object, attribute):
"""
Set the attribute value on the kmip.pie managed object.
"""
attribute_name = attribute[0]
attribute_value = attribute[1]
if self._attribute_policy.is_attribute_multivalued(attribute_name):
... | [
"Set",
"the",
"attribute",
"value",
"on",
"the",
"kmip",
".",
"pie",
"managed",
"object",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/server/engine.py#L744-L798 | [
"def",
"_set_attribute_on_managed_object",
"(",
"self",
",",
"managed_object",
",",
"attribute",
")",
":",
"attribute_name",
"=",
"attribute",
"[",
"0",
"]",
"attribute_value",
"=",
"attribute",
"[",
"1",
"]",
"if",
"self",
".",
"_attribute_policy",
".",
"is_att... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | KmipEngine.get_relevant_policy_section | Look up the policy corresponding to the provided policy name and
group (optional). Log any issues found during the look up. | kmip/services/server/engine.py | def get_relevant_policy_section(self, policy_name, group=None):
"""
Look up the policy corresponding to the provided policy name and
group (optional). Log any issues found during the look up.
"""
policy_bundle = self._operation_policies.get(policy_name)
if not policy_bun... | def get_relevant_policy_section(self, policy_name, group=None):
"""
Look up the policy corresponding to the provided policy name and
group (optional). Log any issues found during the look up.
"""
policy_bundle = self._operation_policies.get(policy_name)
if not policy_bun... | [
"Look",
"up",
"the",
"policy",
"corresponding",
"to",
"the",
"provided",
"policy",
"name",
"and",
"group",
"(",
"optional",
")",
".",
"Log",
"any",
"issues",
"found",
"during",
"the",
"look",
"up",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/server/engine.py#L828-L863 | [
"def",
"get_relevant_policy_section",
"(",
"self",
",",
"policy_name",
",",
"group",
"=",
"None",
")",
":",
"policy_bundle",
"=",
"self",
".",
"_operation_policies",
".",
"get",
"(",
"policy_name",
")",
"if",
"not",
"policy_bundle",
":",
"self",
".",
"_logger"... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | KmipEngine.is_allowed | Determine if object access is allowed for the provided policy and
session settings. | kmip/services/server/engine.py | def is_allowed(
self,
policy_name,
session_user,
session_group,
object_owner,
object_type,
operation
):
"""
Determine if object access is allowed for the provided policy and
session settings.
"""
... | def is_allowed(
self,
policy_name,
session_user,
session_group,
object_owner,
object_type,
operation
):
"""
Determine if object access is allowed for the provided policy and
session settings.
"""
... | [
"Determine",
"if",
"object",
"access",
"is",
"allowed",
"for",
"the",
"provided",
"policy",
"and",
"session",
"settings",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/server/engine.py#L865-L917 | [
"def",
"is_allowed",
"(",
"self",
",",
"policy_name",
",",
"session_user",
",",
"session_group",
",",
"object_owner",
",",
"object_type",
",",
"operation",
")",
":",
"policy_section",
"=",
"self",
".",
"get_relevant_policy_section",
"(",
"policy_name",
",",
"sessi... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | DecryptRequestPayload.write | Write the data encoding the Decrypt request payload to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayStream
object.
kmip_version (KMIPVersion): An enumeration defining t... | kmip/core/messages/payloads/decrypt.py | def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the Decrypt request payload to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayStr... | def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the Decrypt request payload to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayStr... | [
"Write",
"the",
"data",
"encoding",
"the",
"Decrypt",
"request",
"payload",
"to",
"a",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/decrypt.py#L207-L251 | [
"def",
"write",
"(",
"self",
",",
"output_stream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"local_stream",
"=",
"utils",
".",
"BytearrayStream",
"(",
")",
"if",
"self",
".",
"_unique_identifier",
":",
"self",
".",
... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | RevokeRequestPayload.read | Read the data encoding the RevokeRequestPayload object and decode it
into its constituent parts.
Args:
istream (Stream): A data stream containing encoded object data,
supporting a read method; usually a BytearrayStream object.
kmip_version (KMIPVersion): An enumer... | kmip/core/messages/payloads/revoke.py | def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the RevokeRequestPayload object and decode it
into its constituent parts.
Args:
istream (Stream): A data stream containing encoded object data,
supporting a read metho... | def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the RevokeRequestPayload object and decode it
into its constituent parts.
Args:
istream (Stream): A data stream containing encoded object data,
supporting a read metho... | [
"Read",
"the",
"data",
"encoding",
"the",
"RevokeRequestPayload",
"object",
"and",
"decode",
"it",
"into",
"its",
"constituent",
"parts",
".",
"Args",
":",
"istream",
"(",
"Stream",
")",
":",
"A",
"data",
"stream",
"containing",
"encoded",
"object",
"data",
... | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/revoke.py#L63-L95 | [
"def",
"read",
"(",
"self",
",",
"istream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"RevokeRequestPayload",
",",
"self",
")",
".",
"read",
"(",
"istream",
",",
"kmip_version",
"=",
"kmip_version",
")"... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | RevokeRequestPayload.write | Write the data encoding the RevokeRequestPayload object to a stream.
Args:
ostream (Stream): A data stream in which to encode object data,
supporting a write method; usually a BytearrayStream object.
kmip_version (KMIPVersion): An enumeration defining the KMIP
... | kmip/core/messages/payloads/revoke.py | def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the RevokeRequestPayload object to a stream.
Args:
ostream (Stream): A data stream in which to encode object data,
supporting a write method; usually a BytearrayStream objec... | def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the RevokeRequestPayload object to a stream.
Args:
ostream (Stream): A data stream in which to encode object data,
supporting a write method; usually a BytearrayStream objec... | [
"Write",
"the",
"data",
"encoding",
"the",
"RevokeRequestPayload",
"object",
"to",
"a",
"stream",
".",
"Args",
":",
"ostream",
"(",
"Stream",
")",
":",
"A",
"data",
"stream",
"in",
"which",
"to",
"encode",
"object",
"data",
"supporting",
"a",
"write",
"met... | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/revoke.py#L97-L127 | [
"def",
"write",
"(",
"self",
",",
"ostream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"tstream",
"=",
"BytearrayStream",
"(",
")",
"# Write the contents of the request payload",
"if",
"self",
".",
"unique_identifier",
"is",... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | RevokeRequestPayload.validate | Error check the attributes of the ActivateRequestPayload object. | kmip/core/messages/payloads/revoke.py | def validate(self):
"""
Error check the attributes of the ActivateRequestPayload object.
"""
if self.unique_identifier is not None:
if not isinstance(self.unique_identifier,
attributes.UniqueIdentifier):
msg = "invalid unique iden... | def validate(self):
"""
Error check the attributes of the ActivateRequestPayload object.
"""
if self.unique_identifier is not None:
if not isinstance(self.unique_identifier,
attributes.UniqueIdentifier):
msg = "invalid unique iden... | [
"Error",
"check",
"the",
"attributes",
"of",
"the",
"ActivateRequestPayload",
"object",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/revoke.py#L129-L145 | [
"def",
"validate",
"(",
"self",
")",
":",
"if",
"self",
".",
"unique_identifier",
"is",
"not",
"None",
":",
"if",
"not",
"isinstance",
"(",
"self",
".",
"unique_identifier",
",",
"attributes",
".",
"UniqueIdentifier",
")",
":",
"msg",
"=",
"\"invalid unique ... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | RevokeResponsePayload.read | Read the data encoding the RevokeResponsePayload object and decode it
into its constituent parts.
Args:
istream (Stream): A data stream containing encoded object data,
supporting a read method; usually a BytearrayStream object.
kmip_version (KMIPVersion): An enume... | kmip/core/messages/payloads/revoke.py | def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the RevokeResponsePayload object and decode it
into its constituent parts.
Args:
istream (Stream): A data stream containing encoded object data,
supporting a read meth... | def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the RevokeResponsePayload object and decode it
into its constituent parts.
Args:
istream (Stream): A data stream containing encoded object data,
supporting a read meth... | [
"Read",
"the",
"data",
"encoding",
"the",
"RevokeResponsePayload",
"object",
"and",
"decode",
"it",
"into",
"its",
"constituent",
"parts",
".",
"Args",
":",
"istream",
"(",
"Stream",
")",
":",
"A",
"data",
"stream",
"containing",
"encoded",
"object",
"data",
... | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/revoke.py#L172-L193 | [
"def",
"read",
"(",
"self",
",",
"istream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"RevokeResponsePayload",
",",
"self",
")",
".",
"read",
"(",
"istream",
",",
"kmip_version",
"=",
"kmip_version",
")... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | SecretFactory.create | Create a secret object of the specified type with the given value.
Args:
secret_type (ObjectType): An ObjectType enumeration specifying the
type of secret to create.
value (dict): A dictionary containing secret data. Optional,
defaults to None.
R... | kmip/core/factories/secrets.py | def create(self, secret_type, value=None):
"""
Create a secret object of the specified type with the given value.
Args:
secret_type (ObjectType): An ObjectType enumeration specifying the
type of secret to create.
value (dict): A dictionary containing secr... | def create(self, secret_type, value=None):
"""
Create a secret object of the specified type with the given value.
Args:
secret_type (ObjectType): An ObjectType enumeration specifying the
type of secret to create.
value (dict): A dictionary containing secr... | [
"Create",
"a",
"secret",
"object",
"of",
"the",
"specified",
"type",
"with",
"the",
"given",
"value",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/factories/secrets.py#L48-L86 | [
"def",
"create",
"(",
"self",
",",
"secret_type",
",",
"value",
"=",
"None",
")",
":",
"if",
"secret_type",
"is",
"ObjectType",
".",
"CERTIFICATE",
":",
"return",
"self",
".",
"_create_certificate",
"(",
"value",
")",
"elif",
"secret_type",
"is",
"ObjectType... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | KmipServerConfig.set_setting | Set a specific setting value.
This will overwrite the current setting value for the specified
setting.
Args:
setting (string): The name of the setting to set (e.g.,
'certificate_path', 'hostname'). Required.
value (misc): The value of the setting to set.... | kmip/services/server/config.py | def set_setting(self, setting, value):
"""
Set a specific setting value.
This will overwrite the current setting value for the specified
setting.
Args:
setting (string): The name of the setting to set (e.g.,
'certificate_path', 'hostname'). Required.... | def set_setting(self, setting, value):
"""
Set a specific setting value.
This will overwrite the current setting value for the specified
setting.
Args:
setting (string): The name of the setting to set (e.g.,
'certificate_path', 'hostname'). Required.... | [
"Set",
"a",
"specific",
"setting",
"value",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/server/config.py#L58-L100 | [
"def",
"set_setting",
"(",
"self",
",",
"setting",
",",
"value",
")",
":",
"if",
"setting",
"not",
"in",
"self",
".",
"_expected_settings",
"+",
"self",
".",
"_optional_settings",
":",
"raise",
"exceptions",
".",
"ConfigurationError",
"(",
"\"Setting '{0}' is no... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | KmipServerConfig.load_settings | Load configuration settings from the file pointed to by path.
This will overwrite all current setting values.
Args:
path (string): The path to the configuration file containing
the settings to load. Required.
Raises:
ConfigurationError: Raised if the pat... | kmip/services/server/config.py | def load_settings(self, path):
"""
Load configuration settings from the file pointed to by path.
This will overwrite all current setting values.
Args:
path (string): The path to the configuration file containing
the settings to load. Required.
Raises... | def load_settings(self, path):
"""
Load configuration settings from the file pointed to by path.
This will overwrite all current setting values.
Args:
path (string): The path to the configuration file containing
the settings to load. Required.
Raises... | [
"Load",
"configuration",
"settings",
"from",
"the",
"file",
"pointed",
"to",
"by",
"path",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/server/config.py#L102-L128 | [
"def",
"load_settings",
"(",
"self",
",",
"path",
")",
":",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"path",
")",
":",
"raise",
"exceptions",
".",
"ConfigurationError",
"(",
"\"The server configuration file ('{0}') could not be \"",
"\"located.\"",
".",... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | UsageMaskType.process_bind_param | Returns the integer value of the usage mask bitmask. This value is
stored in the database.
Args:
value(list<enums.CryptographicUsageMask>): list of enums in the
usage mask
dialect(string): SQL dialect | kmip/pie/sqltypes.py | def process_bind_param(self, value, dialect):
"""
Returns the integer value of the usage mask bitmask. This value is
stored in the database.
Args:
value(list<enums.CryptographicUsageMask>): list of enums in the
usage mask
dialect(string): SQL dialect
... | def process_bind_param(self, value, dialect):
"""
Returns the integer value of the usage mask bitmask. This value is
stored in the database.
Args:
value(list<enums.CryptographicUsageMask>): list of enums in the
usage mask
dialect(string): SQL dialect
... | [
"Returns",
"the",
"integer",
"value",
"of",
"the",
"usage",
"mask",
"bitmask",
".",
"This",
"value",
"is",
"stored",
"in",
"the",
"database",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/sqltypes.py#L46-L59 | [
"def",
"process_bind_param",
"(",
"self",
",",
"value",
",",
"dialect",
")",
":",
"bitmask",
"=",
"0x00",
"for",
"e",
"in",
"value",
":",
"bitmask",
"=",
"bitmask",
"|",
"e",
".",
"value",
"return",
"bitmask"
] | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | UsageMaskType.process_result_value | Returns a new list of enums.CryptographicUsageMask Enums. This converts
the integer value into the list of enums.
Args:
value(int): The integer value stored in the database that is used
to create the list of enums.CryptographicUsageMask Enums.
dialect(string): SQ... | kmip/pie/sqltypes.py | def process_result_value(self, value, dialect):
"""
Returns a new list of enums.CryptographicUsageMask Enums. This converts
the integer value into the list of enums.
Args:
value(int): The integer value stored in the database that is used
to create the list of... | def process_result_value(self, value, dialect):
"""
Returns a new list of enums.CryptographicUsageMask Enums. This converts
the integer value into the list of enums.
Args:
value(int): The integer value stored in the database that is used
to create the list of... | [
"Returns",
"a",
"new",
"list",
"of",
"enums",
".",
"CryptographicUsageMask",
"Enums",
".",
"This",
"converts",
"the",
"integer",
"value",
"into",
"the",
"list",
"of",
"enums",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/sqltypes.py#L61-L76 | [
"def",
"process_result_value",
"(",
"self",
",",
"value",
",",
"dialect",
")",
":",
"masks",
"=",
"list",
"(",
")",
"if",
"value",
":",
"for",
"e",
"in",
"enums",
".",
"CryptographicUsageMask",
":",
"if",
"e",
".",
"value",
"&",
"value",
":",
"masks",
... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | LongInteger.read | Read the encoding of the LongInteger from the input stream.
Args:
istream (stream): A buffer containing the encoded bytes of a
LongInteger. Usually a BytearrayStream object. Required.
kmip_version (KMIPVersion): An enumeration defining the KMIP
version wi... | kmip/core/primitives.py | def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the encoding of the LongInteger from the input stream.
Args:
istream (stream): A buffer containing the encoded bytes of a
LongInteger. Usually a BytearrayStream object. Required.
k... | def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the encoding of the LongInteger from the input stream.
Args:
istream (stream): A buffer containing the encoded bytes of a
LongInteger. Usually a BytearrayStream object. Required.
k... | [
"Read",
"the",
"encoding",
"of",
"the",
"LongInteger",
"from",
"the",
"input",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/primitives.py#L331-L355 | [
"def",
"read",
"(",
"self",
",",
"istream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"LongInteger",
",",
"self",
")",
".",
"read",
"(",
"istream",
",",
"kmip_version",
"=",
"kmip_version",
")",
"if",... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | LongInteger.write | Write the encoding of the LongInteger to the output stream.
Args:
ostream (stream): A buffer to contain the encoded bytes of a
LongInteger. Usually a BytearrayStream object. Required.
kmip_version (KMIPVersion): An enumeration defining the KMIP
version wi... | kmip/core/primitives.py | def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the encoding of the LongInteger to the output stream.
Args:
ostream (stream): A buffer to contain the encoded bytes of a
LongInteger. Usually a BytearrayStream object. Required.
... | def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the encoding of the LongInteger to the output stream.
Args:
ostream (stream): A buffer to contain the encoded bytes of a
LongInteger. Usually a BytearrayStream object. Required.
... | [
"Write",
"the",
"encoding",
"of",
"the",
"LongInteger",
"to",
"the",
"output",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/primitives.py#L357-L369 | [
"def",
"write",
"(",
"self",
",",
"ostream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"LongInteger",
",",
"self",
")",
".",
"write",
"(",
"ostream",
",",
"kmip_version",
"=",
"kmip_version",
")",
"os... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | LongInteger.validate | Verify that the value of the LongInteger is valid.
Raises:
TypeError: if the value is not of type int or long
ValueError: if the value cannot be represented by a signed 64-bit
integer | kmip/core/primitives.py | def validate(self):
"""
Verify that the value of the LongInteger is valid.
Raises:
TypeError: if the value is not of type int or long
ValueError: if the value cannot be represented by a signed 64-bit
integer
"""
if self.value is not None:
... | def validate(self):
"""
Verify that the value of the LongInteger is valid.
Raises:
TypeError: if the value is not of type int or long
ValueError: if the value cannot be represented by a signed 64-bit
integer
"""
if self.value is not None:
... | [
"Verify",
"that",
"the",
"value",
"of",
"the",
"LongInteger",
"is",
"valid",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/primitives.py#L371-L390 | [
"def",
"validate",
"(",
"self",
")",
":",
"if",
"self",
".",
"value",
"is",
"not",
"None",
":",
"if",
"not",
"isinstance",
"(",
"self",
".",
"value",
",",
"six",
".",
"integer_types",
")",
":",
"raise",
"TypeError",
"(",
"'expected (one of): {0}, observed:... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | BigInteger.read | Read the encoding of the BigInteger from the input stream.
Args:
istream (stream): A buffer containing the encoded bytes of the
value of a BigInteger. Usually a BytearrayStream object.
Required.
kmip_version (KMIPVersion): An enumeration defining the KMIP... | kmip/core/primitives.py | def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the encoding of the BigInteger from the input stream.
Args:
istream (stream): A buffer containing the encoded bytes of the
value of a BigInteger. Usually a BytearrayStream object.
... | def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the encoding of the BigInteger from the input stream.
Args:
istream (stream): A buffer containing the encoded bytes of the
value of a BigInteger. Usually a BytearrayStream object.
... | [
"Read",
"the",
"encoding",
"of",
"the",
"BigInteger",
"from",
"the",
"input",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/primitives.py#L429-L477 | [
"def",
"read",
"(",
"self",
",",
"istream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"BigInteger",
",",
"self",
")",
".",
"read",
"(",
"istream",
",",
"kmip_version",
"=",
"kmip_version",
")",
"# Che... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | BigInteger.write | Write the encoding of the BigInteger to the output stream.
Args:
ostream (Stream): A buffer to contain the encoded bytes of a
BigInteger object. Usually a BytearrayStream object.
Required.
kmip_version (KMIPVersion): An enumeration defining the KMIP
... | kmip/core/primitives.py | def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the encoding of the BigInteger to the output stream.
Args:
ostream (Stream): A buffer to contain the encoded bytes of a
BigInteger object. Usually a BytearrayStream object.
R... | def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the encoding of the BigInteger to the output stream.
Args:
ostream (Stream): A buffer to contain the encoded bytes of a
BigInteger object. Usually a BytearrayStream object.
R... | [
"Write",
"the",
"encoding",
"of",
"the",
"BigInteger",
"to",
"the",
"output",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/primitives.py#L479-L513 | [
"def",
"write",
"(",
"self",
",",
"ostream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"# Convert the value to binary and pad it as needed.",
"binary",
"=",
"\"{0:b}\"",
".",
"format",
"(",
"abs",
"(",
"self",
".",
"value"... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | BigInteger.validate | Verify that the value of the BigInteger is valid.
Raises:
TypeError: if the value is not of type int or long | kmip/core/primitives.py | def validate(self):
"""
Verify that the value of the BigInteger is valid.
Raises:
TypeError: if the value is not of type int or long
"""
if self.value is not None:
if not isinstance(self.value, six.integer_types):
raise TypeError('expected... | def validate(self):
"""
Verify that the value of the BigInteger is valid.
Raises:
TypeError: if the value is not of type int or long
"""
if self.value is not None:
if not isinstance(self.value, six.integer_types):
raise TypeError('expected... | [
"Verify",
"that",
"the",
"value",
"of",
"the",
"BigInteger",
"is",
"valid",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/primitives.py#L515-L525 | [
"def",
"validate",
"(",
"self",
")",
":",
"if",
"self",
".",
"value",
"is",
"not",
"None",
":",
"if",
"not",
"isinstance",
"(",
"self",
".",
"value",
",",
"six",
".",
"integer_types",
")",
":",
"raise",
"TypeError",
"(",
"'expected (one of): {0}, observed:... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | Enumeration.validate | Verify that the value of the Enumeration is valid.
Raises:
TypeError: if the enum is not of type Enum
ValueError: if the value is not of the expected Enum subtype or if
the value cannot be represented by an unsigned 32-bit integer | kmip/core/primitives.py | def validate(self):
"""
Verify that the value of the Enumeration is valid.
Raises:
TypeError: if the enum is not of type Enum
ValueError: if the value is not of the expected Enum subtype or if
the value cannot be represented by an unsigned 32-bit integer
... | def validate(self):
"""
Verify that the value of the Enumeration is valid.
Raises:
TypeError: if the enum is not of type Enum
ValueError: if the value is not of the expected Enum subtype or if
the value cannot be represented by an unsigned 32-bit integer
... | [
"Verify",
"that",
"the",
"value",
"of",
"the",
"Enumeration",
"is",
"valid",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/primitives.py#L633-L659 | [
"def",
"validate",
"(",
"self",
")",
":",
"if",
"not",
"isinstance",
"(",
"self",
".",
"enum",
",",
"enumeration",
".",
"EnumMeta",
")",
":",
"raise",
"TypeError",
"(",
"'enumeration type {0} must be of type EnumMeta'",
".",
"format",
"(",
"self",
".",
"enum",... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | Boolean.read_value | Read the value of the Boolean object from the input stream.
Args:
istream (Stream): A buffer containing the encoded bytes of the
value of a Boolean object. Usually a BytearrayStream object.
Required.
kmip_version (KMIPVersion): An enumeration defining the... | kmip/core/primitives.py | def read_value(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the value of the Boolean object from the input stream.
Args:
istream (Stream): A buffer containing the encoded bytes of the
value of a Boolean object. Usually a BytearrayStream object.
... | def read_value(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the value of the Boolean object from the input stream.
Args:
istream (Stream): A buffer containing the encoded bytes of the
value of a Boolean object. Usually a BytearrayStream object.
... | [
"Read",
"the",
"value",
"of",
"the",
"Boolean",
"object",
"from",
"the",
"input",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/primitives.py#L710-L738 | [
"def",
"read_value",
"(",
"self",
",",
"istream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"try",
":",
"value",
"=",
"unpack",
"(",
"'!Q'",
",",
"istream",
".",
"read",
"(",
"self",
".",
"LENGTH",
")",
")",
"[... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | Boolean.write_value | Write the value of the Boolean object to the output stream.
Args:
ostream (Stream): A buffer to contain the encoded bytes of the
value of a Boolean object. Usually a BytearrayStream object.
Required.
kmip_version (KMIPVersion): An enumeration defining the... | kmip/core/primitives.py | def write_value(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the value of the Boolean object to the output stream.
Args:
ostream (Stream): A buffer to contain the encoded bytes of the
value of a Boolean object. Usually a BytearrayStream object.
... | def write_value(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the value of the Boolean object to the output stream.
Args:
ostream (Stream): A buffer to contain the encoded bytes of the
value of a Boolean object. Usually a BytearrayStream object.
... | [
"Write",
"the",
"value",
"of",
"the",
"Boolean",
"object",
"to",
"the",
"output",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/primitives.py#L754-L770 | [
"def",
"write_value",
"(",
"self",
",",
"ostream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"try",
":",
"ostream",
".",
"write",
"(",
"pack",
"(",
"'!Q'",
",",
"self",
".",
"value",
")",
")",
"except",
"Exceptio... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | Boolean.write | Write the encoding of the Boolean object to the output stream.
Args:
ostream (Stream): A buffer to contain the encoded bytes of a
Boolean object. Usually a BytearrayStream object. Required.
kmip_version (KMIPVersion): An enumeration defining the KMIP
vers... | kmip/core/primitives.py | def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the encoding of the Boolean object to the output stream.
Args:
ostream (Stream): A buffer to contain the encoded bytes of a
Boolean object. Usually a BytearrayStream object. Required.
... | def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the encoding of the Boolean object to the output stream.
Args:
ostream (Stream): A buffer to contain the encoded bytes of a
Boolean object. Usually a BytearrayStream object. Required.
... | [
"Write",
"the",
"encoding",
"of",
"the",
"Boolean",
"object",
"to",
"the",
"output",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/primitives.py#L772-L784 | [
"def",
"write",
"(",
"self",
",",
"ostream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"Boolean",
",",
"self",
")",
".",
"write",
"(",
"ostream",
",",
"kmip_version",
"=",
"kmip_version",
")",
"self",... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | Boolean.validate | Verify that the value of the Boolean object is valid.
Raises:
TypeError: if the value is not of type bool. | kmip/core/primitives.py | def validate(self):
"""
Verify that the value of the Boolean object is valid.
Raises:
TypeError: if the value is not of type bool.
"""
if self.value:
if not isinstance(self.value, bool):
raise TypeError("expected: {0}, observed: {1}".forma... | def validate(self):
"""
Verify that the value of the Boolean object is valid.
Raises:
TypeError: if the value is not of type bool.
"""
if self.value:
if not isinstance(self.value, bool):
raise TypeError("expected: {0}, observed: {1}".forma... | [
"Verify",
"that",
"the",
"value",
"of",
"the",
"Boolean",
"object",
"is",
"valid",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/primitives.py#L786-L796 | [
"def",
"validate",
"(",
"self",
")",
":",
"if",
"self",
".",
"value",
":",
"if",
"not",
"isinstance",
"(",
"self",
".",
"value",
",",
"bool",
")",
":",
"raise",
"TypeError",
"(",
"\"expected: {0}, observed: {1}\"",
".",
"format",
"(",
"bool",
",",
"type"... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | Interval.read | Read the encoding of the Interval from the input stream.
Args:
istream (stream): A buffer containing the encoded bytes of the
value of an Interval. Usually a BytearrayStream object.
Required.
kmip_version (KMIPVersion): An enumeration defining the KMIP
... | kmip/core/primitives.py | def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the encoding of the Interval from the input stream.
Args:
istream (stream): A buffer containing the encoded bytes of the
value of an Interval. Usually a BytearrayStream object.
... | def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the encoding of the Interval from the input stream.
Args:
istream (stream): A buffer containing the encoded bytes of the
value of an Interval. Usually a BytearrayStream object.
... | [
"Read",
"the",
"encoding",
"of",
"the",
"Interval",
"from",
"the",
"input",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/primitives.py#L1064-L1097 | [
"def",
"read",
"(",
"self",
",",
"istream",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"Interval",
",",
"self",
")",
".",
"read",
"(",
"istream",
",",
"kmip_version",
"=",
"kmip_version",
")",
"# Check... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | Interval.validate | Verify that the value of the Interval is valid.
Raises:
TypeError: if the value is not of type int or long
ValueError: if the value cannot be represented by an unsigned
32-bit integer | kmip/core/primitives.py | def validate(self):
"""
Verify that the value of the Interval is valid.
Raises:
TypeError: if the value is not of type int or long
ValueError: if the value cannot be represented by an unsigned
32-bit integer
"""
if self.value is not None:
... | def validate(self):
"""
Verify that the value of the Interval is valid.
Raises:
TypeError: if the value is not of type int or long
ValueError: if the value cannot be represented by an unsigned
32-bit integer
"""
if self.value is not None:
... | [
"Verify",
"that",
"the",
"value",
"of",
"the",
"Interval",
"is",
"valid",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/primitives.py#L1114-L1132 | [
"def",
"validate",
"(",
"self",
")",
":",
"if",
"self",
".",
"value",
"is",
"not",
"None",
":",
"if",
"type",
"(",
"self",
".",
"value",
")",
"not",
"in",
"six",
".",
"integer_types",
":",
"raise",
"TypeError",
"(",
"'expected (one of): {0}, observed: {1}'... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | Key.key_wrapping_data | Retrieve all of the relevant key wrapping data fields and return them
as a dictionary. | kmip/pie/objects.py | def key_wrapping_data(self):
"""
Retrieve all of the relevant key wrapping data fields and return them
as a dictionary.
"""
key_wrapping_data = {}
encryption_key_info = {
'unique_identifier': self._kdw_eki_unique_identifier,
'cryptographic_paramete... | def key_wrapping_data(self):
"""
Retrieve all of the relevant key wrapping data fields and return them
as a dictionary.
"""
key_wrapping_data = {}
encryption_key_info = {
'unique_identifier': self._kdw_eki_unique_identifier,
'cryptographic_paramete... | [
"Retrieve",
"all",
"of",
"the",
"relevant",
"key",
"wrapping",
"data",
"fields",
"and",
"return",
"them",
"as",
"a",
"dictionary",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/objects.py#L424-L493 | [
"def",
"key_wrapping_data",
"(",
"self",
")",
":",
"key_wrapping_data",
"=",
"{",
"}",
"encryption_key_info",
"=",
"{",
"'unique_identifier'",
":",
"self",
".",
"_kdw_eki_unique_identifier",
",",
"'cryptographic_parameters'",
":",
"{",
"'block_cipher_mode'",
":",
"sel... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | Key.key_wrapping_data | Set the key wrapping data attributes using a dictionary. | kmip/pie/objects.py | def key_wrapping_data(self, value):
"""
Set the key wrapping data attributes using a dictionary.
"""
if value is None:
value = {}
elif not isinstance(value, dict):
raise TypeError("Key wrapping data must be a dictionary.")
self._kdw_wrapping_metho... | def key_wrapping_data(self, value):
"""
Set the key wrapping data attributes using a dictionary.
"""
if value is None:
value = {}
elif not isinstance(value, dict):
raise TypeError("Key wrapping data must be a dictionary.")
self._kdw_wrapping_metho... | [
"Set",
"the",
"key",
"wrapping",
"data",
"attributes",
"using",
"a",
"dictionary",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/objects.py#L496-L560 | [
"def",
"key_wrapping_data",
"(",
"self",
",",
"value",
")",
":",
"if",
"value",
"is",
"None",
":",
"value",
"=",
"{",
"}",
"elif",
"not",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"raise",
"TypeError",
"(",
"\"Key wrapping data must be a dictionary.... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | PublicKey.validate | Verify that the contents of the PublicKey object are valid.
Raises:
TypeError: if the types of any PublicKey attributes are invalid. | kmip/pie/objects.py | def validate(self):
"""
Verify that the contents of the PublicKey object are valid.
Raises:
TypeError: if the types of any PublicKey attributes are invalid.
"""
if not isinstance(self.value, bytes):
raise TypeError("key value must be bytes")
elif ... | def validate(self):
"""
Verify that the contents of the PublicKey object are valid.
Raises:
TypeError: if the types of any PublicKey attributes are invalid.
"""
if not isinstance(self.value, bytes):
raise TypeError("key value must be bytes")
elif ... | [
"Verify",
"that",
"the",
"contents",
"of",
"the",
"PublicKey",
"object",
"are",
"valid",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/objects.py#L806-L845 | [
"def",
"validate",
"(",
"self",
")",
":",
"if",
"not",
"isinstance",
"(",
"self",
".",
"value",
",",
"bytes",
")",
":",
"raise",
"TypeError",
"(",
"\"key value must be bytes\"",
")",
"elif",
"not",
"isinstance",
"(",
"self",
".",
"cryptographic_algorithm",
"... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | SecretData.validate | Verify that the contents of the SecretData object are valid.
Raises:
TypeError: if the types of any SecretData attributes are invalid. | kmip/pie/objects.py | def validate(self):
"""
Verify that the contents of the SecretData object are valid.
Raises:
TypeError: if the types of any SecretData attributes are invalid.
"""
if not isinstance(self.value, bytes):
raise TypeError("secret value must be bytes")
... | def validate(self):
"""
Verify that the contents of the SecretData object are valid.
Raises:
TypeError: if the types of any SecretData attributes are invalid.
"""
if not isinstance(self.value, bytes):
raise TypeError("secret value must be bytes")
... | [
"Verify",
"that",
"the",
"contents",
"of",
"the",
"SecretData",
"object",
"are",
"valid",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/objects.py#L1291-L1319 | [
"def",
"validate",
"(",
"self",
")",
":",
"if",
"not",
"isinstance",
"(",
"self",
".",
"value",
",",
"bytes",
")",
":",
"raise",
"TypeError",
"(",
"\"secret value must be bytes\"",
")",
"elif",
"not",
"isinstance",
"(",
"self",
".",
"data_type",
",",
"enum... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | OpaqueObject.validate | Verify that the contents of the OpaqueObject are valid.
Raises:
TypeError: if the types of any OpaqueObject attributes are invalid. | kmip/pie/objects.py | def validate(self):
"""
Verify that the contents of the OpaqueObject are valid.
Raises:
TypeError: if the types of any OpaqueObject attributes are invalid.
"""
if not isinstance(self.value, bytes):
raise TypeError("opaque value must be bytes")
eli... | def validate(self):
"""
Verify that the contents of the OpaqueObject are valid.
Raises:
TypeError: if the types of any OpaqueObject attributes are invalid.
"""
if not isinstance(self.value, bytes):
raise TypeError("opaque value must be bytes")
eli... | [
"Verify",
"that",
"the",
"contents",
"of",
"the",
"OpaqueObject",
"are",
"valid",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/pie/objects.py#L1407-L1426 | [
"def",
"validate",
"(",
"self",
")",
":",
"if",
"not",
"isinstance",
"(",
"self",
".",
"value",
",",
"bytes",
")",
":",
"raise",
"TypeError",
"(",
"\"opaque value must be bytes\"",
")",
"elif",
"not",
"isinstance",
"(",
"self",
".",
"opaque_type",
",",
"en... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | convert_attribute_name_to_tag | A utility function that converts an attribute name string into the
corresponding attribute tag.
For example: 'State' -> enums.Tags.STATE
Args:
value (string): The string name of the attribute.
Returns:
enum: The Tags enumeration value that corresponds to the attribute
name... | kmip/core/enums.py | def convert_attribute_name_to_tag(value):
"""
A utility function that converts an attribute name string into the
corresponding attribute tag.
For example: 'State' -> enums.Tags.STATE
Args:
value (string): The string name of the attribute.
Returns:
enum: The Tags enumeration va... | def convert_attribute_name_to_tag(value):
"""
A utility function that converts an attribute name string into the
corresponding attribute tag.
For example: 'State' -> enums.Tags.STATE
Args:
value (string): The string name of the attribute.
Returns:
enum: The Tags enumeration va... | [
"A",
"utility",
"function",
"that",
"converts",
"an",
"attribute",
"name",
"string",
"into",
"the",
"corresponding",
"attribute",
"tag",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/enums.py#L1762-L1787 | [
"def",
"convert_attribute_name_to_tag",
"(",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"six",
".",
"string_types",
")",
":",
"raise",
"ValueError",
"(",
"\"The attribute name must be a string.\"",
")",
"for",
"entry",
"in",
"attribute_name_tag... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | convert_attribute_tag_to_name | A utility function that converts an attribute tag into the corresponding
attribute name string.
For example: enums.Tags.STATE -> 'State'
Args:
value (enum): The Tags enumeration value of the attribute.
Returns:
string: The attribute name string that corresponds to the attribute
... | kmip/core/enums.py | def convert_attribute_tag_to_name(value):
"""
A utility function that converts an attribute tag into the corresponding
attribute name string.
For example: enums.Tags.STATE -> 'State'
Args:
value (enum): The Tags enumeration value of the attribute.
Returns:
string: The attribut... | def convert_attribute_tag_to_name(value):
"""
A utility function that converts an attribute tag into the corresponding
attribute name string.
For example: enums.Tags.STATE -> 'State'
Args:
value (enum): The Tags enumeration value of the attribute.
Returns:
string: The attribut... | [
"A",
"utility",
"function",
"that",
"converts",
"an",
"attribute",
"tag",
"into",
"the",
"corresponding",
"attribute",
"name",
"string",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/enums.py#L1790-L1815 | [
"def",
"convert_attribute_tag_to_name",
"(",
"value",
")",
":",
"if",
"not",
"isinstance",
"(",
"value",
",",
"Tags",
")",
":",
"raise",
"ValueError",
"(",
"\"The attribute tag must be a Tags enumeration.\"",
")",
"for",
"entry",
"in",
"attribute_name_tag_table",
":",... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | get_bit_mask_from_enumerations | A utility function that computes a bit mask from a collection of
enumeration values.
Args:
enumerations (list): A list of enumeration values to be combined in a
composite bit mask.
Returns:
int: The composite bit mask. | kmip/core/enums.py | def get_bit_mask_from_enumerations(enumerations):
"""
A utility function that computes a bit mask from a collection of
enumeration values.
Args:
enumerations (list): A list of enumeration values to be combined in a
composite bit mask.
Returns:
int: The composite bit mas... | def get_bit_mask_from_enumerations(enumerations):
"""
A utility function that computes a bit mask from a collection of
enumeration values.
Args:
enumerations (list): A list of enumeration values to be combined in a
composite bit mask.
Returns:
int: The composite bit mas... | [
"A",
"utility",
"function",
"that",
"computes",
"a",
"bit",
"mask",
"from",
"a",
"collection",
"of",
"enumeration",
"values",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/enums.py#L1818-L1832 | [
"def",
"get_bit_mask_from_enumerations",
"(",
"enumerations",
")",
":",
"return",
"functools",
".",
"reduce",
"(",
"lambda",
"x",
",",
"y",
":",
"x",
"|",
"y",
",",
"[",
"z",
".",
"value",
"for",
"z",
"in",
"enumerations",
"]",
")"
] | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | get_enumerations_from_bit_mask | A utility function that creates a list of enumeration values from a bit
mask for a specific mask enumeration class.
Args:
enumeration (class): The enumeration class from which to draw
enumeration values.
mask (int): The bit mask from which to identify enumeration values.
Return... | kmip/core/enums.py | def get_enumerations_from_bit_mask(enumeration, mask):
"""
A utility function that creates a list of enumeration values from a bit
mask for a specific mask enumeration class.
Args:
enumeration (class): The enumeration class from which to draw
enumeration values.
mask (int): ... | def get_enumerations_from_bit_mask(enumeration, mask):
"""
A utility function that creates a list of enumeration values from a bit
mask for a specific mask enumeration class.
Args:
enumeration (class): The enumeration class from which to draw
enumeration values.
mask (int): ... | [
"A",
"utility",
"function",
"that",
"creates",
"a",
"list",
"of",
"enumeration",
"values",
"from",
"a",
"bit",
"mask",
"for",
"a",
"specific",
"mask",
"enumeration",
"class",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/enums.py#L1835-L1848 | [
"def",
"get_enumerations_from_bit_mask",
"(",
"enumeration",
",",
"mask",
")",
":",
"return",
"[",
"x",
"for",
"x",
"in",
"enumeration",
"if",
"(",
"x",
".",
"value",
"&",
"mask",
")",
"==",
"x",
".",
"value",
"]"
] | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | is_bit_mask | A utility function that checks if the provided value is a composite bit
mask of enumeration values in the specified enumeration class.
Args:
enumeration (class): One of the mask enumeration classes found in this
file. These include:
* Cryptographic Usage Mask
... | kmip/core/enums.py | def is_bit_mask(enumeration, potential_mask):
"""
A utility function that checks if the provided value is a composite bit
mask of enumeration values in the specified enumeration class.
Args:
enumeration (class): One of the mask enumeration classes found in this
file. These include:
... | def is_bit_mask(enumeration, potential_mask):
"""
A utility function that checks if the provided value is a composite bit
mask of enumeration values in the specified enumeration class.
Args:
enumeration (class): One of the mask enumeration classes found in this
file. These include:
... | [
"A",
"utility",
"function",
"that",
"checks",
"if",
"the",
"provided",
"value",
"is",
"a",
"composite",
"bit",
"mask",
"of",
"enumeration",
"values",
"in",
"the",
"specified",
"enumeration",
"class",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/enums.py#L1851-L1888 | [
"def",
"is_bit_mask",
"(",
"enumeration",
",",
"potential_mask",
")",
":",
"if",
"not",
"isinstance",
"(",
"potential_mask",
",",
"six",
".",
"integer_types",
")",
":",
"return",
"False",
"mask_enumerations",
"=",
"(",
"CryptographicUsageMask",
",",
"ProtectionSto... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | is_attribute | A utility function that checks if the tag is a valid attribute tag.
Args:
tag (enum): A Tags enumeration that may or may not correspond to a
KMIP attribute type.
kmip_version (enum): The KMIPVersion enumeration that should be used
when checking if the tag is a valid attribut... | kmip/core/enums.py | def is_attribute(tag, kmip_version=None):
"""
A utility function that checks if the tag is a valid attribute tag.
Args:
tag (enum): A Tags enumeration that may or may not correspond to a
KMIP attribute type.
kmip_version (enum): The KMIPVersion enumeration that should be used
... | def is_attribute(tag, kmip_version=None):
"""
A utility function that checks if the tag is a valid attribute tag.
Args:
tag (enum): A Tags enumeration that may or may not correspond to a
KMIP attribute type.
kmip_version (enum): The KMIPVersion enumeration that should be used
... | [
"A",
"utility",
"function",
"that",
"checks",
"if",
"the",
"tag",
"is",
"a",
"valid",
"attribute",
"tag",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/enums.py#L1913-L2053 | [
"def",
"is_attribute",
"(",
"tag",
",",
"kmip_version",
"=",
"None",
")",
":",
"kmip_1_0_attribute_tags",
"=",
"[",
"Tags",
".",
"UNIQUE_IDENTIFIER",
",",
"Tags",
".",
"NAME",
",",
"Tags",
".",
"OBJECT_TYPE",
",",
"Tags",
".",
"CRYPTOGRAPHIC_ALGORITHM",
",",
... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | CreateKeyPairRequestPayload.read | Read the data encoding the CreateKeyPair request payload and decode it
into its constituent parts.
Args:
input_buffer (stream): A data buffer containing encoded object
data, supporting a read method.
kmip_version (KMIPVersion): An enumeration defining the KMIP
... | kmip/core/messages/payloads/create_key_pair.py | def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the CreateKeyPair request payload and decode it
into its constituent parts.
Args:
input_buffer (stream): A data buffer containing encoded object
data, supporting... | def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the CreateKeyPair request payload and decode it
into its constituent parts.
Args:
input_buffer (stream): A data buffer containing encoded object
data, supporting... | [
"Read",
"the",
"data",
"encoding",
"the",
"CreateKeyPair",
"request",
"payload",
"and",
"decode",
"it",
"into",
"its",
"constituent",
"parts",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/create_key_pair.py#L139-L234 | [
"def",
"read",
"(",
"self",
",",
"input_buffer",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"CreateKeyPairRequestPayload",
",",
"self",
")",
".",
"read",
"(",
"input_buffer",
",",
"kmip_version",
"=",
"kmi... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | CreateKeyPairRequestPayload.write | Write the data encoding the CreateKeyPair request payload to a buffer.
Args:
output_buffer (stream): A data buffer in which to encode object
data, supporting a write method.
kmip_version (KMIPVersion): An enumeration defining the KMIP
version with which t... | kmip/core/messages/payloads/create_key_pair.py | def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the CreateKeyPair request payload to a buffer.
Args:
output_buffer (stream): A data buffer in which to encode object
data, supporting a write method.
kmip... | def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the CreateKeyPair request payload to a buffer.
Args:
output_buffer (stream): A data buffer in which to encode object
data, supporting a write method.
kmip... | [
"Write",
"the",
"data",
"encoding",
"the",
"CreateKeyPair",
"request",
"payload",
"to",
"a",
"buffer",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/create_key_pair.py#L236-L293 | [
"def",
"write",
"(",
"self",
",",
"output_buffer",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"local_buffer",
"=",
"utils",
".",
"BytearrayStream",
"(",
")",
"if",
"kmip_version",
"<",
"enums",
".",
"KMIPVersion",
".",
... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | CreateKeyPairResponsePayload.read | Read the data encoding the CreateKeyPair response payload and decode it
into its constituent parts.
Args:
input_buffer (stream): A data buffer containing encoded object
data, supporting a read method.
kmip_version (KMIPVersion): An enumeration defining the KMIP
... | kmip/core/messages/payloads/create_key_pair.py | def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the CreateKeyPair response payload and decode it
into its constituent parts.
Args:
input_buffer (stream): A data buffer containing encoded object
data, supportin... | def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the CreateKeyPair response payload and decode it
into its constituent parts.
Args:
input_buffer (stream): A data buffer containing encoded object
data, supportin... | [
"Read",
"the",
"data",
"encoding",
"the",
"CreateKeyPair",
"response",
"payload",
"and",
"decode",
"it",
"into",
"its",
"constituent",
"parts",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/create_key_pair.py#L484-L568 | [
"def",
"read",
"(",
"self",
",",
"input_buffer",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"CreateKeyPairResponsePayload",
",",
"self",
")",
".",
"read",
"(",
"input_buffer",
",",
"kmip_version",
"=",
"km... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | CreateKeyPairResponsePayload.write | Write the data encoding the CreateKeyPair response payload to a buffer.
Args:
output_buffer (stream): A data buffer in which to encode object
data, supporting a write method.
kmip_version (KMIPVersion): An enumeration defining the KMIP
version with which ... | kmip/core/messages/payloads/create_key_pair.py | def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the CreateKeyPair response payload to a buffer.
Args:
output_buffer (stream): A data buffer in which to encode object
data, supporting a write method.
kmi... | def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the CreateKeyPair response payload to a buffer.
Args:
output_buffer (stream): A data buffer in which to encode object
data, supporting a write method.
kmi... | [
"Write",
"the",
"data",
"encoding",
"the",
"CreateKeyPair",
"response",
"payload",
"to",
"a",
"buffer",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/create_key_pair.py#L570-L626 | [
"def",
"write",
"(",
"self",
",",
"output_buffer",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"local_buffer",
"=",
"utils",
".",
"BytearrayStream",
"(",
")",
"if",
"self",
".",
"_private_key_unique_identifier",
":",
"self... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | GetAttributeListRequestPayload.read | Read the data encoding the GetAttributeList request payload and decode
it into its constituent parts.
Args:
input_buffer (stream): A data stream containing encoded object
data, supporting a read method; usually a BytearrayStream
object.
kmip_versi... | kmip/core/messages/payloads/get_attribute_list.py | def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the GetAttributeList request payload and decode
it into its constituent parts.
Args:
input_buffer (stream): A data stream containing encoded object
data, support... | def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the GetAttributeList request payload and decode
it into its constituent parts.
Args:
input_buffer (stream): A data stream containing encoded object
data, support... | [
"Read",
"the",
"data",
"encoding",
"the",
"GetAttributeList",
"request",
"payload",
"and",
"decode",
"it",
"into",
"its",
"constituent",
"parts",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/get_attribute_list.py#L73-L103 | [
"def",
"read",
"(",
"self",
",",
"input_buffer",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"GetAttributeListRequestPayload",
",",
"self",
")",
".",
"read",
"(",
"input_buffer",
",",
"kmip_version",
"=",
"... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | GetAttributeListRequestPayload.write | Write the data encoding the GetAttributeList request payload to a
stream.
Args:
output_buffer (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayStream
object.
kmip_version (KMIPVersion): An enume... | kmip/core/messages/payloads/get_attribute_list.py | def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the GetAttributeList request payload to a
stream.
Args:
output_buffer (stream): A data stream in which to encode object
data, supporting a write method; usual... | def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the GetAttributeList request payload to a
stream.
Args:
output_buffer (stream): A data stream in which to encode object
data, supporting a write method; usual... | [
"Write",
"the",
"data",
"encoding",
"the",
"GetAttributeList",
"request",
"payload",
"to",
"a",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/get_attribute_list.py#L105-L131 | [
"def",
"write",
"(",
"self",
",",
"output_buffer",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"local_buffer",
"=",
"utils",
".",
"BytearrayStream",
"(",
")",
"if",
"self",
".",
"_unique_identifier",
":",
"self",
".",
... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | GetAttributeListResponsePayload.read | Read the data encoding the GetAttributeList response payload and
decode it into its constituent parts.
Args:
input_buffer (stream): A data stream containing encoded object
data, supporting a read method; usually a BytearrayStream
object.
kmip_vers... | kmip/core/messages/payloads/get_attribute_list.py | def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the GetAttributeList response payload and
decode it into its constituent parts.
Args:
input_buffer (stream): A data stream containing encoded object
data, suppor... | def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the GetAttributeList response payload and
decode it into its constituent parts.
Args:
input_buffer (stream): A data stream containing encoded object
data, suppor... | [
"Read",
"the",
"data",
"encoding",
"the",
"GetAttributeList",
"response",
"payload",
"and",
"decode",
"it",
"into",
"its",
"constituent",
"parts",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/get_attribute_list.py#L250-L333 | [
"def",
"read",
"(",
"self",
",",
"input_buffer",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"super",
"(",
"GetAttributeListResponsePayload",
",",
"self",
")",
".",
"read",
"(",
"input_buffer",
",",
"kmip_version",
"=",
... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | GetAttributeListResponsePayload.write | Write the data encoding the GetAttributeList response payload to a
stream.
Args:
output_buffer (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayStream
object.
kmip_version (KMIPVersion): An enum... | kmip/core/messages/payloads/get_attribute_list.py | def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the GetAttributeList response payload to a
stream.
Args:
output_buffer (stream): A data stream in which to encode object
data, supporting a write method; usua... | def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the GetAttributeList response payload to a
stream.
Args:
output_buffer (stream): A data stream in which to encode object
data, supporting a write method; usua... | [
"Write",
"the",
"data",
"encoding",
"the",
"GetAttributeList",
"response",
"payload",
"to",
"a",
"stream",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/core/messages/payloads/get_attribute_list.py#L335-L403 | [
"def",
"write",
"(",
"self",
",",
"output_buffer",
",",
"kmip_version",
"=",
"enums",
".",
"KMIPVersion",
".",
"KMIP_1_0",
")",
":",
"local_buffer",
"=",
"utils",
".",
"BytearrayStream",
"(",
")",
"if",
"self",
".",
"_unique_identifier",
":",
"self",
".",
... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | get_json_files | Scan the provided policy directory for all JSON policy files. | kmip/services/server/monitor.py | def get_json_files(p):
"""
Scan the provided policy directory for all JSON policy files.
"""
f = [os.path.join(p, x) for x in os.listdir(p) if x.endswith(".json")]
return sorted(f) | def get_json_files(p):
"""
Scan the provided policy directory for all JSON policy files.
"""
f = [os.path.join(p, x) for x in os.listdir(p) if x.endswith(".json")]
return sorted(f) | [
"Scan",
"the",
"provided",
"policy",
"directory",
"for",
"all",
"JSON",
"policy",
"files",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/server/monitor.py#L25-L30 | [
"def",
"get_json_files",
"(",
"p",
")",
":",
"f",
"=",
"[",
"os",
".",
"path",
".",
"join",
"(",
"p",
",",
"x",
")",
"for",
"x",
"in",
"os",
".",
"listdir",
"(",
"p",
")",
"if",
"x",
".",
"endswith",
"(",
"\".json\"",
")",
"]",
"return",
"sor... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | PolicyDirectoryMonitor.scan_policies | Scan the policy directory for policy data. | kmip/services/server/monitor.py | def scan_policies(self):
"""
Scan the policy directory for policy data.
"""
policy_files = get_json_files(self.policy_directory)
for f in set(policy_files) - set(self.policy_files):
self.file_timestamps[f] = 0
for f in set(self.policy_files) - set(policy_files... | def scan_policies(self):
"""
Scan the policy directory for policy data.
"""
policy_files = get_json_files(self.policy_directory)
for f in set(policy_files) - set(self.policy_files):
self.file_timestamps[f] = 0
for f in set(self.policy_files) - set(policy_files... | [
"Scan",
"the",
"policy",
"directory",
"for",
"policy",
"data",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/server/monitor.py#L78-L133 | [
"def",
"scan_policies",
"(",
"self",
")",
":",
"policy_files",
"=",
"get_json_files",
"(",
"self",
".",
"policy_directory",
")",
"for",
"f",
"in",
"set",
"(",
"policy_files",
")",
"-",
"set",
"(",
"self",
".",
"policy_files",
")",
":",
"self",
".",
"file... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
test | PolicyDirectoryMonitor.run | Start monitoring operation policy files. | kmip/services/server/monitor.py | def run(self):
"""
Start monitoring operation policy files.
"""
self.initialize_tracking_structures()
if self.live_monitoring:
self.logger.info("Starting up the operation policy file monitor.")
while not self.halt_trigger.is_set():
time.sl... | def run(self):
"""
Start monitoring operation policy files.
"""
self.initialize_tracking_structures()
if self.live_monitoring:
self.logger.info("Starting up the operation policy file monitor.")
while not self.halt_trigger.is_set():
time.sl... | [
"Start",
"monitoring",
"operation",
"policy",
"files",
"."
] | OpenKMIP/PyKMIP | python | https://github.com/OpenKMIP/PyKMIP/blob/b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e/kmip/services/server/monitor.py#L135-L148 | [
"def",
"run",
"(",
"self",
")",
":",
"self",
".",
"initialize_tracking_structures",
"(",
")",
"if",
"self",
".",
"live_monitoring",
":",
"self",
".",
"logger",
".",
"info",
"(",
"\"Starting up the operation policy file monitor.\"",
")",
"while",
"not",
"self",
"... | b51c5b044bd05f8c85a1d65d13a583a4d8fc1b0e |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.