def find_iteration(<EOL>url: Union[methods, str],<EOL>itermode: Optional[str] = None,<EOL>iterkey: Optional[str] = None,<EOL>) -> Tuple[str, str]:
if isinstance(url, methods):<EOL><INDENT>if not itermode:<EOL><INDENT>itermode = url.value[<NUM_LIT:1>]<EOL><DEDENT>if not iterkey:<EOL><INDENT>iterkey = url.value[<NUM_LIT:2>]<EOL><DEDENT><DEDENT>if not iterkey or not itermode:<EOL><INDENT>raise ValueError("<STR_LIT>".format(url))<EOL><DEDENT>elif itermode not in ITERMODE:<EOL><INDENT>raise ValueError("<STR_LIT>".format(itermode))<EOL><DEDENT>return itermode, iterkey<EOL>
Find iteration mode and iteration key for a given :class:`slack.methods`

Args:
    url: :class:`slack.methods` or string url
    itermode: Custom iteration mode
    iterkey: Custom iteration key

Returns:
    :py:class:`tuple` (itermode, iterkey)