Lift a Java Callable to a Scala Function0

@param f the function to lift

@returns the Scala function
164110
public static<Z> Function0<Z> lift(Callable<Z> f) {
	return bridge.lift(f);
    }
439396
public static Map<String, File> loadStringToFileMap(final File f) throws IOException {
    return loadStringToFileMap(Files.asCharSource(f, Charsets.UTF_8));
  }
297553
public DoubleColumn map(ToDoubleFunction<Double> fun) {
        DoubleColumn result = DoubleColumn.create(name());
        for (double t : this) {
            try {
                result.append(fun.applyAsDouble(t));
            } catch (Exception e) {
                result.appendMissing();
            }
        }
        return result;
    }
1111300
public static File assertReadable(final File f) throws FileNotFoundException {
        if (!f.exists()) {
            throw new FileNotFoundException(f.getAbsolutePath() +
                " does not exist.");
        }

        if (!f.canRead()) {
            throw new FileNotFoundException(f.getAbsolutePath() +
                " is not readable.");
        }
        
        return f;
    }
593561
function(f)
	{
		var str = null;

		if (f != null)
		{
			if (f.name != null)
			{
				str = f.name;
			}
			else
			{
				str = mxUtils.trim(f.toString());
				
				if (/^function\s/.test(str))
				{
					str = mxUtils.ltrim(str.substring(9));
					var idx2 = str.indexOf('(');
					
					if (idx2 > 0)
					{
						str = str.substring(0, idx2);
					}
				}
			}
		}
		
		return str;
	}
1122323
public F1<P1, Option<R>> lift() {
            final F1<P1, R> me = this;
            return new F1<P1, Option<R>>() {
                @Override
                public Option<R> apply(P1 p1) {
                    try {
                        return some(me.apply(p1));
                    } catch (RuntimeException e) {
                        return none();
                    }
                }
            };
        }
351857
public static ParameterDef Float(final float f) {
        final BigDecimal bd = new BigDecimal(Float.toString(f));

        return Scaled(Types.FLOAT, bd.scale());
    }
1173392
public static <T, F> Function<F, T> memoize(final Function<F, T> function) {
        return new MemoizeFunction<F, T>() {
            @Override
            public T calc(F arg) {
                return function.apply(arg);
            }
        };
    }
294807
public static <A, B> B foldLeft (F<B,A> func, B zero, Iterable<? extends A> values)
    {
        for (A value : values) {
            zero = func.apply(zero, value);
        }
        return zero;
    }
30694
public static ParameterDef Real(final float f) {
        final BigDecimal bd = new BigDecimal(Float.toString(f));

        return Scaled(Types.REAL, bd.scale());
    }
776813
public static <C> PortableFieldAccess<C> get(Field f) {
		
		Class<?> type = (Class<?>) f.getType();
		
		if (type.isPrimitive()) {
			if (java.lang.Boolean.TYPE == type) {
				return (PortableFieldAccess<C>) new PortableBooleanFieldAccess<C>(f);
			} else if (java.lang.Byte.TYPE == type) {
				return (PortableFieldAccess<C>) new PortableByteFieldAccess<C>(f);
			} else if (java.lang.Character.TYPE == type) {
				return (PortableFieldAccess<C>) new PortableCharFieldAccess<C>(f);
			} else if (java.lang.Short.TYPE == type) {
				return (PortableFieldAccess<C>) new PortableShortFieldAccess<C>(f);
			} else if (java.lang.Integer.TYPE == type) {
				return (PortableFieldAccess<C>) new PortableIntFieldAccess<C>(f);
			} else if (java.lang.Long.TYPE == type) {
				return (PortableFieldAccess<C>) new PortableLongFieldAccess<C>(f);
			} else if (java.lang.Float.TYPE == type) {
				return (PortableFieldAccess<C>) new PortableFloatFieldAccess<C>(f);
			} else if (java.lang.Double.TYPE == type) {
				return (PortableFieldAccess<C>) new PortableDoubleFieldAccess<C>(f);
			}
		}
		return new PortableFieldAccess<C>(f);
	}
590144
public <B> StreamT<W,B> flatMapT(final Function<? super T, StreamT<W,B>> f) {

        return of(run.map(list -> list.flatMap(a -> f.apply(a).run.stream())
                                      .flatMap(a -> a)));
    }
1044492
public <A> JFeatureSpec<T> required(final SerializableFunction<T, A> f,
                                      final Transformer<A, ?, ?> t) {
    Function1<T, A> g = JavaOps.requiredFn(f);
    return wrap(self.required(g, t));
  }
581346
@Override
    public final <B> Maybe<B> fmap(Function<? super A, ? extends B> fn) {
        return Monad.super.<B>fmap(fn).coerce();
    }
687938
public final TextBuilder p(float f) {
        if (null != __buffer) __append(f);
        else __caller.p(f);
        return this;
    }
81531
public static <T0, R> FuncN<R> fromFunc(final Func1<? super T0, ? extends R> f) {
        return new FuncN<R>() {

            @SuppressWarnings("unchecked")
            @Override
            public R call(Object... args) {
                if (args.length != 1) {
                    throw new RuntimeException("Func1 expecting 1 argument.");
                }
                return f.call((T0) args[0]);
            }

        };
    }
1256009
public static MutableFst remove(Fst fst) {
    Preconditions.checkNotNull(fst);
    Preconditions.checkNotNull(fst.getSemiring());

    Semiring semiring = fst.getSemiring();
    MutableFst result = MutableFst.emptyWithCopyOfSymbols(fst);
    int iEps = fst.getInputSymbols().get(Fst.EPS);
    int oEps = fst.getOutputSymbols().get(Fst.EPS);

    @SuppressWarnings("unchecked")
    HashMap<Integer,Double>[] closure = new HashMap[fst.getStateCount()];
    MutableState[] oldToNewStateMap = new MutableState[fst.getStateCount()];
    State[] newToOldStateMap = new State[fst.getStateCount()];
    initResultStates(fst, result, oldToNewStateMap, newToOldStateMap);
    addNonEpsilonArcs(fst, result, iEps, oEps, closure, oldToNewStateMap);

    // augment fst with arcs generated from epsilon moves.
    for (int i = 0; i < result.getStateCount(); i++) {
      MutableState state = result.getState(i);
      State oldState = newToOldStateMap[state.getId()];
      if (closure[oldState.getId()] == null) {
        continue;
      }
      for (Integer pathFinalStateIndex : closure[oldState.getId()].keySet()) {
        State closureState = fst.getState(pathFinalStateIndex);
        if (semiring.isNotZero(closureState.getFinalWeight())) {
          Double prevWeight = getPathWeight(oldState, closureState, closure);
          Preconditions.checkNotNull(prevWeight, "problem with prev weight on closure from %s", oldState);
          state.setFinalWeight(semiring.plus(state.getFinalWeight(), semiring.times(prevWeight, closureState.getFinalWeight())));
        }
        for (int j = 0; j < closureState.getArcCount(); j++) {
          Arc arc = closureState.getArc(j);
          if ((arc.getIlabel() != iEps) || (arc.getOlabel() != oEps)) {
            Double pathWeight = getPathWeight(oldState, closureState, closure);
            Preconditions.checkNotNull(pathWeight, "problem with prev weight on closure from %s", oldState);
            double newWeight = semiring.times(arc.getWeight(), pathWeight);
            MutableState nextState = oldToNewStateMap[arc.getNextState().getId()];
            result.addArc(state, arc.getIlabel(), arc.getOlabel(), nextState, newWeight);
          }
        }
      }
    }

    Connect.apply(result);
    ArcSort.sortByInput(result);

    return result;
  }