Adds an initialization to apply.

@param closure The closure for configuring the initialization.
357170
public void initialization(Closure<?> closure) {
        if (initialization != null) {
            throw new GradleException("Initialization is already set");
        }
        initialization = (Initialization) project.configure(new Initialization(), closure);
    }
1332661
public void transformation(Closure<?> closure) {
        transformations.add((Transformation) project.configure(new Transformation(project), closure));
    }
68653
public void init(Record record, boolean bNoDelete, boolean bNoModify)
    {   // For this to work right, the booking number field needs a listener to re-select this file whenever it changes
        m_bNoDelete = bNoDelete;
        m_bNoModify = bNoModify;
        super.init(record);
    }
756750
protected void generateClosureDefinition(XClosure closure, IAppendable it, IExtraLanguageGeneratorContext context) {
		if (!it.hasName(closure)) {
			final LightweightTypeReference closureType0 = getExpectedType(closure);
			LightweightTypeReference closureType = closureType0;
			if (closureType0.isFunctionType()) {
				final FunctionTypeReference fctRef = closureType0.tryConvertToFunctionTypeReference(true);
				if (fctRef != null) {
					closureType = Utils.toLightweightTypeReference(fctRef.getType(), this.typeServices).getRawTypeReference();
				}
			}
			final String closureName = it.declareSyntheticVariable(closure, "__Jclosure_" //$NON-NLS-1$
					+ closureType.getSimpleName());
			final JvmDeclaredType rawType = (JvmDeclaredType) closureType.getType();
			final JvmOperation function = rawType.getDeclaredOperations().iterator().next();
			// Add the object type as super type because of an issue in the Python language.
			final JvmTypeReference objType = getTypeReferences().getTypeForName(Object.class, closure);
			it.openPseudoScope();
			it.append("class ").append(closureName).append("(") //$NON-NLS-1$//$NON-NLS-2$
				.append(closureType).append(",").append(objType.getType()).append("):") //$NON-NLS-1$ //$NON-NLS-2$
				.increaseIndentation().newLine().append("def ") //$NON-NLS-1$
				.append(function.getSimpleName()).append("(") //$NON-NLS-1$
				.append(getExtraLanguageKeywordProvider().getThisKeywordLambda().apply());
			for (final JvmFormalParameter param : closure.getFormalParameters()) {
				it.append(", "); //$NON-NLS-1$
				final String name = it.declareUniqueNameVariable(param, param.getName());
				it.append(name);
			}
			it.append("):"); //$NON-NLS-1$
			it.increaseIndentation().newLine();
			if (closure.getExpression() != null) {
				LightweightTypeReference returnType = closureType0;
				if (returnType.isFunctionType()) {
					final FunctionTypeReference fctRef = returnType.tryConvertToFunctionTypeReference(true);
					if (fctRef != null) {
						returnType = fctRef.getReturnType();
					} else {
						returnType = null;
					}
				} else {
					returnType = null;
				}
				//LightweightTypeReference returnType = getClosureOperationReturnType(type, operation);
				generate(closure.getExpression(), returnType, it, context);
			} else {
				it.append("pass"); //$NON-NLS-1$
			}
			it.decreaseIndentation().decreaseIndentation().newLine();
			it.closeScope();
		}
	}
1125434
public static <T> T identity(Object self, Closure<T> closure) {
        return DefaultGroovyMethods.with(self, closure);
    }
392290
public function it($example, \Closure $closure = null)
    {
        if ($closure === null) {
            $that = $this;
            $closure = function() use ($that) { $that->pending(); };
        }
        $example = new Example($example, $closure);
        $example->setParent($this->__stack->top());
        $this->__stack->top()->add($example);
        return $example;
    }
767782
public function setInitClosure(CLOSURE $initClosure = null) {
        if ($initClosure === null)
            throw new \Exception ("the initClosure must be set for Stepcontroller");
        $initClosure = $this->generateClosure($initClosure);
        $closureParameter = $this->standardClosureArguments();
        $initClosure($closureParameter);
    }
147626
public function at(\Closure $closure): self
    {
        $arrayy = clone $this;

        foreach ($arrayy->getGenerator() as $key => $value) {
            $closure($value, $key);
        }

        return static::create(
            $arrayy->toArray(),
            $this->iteratorClass,
            false
        );
    }
357089
public function eachFillable(Closure $closure)
    {
        /** @var FillableField $item */
        foreach ($this->items as $item) {
            if ($item->fillable) {
                $closure($item);
            }
        }
    }
902673
protected static function getOrInit($id, Closure $closure)
  {
    if (!self::has($id)) {
      self::set($id, $closure());
    }

    return self::get($id);
  }
687429
public function apply($closure)
    {
        foreach ($this as $key => $val) {
            $this->offsetSet($key, $closure($val, $key, $this));
        }
        return $this;
    }
567110
public FaunusPipeline transform(final String closure) {
        this.state.assertNotLocked();
        this.state.assertNoProperty();

        this.compiler.addMap(TransformMap.Map.class,
                NullWritable.class,
                FaunusVertex.class,
                TransformMap.createConfiguration(this.state.getElementType(), this.validateClosure(closure)));

        this.state.lock();
        makeMapReduceString(TransformMap.class);
        return this;
    }
889726
public function extendBlock($blockName, Closure $closure)
    {
        $blockName  = ucfirst(strtolower($blockName));
        $methodName = camel_case("block_{$blockName}");

        return $this->bindElementClosure($methodName, $closure);
    }
1009052
public void setCustomEndpointInitializer(EndpointInitializer initializer) {
		Objects.requireNonNull(initializer, "Initializer has to be set");
		ClosureCleaner.ensureSerializable(initializer);
		this.initializer = initializer;
	}
723407
public function xit($title, \Closure $closure = null)
    {
        $spec = new Spec($title, $closure, $this->current);
        $spec->setPending();
        $this->current->addSpec($spec);
    }
365381
public static function lazyInit ( Closure $closure, $key = null, array $params = [ ] )
    {
        if ( $key === null ) {
            $key = static::createBacktraceKey();
        }

        return static::lazyInitStatic( $closure, $key, $params );
    }
1315324
public static void eachByte(Byte[] self, @ClosureParams(FirstParam.Component.class) Closure closure) {
        each(self, closure);
    }