Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

        def format_path(path):
    formed = path[:1]
    for part in path[1:]:
        if isinstance(part, int):
            formed.append("[%d]" % part)
        else:
            formed.append("."+part)
    return "".join(formed)
        


src/a/s/astcheck-0.2.1/test_astcheck.py   astcheck(Download)
import ast
import astcheck
from astcheck import (assert_ast_like, is_ast_like, mkarg, format_path,
                      listmiddle, name_or_attr,
                     )
def test_format_path():
    assert format_path(['tree', 'body', 0, 'name']) == 'tree.body[0].name'
 
sample3_code = """
del a