def list_or_args(keys, args):
    # returns a single list combining keys and args
    try:
        iter(keys)
        # a string can be iterated, but indicates
        # keys wasn't passed as a list
        if isinstance(keys, basestring):
            keys = [keys]
    except __HOLE__:
        keys = [keys]
    if args:
        keys.extend(args)
    return keys
dataset/ETHPy150Open zhihu/redis-shard/redis_shard/shard.py/list_or_args