Using attrs , implement a RankedRecord class and a factory function build ranked field that creates an attrs…
Using attrs , implement a RankedRecord class and a factory function build ranked field that creates an attrs…: a task in repo2rlenv-code-instruct (Harbor dataset). build ranked field(ranking) should use attrs.cmp using to produce a field whose comparison operators rank values according to the…
The task
`build_ranked_field(ranking)` should use `attrs.cmp_using` to produce a field whose comparison operators rank values according to the provided `ranking` dict (lower rank value = "less than"). Two values with the same rank are equal; comparisons between values not sharing a type should return `NotImplemented`.
Part of FineEnvs/repo2rlenv-code-instruct.