human
I wrote the below code

    def expand(r):
        if (r.owner and (r not in i)):
            l = (list(r.owner.inputs) + list(r.owner.outputs))
            l.reverse()
            return l
    variables = stack_search(deque(o), expand, 'dfs')
    orphans = [r for r in variables if ((r.owner is None) and (r not in i))]
    return (variables, orphans)

What's a good function header?
 Here's a good function header?
assistant
#Here's a good function header.

def variables_and_orphans(i, o):