@staticmethod
def _convert_to_time_range(interval):
    'Convert an interval timestamp into start and end dates.\n\n        Args:\n            interval: Time frame representation\n\n        Returns:\n            Start timestamp in string format.\n            End timestamp in string format.\n        '
    TS_FORMAT = '%Y-%m-%dT%H:%M:%S'
    get_digits = (lambda s: int(''.join(filter(str.isdigit, s))))
    get_alpha = (lambda s: ''.join(filter(str.isalpha, s)))
    ts_parts = interval.split(' ')
    start = ' '.join(ts_parts[0:(len(ts_parts) - 2)])
    minus = get_digits(ts_parts[(- 2)])
    plus = get_digits(ts_parts[(- 1)])
    interval = get_alpha(ts_parts[(- 1)])
    start_ts = parser.parse(start)
    rd = relativedelta.relativedelta
    if (interval == 's'):
        start_range = (start_ts - rd(seconds=minus))
        end_range = (start_ts + rd(seconds=plus))
    elif (interval == 'm'):
        start_range = (start_ts - rd(minutes=minus))
        end_range = (start_ts + rd(minutes=plus))
    elif (interval == 'h'):
        start_range = (start_ts - rd(hours=minus))
        end_range = (start_ts + rd(hours=plus))
    elif (interval == 'd'):
        start_range = (start_ts - rd(days=minus))
        end_range = (start_ts + rd(days=plus))
    else:
        raise RuntimeError(('Unable to parse the timestamp: ' + str(interval)))
    return (start_range.strftime(TS_FORMAT), end_range.strftime(TS_FORMAT))
Convert an interval timestamp into start and end dates.

Args:
    interval: Time frame representation

Returns:
    Start timestamp in string format.
    End timestamp in string format.
@staticmethod
def _convert_to_time_range(interval):
    'Convert an interval timestamp into start and end dates.\n\n        Args:\n            interval: Time frame representation\n\n        Returns:\n            Start timestamp in string format.\n            End timestamp in string format.\n        '
    TS_FORMAT = '%Y-%m-%dT%H:%M:%S'
    get_digits = (lambda s: int(.join(filter(str.isdigit, s))))
    get_alpha = (lambda s: .join(filter(str.isalpha, s)))
    ts_parts = interval.split(' ')
    start = ' '.join(ts_parts[0:(len(ts_parts) - 2)])
    minus = get_digits(ts_parts[(- 2)])
    plus = get_digits(ts_parts[(- 1)])
    interval = get_alpha(ts_parts[(- 1)])
    start_ts = parser.parse(start)
    rd = relativedelta.relativedelta
    if (interval == 's'):
        start_range = (start_ts - rd(seconds=minus))
        end_range = (start_ts + rd(seconds=plus))
    elif (interval == 'm'):
        start_range = (start_ts - rd(minutes=minus))
        end_range = (start_ts + rd(minutes=plus))
    elif (interval == 'h'):
        start_range = (start_ts - rd(hours=minus))
        end_range = (start_ts + rd(hours=plus))
    elif (interval == 'd'):
        start_range = (start_ts - rd(days=minus))
        end_range = (start_ts + rd(days=plus))
    else:
        raise RuntimeError(('Unable to parse the timestamp: ' + str(interval)))
    return (start_range.strftime(TS_FORMAT), end_range.strftime(TS_FORMAT))