Wrapper methods for compatibility
494787
@VisibleForTesting
    public JSONObject callAPIWithResource(API api, WebResource resource) throws AtlasServiceException {
        return callAPIWithResource(toAPIInfo(api), resource, null, JSONObject.class);
    }
1064068
def wrap_as_stream(item):
    
    if not PY3:
        return StringIO(item)
    if isinstance(item, str):
        return StringIO(item)
    elif isinstance(item, bytes):
        return BytesIO(item)
    raise ValueError('{} is not wrappable!'.format(type(item).__name__))
322506
public synchronized boolean compatible(List<PType> to, List<PType> from)
	{
		done.clear();
		return allCompatible(to, from, false) == Result.Yes;
	}
709529
function wrapInList(
    opts: Options,
    change: Change,
    type?: string,
    data?: Object | Data
): Change {
    const selectedBlocks = getHighestSelectedBlocks(change.value);
    type = type || opts.types[0];

    // Wrap in container
    change.wrapBlock(
        {
            type,
            data: Data.create(data)
        },
        { normalize: false }
    );

    // Wrap in list items
    selectedBlocks.forEach(node => {
        if (isList(opts, node)) {
            // Merge its items with the created list
            node.nodes.forEach(({ key }) =>
                change.unwrapNodeByKey(key, { normalize: false })
            );
        } else {
            change.wrapBlockByKey(node.key, opts.typeItem, {
                normalize: false
            });
        }
    });

    return change.normalize();
}
178854
public static Function<String, String> WrapFunction(final String leftWrapper,
      final String rightWrapper) {
    Preconditions.checkNotNull(leftWrapper);
    Preconditions.checkNotNull(rightWrapper);

    return new Function<String, String>() {
      @Override
      public String apply(final String s) {
        return leftWrapper + s + rightWrapper;
      }
    };
  }
324153
def wrapped_object(self, LayoutClass, fields, *args, **kwargs):
        
        if args:
            if isinstance(fields, list):
                fields = tuple(fields)
            else:
                fields = (fields,)

            if LayoutClass in self.args_first:
                arguments = args + fields
            else:
                arguments = fields + args

            return LayoutClass(*arguments, **kwargs)
        else:
            if isinstance(fields, list):
                return LayoutClass(*fields, **kwargs)
            else:
                return LayoutClass(fields, **kwargs)
17035
def update_wrapper(wrapper,
                   wrapped,
                   assigned = functools.WRAPPER_ASSIGNMENTS,
                   updated = functools.WRAPPER_UPDATES):
    
    # workaround for http://bugs.python.org/issue3445
    assigned = tuple(attr for attr in assigned if hasattr(wrapped, attr))
    wrapper = functools.update_wrapper(wrapper, wrapped, assigned, updated)
    # workaround for https://bugs.python.org/issue17482
    wrapper.__wrapped__ = wrapped
    return wrapper
634823
def wrap_options(self, data, renderer_context):
        ''''''
        request = renderer_context.get("request", None)
        method = request and getattr(request, 'method')
        if method != 'OPTIONS':
            raise WrapperNotApplicable("Request method must be OPTIONS")

        wrapper = self.dict_class()
        wrapper["meta"] = data
        return wrapper
816912
function checkCompatibility() {
        // We use JSON for serialization. http://caniuse.com/#feat=json
        if (! window.JSON) {
            return false;
        }

        // For now, we require jQuery.
        // In the future, we may build adaptors for other libraries
        if (! window.jQuery) {
            return false;
        }

        // We require jQuery >= 1.7, because of `.on`
        if (jQuery().jquery <= '1.7') {
            return false;
        }

        // Otherwise, we are good
        return true;
    }
285990
def decorate_method(wrapped):
    
    def wrapper(self):
        lines = Lines()
        if hasattr(self.model, wrapped.__name__):
            print('            . %s' % wrapped.__name__)
            lines.add(1, method_header(wrapped.__name__, nogil=True))
            for line in wrapped(self):
                lines.add(2, line)
        return lines
    functools.update_wrapper(wrapper, wrapped)
    wrapper.__doc__ = 'Lines of model method %s.' % wrapped.__name__
    return property(wrapper)
1181487
private static boolean isBindingCompatible( Tuple tuple, VarBindingDef binding)
    {
    VarValueDef currentValue = tuple.getBinding( binding.getVarDef());
    return (currentValue == null || currentValue.equals( binding.getValueDef()));
    }
1035963
def wrap(cls, value):
        ''' 

        '''
        if isinstance(value, list):
            if isinstance(value, PropertyValueList):
                return value
            else:
                return PropertyValueList(value)
        else:
            return value
985032
def referenceable(method):
    """"""

    def wrapper(self, value, *args):
        deref = self._prepare(value)
        if deref is not None:
            return deref
        packer, data = method(self, value, *args)
        return self._preserve(value, packer, data)

    return wrapper
897580
final void setCompatibilityWrapper(JSCompatibleMessageImpl wrapper) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            JmfTr.entry(this, tc, "setCompatibilityWrapper", wrapper);

        synchronized (getMessageLockArtefact()) {
            compatibilityWrapperOrSelf = wrapper;
            // If we are our own master & e've just been wrapped in a JSCompatibleMessage, then we
            // need to update the master reference.
            if (master == this) {
                setMaster();
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            JmfTr.exit(this, tc, "setCompatibilityWrapper");
    }
195673
def is_compatible(self, collection):
        '''

        '''
        return all([
            isinstance(collection, Collection),
            collection.head == self.head,
            collection.tail == self.tail,
            collection.padding == self.padding
        ])
289628
def is_compatible(self):
        """"""
        for pattern in OPTIONS['compatible_patterns']:
            if fnmatch(self.package.lower(), pattern):
                return True
        return False
498856
def compatibility_or_constraints(self, target):
    
    if self.get_options().is_flagged('interpreter_constraints'):
      return tuple(self.interpreter_constraints)
    return tuple(target.compatibility or self.interpreter_constraints)