def parse_example(basepath, filename, img_folder, img_folder_os):
    path = os.path.join(basepath, filename)
    with open(path) as f:
        content = f.read().strip()
    n = ast.parse(content)
    docstring = ast.get_docstring(n)
    if docstring == None:
        return []

    # Header
    s = [filename, "".ljust(len(filename), '-')]
    
    # Location 
    folder = os.path.basename(basepath)
    s.append((folder, filename) % "Location: *%s/%s*")
    
    # Docstring
    s.append("")
    s.append(docstring)
    s.append("")
    
    # Screenshot
    img_name,_ = os.path.splitext(filename)
    img_name += ".png"
    if img_folder != None:
        #print os.path.abspath(img_folder)
        #print os.path.abspath(img_folder_os)
        img_path = os.path.join(img_folder, img_name)
        img_path_os = os.path.join(img_folder_os, img_name)
        if os.path.isfile(img_path_os):
            s.append("")
            s.append(".. image:: " + img_path)
            s.append("")
            
    s.append("")
    return s
dataset/ETHPy150Open estevaofon/angry-birds-python/pymunk-4.0.0/docs/src/ext/autoexample.py/parse_example/swapped operands of `%`