import string
import random


def random_string(**kwargs):
    """
    By default generates a random string of 10 chars composed
    of digits and ascii lowercase letters. String length and pool can
    be override by using kwargs. Pool must be a list of strings
    """
    n = kwargs.get('length', 10)
    pool = kwargs.get('pool') or string.digits + string.ascii_lowercase
    return ''.join(random.SystemRandom().choice(pool) for _ in range(n))