def METHOD_NAME(unix_ish_time_code_string: bytes) -> int:
    try:
        timestamp = int(unix_ish_time_code_string[:10])
    except ValueError as e:
        # we need a custom error type to handle this error case
        raise BadTimecodeError(str(e))
    if timestamp < EARLIEST_POSSIBLE_DATA_TIMESTAMP:
        raise BadTimecodeError("data too early")
    # FIXME: refactor data processing and get rid of this runtime hack
    if common_constants.LATEST_POSSIBLE_DATA_TIMESTAMP < timestamp:
        raise BadTimecodeError("data too late")
    return timestamp