class PythonConfigUtil {

	public static Configuration getEnvironmentConfig(StreamExecutionEnvironment env) throws InvocationTargetException,
		IllegalAccessException, NoSuchMethodException {
		Method getConfigurationMethod = null;
		for (Class<?> clz = env.getClass(); clz != Object.class; clz = clz.getSuperclass()) {
			try {
				getConfigurationMethod = clz.getDeclaredMethod("getConfiguration");
				break;
			} catch (NoSuchMethodException e) {

			}
		}

		if (getConfigurationMethod == null) {
			throw new NoSuchMethodException("Method getConfigurationMethod not found.");
		}

		getConfigurationMethod.setAccessible(true);
		Configuration envConfiguration = (Configuration) getConfigurationMethod.invoke(env);
		return envConfiguration;
	}

}