MonoshiTonmoy/Code_Statement_Prediction_Dataset huggingface dataset:
Project Name: benjamincrom+scrabble
Language: Python
Statement Type: Constant Assignment

Source Code:
def get_word_set_total_score(board, word_set, num_move_locations):
    total_score = 0
    word_score = 0

    for word_location_set in word_set:
        word_score = 0
        word_multiplier = 1

        for location in word_location_set:
            square = board.board_square_dict[location]
            word_multiplier *= square.word_multiplier
            word_score += square.tile.point_value * square.letter_multiplier

        word_score *= word_multiplier
        total_score += word_score

    if num_move_locations == config.PLAYER_RACK_SIZE:
        total_score += config.BINGO_SCORE

    return total_score

get_word_set_total_score(board=  abcdefghijklmno1 _______________2 _______________3 _______________4 _______________5 _______________6 _______________7 _______________8 _______BAKER___9 _______________10_______________11_______________12_______________13_______________14_______________15_______________, word_set={frozenset(), frozenset({('h', 8), ('j', 8), ('l', 8), ('i', 8), ('k', 8)})}, num_move_locations=5)

Selected Statement: total_score = 0

Function Input:
board:   abcdefghijklmno1 _______________2 _______________3 _______________4 _______________5 _______________6 _______________7 _______________8 _______BAKER___9 _______________10_______________11_______________12_______________13_______________14_______________15_______________
word_set: {frozenset(), frozenset({('h', 8), ('j', 8), ('l', 8), ('i', 8), ('k', 8)})}
num_move_locations: 5

Variable Values Before Statement:
Constant: 0

Value After Statement Execution: 0

Variable States During Runtime (line, value):
board: 1
  abcdefghijklmno1 _______________2 _______________3 _______________4 _______________5 _______________6 _______________7 _______________8 _______BAKER___9 _______________10_______________11_______________12_______________13_______________14_______________15_______________
word_set: 1
{frozenset(), frozenset({('h', 8), ('j', 8), ('l', 8), ('i', 8), ('k', 8)})}
num_move_locations: 1
5
total_score: 2
0
15
24
word_score: 3
0
12
3
12
8
12
10
12
11
12
12
14
24
word_location_set: 5
frozenset()
5
frozenset({('h', 8), ('j', 8), ('l', 8), ('i', 8), ('k', 8)})
word_multiplier: 7
1
11
2
location: 9
('h', 8)
9
('j', 8)
9
('l', 8)
9
('i', 8)
9
('k', 8)
square: 10
B
10
K
10
R
10
A
10
E
Project Name: boto+boto3
Language: Python
Statement Type: Constant Assignment

Source Code:
def requires_crt(reason=None):
    if reason is None:
        reason = "Test requires awscrt to be installed"

    def decorator(func):
        return unittest.skipIf(not HAS_CRT, reason)(func)

    return decorator

requires_crt(reason=None)

Selected Statement: reason = "Test requires awscrt to be installed"

Function Input:
reason: None

Variable Values Before Statement:
Constant: "Test requires awscrt to be installed"

Value After Statement Execution: "Test requires awscrt to be installed"

Variable States During Runtime (line, value):
reason: 1
None
3
'Test requires awscrt to be installed'
decorator: 5
<function requires_crt.<locals>.decorator at 0x7fbbe4f994c0>
Project Name: ccarocean+pyrads
Language: Python
Statement Type: Constant Assignment

Source Code:
def _check(self) -> None:
        """Check the syntax of the expression.

        :raises ValueError:
            If the expression is incomplete.  This error is aimed at debugging
            the expression so it is very verbose.
        """
        stack_size = 0
        for i, token_ in enumerate(self._tokens):
            stack_size -= token_.pops
            if stack_size < 0:
                raise ValueError(
                    self._format_syntax_error(
                        f"'{token_}' takes {token_.pops} argument(s) but the stack"
                        f" will only have {stack_size + token_.pops} element(s)",
                        i,
                    )
                )
            stack_size += token_.puts
        if stack_size == 0:
            raise ValueError(
                self._format_syntax_error("expression does not produce a result")
            )
        if stack_size > 1:
            raise ValueError(
                self._format_syntax_error(
                    f"expression produces too many results ({stack_size}), "
                    "expected 1"
                )
            )

