def convert_result(r):
if (isinstance(r, collections.Sequence) and<EOL>not isinstance(r, string_types)):<EOL><INDENT>rs = []<EOL>for subresult in r:<EOL><INDENT>rs.append(convert_result(subresult))<EOL><DEDENT>return rs<EOL><DEDENT>if isinstance(r, ipyparallel.AsyncResult):<EOL><INDENT>r = r.r<EOL><DEDENT>if isinstance(r, Ref):<EOL><INDENT>RemoteClass = distob.engine.proxy_types[r.type]<EOL>r = RemoteClass(r)<EOL><DEDENT>return r<EOL>
Waits for and converts any AsyncResults. Converts any Ref into a Remote.
    Args:
      r: can be an ordinary object, ipyparallel.AsyncResult, a Ref, or a
        Sequence of objects, AsyncResults and Refs.
    Returns: 
      either an ordinary object or a Remote instance