from datetime import datetime
import json


def _get_timepoints_from_json(json_str):
    """
        Get TIMEPOINTS list from JSON string.

        Expected JSON looks like:
        ```json
        [
          ["0:00", "5:59"],
          ["6:00", "11:59"],
          ["12:00", "17:59"],
          ["18:00", "24:00"]
        ]
        ```
    """

    return json_str and \
        [tuple(datetime.strptime(t, '%H:%M').time() for t in pair)
         for pair
         in json.loads(json_str)]