input: Write a function to compute the average salary of people from the dataset 'salary.csv'. The function should take the filename as an input parameter, read the CSV file, calculate the average salary, and return it. If the file is empty or if there is an error in reading the file, return 0.
  assert get_average_salary('salary.csv')==2000.0
  assert get_average_salary('empty_file.csv')==0
  assert get_average_salary('invalid_file.csv')==0
output: try:
      with open(filename, 'r') as file:
          lines = file.readlines()
          if not lines:
              return 0
          total_salary = 0
          count = 0
          for line in lines:
              try:
                  salary = float(line.strip())
                  total_salary += salary
                  count += 1
              except ValueError:
                  continue
          if count == 0:
              return 0
          return total_salary / count
  except FileNotFoundError:
      return 0
  except Exception:
      return 0