MonoshiTonmoy/Code_Statement_Prediction_Dataset huggingface dataset:
Project Name: getsentry+responses
Language: Python
Statement Type: API

Source Code:
def _create_key_val_str(input_dict: Union[Mapping[Any, Any], Any]) -> str:
    """
    Returns string of format {'key': val, 'key2': val2}
    Function is called recursively for nested dictionaries

    :param input_dict: dictionary to transform
    :return: (str) reformatted string
    """

    def list_to_str(input_list: List[str]) -> str:
        """
        Convert all list items to string.
        Function is called recursively for nested lists
        """
        converted_list = []
        for item in sorted(input_list, key=lambda x: str(x)):
            if isinstance(item, dict):
                item = _create_key_val_str(item)
            elif isinstance(item, list):
                item = list_to_str(item)

            converted_list.append(str(item))
        list_str = ", ".join(converted_list)
        return "[" + list_str + "]"

    items_list = []
    for key in sorted(input_dict.keys(), key=lambda x: str(x)):
        val = input_dict[key]
        if isinstance(val, dict):
            val = _create_key_val_str(val)
        elif isinstance(val, list):
            val = list_to_str(input_list=val)

        items_list.append(f"{key}: {val}")

    key_val_str = "{{{}}}".format(", ".join(items_list))
    return key_val_str

_create_key_val_str(input_dict={})

Selected Statement: key_val_str = "{{{}}}".format(", ".join(items_list))

Function Input:

Variable Values Before Statement:

Value After Statement Execution: '{}'

Variable States During Runtime (line, value):
input_dict: 1
list_to_str: 10
<function _create_key_val_str.<locals>.list_to_str at 0x7f684994adc0>
items_list: 26
key_val_str: 36
'{}'
Project Name: getsentry+responses
Language: Python
Statement Type: API

Source Code:
def _clean_unicode(url: str) -> str:
    """Clean up URLs, which use punycode to handle unicode chars.

    Applies percent encoding to URL path and query if required.

    Parameters
    ----------
    url : str
        URL that should be cleaned from unicode

    Returns
    -------
    str
        Cleaned URL

    """
    urllist = list(urlsplit(url))
    netloc = urllist[1]
    if _has_unicode(netloc):
        domains = netloc.split(".")
        for i, d in enumerate(domains):
            if _has_unicode(d):
                d = "xn--" + d.encode("punycode").decode("ascii")
                domains[i] = d
        urllist[1] = ".".join(domains)
        url = urlunsplit(urllist)

    # Clean up path/query/params, which use url-encoding to handle unicode chars
    chars = list(url)
    for i, x in enumerate(chars):
        if ord(x) > 128:
            chars[i] = quote(x)

    return "".join(chars)

_clean_unicode(url='http://example.com/test?type=2&ie=utf8&query=汉字')

Selected Statement: chars = list(url)

Function Input:
url: 'http://example.com/test?type=2&ie=utf8&query=汉字'

Variable Values Before Statement:
url: 'http://example.com/test?type=2&ie=utf8&query=汉字'

