input: Write a function to generate sample data for a web application using Python's faker library. The function should return a list of dictionaries, where each dictionary contains three keys: 'name', 'email', and 'age'. The 'age' value should be a random integer between 18 and 60. The function should take an integer parameter 'num_samples' that specifies the number of sample records to generate.
  assert generate_sample_data(3)==[{'name': 'John Doe', 'email': 'john.doe@example.com', 'age': 25}, {'name': 'Jane Smith', 'email': 'jane.smith@fakeemail.com', 'age': 45}, {'name': 'Alice Johnson', 'email': 'alice.johnson@test.org', 'age': 30}]
  assert generate_sample_data(0)==[]
  assert generate_sample_data(1)==[{'name': 'Emily Davis', 'email': 'emily.davis@example.net', 'age': 50}]
  assert generate_sample_data(-1)==[]
  assert generate_sample_data(5)==[{'name': 'Michael Brown', 'email': 'michael.brown@fake.com', 'age': 33}, {'name': 'Olivia Wilson', 'email': 'olivia.wilson@testemail.org', 'age': 22}, {'name': 'William Taylor', 'email': 'william.taylor@example.com', 'age': 41}, {'name': 'Sophia Anderson', 'email': 'sophia.anderson@fakeemail.net', 'age': 18}, {'name': 'James Martinez', 'email': 'james.martinez@test.com', 'age': 29}]
output: 
  def generate_sample_data(num_samples):
      from faker import Faker
      import random
      fake = Faker()
      return [{'name': fake.name(), 'email': fake.email(), 'age': random.randint(18, 60)} for _ in range(max(0, num_samples))]
  