input: Write a function to calculate the distance between two points on a two-dimensional plane. The function should take two tuples as input, where each tuple contains the x and y coordinates of a point. If the input is not valid (e.g., not tuples, not containing exactly two elements each), the function should return -1. The distance should be returned as a float.
  assert calculate_distance((3, 4), (-9, -2))==13.0
  assert calculate_distance((0, 0), (0, 0))==0.0
  assert calculate_distance((1, 2), (4, 6))==5.0
  assert calculate_distance((-1, -1), (1, 1))==2.8284271247461903
  assert calculate_distance((1,), (2, 3))==-1
  assert calculate_distance((1, 2, 3), (4, 5, 6))==-1
  assert calculate_distance((1, 2), "not a point")==-1
output: def calculate_distance(point1, point2):
      if not isinstance(point1, tuple) or not isinstance(point2, tuple) or len(point1) != 2 or len(point2) != 2:
          return -1
      x1, y1 = point1
      x2, y2 = point2
      return ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5