MonoshiTonmoy/Code_Statement_Prediction_Dataset huggingface dataset:
Project Name: chiptopher+guet
Language: Python
Statement Type: API

Source Code:
def _load_local_committers(path: str, path_to_project_root: str) -> List[Committer]:
    lines = read_lines(path)
    committers = []
    for line in lines:
        initials, name, email = line.rstrip().split(',')
        committers.append(LocalCommitter(initials=initials, name=name, email=email, project_root=path_to_project_root))
    return committers

_load_local_committers(path='/path/to/project/root/.guet/committers', path_to_project_root='/path/to/project/root')

Selected Statement: lines = read_lines(path)

Function Input:
path: '/path/to/project/root/.guet/committers'
path_to_project_root: '/path/to/project/root'

Variable Values Before Statement:
path: '/path/to/project/root/.guet/committers'

Value After Statement Execution: initials1,othername1,otheremail1


Variable States During Runtime (line, value):
path: 1
'/path/to/project/root/.guet/committers'
path_to_project_root: 1
'/path/to/project/root'
lines: 2
initials1,othername1,otheremail1

committers: 3
6
[<guet.committers.local_committer.LocalCommitter object at 0x7fc0ad2c3d00>]
line: 4
'initials1,othername1,otheremail1\n'
initials: 5
'initials1'
name: 5
'othername1'
email: 5
'otheremail1'
Project Name: chiptopher+guet
Language: Python
Statement Type: API

Source Code:
def _add_to_current_set_lines(current_set, formatted_set_committers_information):
    git_path = git_path_from_cwd()
    line_with_git_path = next((line for line in current_set if line.endswith(git_path)), None)
    if line_with_git_path:
        index = current_set.index(line_with_git_path)
        current_set[index] = formatted_set_committers_information
    else:
        current_set.append(formatted_set_committers_information)

_add_to_current_set_lines(current_set=['initials3,initials4,1000000000000,/absolute/path/to/other/.git'], formatted_set_committers_information='initials1,initials2,1000000000000,/absolute/path/to/.git')

Selected Statement: line_with_git_path = next((line for line in current_set if line.endswith(git_path)), None)

Function Input:
current_set: initials3,initials4,1000000000000,/absolute/path/to/other/.git
formatted_set_committers_information: 'initials1,initials2,1000000000000,/absolute/path/to/.git'

Variable Values Before Statement:
git_path: '/absolute/path/to/.git'

Value After Statement Execution: None

Variable States During Runtime (line, value):
current_set: 1
initials3,initials4,1000000000000,/absolute/path/to/other/.git
8
initials3,initials4,1000000000000,/absolute/path/to/other/.git, initials1,initials2,1000000000000,/absolute/path/to/.git
formatted_set_committers_information: 1
'initials1,initials2,1000000000000,/absolute/path/to/.git'
git_path: 2
'/absolute/path/to/.git'
line_with_git_path: 3
None
Project Name: chiptopher+guet
Language: Python
Statement Type: API

Source Code:
def _parse_file_content(create, path_to_hook):
        _content = Hook._get_file_content(path_to_hook, create)
        if _content != GUET_HOOK_FILE:
            _content = Hook._handle_mismatched_content(_content, create)
        return _content

_parse_file_content(create=True, path_to_hook='/path/to/.git/hooks/name')

Selected Statement: _content = Hook._handle_mismatched_content(_content, create)

Function Input:
create: True
path_to_hook: '/path/to/.git/hooks/name'

Variable Values Before Statement:
_content: Other, Content
create: True

Value After Statement Execution: #! /usr/bin/env python3
from guet.hooks import manage
import sys
manage(sys.argv[0])

Variable States During Runtime (line, value):
create: 1
True
path_to_hook: 1
'/path/to/.git/hooks/name'
_content: 2
Other, Content
4
#! /usr/bin/env python3
from guet.hooks import manage
import sys
manage(sys.argv[0])
Project Name: saltstack+salt
Language: Python
Statement Type: API

