<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def samples(*sets):
 """Generate samples from the given sets using their ``examples`` method. Parameters Set(s) from which to generate the samples. Returns ------- samples : `generator` Generator that yields tuples of examples from the sets. Examples -------- """

    if len(sets) == 1:
        for example in sets[0].examples:
            yield example
    else:
        generators = [set_.examples for set_ in sets]
        for examples in product(*generators):
            yield examples