code: def _check_make_function_instrs(load_code_instr,
                                  load_name_instr,
                                  make_function_instr,
                                  *,
                                  expect_lambda=False):
      
  
      # Validate load_code_instr.
      if not isinstance(load_code_instr, instrs.LOAD_CONST):
          raise TypeError(
              "make_function expected 'load_code_instr` to be a "
              "LOAD_CONST, but got %s" % load_code_instr,
          )
      if not isinstance(load_code_instr.arg, types.CodeType):
          raise TypeError(
              "make_function expected load_code_instr "
              "to load a code object, but got %s" % load_code_instr.arg,
          )
  
      # Validate load_name_instr
      if not isinstance(load_name_instr, instrs.LOAD_CONST):
          raise TypeError(
              "make_function expected 'load_name_instr` to be a "
              "LOAD_CONST, but got %s" % load_code_instr,
          )
  
      if not isinstance(load_name_instr.arg, str):
          raise TypeError(
              "make_function expected load_name_instr "
              "to load a string, but got %r instead" % load_name_instr.arg
          )
  
      # This is an endswith rather than '==' because the arg is the
      # fully-qualified name.
      is_lambda = is_lambda_name(load_name_instr.arg)
      if expect_lambda and not is_lambda:
          raise ValueError(
              "Expected to make a function named <lambda>, but "
              "got %r instead." % load_name_instr.arg
          )
      if not expect_lambda and is_lambda:
          raise ValueError("Unexpectedly received lambda function.")
  
      # Validate make_function_instr
      if not isinstance(make_function_instr, (instrs.MAKE_FUNCTION,
                                              instrs.MAKE_CLOSURE)):
          raise TypeError(
              "make_function expected a MAKE_FUNCTION or MAKE_CLOSURE"
              "instruction, but got %s instead." % make_function_instr
          )
docs: Validate the instructions passed to a make_function call.