input: Write a function to generate a random string of given length using characters from the specified set.
  assert len(generate_random_string(5, 'abc')) == 5
  assert all(c in 'abc' for c in generate_random_string(5, 'abc'))
  assert len(generate_random_string(10, 'xyz')) == 10
output: import random
  
  def generate_random_string(length, char_set):
      return ''.join(random.choice(char_set) for _ in range(length))