MonoshiTonmoy/Code_Statement_Prediction_Dataset huggingface dataset:
Project Name: PyFilesystem+pyfilesystem2
Language: Python
Statement Type: Branch

Source Code:
def __setitem__(self, key, value):
        # type: (_K, _V) -> None
        """Store a new views, potentially discarding an old value.
        """
        if key not in self:
            if len(self) >= self.cache_size:
                self.popitem(last=False)
        OrderedDict.__setitem__(self, key, value)

__setitem__(self=LRUCache(), key='foo', value=1)

Selected Statement: if key not in self:

Function Input:
self: LRUCache()
key: 'foo'
value: 1

Variable Values Before Statement:
key: 'foo'
self: LRUCache()

Value After Statement Execution: No

Variable States During Runtime (line, value):
self: 1
LRUCache()
8
LRUCache([('foo', 1)])
key: 1
'foo'
value: 1
1
self['foo']: 8
1
Project Name: binux+pyspider
Language: Python
Statement Type: Branch

Source Code:
def config(_config=None, **kwargs):
    """
    A decorator for setting the default kwargs of `BaseHandler.crawl`.
    Any self.crawl with this callback will use this config.
    """
    if _config is None:
        _config = {}
    _config.update(kwargs)

    def wrapper(func):
        func._config = _config
        return func
    return wrapper

config(_config=None, kwargs={'age': 864000})

Selected Statement: if _config is None:

Function Input:
_config: None
kwargs: age: 864000

Variable Values Before Statement:
_config: None

Value After Statement Execution: Yes

Variable States During Runtime (line, value):
_config: 1
None
7
8
age: 864000
kwargs: 1
age: 864000
wrapper: 10
<function config.<locals>.wrapper at 0x7f6a10388ee0>
Project Name: jpadilla+pyjwt
Language: Python
Statement Type: Branch

Source Code:
def base64url_decode(input: Union[bytes, str]) -> bytes:
    input_bytes = force_bytes(input)

    rem = len(input_bytes) % 4

    if rem > 0:
        input_bytes += b"=" * (4 - rem)

    return base64.urlsafe_b64decode(input_bytes)

base64url_decode(input='hJtXIZ2uSN5kbQfbtTNWbpdmhkV8FJG-Onbc6mxCcYg')

Selected Statement: if rem > 0:

Function Input:
input: 'hJtXIZ2uSN5kbQfbtTNWbpdmhkV8FJG-Onbc6mxCcYg'

Variable Values Before Statement:
rem: 3

Value After Statement Execution: Yes

Variable States During Runtime (line, value):
input: 1
'hJtXIZ2uSN5kbQfbtTNWbpdmhkV8FJG-Onbc6mxCcYg'
input_bytes: 2
b'hJtXIZ2uSN5kbQfbtTNWbpdmhkV8FJG-Onbc6mxCcYg'
7
b'hJtXIZ2uSN5kbQfbtTNWbpdmhkV8FJG-Onbc6mxCcYg='
rem: 4
3
Project Name: EntilZha+ScalaFunctional
Language: Python
Statement Type: Branch

Source Code:
def to_dict(self, default=None):
        """
        Converts sequence of (Key, Value) pairs to a dictionary.

        >>> type(seq([('a', 1)]).to_dict())
        dict

        >>> seq([('a', 1), ('b', 2)]).to_dict()
        {'a': 1, 'b': 2}

        :param default: Can be a callable zero argument function. When not None, the returned
            dictionary is a collections.defaultdict with default as value for missing keys. If the
            value is not callable, then a zero argument lambda function is created returning the
            value and used for collections.defaultdict
        :return: dictionary from sequence of (Key, Value) elements
        """
        dictionary = {}
        for e in self.sequence:
            dictionary[e[0]] = e[1]
        if default is None:
            return dictionary
        else:
            if hasattr(default, '__call__'):
                return collections.defaultdict(default, dictionary)
            else:
                return collections.defaultdict(lambda: default, dictionary)

to_dict(self=[(1, 2), (2, 10), (7, 2)], default=None, self._base_sequence=[(1, 2), (2, 10), (7, 2)], self._lineage=Lineage: sequence)

Selected Statement: if default is None:

Function Input:
self: [(1, 2), (2, 10), (7, 2)]
default: None
self._base_sequence: [(1, 2), (2, 10), (7, 2)]
self._lineage: Lineage: sequence

Variable Values Before Statement:
default: None

Value After Statement Execution: No

