input: Write a function to compute the average salary of people from a given dataset stored in a CSV file named 'salary.csv'. The CSV file contains two columns: 'name' and 'salary'. If the file is empty or contains invalid data, return 0.0. Otherwise, return the computed average salary.
  assert get_average_salary('salary.csv') == 2000.0
  assert get_average_salary('empty.csv') == 0.0
  assert get_average_salary('invalid.csv') == 0.0
  assert get_average_salary('salary_with_invalid_data.csv') == 0.0
output: def get_average_salary(filename):
      try:
          with open(filename, 'r') as file:
              reader = csv.DictReader(file)
              salaries = []
              for row in reader:
                  try:
                      salary = float(row['salary'])
                      salaries.append(salary)
                  except (ValueError, KeyError):
                      return 0.0
              if not salaries:
                  return 0.0
              return sum(salaries) / len(salaries)
      except (FileNotFoundError, csv.Error):
          return 0.0