code: def from_attrs(target, args, kwargs, to_infer):
      """An internal version of builds(), specialised for Attrs classes."""
      fields = attr.fields(target)
      kwargs = {k: v for k, v in kwargs.items() if v is not infer}
      for name in to_infer:
          kwargs[name] = from_attrs_attribute(
              getattr(fields, name), target
          )
      # We might make this strategy more efficient if we added a layer here that
      # retries drawing if validation fails, for improved composition.
      # The treatment of timezones in datetimes() provides a precedent.
      return st.tuples(
          st.tuples(*args), st.fixed_dictionaries(kwargs)
      ).map(lambda value: target(*value[0], **value[1]))
  
file_path: catboost/contrib/python/hypothesis/py2/hypothesis/strategies/_internal/attrs.py
imports: from __future__ import absolute_import, division, print_function
  from functools import reduce
  from itertools import chain
  import attr
  import hypothesis.strategies
  from hypothesis.errors import ResolutionFailed
  from hypothesis.internal.compat import get_type_hints, string_types
  from hypothesis.strategies._internal.types import is_a_type, type_sorting_key
  from hypothesis.utils.conventions import infer
label_desc: Use image node_id 1 for calling a global function with example usage: from_attrs(target, args, kwargs, to_infer) and returns: st