input: Write a function to refactor and optimize the provided Python code snippet for determining the commission rate based on gross sales. If the gross sales are 10000 or more, the commission rate should be 0.1. If the gross sales are between 5000 (inclusive) and 10000 (exclusive), the commission rate should be 0.07. If the gross sales are less than 5000, the commission rate should be 0.05. The function should directly return the commission rate instead of assigning it to a variable first.
  assert determine_commission_rate(12000)==0.1
  assert determine_commission_rate(7500)==0.07
  assert determine_commission_rate(4500)==0.05
output: def determine_commission_rate(gross_sales):
      if gross_sales >= 10000:
          return 0.1
      elif gross_sales >= 5000:
          return 0.07
      else:
          return 0.05