def list_ngrams(token_list, n=<NUM_LIT:1>, join='<STR_LIT:U+0020>'):
join = '<STR_LIT:U+0020>' if join is True else join<EOL>if isinstance(join, str):<EOL><INDENT>return [join.join(ng) for ng in list_ngrams(token_list, n=n, join=False)]<EOL><DEDENT>return list(zip(*[token_list[i:] for i in range(n)]))<EOL>
Return a list of n-tuples, one for each possible sequence of n items in the token_list

    Arguments:
      join (bool or str): if str, then join ngrom tuples on it before returning
         True is equivalent to join=' '
         default = True

    See: http://stackoverflow.com/a/30609050/623735

    >>> list_ngrams('goodbye cruel world'.split(), join=False)
    [('goodbye',), ('cruel',), ('world',)]
    >>> list_ngrams('goodbye cruel world'.split(), 2, join=False)
    [('goodbye', 'cruel'), ('cruel', 'world')]