def call_tip(oinfo, format_call=True):
<EOL>argspec = oinfo.get('<STR_LIT>')<EOL>if argspec is None:<EOL><INDENT>call_line = None<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>has_self = argspec['<STR_LIT:args>'][<NUM_LIT:0>] == '<STR_LIT>'<EOL><DEDENT>except (KeyError, IndexError):<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>if has_self:<EOL><INDENT>argspec['<STR_LIT:args>'] = argspec['<STR_LIT:args>'][<NUM_LIT:1>:]<EOL><DEDENT><DEDENT>call_line = oinfo['<STR_LIT:name>']+format_argspec(argspec)<EOL><DEDENT>doc = oinfo.get('<STR_LIT>')<EOL>if doc is None:<EOL><INDENT>doc = oinfo.get('<STR_LIT>')<EOL><DEDENT>if doc is None:<EOL><INDENT>doc = oinfo.get('<STR_LIT>','<STR_LIT>')<EOL><DEDENT>return call_line, doc<EOL>
Extract call tip data from an oinfo dict.

    Parameters
    ----------
    oinfo : dict

    format_call : bool, optional
      If True, the call line is formatted and returned as a string.  If not, a
      tuple of (name, argspec) is returned.

    Returns
    -------
    call_info : None, str or (str, dict) tuple.
      When format_call is True, the whole call information is formattted as a
      single string.  Otherwise, the object's name and its argspec dict are
      returned.  If no call information is available, None is returned.

    docstring : str or None
      The most relevant docstring for calling purposes is returned, if
      available.  The priority is: call docstring for callable instances, then
      constructor docstring for classes, then main object's docstring otherwise
      (regular functions).