Variable States During Runtime (line, value):
self: 1
[(1, 2), (2, 10), (7, 2)]
default: 1
None
self._base_sequence: 1
[(1, 2), (2, 10), (7, 2)]
self._lineage: 1
Lineage: sequence
dictionary: 17
19
{1: 2}
19
{1: 2, 2: 10}
19
{1: 2, 2: 10, 7: 2}
e: 18
(1, 2)
18
(2, 10)
18
(7, 2)
Project Name: EntilZha+ScalaFunctional
Language: Python
Statement Type: Branch

Source Code:
def sqlite3(conn, sql, parameters=None, *args, **kwargs):
    """
    Additional entry point to Sequence which query data from sqlite db file.

    >>> seq.sqlite3('examples/users.db', 'select id, name from users where id = 1;').first()
    [(1, "Tom")]

    :param conn: path or sqlite connection, cursor
    :param sql: SQL query string
    :return: Sequence wrapping SQL cursor
    """

    if parameters is None:
        parameters = ()

    if isinstance(conn, (sqlite3api.Connection, sqlite3api.Cursor)):
        return seq(conn.execute(sql, parameters))
    elif isinstance(conn, str):
        with sqlite3api.connect(conn, *args, **kwargs) as input_conn:
            return seq(input_conn.execute(sql, parameters))
    else:
        raise ValueError('conn must be a must be a file path or sqlite3 Connection/Cursor')

sqlite3(conn=1, sql='SELECT * from user', parameters=None, args=(), kwargs={})

Selected Statement: if parameters is None:

Function Input:
conn: 1
sql: 'SELECT * from user'
parameters: None
args: ()

Variable Values Before Statement:
parameters: None

Value After Statement Execution: Yes

Variable States During Runtime (line, value):
conn: 1
1
sql: 1
'SELECT * from user'
parameters: 1
None
14
()
args: 1
()
kwargs: 1
Project Name: davedittrich+python_secrets
Language: Python
Statement Type: API

Source Code:
def secrets_dir(env=os.getenv('D2_ENVIRONMENT', None),
                basedir=os.getenv('D2_SECRETS_BASEDIR', None)):
    if env is not None:
        env_str = str(env)
    else:
        cwd = os.getcwd()
        default_file = os.path.join(cwd, '.python_secrets_environment')
        if os.path.exists(default_file):
            with open(default_file, 'r') as f:
                env_str = f.read().strip()
        else:
            env_str = os.path.basename(cwd)
    if basedir is None:
        basedir = os.path.join(
                HOME,
                'secrets' if sys.platform.startswith('win') else '.secrets')
    return os.path.join(basedir, env_str)

secrets_dir(env=None, basedir=None)

Selected Statement: default_file = os.path.join(cwd, '.python_secrets_environment')

Function Input:
env: None
basedir: None

Variable Values Before Statement:
cwd: '/local/rcs/jinjun/code/pytrace-collector/logs/pypibugs/tried/davedittrich+python_secrets/davedittrich+python_secrets'

Value After Statement Execution: '/local/rcs/jinjun/code/pytrace-collector/logs/pypibugs/tried/davedittrich+python_secrets/davedittrich+python_secrets/.python_secrets_environment'

Variable States During Runtime (line, value):
env: 1
None
basedir: 1
None
14
'/home/jinjun/.secrets'
cwd: 6
'/local/rcs/jinjun/code/pytrace-collector/logs/pypibugs/tried/davedittrich+python_secrets/davedittrich+python_secrets'
default_file: 7
'/local/rcs/jinjun/code/pytrace-collector/logs/pypibugs/tried/davedittrich+python_secrets/davedittrich+python_secrets/.python_secrets_environment'
env_str: 12
'davedittrich+python_secrets'
Project Name: davedittrich+python_secrets
Language: Python
Statement Type: API

Source Code:
def _identify_environment(environment=None):
    """
    Returns the environment identifier.

    There are multiple ways to define the default environment (in order
    of priority):

    1. The --environment command line option;
    2. The content of the file .python_secrets_environment in the current
       working directory;
    3. The value specified by environment variable D2_ENVIRONMENT; or
    4. The basename of the current working directory.
    """
    cwd = os.getcwd()
    if environment is None:
        env_file = os.path.join(cwd, '.python_secrets_environment')
        if os.path.exists(env_file):
            with open(env_file, 'r') as f:
                environment = f.read().replace('\n', '')
        else:
            environment = os.getenv('D2_ENVIRONMENT',
                                    os.path.basename(cwd))
    return environment

_identify_environment(environment=None)

Selected Statement: env_file = os.path.join(cwd, '.python_secrets_environment')

Function Input:
environment: None

Variable Values Before Statement:
cwd: '/local/rcs/jinjun/code/pytrace-collector/logs/pypibugs/tried/davedittrich+python_secrets/davedittrich+python_secrets'

