input: Write a function to generate a histogram for an array of data using Python. The function should take an array of numbers as input and generate a histogram with specified bin ranges. If the input array is empty, the function should not generate any histogram and simply return without error.
  
  import matplotlib.pyplot as plt
  
  def generate_histogram(data):
      if not data:
          return
      plt.hist(data, bins = [0, 20, 40, 60, 80, 100, 120, 140, 160], edgecolor = 'black')
      plt.xlabel('Range of values') 
      plt.ylabel('Number of Occurrences') 
      plt.title('Histogram of data') 
      plt.show()
  
  assert generate_histogram([3, 5, 7, 2, 8, 10, 11, 65, 72, 81, 99, 100, 150]) is None
  assert generate_histogram([]) is None
output: def generate_histogram(data):
      if not data:
          return
      plt.hist(data, bins=[0, 20, 40, 60, 80, 100, 120, 140, 160], edgecolor='black')
      plt.xlabel('Range of values')
      plt.ylabel('Number of Occurrences')
      plt.title('Histogram of data')
      plt.show()