| f | import random | f | import random | 
            | n | from collections.abc import Iterable | n | from collections.abc import Sequence, Iterable | 
            |  | from collections.abc import Sequence |  |  | 
            |  |  |  |  | 
            |  | def rnd(a, b=None): |  | def rnd(a, b=None): | 
            |  | match (a, b): |  | match (a, b): | 
            |  | case [int(), None]: |  | case [int(), None]: | 
            |  | return random.randint(0, a) |  | return random.randint(0, a) | 
            |  | case [int(), int()]: |  | case [int(), int()]: | 
            |  | return random.randint(a, b) |  | return random.randint(a, b) | 
            |  | case [float(), int() | float()]: |  | case [float(), int() | float()]: | 
            |  | return random.uniform(a, b) |  | return random.uniform(a, b) | 
            |  | case [str(), int()]: |  | case [str(), int()]: | 
            | t | start = random.randint(0, len(a) - b) | t | x = random.randint(0, len(a) - b) | 
            |  | return a[start:start + b] |  | return a[x:x + b] | 
            |  | case [str(), None]: |  | case [str(), None]: | 
            |  | return random.choice(a.split()) |  | return random.choice(a.split()) | 
            |  | case [str(), str()]: |  | case [str(), str()]: | 
            |  | return random.choice(a.split(b)) |  | return random.choice(a.split(b)) | 
            |  | case [Iterable(), None]: |  | case [Iterable(), None]: | 
            |  | return random.choice(list(a)) |  | return random.choice(list(a)) | 
            |  | case [Iterable(), int()]: |  | case [Iterable(), int()]: | 
            |  | return random.choices(list(a), k=b) |  | return random.choices(list(a), k=b) |