<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def trace_xray_subsegment(skip_args=False):
 """Can be applied to any function or method to be traced by X-Ray. If `skip_args` is True, the arguments of the function won't be sent to X-Ray. """

    @wrapt.decorator
    def wrapper(wrapped, instance, args, kwargs):
        metadata_extractor = (
            noop_function_metadata
            if skip_args
            else extract_function_metadata
        )
        return generic_xray_wrapper(
            wrapped, instance, args, kwargs,
            name=get_function_name,
            namespace='local',
            metadata_extractor=metadata_extractor,
        )

    return wrapper