input: Write a python function to generate a random password with given size and given characters.
  assert len(generate_pass(8)) == 8
  assert len(generate_pass(12)) == 12
  assert any(char in string.ascii_uppercase for char in generate_pass(8))
  assert any(char in string.ascii_lowercase for char in generate_pass(8))
  assert any(char in string.digits for char in generate_pass(8))
  assert any(char in string.punctuation for char in generate_pass(8))
output: import random
  import string
  
  def generate_pass(size):
      all_chars = string.ascii_letters + string.digits + string.punctuation
      password = ''.join(random.choice(all_chars) for _ in range(size))
      
      # Ensure the password includes at least one of each required character type
      while not (any(char in string.ascii_uppercase for char in password) and
                 any(char in string.ascii_lowercase for char in password) and
                 any(char in string.digits for char in password) and
                 any(char in string.punctuation for char in password)):
          password = ''.join(random.choice(all_chars) for _ in range(size))
      
      return password