Throw Exception if the member is in a Map/List
439556
private void failIfInCollection(Member c2jMemberDefinition, Shape parentShape) {
        if (isMapShape(parentShape) || isListShape(parentShape)) {
            throw new IllegalArgumentException(String.format(
                "Member (%s) has timestamp format provided. Timestamp format is not supported for Date in List/Map",
                c2jMemberDefinition.getShape()));
        }
    }
115030
protected final void writeMapTo( Map<String,Object> map , RawDataBuffer out )
    {
    	if (map == null)
    	{
    		out.writeInt(0);
    		return;
    	}
    	
        out.writeInt(map.size());
        if (!map.isEmpty())
        {
            Iterator<Map.Entry<String,Object>> allEntries = map.entrySet().iterator();
            while (allEntries.hasNext())
            {
                Map.Entry<String,Object> entry = allEntries.next();
                out.writeUTF(entry.getKey());
                out.writeGeneric(entry.getValue());
            }
        }
    }
698070
public void map(Class<? extends Exception> exceptionClass, ExceptionHandlerImpl handler) {
        this.exceptionMap.put(exceptionClass, handler);
    }
1115648
@SuppressWarnings("unchecked")
  @Nullable
  static List<?> getList(Map<String, ?> obj, String key) {
    assert key != null;
    if (!obj.containsKey(key)) {
      return null;
    }
    Object value = obj.get(key);
    if (!(value instanceof List)) {
      throw new ClassCastException(
          String.format("value '%s' for key '%s' in '%s' is not List", value, key, obj));
    }
    return (List<?>) value;
  }
1232383
function mapObjects(root, list, callback) {
	var ret = {};
	var sent = false;
	var count = list.length;
	if (count === 0) {
		callback(null, ret);
	}
	list.forEach(function (pointer) {
		var name = path.join(root._path, pointer);
		fp.define({filePath: name, parent: root}, function (err, obj) {
			if (err) {
				if (!sent) {
					callback(err);
					sent = true;
				}
				return;
			}
			ret[name] = obj;
			if (ret[name]._type === 'directory') {
				addMaping(ret[name]);
			}
			if (--count === 0) {
				callback(null, ret);
			}
		});
	});

}
1151962
public static void throwIfUnchecked(Throwable t) {
    Preconditions.checkNotNull(t);
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    }
    if (t instanceof Error) {
      throw (Error) t;
    }
  }
381431
public static <T, E extends Exception> DoubleList mapToDouble(final T[] a, final int fromIndex, final int toIndex,
            final Try.ToDoubleFunction<? super T, E> func) throws E {
        checkFromToIndex(fromIndex, toIndex, len(a));
        N.checkArgNotNull(func);

        if (N.isNullOrEmpty(a)) {
            return new DoubleList();
        }

        final DoubleList result = new DoubleList(toIndex - fromIndex);

        for (int i = fromIndex; i < toIndex; i++) {
            result.add(func.applyAsDouble(a[i]));
        }

        return result;
    }
1297608
public void onMemberLeft(MemberImpl leftMember) {
        for (WaitSet waitSet : waitSetMap.values()) {
            waitSet.invalidateAll(leftMember.getUuid());
        }
    }
374106
private void throwExIntParam(MethodVisitor mv, Class<?> exCls) {
		String exSig = Type.getInternalName(exCls);
		mv.visitTypeInsn(NEW, exSig);
		mv.visitInsn(DUP);
		mv.visitLdcInsn("mapping " + this.className + " failed to map field:");
		mv.visitVarInsn(ILOAD, 2);
		mv.visitMethodInsn(INVOKESTATIC, "java/lang/Integer", "toString", "(I)Ljava/lang/String;");
		mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "concat", "(Ljava/lang/String;)Ljava/lang/String;");
		mv.visitMethodInsn(INVOKESPECIAL, exSig, "<init>", "(Ljava/lang/String;)V");
		mv.visitInsn(ATHROW);
	}
772568
def map(self, mapper: Callable[[Any], Any]) -> 'List':
        """"""
        try:
            ret = List.from_iterable([mapper(x) for x in self])
        except TypeError:
            ret = List.from_iterable([partial(mapper, x) for x in self])
        return ret