Source Code:
def join(*parts, **kwargs):
    """
    This functions tries to solve some issues when joining multiple absolute
    paths on both *nix and windows platforms.

    See tests/unit/utils/path_join_test.py for some examples on what's being
    talked about here.

    The "use_posixpath" kwarg can be be used to force joining using poxixpath,
    which is useful for Salt fileserver paths on Windows masters.
    """
    parts = [salt.utils.stringutils.to_str(part) for part in parts]

    kwargs = salt.utils.args.clean_kwargs(**kwargs)
    use_posixpath = kwargs.pop("use_posixpath", False)
    if kwargs:
        salt.utils.args.invalid_kwargs(kwargs)

    pathlib = posixpath if use_posixpath else os.path

    # Normalize path converting any os.sep as needed
    parts = [pathlib.normpath(p) for p in parts]

    try:
        root = parts.pop(0)
    except IndexError:
        # No args passed to func
        return ""

    root = salt.utils.stringutils.to_unicode(root)
    if not parts:
        ret = root
    else:
        stripped = [p.lstrip(os.sep) for p in parts]
        ret = pathlib.join(root, *salt.utils.data.decode(stripped))
    return pathlib.normpath(ret)

join(parts=('/home/jinjun/.gdrive-downloader', 'true'), kwargs={})

Selected Statement: ret = pathlib.join(root, *salt.utils.data.decode(stripped))

Function Input:
parts: ('/home/jinjun/.gdrive-downloader', 'true')

Variable Values Before Statement:
stripped: true

Value After Statement Execution: '/home/jinjun/.gdrive-downloader/true'

Variable States During Runtime (line, value):
parts: 1
('/home/jinjun/.gdrive-downloader', 'true')
12
/home/jinjun/.gdrive-downloader, true
25
true
kwargs: 1
use_posixpath: 15
False
pathlib: 19
<module 'posixpath' from '/local/rcs/jinjun/miniforge3/envs/saltstack+salt/lib/python3.9/posixpath.py'>
root: 25
'/home/jinjun/.gdrive-downloader'
stripped: 34
true
ret: 35
'/home/jinjun/.gdrive-downloader/true'
Project Name: dylanaraps+pywal
Language: Python
Statement Type: API

Source Code:
def parse(theme_file):
    """Parse the theme file."""
    data = util.read_file_json(theme_file)

    if "wallpaper" not in data:
        data["wallpaper"] = "None"

    if "alpha" not in data:
        data["alpha"] = util.Color.alpha_num

    # Terminal.sexy format.
    if "color" in data:
        data = terminal_sexy_to_wal(data)

    return data

parse(theme_file='tests/test_files/test_file.json')

Selected Statement: data = util.read_file_json(theme_file)

Function Input:
theme_file: 'tests/test_files/test_file.json'

Variable Values Before Statement:
theme_file: 'tests/test_files/test_file.json'

Value After Statement Execution: {'wallpaper': '5.png', 'alpha': '100', 'special': {'background': '#1F211E', 'foreground': '#F5F1F4', 'cursor': '#F5F1F4'}, 'colors': {'color0': '#1F211E', 'color1': '#4B7A85', 'color2': '#CC6A93', 'color3': '#5C9894', 'color4': '#A0A89B', 'color5': '#D1B9A9', 'color6': '#E3D6D8', 'color7': '#F5F1F4', 'color8': '#666666', 'color9': '#4B7A85', 'color10': '#CC6A93', 'color11': '#5C9894', 'color12': '#A0A89B', 'color13': '#D1B9A9', 'color14': '#E3D6D8', 'color15': '#F5F1F4'}}

Variable States During Runtime (line, value):
theme_file: 1
'tests/test_files/test_file.json'
data: 3
{'wallpaper': '5.png', 'alpha': '100', 'special': {'background': '#1F211E', 'foreground': '#F5F1F4', 'cursor': '#F5F1F4'}, 'colors': {'color0': '#1F211E', 'color1': '#4B7A85', 'color2': '#CC6A93', 'color3': '#5C9894', 'color4': '#A0A89B', 'color5': '#D1B9A9', 'color6': '#E3D6D8', 'color7': '#F5F1F4', 'color8': '#666666', 'color9': '#4B7A85', 'color10': '#CC6A93', 'color11': '#5C9894', 'color12': '#A0A89B', 'color13': '#D1B9A9', 'color14': '#E3D6D8', 'color15': '#F5F1F4'}}
Project Name: dylanaraps+pywal
Language: Python
Statement Type: API

