input: Write a function to calculate the distance between two points on a two-dimensional plane. The function should take four parameters: x1, y1, x2, and y2, representing the coordinates of the two points. The function should return the distance between these two points. If any of the parameters are invalid (e.g., not numbers), the function should return -1.
  assert distance(3, 4, -9, -2)==13.601470508735444
  assert distance(0, 0, 0, 0)==0.0
  assert distance('a', 4, -9, -2)==-1
  assert distance(3, 4, 3, 4)==0.0
output: def distance(x1, y1, x2, y2):
      if not (isinstance(x1, (int, float)) and isinstance(y1, (int, float)) and isinstance(x2, (int, float)) and isinstance(y2, (int, float))):
          return -1
      return ((x2 - x1) ** 2 + (y2 - y1) ** 2) ** 0.5