input: from typing import Optional
  
  def determine_commission_rate(gross_sales: float) -> Optional[float]:
      """Determine the commission rate based on the amount of gross sales.
      If the gross sales are greater than or equal to 10000, the commission rate is 0.1.
      If the gross sales are between 5000 (inclusive) and 10000, the commission rate is 0.07.
      If the gross sales are less than 5000, the commission rate is 0.05.
      Returns the commission rate or None if invalid input is given.
      
      >>> determine_commission_rate(12000)
      0.1
      >>> determine_commission_rate(7500)
      0.07
      >>> determine_commission_rate(4000)
      0.05
      >>> determine_commission_rate(-1000)
      """
      if gross_sales >= 10000:
          return 0.1
      elif gross_sales >= 5000:
          return 0.07
      elif gross_sales >= 0:
          return 0.05
      else:
          return None
output:     if gross_sales >= 10000:
          return 0.1
      elif gross_sales >= 5000:
          return 0.07
      elif gross_sales >= 0:
          return 0.05
      else:
          return None