Source Code:
def get(img, cache_dir=CACHE_DIR, iterative=False, recursive=False):
    """Validate image input."""
    if os.path.isfile(img):
        wal_img = img

    elif os.path.isdir(img):
        if iterative:
            wal_img = get_next_image(img, recursive)

        else:
            wal_img = get_random_image(img, recursive)

    else:
        logging.error("No valid image file found.")
        sys.exit(1)

    wal_img = os.path.abspath(wal_img)

    # Cache the image file path.
    util.save_file(wal_img, os.path.join(cache_dir, "wal"))

    logging.info("Using image \033[1;37m%s\033[0m.", os.path.basename(wal_img))
    return wal_img

get(img='tests/test_files/test.jpg', cache_dir='/home/jinjun/.cache/wal', iterative=False, recursive=False)

Selected Statement: wal_img = os.path.abspath(wal_img)

Function Input:
img: 'tests/test_files/test.jpg'
cache_dir: '/home/jinjun/.cache/wal'
iterative: False
recursive: False

Variable Values Before Statement:
wal_img: 'tests/test_files/test.jpg'

Value After Statement Execution: '/local/rcs/jinjun/code/pytrace-collector/logs/self_collected/tried/dylanaraps+pywal/dylanaraps+pywal/tests/test_files/test.jpg'

Variable States During Runtime (line, value):
img: 1
'tests/test_files/test.jpg'
cache_dir: 1
'/home/jinjun/.cache/wal'
iterative: 1
False
recursive: 1
False
wal_img: 4
'tests/test_files/test.jpg'
17
'/local/rcs/jinjun/code/pytrace-collector/logs/self_collected/tried/dylanaraps+pywal/dylanaraps+pywal/tests/test_files/test.jpg'
Project Name: dylanaraps+pywal
Language: Python
Statement Type: API

Source Code:
def get_random_image(img_dir, recursive):
    """Pick a random image file from a directory."""
    if recursive:
        images, current_wall = get_image_dir_recursive(img_dir)
    else:
        images, current_wall = get_image_dir(img_dir)

    if len(images) > 2 and current_wall in images:
        images.remove(current_wall)

    elif not images:
        logging.error("No images found in directory.")
        sys.exit(1)

    random.shuffle(images)
    return os.path.join(img_dir if not recursive else "", images[0])

get_random_image(img_dir='tests/test_files', recursive=False)

Selected Statement: random.shuffle(images)

Function Input:
img_dir: 'tests/test_files'
recursive: False

Variable Values Before Statement:
images: test2.jpg, test.png

Value After Statement Execution: test.png, test2.jpg

Variable States During Runtime (line, value):
img_dir: 1
'tests/test_files'
recursive: 1
False
images: 6
test2.jpg, test.jpg, test.png
9
test2.jpg, test.png
15
test.png, test2.jpg
current_wall: 6
'test.jpg'
Project Name: dylanaraps+pywal
Language: Python
Statement Type: API

Source Code:
def get_image_dir(img_dir):
    """Get all images in a directory."""
    current_wall = wallpaper.get()
    current_wall = os.path.basename(current_wall)

    file_types = (".png", ".jpg", ".jpeg", ".jpe", ".gif")

    return [img.name for img in os.scandir(img_dir)
            if img.name.lower().endswith(file_types)], current_wall

get_image_dir(img_dir='tests/test_files')

Selected Statement: current_wall = os.path.basename(current_wall)

Function Input:
img_dir: 'tests/test_files'

Variable Values Before Statement:
current_wall: '/local/rcs/jinjun/code/pytrace-collector/logs/self_collected/tried/dylanaraps+pywal/dylanaraps+pywal/tests/test_files/test.jpg'

Value After Statement Execution: 'test.jpg'

Variable States During Runtime (line, value):
img_dir: 1
'tests/test_files'
current_wall: 3
'/local/rcs/jinjun/code/pytrace-collector/logs/self_collected/tried/dylanaraps+pywal/dylanaraps+pywal/tests/test_files/test.jpg'
4
'test.jpg'
file_types: 6
('.png', '.jpg', '.jpeg', '.jpe', '.gif')
Project Name: brython-dev+brython
Language: Python
Statement Type: API

Source Code:
def check_impl_detail(**guards):
    """This function returns True or False depending on the host platform.
       Examples:
          if check_impl_detail():               # only on CPython (default)
          if check_impl_detail(jython=True):    # only on Jython
          if check_impl_detail(cpython=False):  # everywhere except on CPython
    """
    guards, default = _parse_guards(guards)
    return guards.get(sys.implementation.name, default)

check_impl_detail(guards={})

