Write a Python function is uuid(obj, version=4) that checks whether a given value represents a valid UUID of…
Write a Python function is uuid(obj, version=4) that checks whether a given value represents a valid UUID of…: a task in repo2rlenv-r2e (Harbor dataset). Behavior: - The function accepts a uuid.UUID object or a string as obj . Any other type (e.g., None , int ) should return False . - String…
The task
Behavior: - The function accepts a `uuid.UUID` object or a string as `obj`. Any other type (e.g., `None`, `int`) should return `False`. - String inputs are parsed as UUIDs; hyphens are optional and matching is case-insensitive. If the string cannot be parsed as a UUID, return `False`. - The `version` parameter…
Part of FineEnvs/repo2rlenv-r2e.