Checks if the call should be transformed. If yes, it applies the transform function
518622
function checkAndTransform(method) {
            return re.test(method) ? function (req) {
                return next[method](req).then(function (res) {
                    return Object.assign(res, { data: transform(res.data) });
                });
            } : function (req) {
                return next[method](req);
            };
        }
87044
def is_transform_generator(fn):
    """"""
    try:
        if six.PY2:
            fn.func_dict['is_transform_generator'] = True
        else:
            # py3
            return fn.__dict__.get('is_transform_generator', False)
    except AttributeError:
        return False
323267
function applyTransformationsGroup( filter, element, group ) {
		var i, rule;

		for ( i = 0; i < group.length; ++i ) {
			rule = group[ i ];

			// Test with #check or #left only if it's set.
			// Do not apply transformations because that creates infinite loop.
			if ( ( !rule.check || filter.check( rule.check, false ) ) &&
				( !rule.left || rule.left( element ) ) ) {
				rule.right( element, transformationsTools );
				return; // Only first matching rule in a group is executed.
			}
		}
	}
261017
function transformType (type) {
  if (Array.isArray(type)) {
    return transformArray(type)
  }

  if (typeof type === 'object') {
    return transformObject(type)
  }

  if (
    typeof type === 'function' &&
    (!type.prototype || type.name === '')
  ) {
    return type
  }

  return findType(type)
}
787569
def _revcheck(self, func, version):
        '''
        
        '''
        current = self._revint(self.version)
        check = self._revint(version)
        if func in ('lt', '<=',):
            return check <= current
        elif func in ('gt', '>='):
            return check >= current
        elif func in ('eq', '=', 'equals'):
            return check == current
        else:
            return False
201684
function shouldTransform (req, res) {
  var cacheControl = res.getHeader('Cache-Control')

  // Don't compress for Cache-Control: no-transform
  // https://tools.ietf.org/html/rfc7234#section-5.2.2.4
  return !cacheControl ||
    !cacheControlNoTransformRegExp.test(cacheControl)
}
682168
function onNextTransform (transform, next) {
      // check if we should handle this filePath
      function shouldProcess (filePath, done) {
        done(!!multimatch(filePath, transform.pattern, transform.opts).length)
      }

      // transform the path
      function process (filePath, complete) {
        var filename = path.basename(filePath),
            pathParts = path.dirname(filePath).split(path.sep)

        // we'll get an empty arrary if we overslice
        pathParts = pathParts.slice(transform.by)
        pathParts.push(filename)

        var newPath = pathParts.join(path.sep),
            fileData = files[filePath]

        // don't need the old fileData anymore,
        // since we are re-adding with the new path
        delete files[filePath]
        files[newPath] = fileData

        complete()
      }

      // we do this for each option as the last may have modified the collection
      async.filter(Object.keys(files), shouldProcess, function (results) {
        async.each(results, process, next)
      })
    }
461335
def apply_transform(key, value, type)
      if type
        if respond_to?("convert_#{type}", true)
          send("convert_#{type}", key, value)
        else
          send(type, value)
        end
      else
        value
      end
    end
503726
private boolean checkArrivedX(double extrp, double sx, double dx)
    {
        final double x = transformable.getX();
        if (sx < 0 && x <= dx || sx >= 0 && x >= dx)
        {
            transformable.moveLocation(extrp, dx - x, 0);
            return true;
        }
        return false;
    }
239076
def called_with(self, *args, **kwargs):
        
        expected_call = Call(*args, **kwargs)
        if expected_call in calls(self.spy):
            return True
        raise VerificationError(
            "expected %s to be called with %s, but it wasn't" % (
                self.spy, expected_call.formatted_args))
1111053
function _transform() {
	var codeIn = $('#codeIn').val();
	try {
		var codeOut = Streamline.transform(codeIn, {
			runtime: _generators ? "generators" : "callbacks",
		});
		$('#codeOut').val(codeOut);
		info("ready");
	} catch (ex) {
		console.error(ex);
		error(ex.message);
	}
}
1177471
def not_called_with(self, *args, **kwargs):
        
        call = Call(*args, **kwargs)
        if call in calls(self.spy):
            raise VerificationError(
                'expected %s to not be called with %s, but it was' % (
                    self.spy, call.formatted_args))
        return True
755868
def call(object)
      return true if object.is_a?(CodeObjects::Proxy)
      modify_nilclass
      @object = object
      retval = __execute ? true : false
      unmodify_nilclass
      retval
    end
407120
def apply(self, transformation, node):
        '''
        
        '''
        assert issubclass(transformation, (Transformation, Analysis))
        a = transformation()
        a.attach(self)
        res = a.apply(node)

        # the transformation updated the AST, so analyse may need to be rerun
        # we could use a finer-grain caching system, and provide a way to flag
        # some analyses as `unmodified' by the transformation, as done in LLVM
        # (and PIPS ;-)
        if a.update:
            self._cache.clear()
        return res
604419
function transform(path) {
    if (shouldProcess(path)) {
        const renderer = Renderer.forPath(path);
        transformer(path.node, renderer, buildErrorHandler(path));
        // replace the render call if present, else replace the JSX
        if (Renderer.isParent(path)) {
            path.parentPath.replaceWith(renderer.toFunctionCall());
        } else {
            path.replaceWith(renderer.toFunctionCall());
        }
    }
}
762215
def net_transform(transform_func, block=None, **kwargs):
    
    block = working_block(block)
    with set_working_block(block, True):
        for net in block.logic.copy():
            keep_orig_net = transform_func(net, **kwargs)
            if not keep_orig_net:
                block.logic.remove(net)
22706
function callOnce(fn) {
  var called = false

  return calledOnceShim

  //-----------------------------------
  function calledOnceShim() {
    if (called) return
    called = true

    fn.apply(this, arguments)
  }
}