244318
public <U> Try<U> map(Function<? super V, U> mapper) {
        if (isSuccess()) {
            return succeeded(mapper.apply(value));
        }
        return failed(this.throwable);
    }
55347
@Beta
    public <R, E extends Exception, E2 extends Exception> List<R> filterThenFlatMap(final Try.Predicate<? super T, E> filter,
            final Try.Function<? super T, ? extends Collection<? extends R>, E2> mapper) throws E, E2 {
        N.checkArgNotNull(filter);
        N.checkArgNotNull(mapper);

        final List<R> result = new ArrayList<>();

        Collection<? extends R> c = null;

        for (T e : coll) {
            if (filter.test(e)) {
                c = mapper.apply(e);

                if (N.notNullOrEmpty(c)) {
                    result.addAll(c);
                }
            }
        }

        return result;
    }
28601
public static <T, E extends Exception> IntList mapToInt(final Collection<? extends T> c, final int fromIndex, final int toIndex,
            final Try.ToIntFunction<? super T, E> func) throws E {
        checkFromToIndex(fromIndex, toIndex, size(c));
        N.checkArgNotNull(func);

        if (N.isNullOrEmpty(c) && fromIndex == 0 && toIndex == 0) {
            return new IntList();
        }

        final IntList result = new IntList(toIndex - fromIndex);

        if (c instanceof List && c instanceof RandomAccess) {
            final List<T> list = (List<T>) c;

            for (int i = fromIndex; i < toIndex; i++) {
                result.add(func.applyAsInt(list.get(i)));
            }
        } else {
            int idx = 0;

            for (T e : c) {
                if (idx++ < fromIndex) {
                    continue;
                }

                result.add(func.applyAsInt(e));

                if (idx >= toIndex) {
                    break;
                }
            }
        }

        return result;
    }
401891
function (iterator, context) {
        return _.map(this.members, _.isFunction(iterator) ? iterator.bind(context || this) : iterator);
    }
834745
protected void handleOperation(Map<String, String> map, String operation) throws Exception {
        int index=operation.indexOf('.');
        if(index == -1)
            throw new IllegalArgumentException("operation " + operation + " is missing the protocol name");
        String prot_name=operation.substring(0, index);
        Protocol prot=ch.getProtocolStack().findProtocol(prot_name);
        if(prot == null) {
            log.error("protocol %s not found", prot_name);
            return; // less drastic than throwing an exception...
        }

        int args_index=operation.indexOf('[');
        String method_name;
        if(args_index != -1)
            method_name=operation.substring(index +1, args_index).trim();
        else
            method_name=operation.substring(index+1).trim();

        String[] args=null;
        if(args_index != -1) {
            int end_index=operation.indexOf(']');
            if(end_index == -1)
                throw new IllegalArgumentException("] not found");
            List<String> str_args=Util.parseCommaDelimitedStrings(operation.substring(args_index + 1, end_index));
            Object[] strings=str_args.toArray();
            args=new String[strings.length];
            for(int i=0; i < strings.length; i++)
                args[i]=(String)strings[i];
        }

        Method method=findMethod(prot, method_name, args);
        MethodCall call=new MethodCall(method);
        Object[] converted_args=null;
        if(args != null) {
            converted_args=new Object[args.length];
            Class<?>[] types=method.getParameterTypes();
            for(int i=0; i < args.length; i++)
                converted_args[i]=Util.convert(args[i], types[i]);
        }
        Object retval=call.invoke(prot, converted_args);
        if(retval != null)
            map.put(prot_name + "." + method_name, retval.toString());
    }
543902
public QueryBuilder call(String method_name, Object ... items) throws Exception {
        return map(null, method_name, items);
    }
789542
def _check_mapper(self, mapper):
        
        if not hasattr(mapper, 'parse') or not callable(mapper.parse):
            raise ValueError('mapper must implement parse()')
        if not hasattr(mapper, 'format') or not callable(mapper.format):
            raise ValueError('mapper must implement format()')