Value After Statement Execution: '/local/rcs/jinjun/code/pytrace-collector/logs/pypibugs/tried/davedittrich+python_secrets/davedittrich+python_secrets/.python_secrets_environment'

Variable States During Runtime (line, value):
environment: 1
None
21
'davedittrich+python_secrets'
cwd: 14
'/local/rcs/jinjun/code/pytrace-collector/logs/pypibugs/tried/davedittrich+python_secrets/davedittrich+python_secrets'
env_file: 16
'/local/rcs/jinjun/code/pytrace-collector/logs/pypibugs/tried/davedittrich+python_secrets/davedittrich+python_secrets/.python_secrets_environment'
Project Name: aperezdc+omni
Language: Python
Statement Type: API

Source Code:
def parse_route_template(template):
    rbuilder = ["^"]
    fbuilder = []
    position = 0
    schema = {}

    for match in template_var_re_finditer(template):
        param_name = match.group("name")
        param_type = match.group("type") or "id"
        # TODO: Handle KeyError, maybe we want to use a custom error here.
        param_formatchar, param_re, param_schema = _schema_map[param_type]
        schema[param_name] = param_schema

        rbuilder.append(re.escape(template[position:match.start()]))
        rbuilder.append(param_re.format(param_name))

        fbuilder.append(template[position:match.start()])
        fbuilder.append("{")
        fbuilder.append(param_name)
        fbuilder.append(":")
        fbuilder.append(param_formatchar)
        fbuilder.append("}")

        position = match.end()

    rbuilder.append(re.escape(template[position:]))
    rbuilder.append("$")
    fbuilder.append(template[position:])

    return (valid.Schema(schema),
            re.compile("".join(rbuilder)),
            u"".join(fbuilder).format)

parse_route_template(template='get/{variable}')

Selected Statement: fbuilder.append(param_name)

Function Input:
template: 'get/{variable}'

Variable Values Before Statement:
param_name: 'variable'