Value After Statement Execution: ['h', 't', 't', 'p', ':', '/', '/', 'e', 'x', 'a', 'm', 'p', 'l', 'e', '.', 'c', 'o', 'm', '/', 't', 'e', 's', 't', '?', 't', 'y', 'p', 'e', '

Variable States During Runtime (line, value):
url: 1
'http://example.com/test?type=2&ie=utf8&query=汉字'
urllist: 17
http
example.com
/test
type=2&ie=utf8&query=汉字
netloc: 18
'example.com'
chars: 29
h
t
t
p
:
/
/
e
x
a
m
p
l
e
.
c
o
m
/
t
e
s
t
?
t
y
p
e
=
2
&
i
e
=
u
t
f
8
&
q
u
e
r
y
=
汉
字
32
h
t
t
p
:
/
/
e
x
a
m
p
l
e
.
c
o
m
/
t
e
s
t
?
t
y
p
e
=
2
&
i
e
=
u
t
f
8
&
q
u
e
r
y
=
%E6%B1%89
字
32
h
t
t
p
:
/
/
e
x
a
m
p
l
e
.
c
o
m
/
t
e
s
t
?
t
y
p
e
=
2
&
i
e
=
u
t
f
8
&
q
u
e
r
y
=
%E6%B1%89
%E5%AD%97
i: 30
0
30
1
30
2
30
3
30
4
30
5
30
6
30
7
30
8
30
9
30
10
30
11
30
12
30
13
30
14
30
15
30
16
30
17
30
18
30
19
30
20
30
21
30
22
30
23
30
24
30
25
30
26
30
27
30
28
30
29
30
30
30
31
30
32
30
33
30
34
30
35
30
36
30
37
30
38
30
39
30
40
30
41
30
42
30
43
30
44
30
45
30
46
x: 30
'h'
30
't'
30
'p'
30
':'
30
'/'
30
'e'
30
'x'
30
'a'
30
'm'
30
'p'
30
'l'
30
'e'
30
'.'
30
'c'
30
'o'
30
'm'
30
'/'
30
't'
30
'e'
30
's'
30
't'
30
'?'
30
't'
30
'y'
30
'p'
30
'e'
30
'='
30
'2'
30
'&'
30
'i'
30
'e'
30
'='
30
'u'
30
't'
30
'f'
30
'8'
30
'&'
30
'q'
30
'u'
30
'e'
30
'r'
30
'y'
30
'='
30
'汉'
30
'字'
Project Name: tgbot-collection+YYeTsBot
Language: Python
Statement Type: API

Source Code:
def class_to_tg(sub_class: str):
    trans = {"Online": "_online", "Offline": "_offline"}

    for upper, lower in trans.items():
        sub_class = sub_class.replace(upper, lower)

    return sub_class.lower()

class_to_tg(sub_class='YYeTsOffline')

Selected Statement: sub_class = sub_class.replace(upper, lower)

Function Input:
sub_class: 'YYeTsOffline'

Variable Values Before Statement:
upper: 'Offline'
lower: '_offline'

Value After Statement Execution: 'YYeTs_offline'

Variable States During Runtime (line, value):
sub_class: 1
'YYeTsOffline'
5
'YYeTs_offline'
trans: 2
Online: _online
Offline: _offline
upper: 4
'Online'
4
'Offline'
lower: 4
'_online'
4
'_offline'
Project Name: Dreem-Organization+benderopt
Language: Python
Statement Type: API

Source Code:
def generate_samples_loguniform(low, high, step, base, size=1):
    """Generate sample for (discrete)uniform density."""

    samples = base ** (random.uniform(low=logb(low, base), high=logb(high, base), size=size))
    if step:
        samples = step * np.floor(samples / step)
    return samples

generate_samples_loguniform(low=5.8884365535558836e-08, high=2.6977394324449206e-07, step=None, base=10, size=100000)

Selected Statement: samples = base ** (random.uniform(low=logb(low, base), high=logb(high, base), size=size))

Function Input:
low: 5.8884365535558836e-08
high: 2.6977394324449206e-07
step: None
base: 10
size: 100000

Variable Values Before Statement:
high: 2.6977394324449206e-07
base: 10

Value After Statement Execution: array([8.36400364e-08, 2.64090744e-07, 2.64351674e-07, ...,       6.02217873e-08, 1.13953435e-07, 8.52185827e-08])

Variable States During Runtime (line, value):
low: 1
5.8884365535558836e-08
high: 1
2.6977394324449206e-07
step: 1
None
base: 1
10
size: 1
100000
samples: 4
array([8.36400364e-08, 2.64090744e-07, 2.64351674e-07, ...,       6.02217873e-08, 1.13953435e-07, 8.52185827e-08])
Project Name: Dreem-Organization+benderopt
Language: Python
Statement Type: API

Source Code:
def validate_categorical(search_space):
    # error = "Expected a dict with mandatory key 'values' (list) and optional key 'probabilities' (list)"
    search_space = search_space.copy()

    if type(search_space) != dict:
        raise ValueError
    if "values" not in search_space.keys() or type(search_space['values']) != list:
        raise ValueError
    if "probabilities" in search_space.keys() and (
            type(search_space['probabilities']) != list or
            len(search_space['probabilities']) != len(search_space['values'])):
        raise ValueError

    # Test that proba sum to 1 but we are lazy and we try directly
    if "probabilities" in search_space.keys():
        np.random.choice(range(len(search_space["probabilities"])),
                         p=search_space["probabilities"])

    if "probabilities" not in search_space.keys():
        number_of_values = len(search_space["values"])
        search_space["probabilities"] = list(np.ones(number_of_values) / number_of_values)

    return search_space

validate_categorical(search_space={'values': [0, 0.6283185307179586, 0.7853981633974483, 1.0471975511965976, 1.5707963267948966, 3.141592653589793]})

Selected Statement: search_space["probabilities"] = list(np.ones(number_of_values) / number_of_values)

Function Input:
search_space: {'values': [0, 0.6283185307179586, 0.7853981633974483, 1.0471975511965976, 1.5707963267948966, 3.141592653589793]}

Variable Values Before Statement:
number_of_values: 6

Value After Statement Execution: {'values': [0, 0.6283185307179586, 0.7853981633974483, 1.0471975511965976, 1.5707963267948966, 3.141592653589793], 'probabilities': [0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666]}

Variable States During Runtime (line, value):
search_space: 1
{'values': [0, 0.6283185307179586, 0.7853981633974483, 1.0471975511965976, 1.5707963267948966, 3.141592653589793]}
21
{'values': [0, 0.6283185307179586, 0.7853981633974483, 1.0471975511965976, 1.5707963267948966, 3.141592653589793], 'probabilities': [0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666]}
number_of_values: 20
6
Project Name: simonw+datasette
Language: Python
Statement Type: API

Source Code:
def __missing__(self, b):
        # Handle a cache miss, store encoded string in cache and return.
        if b in _TILDE_ENCODING_SAFE:
            res = chr(b)
        elif b == _space:
            res = "+"
        else:
            res = "~{:02X}".format(b)
        self[b] = res
        return res

__missing__(self={}, b=102)

Selected Statement: res = chr(b)

Function Input:
b: 102

Variable Values Before Statement:
b: 102

Value After Statement Execution: 'f'

Variable States During Runtime (line, value):
self: 1
9
102: f
b: 1
102
res: 4
'f'
self[102]: 9
'f'
Project Name: simonw+datasette
Language: Python
Statement Type: API

Source Code:
def to_css_class(s):
    """
    Given a string (e.g. a table name) returns a valid unique CSS class.
    For simple cases, just returns the string again. If the string is not a
    valid CSS class (we disallow - and _ prefixes even though they are valid
    as they may be confused with browser prefixes) we strip invalid characters
    and add a 6 char md5 sum suffix, to make sure two tables with identical
    names after stripping characters don't end up with the same CSS class.
    """
    if css_class_re.match(s):
        return s
    md5_suffix = hashlib.md5(s.encode("utf8")).hexdigest()[:6]
    # Strip leading _, -
    s = s.lstrip("_").lstrip("-")
    # Replace any whitespace with hyphens
    s = "-".join(s.split())
    # Remove any remaining invalid characters
    s = css_invalid_chars_re.sub("", s)
    # Attach the md5 suffix
    bits = [b for b in (s, md5_suffix) if b]
    return "-".join(bits)

to_css_class(s='table/with/slashes.csv')

Selected Statement: s = css_invalid_chars_re.sub("", s)

Function Input:
s: 'table/with/slashes.csv'

Variable Values Before Statement:
s: 'table/with/slashes.csv'

Value After Statement Execution: 'tablewithslashescsv'

Variable States During Runtime (line, value):
s: 1
'table/with/slashes.csv'
18
'tablewithslashescsv'
md5_suffix: 12
'fa7563'
bits: 20
tablewithslashescsv, fa7563
Project Name: WattTime+pyiso
Language: Python
Statement Type: Arithmetic Assignment

Source Code:
def client_factory(client_name, **kwargs):
    """Return a client for an external data set"""
    # set up
    dir_name = os.path.dirname(os.path.abspath(__file__))
    error_msg = 'No client found for name %s' % client_name
    client_key = client_name.upper()

    # find client
    try:
        client_vals = BALANCING_AUTHORITIES[client_key]
        module_name = client_vals['module']

        class_name = client_vals['class']
    except KeyError:
        raise ValueError(error_msg)

    # find module
    try:
        fp, pathname, description = imp.find_module(module_name, [dir_name])
    except ImportError:
        raise ValueError(error_msg)

    # load
    try:
        mod = imp.load_module(module_name, fp, pathname, description)
    finally:
        # Since we may exit via an exception, close fp explicitly.
        if fp:
            fp.close()

    # instantiate class
    try:
        client_inst = getattr(mod, class_name)(**kwargs)
    except AttributeError:
        raise ValueError(error_msg)

    # set name
    client_inst.NAME = client_name

    return client_inst

client_factory(client_name='MISO', kwargs={})

Selected Statement: error_msg = 'No client found for name %s' % client_name

Function Input:
client_name: 'MISO'

Variable Values Before Statement:
client_name: 'MISO'

Value After Statement Execution: 'No client found for name MISO'

Variable States During Runtime (line, value):
client_name: 1
'MISO'
kwargs: 1
dir_name: 4
'/local/rcs/jinjun/code/pytrace-collector/logs/pypibugs/tried/WattTime+pyiso/WattTime+pyiso/pyiso'
error_msg: 5
'No client found for name MISO'
client_key: 6
'MISO'
client_vals: 10
module: miso
class: MISOClient
module_name: 11
'miso'
class_name: 13
'MISOClient'
fp: 19
<_io.TextIOWrapper name='/local/rcs/jinjun/code/pytrace-collector/logs/pypibugs/tried/WattTime+pyiso/WattTime+pyiso/pyiso/miso.py' mode='r' encoding='utf-8'>
pathname: 19
'/local/rcs/jinjun/code/pytrace-collector/logs/pypibugs/tried/WattTime+pyiso/WattTime+pyiso/pyiso/miso.py'
description: 19
('.py', 'r', 1)
Project Name: WattTime+pyiso
Language: Python
Statement Type: Arithmetic Assignment

Source Code:
def get_generation(ba_name, **kwargs):
    # get data
    c = client_factory(ba_name)
    data = c.get_generation(**kwargs)
    
    # log
    if len(data) == 0:
        msg = '%s: No generation data at %s with args %s' % (ba_name, datetime.utcnow().isoformat(),
                                                    kwargs)
        logger.warn(msg)
    
    # return
    return data

get_generation(ba_name='CAISO', kwargs={'latest': True})

Selected Statement: msg = '%s: No generation data at %s with args %s' % (ba_name, datetime.utcnow().isoformat(),

Function Input:
ba_name: 'CAISO'
kwargs: latest: yes

Variable Values Before Statement:

Value After Statement Execution: "CAISO: No generation data at 2024-04-03T22:46:21.338362 with args {'latest': True}"

Variable States During Runtime (line, value):
ba_name: 1
'CAISO'
kwargs: 1
latest: yes
c: 3
{options={}, NAME='CAISO'}
4
{options={'data': 'gen', 'latest': True, 'yesterday': False, 'start_at': False, 'end_at': False, 'sliceable': False, 'forecast': False, 'market': 'RT5M', 'freq': '10m'}, NAME='CAISO', session=<requests.sessions.Session object at 0x7fcc37a98b50>}
data: 4
msg: 8
"CAISO: No generation data at 2024-04-03T22:46:21.338362 with args {'latest': True}"
Project Name: WattTime+pyiso
Language: Python
Statement Type: Arithmetic Assignment

Source Code:
def get_load(ba_name, **kwargs):
    # get data
    c = client_factory(ba_name)
    data = c.get_load(**kwargs)
    
    # log
    if len(data) == 0:
        msg = '%s: No load data at %s with args %s' % (ba_name, datetime.utcnow().isoformat(),
                                                    kwargs)
        logger.warn(msg)
    
    # return
    return data

get_load(ba_name='PJM', kwargs={'latest': True})

Selected Statement: msg = '%s: No load data at %s with args %s' % (ba_name, datetime.utcnow().isoformat(),

Function Input:
ba_name: 'PJM'
kwargs: latest: yes

Variable Values Before Statement:

Value After Statement Execution: "PJM: No load data at 2024-04-03T22:47:45.327834 with args {'latest': True}"

Variable States During Runtime (line, value):
ba_name: 1
'PJM'
kwargs: 1
latest: yes
c: 3
{options={}, NAME='PJM'}
4
{options={'data': 'load', 'latest': True, 'start_at': None, 'end_at': None, 'forecast': False, 'sliceable': False}, NAME='PJM', session=<requests.sessions.Session object at 0x7fcc37745f10>}
data: 4
msg: 8
"PJM: No load data at 2024-04-03T22:47:45.327834 with args {'latest': True}"
Project Name: djerbic+xlrd-ignore-writeaccess-corruption
Language: Python
Statement Type: Arithmetic Assignment

Source Code:
def xldate_as_tuple(xldate, datemode):
    if datemode not in (0, 1):
        raise XLDateBadDatemode(datemode)
    if xldate == 0.00:
        return (0, 0, 0, 0, 0, 0)
    if xldate < 0.00:
        raise XLDateNegative(xldate)
    xldays = int(xldate)
    frac = xldate - xldays
    seconds = int(round(frac * 86400.0))
    assert 0 <= seconds <= 86400
    if seconds == 86400:
        hour = minute = second = 0
        xldays += 1
    else:
        # second = seconds % 60; minutes = seconds // 60
        minutes, second = divmod(seconds, 60)
        # minute = minutes % 60; hour    = minutes // 60
        hour, minute = divmod(minutes, 60)
    if xldays >= _XLDAYS_TOO_LARGE[datemode]:
        raise XLDateTooLarge(xldate)

    if xldays == 0:
        return (0, 0, 0, hour, minute, second)

    if xldays < 61 and datemode == 0:
        raise XLDateAmbiguous(xldate)

    jdn = xldays + _JDN_delta[datemode]
    yreg = (ifd(ifd(jdn * 4 + 274277, 146097) * 3, 4) + jdn + 1363) * 4 + 3
    mp = ifd(yreg % 1461, 4) * 535 + 333
    d = ifd(mp % 16384, 535) + 1
    # mp /= 16384
    mp >>= 14
    if mp >= 10:
        return (ifd(yreg, 1461) - 4715, mp - 9, d, hour, minute, second)
    else:
        return (ifd(yreg, 1461) - 4716, mp + 3, d, hour, minute, second)

xldate_as_tuple(xldate=2741.0, datemode=0)

Selected Statement: frac = xldate - xldays

Function Input:
xldate: 2741.0
datemode: 0

Variable Values Before Statement:
xldate: 2741.0
xldays: 2741

Value After Statement Execution: 0.0

Variable States During Runtime (line, value):
xldate: 1
2741.0
datemode: 1
0
xldays: 8
2741
frac: 9
0.0
seconds: 10
0
second: 17
0
minutes: 17
0
hour: 19
0
minute: 19
0
jdn: 29
2417760
yreg: 30
9676699
mp: 31
66673
34
4
d: 32
3
Project Name: djerbic+xlrd-ignore-writeaccess-corruption
Language: Python
Statement Type: Arithmetic Assignment

Source Code:
def xldate_from_date_tuple(date_tuple, datemode):
    """Create an excel date from a tuple of (year, month, day)"""
    year, month, day = date_tuple

    if datemode not in (0, 1):
        raise XLDateBadDatemode(datemode)

    if year == 0 and month == 0 and day == 0:
        return 0.00

    if not (1900 <= year <= 9999):
        raise XLDateBadTuple("Invalid year: %r" % ((year, month, day),))
    if not (1 <= month <= 12):
        raise XLDateBadTuple("Invalid month: %r" % ((year, month, day),))
    if  day < 1 \
    or (day > _days_in_month[month] and not(day == 29 and month == 2 and _leap(year))):
        raise XLDateBadTuple("Invalid day: %r" % ((year, month, day),))

    Yp = year + 4716
    M = month
    if M <= 2:
        Yp = Yp - 1
        Mp = M + 9
    else:
        Mp = M - 3
    jdn = ifd(1461 * Yp, 4) + ifd(979 * Mp + 16, 32) + \
        day - 1364 - ifd(ifd(Yp + 184, 100) * 3, 4)
    xldays = jdn - _JDN_delta[datemode]
    if xldays <= 0:
        raise XLDateBadTuple("Invalid (year, month, day): %r" % ((year, month, day),))
    if xldays < 61 and datemode == 0:
        raise XLDateAmbiguous("Before 1900-03-01: %r" % ((year, month, day),))
    return float(xldays)

xldate_from_date_tuple(date_tuple=(1907, 7, 3), datemode=0)

Selected Statement: Yp = year + 4716

Function Input:
date_tuple: (1907, 7, 3)
datemode: 0

Variable Values Before Statement:
year: 1907

Value After Statement Execution: 6623

Variable States During Runtime (line, value):
date_tuple: 1
(1907, 7, 3)
datemode: 1
0
year: 3
1907
month: 3
7
day: 3
3
Yp: 19
6623
M: 20
7
Mp: 25
4
jdn: 26
2417760
xldays: 28
2741
Project Name: tensorlayer+TensorLayer
Language: Python
Statement Type: Arithmetic Assignment

Source Code:
def _add_notice_to_docstring(doc, no_doc_str, notice):
    """Adds a deprecation notice to a docstring."""
    if not doc:
        lines = [no_doc_str]

    else:
        lines = _normalize_docstring(doc).splitlines()

    notice = [''] + notice

    if len(lines) > 1:
        # Make sure that we keep our distance from the main body
        if lines[1].strip():
            notice.append('')

        lines[1:1] = notice
    else:
        lines += notice

    return '\n'.join(lines)

_add_notice_to_docstring(doc=None, no_doc_str='DEPRECATED FUNCTION', notice=['\n            .. warning::\n                **THIS FUNCTION IS DEPRECATED:** It will be removed after after 2018-09-30.\n                *Instructions for updating:* This API is deprecated. Please use as `tl.logging.warning`.\n        '])

Selected Statement: notice = [''] + notice

Function Input:
doc: None
no_doc_str: 'DEPRECATED FUNCTION'
notice: 
            .. warning::
                **THIS FUNCTION IS DEPRECATED:** It will be removed after after 2018-09-30.
                *Instructions for updating:* This API is deprecated. Please use as `tl.logging.warning`.
        

Variable Values Before Statement:
notice: 
            .. warning::
                **THIS FUNCTION IS DEPRECATED:** It will be removed after after 2018-09-30.
                *Instructions for updating:* This API is deprecated. Please use as `tl.logging.warning`.
        

Value After Statement Execution: 
            .. warning::
                **THIS FUNCTION IS DEPRECATED:** It will be removed after after 2018-09-30.
                *Instructions for updating:* This API is deprecated. Please use as `tl.logging.warning`.
        

Variable States During Runtime (line, value):
doc: 1
None
no_doc_str: 1
'DEPRECATED FUNCTION'
notice: 1

            .. warning::
                **THIS FUNCTION IS DEPRECATED:** It will be removed after after 2018-09-30.
                *Instructions for updating:* This API is deprecated. Please use as `tl.logging.warning`.
        
9

            .. warning::
                **THIS FUNCTION IS DEPRECATED:** It will be removed after after 2018-09-30.
                *Instructions for updating:* This API is deprecated. Please use as `tl.logging.warning`.
        
lines: 4
DEPRECATED FUNCTION
18
DEPRECATED FUNCTION

            .. warning::
                **THIS FUNCTION IS DEPRECATED:** It will be removed after after 2018-09-30.
                *Instructions for updating:* This API is deprecated. Please use as `tl.logging.warning`.
Project Name: JRCSTU+co2mpas-ta
Language: Python
Statement Type: Arithmetic Assignment

Source Code:
def calculate_r_wheels(tyre_dimensions):
    """
    Calculates the radius of the wheels [m] from the tyre dimensions.

    :param tyre_dimensions:
        Tyre dimensions.

        .. note:: The fields are : use, nominal_section_width, aspect_ratio,
           carcass, diameter, load_index, speed_rating, and additional_marks.
    :type tyre_dimensions: dict

    :return:
        Radius of the wheels [m].
    :rtype: float
    """
    if 'diameter' in tyre_dimensions:
        if tyre_dimensions['code'] == 'pax':
            return tyre_dimensions['diameter'] / 2000  # Diameter is in mm.
        return tyre_dimensions['diameter'] * 0.0254  # Diameter is in inches.
    a = tyre_dimensions['aspect_ratio'] / 100  # Aspect ratio is Height/Width.
    w = tyre_dimensions['nominal_section_width']
    if tyre_dimensions.get('code', 'iso') == 'iso':
        w /= 1000  # Width is in mm.
    else:
        w *= 0.0254  # Width is in inches.

    dr = tyre_dimensions['rim_diameter'] * 0.0254  # Rim is in inches.
    return a * w + dr / 2

calculate_r_wheels(tyre_dimensions={'code': 'iso', 'carcass': 'R', 'nominal_section_width': 265.0, 'use': 'LT', 'load_range': 'D', 'rim_diameter': 15.0, 'aspect_ratio': 75.0})

Selected Statement: a = tyre_dimensions['aspect_ratio'] / 100  # Aspect ratio is Height/Width.

Function Input:
tyre_dimensions: code: iso
carcass: R
nominal_section_width: 265
use: LT
load_range: D
rim_diameter: 15
aspect_ratio: 75

Variable Values Before Statement:

Value After Statement Execution: 0.75

Variable States During Runtime (line, value):
tyre_dimensions: 1
code: iso
carcass: R
nominal_section_width: 265
use: LT
load_range: D
rim_diameter: 15
aspect_ratio: 75
a: 20
0.75
w: 21
265.0
23
0.265
dr: 27
0.381