Selected Statement: guards, default = _parse_guards(guards)

Function Input:

Variable Values Before Statement:

Value After Statement Execution: False

Variable States During Runtime (line, value):
guards: 1
8
cpython: yes
default: 8
False
Project Name: google-research+arxiv-latex-cleaner
Language: Python
Statement Type: API

Source Code:
def strip_whitespace(text):
  """Strips all whitespace characters.

  https://stackoverflow.com/questions/8270092/remove-all-whitespace-in-a-string
  """
  pattern = regex.compile(r'\s+')
  text = regex.sub(pattern, '', text)
  return text

strip_whitespace(text='\\parbox[c]{\n            \\ww\\linewidth\n        }{\n            \\includegraphics[\n                width=1.0\\linewidth\n            ]{\n                figures/image1.jpg\n            }\n        } ')

Selected Statement: text = regex.sub(pattern, '', text)

Function Input:
text: '\\parbox[c]{\n            \\ww\\linewidth\n        }{\n            \\includegraphics[\n                width=1.0\\linewidth\n            ]{\n                figures/image1.jpg\n            }\n        } '

Variable Values Before Statement:
pattern: regex.Regex('\\s+', flags=regex.V0)
text: '\\parbox[c]{\n            \\ww\\linewidth\n        }{\n            \\includegraphics[\n                width=1.0\\linewidth\n            ]{\n                figures/image1.jpg\n            }\n        } '

Value After Statement Execution: '\\parbox[c]{\\ww\\linewidth}{\\includegraphics[width

Variable States During Runtime (line, value):
text: 1
'\\parbox[c]{\n            \\ww\\linewidth\n        }{\n            \\includegraphics[\n                width=1.0\\linewidth\n            ]{\n                figures/image1.jpg\n            }\n        } '
7
'\\parbox[c]{\\ww\\linewidth}{\\includegraphics[width=1.0\\linewidth]{figures/image1.jpg}}'
pattern: 6
regex.Regex('\\s+', flags=regex.V0)
Project Name: google-research+arxiv-latex-cleaner
Language: Python
Statement Type: API

Source Code:
def _remove_comments_inline(text):
  """Removes the comments from the string 'text' and ignores % inside \\url{}."""
  if 'auto-ignore' in text:
    return text
  if text.lstrip(' ').lstrip('\t').startswith('%'):
    return ''

  url_pattern = r'\\url\{(?>[^{}]|(?R))*\}'

  def remove_comments(segment):
    """Remove comments from a segment of text."""
    if segment.lstrip().startswith('%'):
      return ''
    match = regex.search(r'(?<!\\)%', segment)
    if match:
      return segment[: match.end()] + '\n'
    else:
      return segment

  # split the text into segments based on \url{} tags
  segments = regex.split(f'({url_pattern})', text)

  for i in range(len(segments)):
    # only process segments that are not part of a \url{} tag
    if not regex.match(url_pattern, segments[i]):
      segments[i] = remove_comments(segments[i])

  final_text = ''.join(segments)
  return (
      final_text
      if final_text.endswith('\n') or final_text.endswith('\\n')
      else final_text + '\n'
  )

_remove_comments_inline(text='Foo %Comment\n')

Selected Statement: segments = regex.split(f'({url_pattern})', text)

Function Input:
text: 'Foo %Comment\n'

Variable Values Before Statement:
text: 'Foo %Comment\n'

Value After Statement Execution: Foo %Comment


Variable States During Runtime (line, value):
text: 1
'Foo %Comment\n'
url_pattern: 8
'\\\\url\\{(?>[^{}]|(?R))*\\}'
remove_comments: 10
<function _remove_comments_inline.<locals>.remove_comments at 0x7f185616f280>
segments: 21
Foo %Comment

26
Foo %

i: 23
0
final_text: 28
'Foo %\n'
Project Name: google-research+arxiv-latex-cleaner
Language: Python
Statement Type: API

Source Code:
def _replace_includesvg(content, svg_inkscape_files):
  def repl_svg(matchobj):
    svg_path = matchobj.group(2)
    svg_filename = os.path.basename(svg_path)
    # search in svg_inkscape split if pdf_tex file is available
    matching_pdf_tex_files = _keep_pattern(
        svg_inkscape_files, ['/' + svg_filename + '-tex.pdf_tex']
    )
    if len(matching_pdf_tex_files) == 1:
      options = '' if matchobj.group(1) is None else matchobj.group(1)
      return f'\\includeinkscape{options}{{{matching_pdf_tex_files[0]}}}'
    else:
      return matchobj.group(0)

  content = regex.sub(r'\\includesvg(\[.*?\])?{(.*?)}', repl_svg, content)

  return content

