code: def is_invalid_test(
      name, original_argspec, given_arguments, given_kwargs
  ):
      """Check the arguments to ``@given`` for basic usage constraints.
  
      Most errors are not raised immediately; instead we return a dummy test
      function that will raise the appropriate error if it is actually called.
      When the user runs a subset of tests (e.g via ``pytest -k``), errors will
      only be reported for tests that actually ran.
      """
  
      def invalid(message):
          def wrapped_test(*arguments, **kwargs):
              raise InvalidArgument(message)
  
          wrapped_test.is_hypothesis_test = True
          return wrapped_test
  
      if not (given_arguments or given_kwargs):
          return invalid(
              "given must be called with at least one argument"
          )
  
      if given_arguments and any(
          [
              original_argspec.varargs,
              original_argspec.varkw,
              original_argspec.kwonlyargs,
          ]
      ):
          return invalid(
              "positional arguments to @given are not supported with varargs, "
              "varkeywords, or keyword-only arguments"
          )
  
      if len(given_arguments) > len(original_argspec.args):
          args = tuple(given_arguments)
          return invalid(
              "Too many positional arguments for %s() were passed to @given "
              "- expected at most %d arguments, but got %d %r"
              % (name, len(original_argspec.args), len(args), args)
          )
  
      if infer in given_arguments:
          return invalid(
              "infer was passed as a positional argument to @given, "
              "but may only be passed as a keyword argument"
          )
  
      if given_arguments and given_kwargs:
          return invalid(
              "cannot mix positional and keyword arguments to @given"
          )
      extra_kwargs = [
          k
          for k in given_kwargs
          if k
          not in original_argspec.args + original_argspec.kwonlyargs
      ]
      if extra_kwargs and not original_argspec.varkw:
          arg = extra_kwargs[0]
          return invalid(
              "%s() got an unexpected keyword argument %r, from `%s=%r` in @given"
              % (name, arg, arg, given_kwargs[arg])
          )
      for a in original_argspec.args:
          if isinstance(a, list):  # pragma: no cover
              return invalid(
                  "Cannot decorate function %s() because it has destructuring arguments"
                  % (name,)
              )
      if original_argspec.defaults or original_argspec.kwonlydefaults:
          return invalid(
              "Cannot apply @given to a function with defaults."
          )
      missing = [
          repr(kw)
          for kw in original_argspec.kwonlyargs
          if kw not in given_kwargs
      ]
      if missing:
          return invalid(
              "Missing required kwarg{}: {}".format(
                  "s" if len(missing) > 1 else "", ", ".join(missing)
              )
          )
  
imports: from __future__ import absolute_import, division, print_function
  import base64
  import contextlib
  import datetime
  import inspect
  import random
  import sys
  import traceback
  import warnings
  import zlib
  from random import Random
  from unittest import TestCase
  import attr
  import hypothesis.strategies
  from hypothesis._settings import HealthCheck, Phase, Verbosity, local_settings, settings
  from hypothesis.control import BuildContext
  from hypothesis.errors import DeadlineExceeded, DidNotReproduce, FailedHealthCheck, Flaky, Found, HypothesisDeprecationWarning, HypothesisWarning, InvalidArgument, MultipleFailures, NoSuchExample, Unsatisfiable, UnsatisfiedAssumption
  from hypothesis.executors import new_style_executor
  from hypothesis.internal.compat import PY2, bad_django_TestCase, benchmark_time, binary_type, get_type_hints, getfullargspec, hbytes, int_from_bytes, qualname
  from hypothesis.internal.conjecture.data import ConjectureData, StopTest
  from hypothesis.internal.conjecture.engine import ConjectureRunner, sort_key
  from hypothesis.internal.entropy import deterministic_PRNG
  from hypothesis.internal.escalation import escalate_hypothesis_internal_error, get_trimmed_traceback
  from hypothesis.internal.healthcheck import fail_health_check
  from hypothesis.internal.reflection import arg_string, convert_positional_arguments, define_function_signature, function_digest, get_pretty_function_description, impersonate, is_mock, proxies
  from hypothesis.reporting import current_verbosity, report, verbose_report, with_reporter
  from hypothesis.statistics import note_engine_for_statistics
  from hypothesis.strategies._internal.collections import TupleStrategy
  from hypothesis.strategies._internal.strategies import MappedSearchStrategy, SearchStrategy
  from hypothesis.utils.conventions import infer
  from hypothesis.vendor.pretty import CUnicodeIO, RepresentationPrinter
  from hypothesis.version import __version__
label_desc: Use image node_id 6 for calling a global function with example usage: is_invalid_test(name, original_argspec, given_arguments, given_kwargs) and returns: wrapped_test, invalid, invalid, invalid, invalid, invalid, invalid, invalid, invalid, invalid