input: Write a python function to fetch JSON data from a given URL and return it.
  assert fetch_json_data('https://api.example.com/data') == {'key1': 'value1', 'key2': 'value2'}
  assert fetch_json_data('https://api.example.com/anotherdata') == {'data': [1, 2, 3], 'status': 'ok'}
  assert fetch_json_data('https://api.example.com/nodata') == {'error': 'not found'}
output: import requests
  
  def fetch_json_data(url):
      response = requests.get(url)
      return response.json()