_check(self=CompleteExpression([Literal(1)]), self[0]=Literal(1))

Selected Statement: stack_size = 0

Function Input:
self: CompleteExpression([Literal(1)])
self[0]: Literal(1)

Variable Values Before Statement:
Constant: 0

Value After Statement Execution: 0

Variable States During Runtime (line, value):
self: 1
CompleteExpression([Literal(1)])
self[0]: 1
Literal(1)
stack_size: 8
0
19
1
i: 9
0
token_: 9
Literal(1)
Project Name: ccarocean+pyrads
Language: Python
Statement Type: Constant Assignment

Source Code:
def _simulate(self) -> Tuple[int, int]:
        """Simulate the expression to determine inputs and outputs.

        :return:
            A tuple of the number of inputs the expression takes and the number
            of outputs from the expression.
        """
        inputs = 0
        outputs = 0
        for token_ in self._tokens:
            outputs -= token_.pops
            inputs = max(inputs, -outputs)
            outputs += token_.puts
        return inputs, outputs + inputs

_simulate(self=Expression([Literal(1)]), self[0]=Literal(1))

Selected Statement: inputs = 0

Function Input:
self: Expression([Literal(1)])
self[0]: Literal(1)

Variable Values Before Statement:
Constant: 0

Value After Statement Execution: 0

Variable States During Runtime (line, value):
self: 1
Expression([Literal(1)])
self[0]: 1
Literal(1)
inputs: 8
0
outputs: 9
0
13
1
token_: 10
Literal(1)
Project Name: chyroc+WechatSogou
Language: Python
Statement Type: Constant Assignment

Source Code:
def gen_search_gzh_url(keyword, page=1):
        """拼接搜索 公众号 URL

        Parameters
        ----------
        keyword : str or unicode
            搜索文字
        page : int, optional
            页数 the default is 1

        Returns
        -------
        str
            search_gzh_url
        """
        assert isinstance(page, int) and page > 0

        qs_dict = OrderedDict()
        qs_dict['type'] = _search_type_gzh
        qs_dict['page'] = page
        qs_dict['ie'] = 'utf8'
        qs_dict['query'] = keyword

        return 'http://weixin.sogou.com/weixin?{}'.format(urlencode(qs_dict))

gen_search_gzh_url(keyword='高考', page=1)

Selected Statement: qs_dict['ie'] = 'utf8'

Function Input:
keyword: '高考'
page: 1

Variable Values Before Statement:
Constant: 'utf8'

Value After Statement Execution: 'utf8'

Variable States During Runtime (line, value):
keyword: 1
'高考'
page: 1
1
qs_dict: 18
OrderedDict()
19
OrderedDict([('type', 1)])
20
OrderedDict([('type', 1), ('page', 1)])
21
OrderedDict([('type', 1), ('page', 1), ('ie', 'utf8')])
22
OrderedDict([('type', 1), ('page', 1), ('ie', 'utf8'), ('query', '高考')])
Project Name: DaniFdezAlvarez+shexerp3
Language: Python
Statement Type: Constant Assignment

Source Code:
def check_just_one_not_none(*value_refname):
    nones=0
    for a_tuple in value_refname:
        if a_tuple[0] is not None:
            nones += 1
    if nones != 1:
        raise ValueError(error_message_for_non_compatible_references([a_tuple[1] for a_tuple in value_refname]))

check_just_one_not_none(value_refname=((None, 'graph_file_input'), (None, 'graph_list_of_files_input'), ('\n@prefix : <http://example.org/> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n\n:Marie a :person ;\n\t:likes :Justine ;\n\t:likes :Antoine ;\n\t:likes :football ;\n\t:name "Marie" ;\n\t:age "30"^^xsd:int .\n\n:Justine a :person ;\n    :likes :Marie ;\n    :likes :basketball ;\n    :name "Justine" .\n\n:Antoine a :person ;\n\t:likes :Marie ;\n\t:likes :Justine ;\n\t:name "Antoine" ;\n\t:age "32"^^xsd:int .\n', 'raw_graph'), (None, 'url_input'), (None, 'list_of_url_input'), (None, 'url_endpoint')))

