FineEnvs/repo2rlenv-r2e
repo2rlenv-r2e: Harbor dataset on Hugging Face with 100 tasks. Author equivalence tests around repository functions, measure their execution and coverage remotely, and export function-reconstruction tasks with the original implementation as reference. Contains 100 Harbor tasks generated with the…
Tasks
- Implement a decorator factory called ttl cache that wraps a function with a memoizing callable combining LRU eviction with a per-item…
- Implement a Python decorator factory called cached that memoizes any function using a caller-provided cache mapping.
- Write a Python function format exp repr(obj, pos names, req names=None, opt names=None, opt key=None) that produces a…
- Implement a Python function base64 encode(string: str bytes) - bytes that encodes its input using the URL-safe Base64 alphabet and returns…
- Write a Python function called random permutation(iterable, r=None) that returns a randomly ordered tuple of r elements drawn without…
- Write a Python generator function called random ordered range that accepts the same arguments as the built-in range() (i.e., one, two, or…
- Write a Python function called frange that behaves like the built-in range() but works with floating-point values and always returns a…
- Implement a Python function called base64 decode that decodes a URL-safe Base64-encoded value.
- Implement a function is instance of cmp that takes a single argument types , which is either a single Python type or a tuple of Python…
- Write a Python function is uuid(obj, version=4) that checks whether a given value represents a valid UUID of a specific version.
- Write a Python function called pairwise(src, end= UNSET) that takes an iterable src and an optional end sentinel value, and returns a list…
- Write a Python generator function called map if that conditionally transforms items from an iterable based on a predicate.
- Implement a Python function split(sql: str, encoding: str None = None, strip semicolon: bool = False) - list str that takes a SQL string…
- Write a Python function called soft sorted(iterable, first=None, last=None, key=None, reverse=False) that sorts an iterable while allowing…
- Implement a Python function find delimited spans(text: str) - DelimitedSpans that scans a SQL string for the positions of PostgreSQL…
- Implement a Python function called zip object deep that builds a deeply nested dictionary from dot-notation path keys and corresponding…
- Implement a Python generator function named xfrange with the signature xfrange(stop, start=None, step=1.0) that yields floating-point…
- Write a Python function called resolve path parts that normalizes a URL path by resolving '.' and '..' segments according to RFC 3986…
- Implement a Python generator function named split iter(src, sep=None, maxsplit=None) that lazily splits an iterable into sublists of…
- Write a Python generator function called flatten that recursively flattens an arbitrarily nested iterable into a single-level sequence of…
- Implement a method methodkey(self, args, kwargs) on a class that generates a hashable cache key suitable for use with cached instance…
- Implement a Python generator function called unique iter(src, key=None) that yields elements from an iterable src in their original order…
- Write a Python function called expandpath that accepts a single argument path (a string or path-like object) and returns a string with…
- Implement a public function parse(sql: str, encoding: str None = None) - tuple in a Python module.
- Write a Python generator function called filter map that takes two arguments: a callable func and an iterable . The function should apply…
- Implement a Python function called over args(func, transforms) that returns a callable wrapper. When the returned callable is called with…
- Write a Python function called interpreter version that returns the current Python interpreter's version as a numeric string with no dot…
- Implement a decorator factory called rr cache that wraps a function with a memoizing callable using a Random Replacement (RR) cache…
- Write a Python generator function called duplicates everseen that takes an iterable and an optional key callable, and yields every element…
- Implement a function ranges are prerelease only(ranges) that takes a sequence of version intervals and returns a boolean indicating…
- Implement a public function hashkey( args, kwargs) that produces a hashable cache key from any combination of positional and keyword…
- Write a Python function called second that takes a single argument seq , which can be any iterable (such as a list, tuple, string…
- Write a Python function called group by keys that takes two arguments: get keys and seq . The function should group items from seq into a…
- Implement a Python function named includes that checks whether a given target value is present in a collection (either a sequence or a…
- Write a Python function named generic tags that generates packaging tags for a non-CPython (or any generic) interpreter.
- Implement a public function filter(pred, seq) that behaves like an extended version of Python's built-in filter() . It must accept a…
- Write a Python function called omit(mapping, keys) that returns a new object with all key-value pairs from mapping whose keys are NOT…
- Write a Python function called cache that acts as a decorator factory providing in-memory result caching for the decorated function.
- Implement a public function default environment() - dict (typed as returning an Environment TypedDict or equivalent) that takes no…
- Write a Python function called split unquoted newlines(stmt) that splits a string on all unquoted newline characters (\n, \r, or \r\n)…
- Write a Python generator function called unique in window that filters items from an iterable, yielding only those items that have not…
- Implement a method typedmethodkey(self, args, kwargs) that generates a typed cache key suitable for use with cached methods.
- Write a Python generator function called collapse that recursively flattens an arbitrarily nested iterable into a flat sequence of leaf…
- Implement a function called unique that takes an iterable src and an optional key parameter (defaulting to None ), and returns a list of…
- Implement a Python generator function named cpython tags that yields compatibility tags for the CPython interpreter.
- Write a Python function called running statistics that takes an iterable of orderable numeric values and an optional keyword argument…
- Write a Python function called subslices that takes a single argument iterable (any iterable such as a list, tuple, string, generator, or…
- Write a Python function called dt to timestamp that converts a datetime.datetime object into a Unix timestamp (a float representing…
- Implement a Python decorator factory called lfu cache that memoizes the return values of the decorated function using a Least Frequently…
- Implement a decorator factory called lru cache that wraps a callable with memoization using a Least Recently Used (LRU) eviction policy.
- Implement a function called a10n that takes a single string argument and returns its numeronym form. A numeronym replaces the middle…
- Implement a public function named tokenize that accepts a SQL string (or byte string) and an optional encoding parameter, and returns a…
- Write a Python function called remove quotes that takes a single argument val , which can be either a string or None .
- Implement a function get all subclasses(cls) that, given a class object cls , returns a flat list of every class that directly or…
- Implement a Python generator function called iterate that takes a callable f and an initial value x , and yields an infinite sequence…
- Write a function called subdict(d, keep=None, drop=None) that returns a filtered copy of the dictionary d containing only the entries…
- Write a Python generator function called partitions that accepts a single argument iterable and yields every possible order-preserving…
- Implement a Python function called empty that accepts a single argument coll (a collection or iterator) and returns a new, empty…
- Implement a Python generator function called iterate that takes two arguments: a callable func and an initial value start . The function…
- Implement a function is normalized name(name: str) - bool that checks whether a given string is a normalized project name.
- Implement a Python function called identity that takes a single argument of any type and returns it unchanged. The function must return…
- Write a Python function called consume(iterator, n) that advances a given iterator by n steps in-place, discarding the elements it skips…
- Write a Python function called padded that takes an iterable and yields all of its elements followed by a fill value, ensuring that at…
- Write a Python function called unique to each that accepts any number of iterables as positional arguments and returns a list of lists…
- Write a Python function called re find that searches for the first occurrence of a regular expression pattern in a string and returns the…
- Write a Python function called constantly that takes a single argument x of any type and returns a new callable. The returned callable…
- Write a Python function called consume that advances an iterator by a specified number of steps without returning any values, effectively…
- Implement a public function called typedkey that accepts any number of positional arguments ( args ) and keyword arguments ( kwargs ) and…
- Write a Python function called chunked(src, size, count=None, kw) that splits any iterable into a list of consecutive chunks.
- Write a Python function called polynomial derivative that takes a single argument coefficients , a list of numeric values representing…
- Implement a function is valid pylock path(path: Path) - bool in a Python module.
- Write a Python generator function called substrings that takes a single argument iterable and yields all contiguous sub-sequences of the…
- Implement a function parse qsl(qs, keep blank values=True, encoding=DEFAULT ENCODING) that converts a URL query string into a list of…
- Implement a decorator factory called fifo cache that wraps a function with memoization using a First In First Out (FIFO) cache eviction…
- Write a Python function called dir dict(obj, raise exc=False) that returns a plain dict mapping every attribute name to its resolved value…
- Write a Python function called group order that takes a single argument tlist , which is a sqlparse TokenList object (such as a parsed SQL…
- Implement a Python function is object(value: Any) - bool that returns True if the given value is an instance of list or dict , and False…
- Implement a Python generator function tree nodes(root, follow=is seqcont, children=iter) that traverses a tree-like nested structure and…
- Write a Python generator function called chunked iter(src, size, kw) that splits an iterable src into successive non-overlapping chunks of…
- Implement a function named imt(token, i=None, m=None, t=None) that checks whether a given token satisfies at least one of three optional…
- Write a Python function called flatten that accepts a single argument, list of lists , which is an iterable of iterables (such as a list…
- Write a Python function called escape shell args(args, sep=' ', style=None) that takes a list of string arguments, escapes each one for…
- Implement a Python function called parsestream with the following signature:
- Implement a function called is text serializer that accepts a single argument — a serializer object — and returns a boolean indicating…
- Write a Python function called strip ansi(text) that removes ANSI escape codes from the given text and returns the cleaned text.
- Write a Python function int ranges from int list(range string, delim=',', range delim='-') that converts a string of positive integers and…
- Write a Python function called nth that takes two parameters: an integer n and a sequence or iterable seq , and returns the element at…
- Write a Python function to lower(text) that accepts a single argument of any type and returns a lower-case string representation of that…
- Implement a Python generator function called classify unique that takes an iterable and an optional key callable, and for each element…
- Write a Python function called dotproduct that takes two iterables of numeric values ( vec1 and vec2 ) and returns their dot product — the…
- Write a Python function called flatten url params that normalises URL query parameters into a flat list of (key, value) tuples.
- Implement a function format(sql: str, encoding: str None = None, options) - str that formats a SQL string according to configurable…
- Implement a function called reg exp js match(text, reg exp) that searches a string for matches using a JavaScript-style regular expression…
- Write a Python generator function called split after that takes an iterable, a predicate callable, and an optional integer maxsplit…
- Write a Python function called with prev that takes an iterable seq and an optional fill parameter (defaulting to None ). The function…
- Write a Python function called gobs program that takes no arguments and runs an infinite loop. On every iteration of the loop, it should…
- Write a Python generator function called tree leaves that performs a depth-first traversal of a tree represented as arbitrarily nested…
- Write a Python function called flip that swaps the keys and values of a mapping or collection of pairs.
- Write a Python function called augpath that takes a file path string (or path-like object) and returns a new path string with optionally…
- Write a Python function called rcurry that transforms a callable into a chain of single-argument functions, collecting arguments from…