Applies a mapping function to both the old and the new value, wrapping the result
in a new Change.
@param fn the mapping function
@param <R> type returned by the mapping function
@return a new Change with mapped values
551215
public <R> Change<R> map(Function<T, R> fn) {
        return new Change<>(
                fn.apply(getOldValue()),
                fn.apply(getNewValue())
        );
    }
208605
public <R> R map(@NonNull Function<Tuple, R> function) {
      return function.apply(this);
   }
765063
private void setRecursive(Type type, IAtomContainer mol) {
        switch (type) {
            case RECURSIVE:
                this.type = type;
                this.value = 0;
                this.left = null;
                this.right = null;
                this.query = mol;
                this.ptrn  = null;
                break;
            default:
                throw new IllegalArgumentException();
        }
    }
1023513
function mapping (type, stateDefinitions, contractName) {
  var match = type.match(/mapping\((.*?)=>(.*)\)$/)
  var keyTypeName = match[1].trim()
  var valueTypeName = match[2].trim()

  var keyType = parseType(keyTypeName, stateDefinitions, contractName, 'storage')
  var valueType = parseType(valueTypeName, stateDefinitions, contractName, 'storage')

  var underlyingTypes = {
    'keyType': keyType,
    'valueType': valueType
  }
  return new MappingType(underlyingTypes, 'location', util.removeLocation(type))
}
711571
public int newLocal(final Type type) {
        Object t;
        switch (type.getSort()) {
        case Type.BOOLEAN:
        case Type.CHAR:
        case Type.BYTE:
        case Type.SHORT:
        case Type.INT:
            t = Opcodes.INTEGER;
            break;
        case Type.FLOAT:
            t = Opcodes.FLOAT;
            break;
        case Type.LONG:
            t = Opcodes.LONG;
            break;
        case Type.DOUBLE:
            t = Opcodes.DOUBLE;
            break;
        case Type.ARRAY:
            t = type.getDescriptor();
            break;
        // case Type.OBJECT:
        default:
            t = type.getInternalName();
            break;
        }
        int local = newLocalMapping(type);
        setLocalType(local, type);
        setFrameLocal(local, t);
        changed = true;
        return local;
    }
33377
protected Binding bindAnnotatedWithNameToInstance(TypeReference bind, String name, String to,
			String functionName) {
		String tmpName = Strings.emptyIfNull(name);
		if (tmpName.startsWith(REFERENCE_PREFIX)) {
			tmpName = tmpName.substring(REFERENCE_PREFIX.length()).trim();
		} else {
			tmpName = "\"" + tmpName + "\""; //$NON-NLS-1$//$NON-NLS-2$
		}
		final String unferencedName = tmpName;
		final StringConcatenationClient client = new StringConcatenationClient() {
			@Override
			protected void appendTo(TargetStringConcatenation builder) {
				builder.append("binder.bind("); //$NON-NLS-1$
				builder.append(bind);
				builder.append(".class).annotatedWith(Names.named("); //$NON-NLS-1$
				builder.append(unferencedName);
				builder.append(")).toInstance("); //$NON-NLS-1$
				builder.append(to);
				builder.append(".class);"); //$NON-NLS-1$
			}
		};
		String fctname = functionName;
		if (Strings.isEmpty(fctname)) {
			fctname = name;
		}
		final BindKey key = new GuiceModuleAccess.BindKey(formatFunctionName(fctname), null, false, false);
		final BindValue statements = new BindValue(null, null, false, Collections.singletonList(client));
	    return new Binding(key, statements, true, this.name);
	}
875997
public <R> Future<R> map(final Function<? super T, ? extends R> fn, Executor ex) {
        return new Future<R>(
                              future.thenApplyAsync(fn,ex));
    }
1354774
public static <T, V> ChannelSupplier<V> remap(ChannelSupplier<T> supplier, Function<? super T, ? extends Iterator<? extends V>> fn) {
		return new AbstractChannelSupplier<V>(supplier) {
			Iterator<? extends V> iterator = CollectionUtils.emptyIterator();
			boolean endOfStream;

			@Override
			protected Promise<V> doGet() {
				if (iterator.hasNext()) return Promise.of(iterator.next());
				return Promise.ofCallback(this::next);
			}

			private void next(SettableCallback<V> cb) {
				if (!endOfStream) {
					supplier.get()
							.whenComplete((item, e) -> {
								if (e == null) {
									if (item == null) endOfStream = true;
									iterator = fn.apply(item);
									if (iterator.hasNext()) {
										cb.set(iterator.next());
									} else {
										next(cb);
									}
								} else {
									cb.setException(e);
								}
							});
				} else {
					cb.set(null);
				}
			}
		};
	}
1150805
public <C> C mapTo(Class<C> type) {
    DataFormatMapper mapper = dataFormat.getMapper();
    return mapper.mapInternalToJava(jsonNode, type);
  }
1348228
public static <T extends GrayF<T>, W extends ImageInterleaved>
	DiscreteFourierTransform<T,W> createTransform( ImageDataType type ) {
		switch( type ) {
			case F32: return (DiscreteFourierTransform)createTransformF32();
			case F64: return (DiscreteFourierTransform)createTransformF64();
		}
		throw new IllegalArgumentException("Unsupported image type "+type);
	}
927536
def _new_type(cls, args):
        

        fformat = ["%r" if f is None else "%s=%%r" % f for f in args]
        fformat = "(%s)" % ", ".join(fformat)

        class _ResultTuple(cls):
            __slots__ = ()
            _fformat = fformat
            if args:
                for i, a in enumerate(args):
                    if a is not None:
                        vars()[a] = property(itemgetter(i))
                del i, a

        return _ResultTuple
679355
public static <T, P, R> Function<T, R> bind(Function2<? super T, ? super P, ? extends R> function, P parameter)
    {
        return new BindFunction2<T, P, R>(function, parameter);
    }
905396
public static <T> TypedColumn<T, Double> avg(MapFunction<T, Double> f) {
    return new TypedAverage<T>(f).toColumnJava();
  }
581346
@Override
    public final <B> Maybe<B> fmap(Function<? super A, ? extends B> fn) {
        return Monad.super.<B>fmap(fn).coerce();
    }
47729
function increment(type, version) {
  debug(`incrementing ${version} by ${type}`);

  let [major, minor, patch] = version
    .replace('v', '')
    .split('.')
    .map((v) => parseInt(v, 10));

  if (major === 0) {
    switch (type) {
      case 'major':
        minor += 1;
        patch = 0;
        break;
      case 'minor':
        patch += 1;
        break;
      case 'patch':
        patch += 1;
        break;
      default:
        throw new Error('unrecognized change type');
    }
  }
  else {
    switch (type) {
      case 'major':
        major += 1;
        minor = 0;
        patch = 0;
        break;
      case 'minor':
        minor += 1;
        patch = 0;
        break;
      case 'patch':
        patch += 1;
        break;
      default:
        throw new Error('unrecognized change type');
    }
  }

  return `${major}.${minor}.${patch}`;
}
1332321
public static <T> void remapField(Class<T> type, String jsonFieldName, String javaFieldName) {
		defaultReader.remapField(type, jsonFieldName, javaFieldName);
		defaultWriter.remapField(type, javaFieldName, jsonFieldName);
	}
1278737
public void replace(ClassNode type) {
        int size = ensureStackNotEmpty(stack);
        stack.set(size - 1, type);
    }