{"record":{"id":"10984988365e766b","repo":"microsoft/qlib","slug":"please-implement-the-is-single-value-func-for-reg","errorCode":null,"errorMessage":"please implement the is_single_value func for {region}","messagePattern":"please implement the is_single_value func for (.+?)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"qlib/utils/time.py","lineNumber":111,"sourceCode":"        if start_time.hour == 11 and start_time.minute == 29 and start_time.second == 0:\n            return True\n        if start_time.hour == 14 and start_time.minute == 59 and start_time.second == 0:\n            return True\n        return False\n    elif region == REG_TW:\n        if end_time - start_time < freq:\n            return True\n        if start_time.hour == 13 and start_time.minute >= 25 and start_time.second == 0:\n            return True\n        return False\n    elif region == REG_US:\n        if end_time - start_time < freq:\n            return True\n        if start_time.hour == 15 and start_time.minute == 59 and start_time.second == 0:\n            return True\n        return False\n    else:\n        raise NotImplementedError(f\"please implement the is_single_value func for {region}\")\n\n\nclass Freq:\n    NORM_FREQ_MONTH = \"month\"\n    NORM_FREQ_WEEK = \"week\"\n    NORM_FREQ_DAY = \"day\"\n    NORM_FREQ_MINUTE = \"min\"  # using min instead of minute for align with Qlib's data filename\n    SUPPORT_CAL_LIST = [NORM_FREQ_MINUTE, NORM_FREQ_DAY]  # FIXME: this list should from data\n\n    def __init__(self, freq: Union[str, \"Freq\"]) -> None:\n        if isinstance(freq, str):\n            self.count, self.base = self.parse(freq)\n        elif isinstance(freq, Freq):\n            self.count, self.base = freq.count, freq.base\n        else:\n            raise NotImplementedError(f\"This type of input is not supported\")\n\n    def __eq__(self, freq):","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/utils/time.py#L93-L129","documentation":"Error \"please implement the is_single_value func for {region}\" thrown in microsoft/qlib.","triggerScenarios":"This error is raised at qlib/utils/time.py:111 when the guard condition fails: \"please implement the is_single_value func\". It triggers when the code path receives input or a state that violates the precondition checked at this point — e.g. an unimplemented abstract method being called, an unsupported argument type/value, or an invalid configuration. To avoid it, satisfy the documented precondition before this call: implement the required method in your subclass, or pass a supported value of the expected type as described by the message.","commonSituations":"See trigger scenarios.","solutions":["Implement the `is_single_value` function for your custom region's time utility class.","Use a built-in region whose time utility already implements `is_single_value`."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}