Selected Statement: nones=0

Function Input:
value_refname: ((None, 'graph_file_input'), (None, 'graph_list_of_files_input'), ('\n@prefix : <http://example.org/> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n\n:Marie a :person ;\n\t:likes :Justine ;\n\t:likes :Antoine ;\n\t:likes :football ;\n\t:name "Marie" ;\n\t:age "30"^^xsd:int .\n\n:Justine a :person ;\n    :likes :Marie ;\n    :likes :basketball ;\n    :name "Justine" .\n\n:Antoine a :person ;\n\t:likes :Marie ;\n\t:likes :Justine ;\n\t:name "Antoine" ;\n\t:age "32"^^xsd:int .\n', 'raw_graph'), (None, 'url_input'), (None, 'list_of_url_input'), (None, 'url_endpoint'))

Variable Values Before Statement:
Constant: 0

Value After Statement Execution: 0

Variable States During Runtime (line, value):
value_refname: 1
((None, 'graph_file_input'), (None, 'graph_list_of_files_input'), ('\n@prefix : <http://example.org/> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n\n:Marie a :person ;\n\t:likes :Justine ;\n\t:likes :Antoine ;\n\t:likes :football ;\n\t:name "Marie" ;\n\t:age "30"^^xsd:int .\n\n:Justine a :person ;\n    :likes :Marie ;\n    :likes :basketball ;\n    :name "Justine" .\n\n:Antoine a :person ;\n\t:likes :Marie ;\n\t:likes :Justine ;\n\t:name "Antoine" ;\n\t:age "32"^^xsd:int .\n', 'raw_graph'), (None, 'url_input'), (None, 'list_of_url_input'), (None, 'url_endpoint'))
nones: 2
0
5
1
a_tuple: 3
(None, 'graph_file_input')
3
(None, 'graph_list_of_files_input')
3
('\n@prefix : <http://example.org/> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n\n:Marie a :person ;\n\t:likes :Justine ;\n\t:likes :Antoine ;\n\t:likes :football ;\n\t:name "Marie" ;\n\t:age "30"^^xsd:int .\n\n:Justine a :person ;\n    :likes :Marie ;\n    :likes :basketball ;\n    :name "Justine" .\n\n:Antoine a :person ;\n\t:likes :Marie ;\n\t:likes :Justine ;\n\t:name "Antoine" ;\n\t:age "32"^^xsd:int .\n', 'raw_graph')
3
(None, 'url_input')
3
(None, 'list_of_url_input')
3
(None, 'url_endpoint')
Project Name: DaniFdezAlvarez+shexerp3
Language: Python
Statement Type: Constant Assignment

Source Code:
def check_one_or_zero_not_none(*value_refname):
    nones=0
    for a_tuple in value_refname:
        if a_tuple[0] is not None:
            nones += 1
    if nones > 1:
        raise ValueError(error_message_for_non_compatible_references(
            list_of_ref_names=[a_tuple[1] for a_tuple in value_refname],
            one_mandatory=False))

check_one_or_zero_not_none(value_refname=((None, 'namespaces_dict'), (None, 'namespaces_dict_file')))

Selected Statement: nones=0

Function Input:
value_refname: ((None, 'namespaces_dict'), (None, 'namespaces_dict_file'))

Variable Values Before Statement:
Constant: 0

Value After Statement Execution: 0

Variable States During Runtime (line, value):
value_refname: 1
((None, 'namespaces_dict'), (None, 'namespaces_dict_file'))
nones: 2
0
a_tuple: 3
(None, 'namespaces_dict')
3
(None, 'namespaces_dict_file')
Project Name: Lightning-AI+lit-gpt
Language: Python
Statement Type: Constant Assignment

Source Code:
def layer_template(layer_name: str, idx: int) -> Tuple[str, int]:
    split = layer_name.split(".")
    number = int(split[idx])
    split[idx] = "{}"
    from_name = ".".join(split)
    return from_name, number

