def METHOD_NAME(vw, fromva, tova, trim=True):
    """
    Return a list of paths, where each path is a list
    of code blocks from fromva to tova.
    Usage: getCodePaths(vw, <fromva>, <tova>) -> [ [frblock, ..., toblock], ...]
    NOTE: "trim" causes an optimization which may not reveal *all* the paths,
          but is much faster to run.  It will never return no paths when there
          are some, but may not return all of them... (based on path overlap)
    """
    done = {}
    res = []
    frcb = vw.getCodeBlock(fromva)
    tocb = vw.getCodeBlock(tova)
    if frcb is None:
        raise viv_exc.InvalidLocation(fromva)
    if tocb is None:
        raise viv_exc.InvalidLocation(tova)
    frva = frcb[0] # For compare speed
    root = vg_path.newPathNode(cb=tocb, cbva=tocb[0])
    todo = [root, ]
    done[tova] = tocb
    cbcache = {}
    while len(todo):
        path = todo.pop()
        cbva = vg_path.getNodeProp(path, 'cbva')
        codeblocks = cbcache.get(cbva)
        if codeblocks is None:
            codeblocks = getCodeFlow(vw, cbva)
            cbcache[cbva] = codeblocks
        for cblock in codeblocks:
            bva,bsize,bfva = cblock
            # Don't follow loops...
            if vg_path.isPathLoop(path, 'cbva', bva):
                continue
            # If we have been here before and it's *not* the answer,
            # skip out...
            if trim and done.get(bva) is not None:
                continue
            done[bva] = cblock
            newpath = vg_path.newPathNode(parent=path, cb=cblock, cbva=bva)
            # If this one is a match, we don't need to
            # track past it.  Also, put it in the results list
            # so we don't have to do it later....
            if bva == frva:
                #res.append(newpath)
                fullpath = vg_path.getPathToNode(newpath)
                # We actually do it by inbound references, so reverse the result!
                fullpath.reverse()
                yield [vg_path.getNodeProp(path, 'cb') for path in fullpath]
            else:
                todo.append(newpath)