Value After Statement Execution: get/
{
variable

Variable States During Runtime (line, value):
template: 1
'get/{variable}'
rbuilder: 2
^
14
^, get/
15
^
get/
(?P<variable>[_a-zA-Z][_\w]*)
26
^
get/
(?P<variable>[_a-zA-Z][_\w]*)
27
^
get/
(?P<variable>[_a-zA-Z][_\w]*)
$
fbuilder: 3
17
get/
18
get/
{
19
get/
{
variable
20
get/
{
variable
:
21
get/
{
variable
:
s
22
get/
{
variable
:
s
}
28
get/
{
variable
:
s
}
position: 4
0
24
14
schema: 5
12
{'variable': And(<class 'str'>, <function Match at 0x7f0c58d64940>)}
match: 7
<re.Match object; span=(4, 14), match='{variable}'>
param_name: 8
'variable'
param_type: 9
'id'
param_formatchar: 11
's'
param_re: 11
'(?P<{}>[_a-zA-Z][_\\w]*)'
param_schema: 11
And(<class 'str'>, <function Match at 0x7f0c58d64940>)
Project Name: WattTime+pyiso
Language: Python
Statement Type: API

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: c = client_factory(ba_name)

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

Variable Values Before Statement:
ba_name: 'CAISO'

Value After Statement Execution: {options

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: API

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: c = client_factory(ba_name)

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

Variable Values Before Statement:
ba_name: 'PJM'

Value After Statement Execution: {options

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: geopy+geopy
Language: Python
Statement Type: API

Source Code:
def format_decimal(self, altitude=None):
        """
        Format decimal degrees with altitude::

            >>> p = Point(41.5, -81.0, 12.3)
            >>> p.format_decimal()
            '41.5, -81.0, 12.3km'
            >>> p = Point(41.5, 0, 0)
            >>> p.format_decimal()
            '41.5, 0.0'

        :param bool altitude: Whether to include ``altitude`` value.
            By default it is automatically included if it is non-zero.
        """
        coordinates = [str(self.latitude), str(self.longitude)]

        if altitude is None:
            altitude = bool(self.altitude)
        if altitude:
            if not isinstance(altitude, str):
                altitude = 'km'
            coordinates.append(self.format_altitude(altitude))

        return ", ".join(coordinates)

format_decimal(self=Point(41.5, 81.0, 2.5), altitude=None, self.altitude=2.5, self.latitude=41.5, self.longitude=81.0)

Selected Statement: coordinates.append(self.format_altitude(altitude))

Function Input:
self: Point(41.5, 81.0, 2.5)
altitude: None
self.altitude: 2.5
self.latitude: 41.5
self.longitude: 81.0

Variable Values Before Statement:
altitude: 'km'

Value After Statement Execution: 41.5, 81.0, 2.5km

Variable States During Runtime (line, value):
self: 1
Point(41.5, 81.0, 2.5)
altitude: 1
None
18
True
21
'km'
self.altitude: 1
2.5
self.latitude: 1
41.5
self.longitude: 1
81.0
coordinates: 15
41.5, 81.0
22
41.5, 81.0, 2.5km
Project Name: tensorpack+tensorpack
Language: Python
Statement Type: API

Source Code:
def _global_import(name):
    p = __import__(name, globals(), locals(), level=1)
    lst = p.__all__ if '__all__' in dir(p) else dir(p)
    if lst:
        globals().pop(name, None)
        for k in lst:
            if not k.startswith('__'):
                globals()[k] = p.__dict__[k]
                __all__.append(k)

_global_import(name='base')

Selected Statement: p = __import__(name, globals(), locals(), level=1)

Function Input:
name: 'base'

Variable Values Before Statement:
name: 'base'

Value After Statement Execution: <module 'tensorpack.dataflow.base' from '/local/rcs/jinjun/code/pytrace-collector/logs/self_collected/tried/tensorpack+tensorpack/tensorpack+tensorpack/tensorpack/dataflow/base.py'>

Variable States During Runtime (line, value):
name: 1
'base'
p: 2
<module 'tensorpack.dataflow.base' from '/local/rcs/jinjun/code/pytrace-collector/logs/self_collected/tried/tensorpack+tensorpack/tensorpack+tensorpack/tensorpack/dataflow/base.py'>
lst: 3
DataFlow, ProxyDataFlow, RNGDataFlow, DataFlowTerminated
k: 6
'DataFlow'
6
'ProxyDataFlow'
6
'RNGDataFlow'
6
'DataFlowTerminated'
Project Name: tensorpack+tensorpack
Language: Python
Statement Type: API

Source Code:
def global_import(name):
    p = __import__(name, globals(), locals(), level=1)
    lst = p.__all__ if '__all__' in dir(p) else []
    del globals()[name]
    for k in lst:
        if not k.startswith('__'):
            globals()[k] = p.__dict__[k]
            __all__.append(k)

global_import(name='model_desc')

Selected Statement: p = __import__(name, globals(), locals(), level=1)

Function Input:
name: 'model_desc'

Variable Values Before Statement:
name: 'model_desc'

Value After Statement Execution: <module 'tensorpack.graph_builder.model_desc' from '/local/rcs/jinjun/code/pytrace-collector/logs/self_collected/tried/tensorpack+tensorpack/tensorpack+tensorpack/tensorpack/graph_builder/model_desc.py'>

Variable States During Runtime (line, value):
name: 1
'model_desc'
p: 2
<module 'tensorpack.graph_builder.model_desc' from '/local/rcs/jinjun/code/pytrace-collector/logs/self_collected/tried/tensorpack+tensorpack/tensorpack+tensorpack/tensorpack/graph_builder/model_desc.py'>
lst: 3
Project Name: djerbic+xlrd-ignore-writeaccess-corruption
Language: Python
Statement Type: API

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: minutes, second = divmod(seconds, 60)

Function Input:
xldate: 2741.0
datemode: 0

Variable Values Before Statement:
seconds: 0

Value After Statement Execution: 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: lucidrains+imagen-pytorch
Language: Python
Statement Type: API

Source Code:
def cast_tuple(val, length = None):
    if isinstance(val, list):
        val = tuple(val)

    output = val if isinstance(val, tuple) else ((val,) * default(length, 1))

    if exists(length):
        assert len(output) == length

    return output

cast_tuple(val=1, length=4)

Selected Statement: output = val if isinstance(val, tuple) else ((val,) * default(length, 1))

Function Input:
val: 1
length: 4

Variable Values Before Statement:
length: 4

Value After Statement Execution: (1, 1, 1, 1)

Variable States During Runtime (line, value):
val: 1
1
length: 1
4
output: 5
(1, 1, 1, 1)
Project Name: smacke+ffsubsync
Language: Python
Statement Type: API

Source Code:
def test_start_seconds(start_seconds):
    parser_zero = GenericSubtitleParser(start_seconds=0)
    parser_zero.fit(BytesIO(fake_srt))
    parser = GenericSubtitleParser(start_seconds=start_seconds)
    parser.fit(BytesIO(fake_srt))
    expected = [
        sub
        for sub in parser_zero.subs_
        if sub.start >= timedelta(seconds=start_seconds)
    ]
    assert all(esub == psub for esub, psub in zip(expected, parser.subs_))

test_start_seconds(start_seconds=0)

Selected Statement: assert all(esub == psub for esub, psub in zip(expected, parser.subs_))

Function Input:
start_seconds: 0

Variable Values Before Statement:
expected: [<ffsubsync.generic_subtitles.GenericSubtitle object at 0x7fb0b6c79520>, <ffsubsync.generic_subtitles.GenericSubtitle object at 0x7fb015502430>, <ffsubsync.generic_subtitles.GenericSubtitle object at 0x7fb01543e190>]

Value After Statement Execution: None

Variable States During Runtime (line, value):
start_seconds: 1
0
parser_zero: 2
{subs_=None, sub_format='srt', encoding='infer', caching=False, fit_fname=None, detected_encoding_=None, max_subtitle_seconds=None, start_seconds=0, _skip_ssa_info=False, _strict=False}
3
{subs_=<ffsubsync.generic_subtitles.GenericSubtitlesFile object at 0x7fb015444520>, sub_format='srt', encoding='infer', caching=False, fit_fname=<_io.BytesIO object at 0x7fb015254db0>, detected_encoding_='ASCII', max_subtitle_seconds=None, start_seconds=0, _skip_ssa_info=False, _strict=False}
parser: 4
{subs_=None, sub_format='srt', encoding='infer', caching=False, fit_fname=None, detected_encoding_=None, max_subtitle_seconds=None, start_seconds=0, _skip_ssa_info=False, _strict=False}
5
{subs_=<ffsubsync.generic_subtitles.GenericSubtitlesFile object at 0x7fb0b6ce5c40>, sub_format='srt', encoding='infer', caching=False, fit_fname=<_io.BytesIO object at 0x7fb01520a4a0>, detected_encoding_='ASCII', max_subtitle_seconds=None, start_seconds=0, _skip_ssa_info=False, _strict=False}
expected: 6
[<ffsubsync.generic_subtitles.GenericSubtitle object at 0x7fb0b6c79520>, <ffsubsync.generic_subtitles.GenericSubtitle object at 0x7fb015502430>, <ffsubsync.generic_subtitles.GenericSubtitle object at 0x7fb01543e190>]
@py_assert1: 11
None
@py_assert3: 11
None
Project Name: andsor+pydevs
Language: Python
Statement Type: API

Source Code:
def git_versions_from_vcs(tag_prefix, root, verbose=False):
    # this runs 'git' from the root of the source tree. This only gets called
    # if the git-archive 'subst' keywords were *not* expanded, and
    # _version.py hasn't already been rewritten with a short version string,
    # meaning we're inside a checked out source tree.

    if not os.path.exists(os.path.join(root, ".git")):
        if verbose:
            print("no .git in %s" % root)
        return {}

    GITS = ["git"]
    if sys.platform == "win32":
        GITS = ["git.cmd", "git.exe"]
    stdout = run_command(GITS, ["describe", "--tags", "--dirty", "--always"],
                         cwd=root)
    if stdout is None:
        return {}
    if not stdout.startswith(tag_prefix):
        if verbose:
            print("tag '%s' doesn't start with prefix '%s'"
                  % (stdout, tag_prefix))
        return {}
    tag = stdout[len(tag_prefix):]
    stdout = run_command(GITS, ["rev-parse", "HEAD"], cwd=root)
    if stdout is None:
        return {}
    full = stdout.strip()
    if tag.endswith("-dirty"):
        full += "-dirty"
    return {"version": tag, "full": full}

git_versions_from_vcs(tag_prefix='v', root='/local/rcs/jinjun/code/pytrace-collector/logs/pypibugs/tried/andsor+pydevs/andsor+pydevs', verbose=False)

Selected Statement: stdout = run_command(GITS, ["rev-parse", "HEAD"], cwd=root)

Function Input:
tag_prefix: 'v'
root: '/local/rcs/jinjun/code/pytrace-collector/logs/pypibugs/tried/andsor+pydevs/andsor+pydevs'
verbose: False

Variable Values Before Statement:
GITS: git

Value After Statement Execution: '1ef835aee49f536a5a499db71927deac87f4152e'

Variable States During Runtime (line, value):
tag_prefix: 1
'v'
root: 1
'/local/rcs/jinjun/code/pytrace-collector/logs/pypibugs/tried/andsor+pydevs/andsor+pydevs'
verbose: 1
False
GITS: 12
git
stdout: 15
'v0.1.2'
25
'1ef835aee49f536a5a499db71927deac87f4152e'
tag: 24
'0.1.2'
full: 28
'1ef835aee49f536a5a499db71927deac87f4152e'