_replace_includesvg(content='Foo\\includesvg{test2}\nFoo', svg_inkscape_files=['ext_svg/test1-tex.pdf_tex', 'ext_svg/test2-tex.pdf_tex'])

Selected Statement: content = regex.sub(r'\\includesvg(\[.*?\])?{(.*?)}', repl_svg, content)

Function Input:
content: 'Foo\\includesvg{test2}\nFoo'
svg_inkscape_files: ext_svg/test1-tex.pdf_tex, ext_svg/test2-tex.pdf_tex

Variable Values Before Statement:
repl_svg: <function _replace_includesvg.<locals>.repl_svg at 0x7f1855304550>
content: 'Foo\\includesvg{test2}\nFoo'

Value After Statement Execution: 'Foo\\includeinkscape{ext_svg/test2-tex.pdf_tex}\nFoo'

Variable States During Runtime (line, value):
content: 1
'Foo\\includesvg{test2}\nFoo'
15
'Foo\\includeinkscape{ext_svg/test2-tex.pdf_tex}\nFoo'
svg_inkscape_files: 1
ext_svg/test1-tex.pdf_tex, ext_svg/test2-tex.pdf_tex
repl_svg: 2
<function _replace_includesvg.<locals>.repl_svg at 0x7f1855304550>
Project Name: google-research+arxiv-latex-cleaner
Language: Python
Statement Type: API

Source Code:
def _search_reference(filename, contents, strict=False):
  """Returns a match object if filename is referenced in contents, and None otherwise.

  If not strict mode, path prefix and extension are optional.
  """
  if strict:
    # regex pattern for strict=True for path/to/img.ext:
    # \{[\s%]*path/to/img\.ext[\s%]*\}
    filename_regex = filename.replace('.', r'\.')
  else:
    filename_path = Path(filename)

    # make extension optional
    root, extension = filename_path.stem, filename_path.suffix
    basename_regex = '{}({})?'.format(
        regex.escape(root), regex.escape(extension)
    )

    # iterate through parent fragments to make path prefix optional
    path_prefix_regex = ''
    for fragment in reversed(filename_path.parents):
      if fragment.name == '.':
        continue
      fragment = regex.escape(fragment.name)
      path_prefix_regex = '({}{}{})?'.format(
          path_prefix_regex, fragment, os.sep
      )

    # Regex pattern for strict=True for path/to/img.ext:
    # \{[\s%]*(<path_prefix>)?<basename>(<ext>)?[\s%]*\}
    filename_regex = path_prefix_regex + basename_regex

  # Some files 'path/to/file' are referenced in tex as './path/to/file' thus
  # adds prefix for relative paths starting with './' or '.\' to regex search.
  filename_regex = r'(.' + os.sep + r')?' + filename_regex

  # Pads with braces and optional whitespace/comment characters.
  patn = r'\{{[\s%]*{}[\s%]*\}}'.format(filename_regex)
  # Picture references in LaTeX are allowed to be in different cases.
  return regex.search(patn, contents, regex.IGNORECASE)

_search_reference(filename='to/img.ext', contents='{img.ext}', strict=False)

Selected Statement: filename_path = Path(filename)

Function Input:
filename: 'to/img.ext'
contents: '{img.ext}'
strict: False

Variable Values Before Statement:
filename: 'to/img.ext'

Value After Statement Execution: PosixPath('to/img.ext')

Variable States During Runtime (line, value):
filename: 1
'to/img.ext'
contents: 1
'{img.ext}'
strict: 1
False
filename_path: 11
PosixPath('to/img.ext')
root: 14
'img'
extension: 14
'.ext'
basename_regex: 15
'img(\\.ext)?'
path_prefix_regex: 20
''
25
'(/)?'
25
'((/)?to/)?'
fragment: 21
PosixPath('.')
24
''
21
PosixPath('to')
24
'to'
filename_regex: 31
'((/)?to/)?img(\\.ext)?'
35
'(./)?((/)?to/)?img(\\.ext)?'
patn: 38
'\\{[\\s%]*(./)?((/)?to/)?img(\\.ext)?[\\s%]*\\}'
Project Name: idealo+imagededup
Language: Python
Statement Type: API