layer_template(layer_name='model.layers.0.self_attn.q_proj.weight', idx=2)

Selected Statement: split[idx] = "{}"

Function Input:
layer_name: 'model.layers.0.self_attn.q_proj.weight'
idx: 2

Variable Values Before Statement:
Constant: "{}"

Value After Statement Execution: "{}"

Variable States During Runtime (line, value):
layer_name: 1
'model.layers.0.self_attn.q_proj.weight'
idx: 1
2
split: 2
model, layers, 0, self_attn, q_proj, weight
4
model
layers
self_attn
q_proj
weight
number: 3
0
from_name: 5
'model.layers.{}.self_attn.q_proj.weight'
Project Name: burnash+gspread
Language: Python
Statement Type: Constant Assignment

Source Code:
def rowcol_to_a1(row, col):
    """Translates a row and column cell address to A1 notation.

    :param row: The row of the cell to be converted.
        Rows start at index 1.
    :type row: int, str

    :param col: The column of the cell to be converted.
        Columns start at index 1.
    :type row: int, str

    :returns: a string containing the cell's coordinates in A1 notation.

    Example:

    >>> rowcol_to_a1(1, 1)
    A1

    """
    row = int(row)
    col = int(col)

    if row < 1 or col < 1:
        raise IncorrectCellLabel("({}, {})".format(row, col))

    div = col
    column_label = ""

    while div:
        (div, mod) = divmod(div, 26)
        if mod == 0:
            mod = 26
            div -= 1
        column_label = chr(mod + MAGIC_NUMBER) + column_label

    label = "{}{}".format(column_label, row)

    return label

rowcol_to_a1(row=4, col=4)

Selected Statement: column_label = ""

Function Input:
row: 4
col: 4

Variable Values Before Statement:
Constant: ""

Value After Statement Execution: ""

Variable States During Runtime (line, value):
row: 1
4
col: 1
4
div: 26
4
30
0
column_label: 27
''
34
'D'
mod: 30
4
label: 36
'D4'
Project Name: burnash+gspread
Language: Python
Statement Type: Constant Assignment

Source Code:
def a1_to_rowcol(label):
    """Translates a cell's address in A1 notation to a tuple of integers.

    :param str label: A cell label in A1 notation, e.g. 'B1'.
        Letter case is ignored.
    :returns: a tuple containing `row` and `column` numbers. Both indexed
              from 1 (one).
    :rtype: tuple

    Example:

    >>> a1_to_rowcol('A1')
    (1, 1)

    """
    m = CELL_ADDR_RE.match(label)
    if m:
        column_label = m.group(1).upper()
        row = int(m.group(2))

        col = 0
        for i, c in enumerate(reversed(column_label)):
            col += (ord(c) - MAGIC_NUMBER) * (26**i)
    else:
        raise IncorrectCellLabel(label)

    return (row, col)

a1_to_rowcol(label='B1')

Selected Statement: col = 0

Function Input:
label: 'B1'

Variable Values Before Statement:
Constant: 0

Value After Statement Execution: 0

Variable States During Runtime (line, value):
label: 1
'B1'
m: 16
<re.Match object; span=(0, 2), match='B1'>
column_label: 18
'B'
row: 19
1
col: 21
0
23
2
i: 22
0
c: 22
'B'
Project Name: burnash+gspread
Language: Python
Statement Type: Constant Assignment

