<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _create_interval_filter(interval):
 """Returns a function that checkes whether a number belongs to an interval. Args: interval: A tensorboard.hparams.Interval protobuf describing the interval. Returns: A function taking a number (a float or an object of a type in six.integer_types) that returns True if the number belongs to (the closed) 'interval'. """

  def filter_fn(value):
    if (not isinstance(value, six.integer_types) and
        not isinstance(value, float)):
      raise error.HParamsError(
          'Cannot use an interval filter for a value of type: %s, Value: %s' %
          (type(value), value))
    return interval.min_value <= value and value <= interval.max_value

  return filter_fn