def imapmethod(methodname, *iterables):
    """
    If methodname is a string, make an iterator that calls the method
    on each of the iterables named methodname with no
    arguments. Otherwise, make an iterator that calls the method on
    each of the iterables named by the corresponding element in
    methodname.
    
    >>> a = ["aBrA", "cAdAbRa"]
    >>> b = ["aLa", "kAzAm"]
    >>> it1 = imapmethod("title", a)
    >>> it1.next()
    'Abra'
    >>> it1.next()
    'Cadabra'
    >>> it2 = imapmethod(("upper", "lower"), a, b)
    >>> it2.next()
    ('ABRA', 'ala')
    >>> it2.next()
    ('CADABRA', 'kazam')
    """
    def methodcall(item):
        return getattr(item, methodname)()

    if isinstance(methodname, str):
        if len(iterables) == 1:
            return itertools.imap(methodcall, *iterables)
        else:
            return imapzip(itertools.imap, [methodcall] * len(iterables), iterables)
    else:
        return imapzip(imapmethod, methodname, iterables)

    If methodname is a string, make an iterator that calls the method
    on each of the iterables named methodname with no
    arguments. Otherwise, make an iterator that calls the method on
    each of the iterables named by the corresponding element in
    methodname.
    
    >>> a = ["aBrA", "cAdAbRa"]
    >>> b = ["aLa", "kAzAm"]
    >>> it1 = imapmethod("title", a)
    >>> it1.next()
    'Abra'
    >>> it1.next()
    'Cadabra'
    >>> it2 = imapmethod(("upper", "lower"), a, b)
    >>> it2.next()
    ('ABRA', 'ala')
    >>> it2.next()
    ('CADABRA', 'kazam')
    
recipes/Python/231504_imapmethod_and_friends/recipe-231504.py