Source Code:
def return_logger(name: str) -> logging.Logger:
    # Set log message format

    logger = logging.getLogger(name)

    if not len(logger.handlers):
        log_formatter = logging.Formatter('%(asctime)-s: %(levelname)-s %(message)s')
        # set logging level
        logger.setLevel(logging.DEBUG)

        # Direct logs to stderr
        console_handler = logging.StreamHandler()
        console_handler.setFormatter(log_formatter)
        logger.addHandler(console_handler)

    return logger

return_logger(name='imagededup.handlers.metrics.classification')

Selected Statement: logger = logging.getLogger(name)

Function Input:
name: 'imagededup.handlers.metrics.classification'

Variable Values Before Statement:
name: 'imagededup.handlers.metrics.classification'

Value After Statement Execution: <Logger imagededup.handlers.metrics.classification (WARNING)>

Variable States During Runtime (line, value):
name: 1
'imagededup.handlers.metrics.classification'
logger: 4
<Logger imagededup.handlers.metrics.classification (WARNING)>
9
<Logger imagededup.handlers.metrics.classification (DEBUG)>
log_formatter: 7
{_style=<logging.PercentStyle object at 0x7fcf18561f10>, _fmt='%(asctime)-s: %(levelname)-s %(message)s', datefmt=None}
console_handler: 12
<StreamHandler <stderr> (NOTSET)>
Project Name: davidhalter+jedi
Language: Python
Statement Type: API

Source Code:
def _search_param_in_docstr(docstr, param_str):
    """
    Search `docstr` for type(-s) of `param_str`.

    >>> _search_param_in_docstr(':type param: int', 'param')
    ['int']
    >>> _search_param_in_docstr('@type param: int', 'param')
    ['int']
    >>> _search_param_in_docstr(
    ...   ':type param: :class:`threading.Thread`', 'param')
    ['threading.Thread']
    >>> bool(_search_param_in_docstr('no document', 'param'))
    False
    >>> _search_param_in_docstr(':param int param: some description', 'param')
    ['int']

    """
    # look at #40 to see definitions of those params
    patterns = [re.compile(p % re.escape(param_str))
                for p in DOCSTRING_PARAM_PATTERNS]
    for pattern in patterns:
        match = pattern.search(docstr)
        if match:
            return [_strip_rst_role(match.group(1))]

    return _search_param_in_numpydocstr(docstr, param_str)

_search_param_in_docstr(docstr=':type param: int', param_str='param')

Selected Statement: patterns = [re.compile(p % re.escape(param_str))

Function Input:
docstr: ':type param: int'
param_str: 'param'

Variable Values Before Statement:
param_str: 'param'

Value After Statement Execution: [re.compile('\\s*:type\\s+param:\\s*([^\\n]+)'), re.compile('\\s*:param\\s+(\\w+)\\s+param:[^\\n]*'), re.compile('\\s*@type\\s+param:\\s*([^\\n]+)')]

Variable States During Runtime (line, value):
docstr: 1
':type param: int'
param_str: 1
'param'
patterns: 19
[re.compile('\\s*:type\\s+param:\\s*([^\\n]+)'), re.compile('\\s*:param\\s+(\\w+)\\s+param:[^\\n]*'), re.compile('\\s*@type\\s+param:\\s*([^\\n]+)')]
pattern: 21
re.compile('\\s*:type\\s+param:\\s*([^\\n]+)')
match: 22
<re.Match object; span=(0, 16), match=':type param: int'>
Project Name: a1fred+carnival
Language: Python
Statement Type: API

Source Code:
def _underscore(word: str) -> str:
    # https://github.com/jpvanhal/inflection/blob/master/inflection.py
    word = re.sub(r"([A-Z]+)([A-Z][a-z])", r'\1_\2', word)
    word = re.sub(r"([a-z\d])([A-Z])", r'\1_\2', word)
    word = word.replace("-", "_")
    return word.lower()

_underscore(word='TestKlass')

Selected Statement: word = re.sub(r"([a-z\d])([A-Z])", r'\1_\2', word)

Function Input:
word: 'TestKlass'

Variable Values Before Statement:
word: 'TestKlass'

Value After Statement Execution: 'Test_Klass'

Variable States During Runtime (line, value):
word: 1
'TestKlass'
4
'Test_Klass'