Source Code:
def _a1_to_rowcol_unbounded(label):
    """Translates a cell's address in A1 notation to a tuple of integers.

    Same as `a1_to_rowcol()` but allows for missing row or column part
    (e.g. "A" for the first column)

    :returns: a tuple containing `row` and `column` numbers. Both indexed
        from 1 (one).
    :rtype: tuple

    Example:

    >>> _a1_to_rowcol_unbounded('A1')
    (1, 1)

    >>> _a1_to_rowcol_unbounded('A')
    (inf, 1)

    >>> _a1_to_rowcol_unbounded('1')
    (1, inf)

    >>> _a1_to_rowcol_unbounded('ABC123')
    (123, 731)

    >>> _a1_to_rowcol_unbounded('ABC')
    (inf, 731)

    >>> _a1_to_rowcol_unbounded('123')
    (123, inf)

    >>> _a1_to_rowcol_unbounded('1A')
    Traceback (most recent call last):
        ...
    gspread.exceptions.IncorrectCellLabel: 1A

    >>> _a1_to_rowcol_unbounded('')
    (inf, inf)

    """
    m = A1_ADDR_ROW_COL_RE.match(label)
    if m:
        column_label, row = m.groups()

        if column_label:
            col = 0
            for i, c in enumerate(reversed(column_label.upper())):
                col += (ord(c) - MAGIC_NUMBER) * (26**i)
        else:
            col = inf

        if row:
            row = int(row)
        else:
            row = inf
    else:
        raise IncorrectCellLabel(label)

    return (row, col)

_a1_to_rowcol_unbounded(label='A1')

Selected Statement: col = 0

Function Input:
label: 'A1'

Variable Values Before Statement:
Constant: 0

Value After Statement Execution: 0

Variable States During Runtime (line, value):
label: 1
'A1'
m: 40
<re.Match object; span=(0, 2), match='A1'>
column_label: 42
'A'
row: 42
'1'
52
1
col: 45
0
47
1
i: 46
0
c: 46
'A'
Project Name: berkeleylab+als.milo
Language: Python
Statement Type: Constant Assignment

Source Code:
def get_config():
    """Create, populate and return the VersioneerConfig() object."""
    # these strings are filled in when 'setup.py versioneer' creates
    # _version.py
    cfg = VersioneerConfig()
    cfg.VCS = "git"
    # cfg.style = "pep440-micro"
    # cfg.style = "pep440-develop"
    cfg.style = "pep440-auto"
    cfg.tag_prefix = ""
    cfg.parentdir_prefix = ""
    cfg.versionfile_source = "milo/_version.py"
    cfg.verbose = False
    return cfg

get_config()

Selected Statement: cfg.VCS = "git"

Function Input:

Variable Values Before Statement:
Constant: "git"

Value After Statement Execution: "git"

Variable States During Runtime (line, value):
cfg: 5
6
{VCS='git'}
9
{VCS='git', style='pep440-auto'}
10
{VCS='git', style='pep440-auto', tag_prefix=''}
11
{VCS='git', style='pep440-auto', tag_prefix='', parentdir_prefix=''}
12
{VCS='git', style='pep440-auto', tag_prefix='', parentdir_prefix='', versionfile_source='milo/_version.py'}
13
{VCS='git', style='pep440-auto', tag_prefix='', parentdir_prefix='', versionfile_source='milo/_version.py', verbose=False}
Project Name: aws+aws-cli
Language: Python
Statement Type: Constant Assignment

Source Code:
def requires_crt(reason=None):
    if reason is None:
        reason = "Test requires awscrt to be installed"

    def decorator(func):
        return unittest.skipIf(not HAS_CRT, reason)(func)

    return decorator

requires_crt(reason=None)

Selected Statement: reason = "Test requires awscrt to be installed"

Function Input:
reason: None

Variable Values Before Statement:
Constant: "Test requires awscrt to be installed"

Value After Statement Execution: "Test requires awscrt to be installed"

Variable States During Runtime (line, value):
reason: 1
None
3
'Test requires awscrt to be installed'
decorator: 5
<function requires_crt.<locals>.decorator at 0x7f51d80bc0d0>
Project Name: jpadilla+pyjwt
Language: Python
Statement Type: Constant Assignment

Source Code:
def bytes_from_int(val: int) -> bytes:
    remaining = val
    byte_length = 0

    while remaining != 0:
        remaining >>= 8
        byte_length += 1

    return val.to_bytes(byte_length, "big", signed=False)

bytes_from_int(val=0)

Selected Statement: byte_length = 0

Function Input:
val: 0

Variable Values Before Statement:
Constant: 0

Value After Statement Execution: 0

Variable States During Runtime (line, value):
val: 1
0
remaining: 2
0
byte_length: 3
0