def _calc_concat_over(datasets, dim, data_vars, coords):
    def process_subset_opt(opt, subset):
        if subset == 'coords':
            subset_long_name = 'coordinates'
        else:
            subset_long_name = 'data variables'

        if isinstance(opt, basestring):
            if opt == 'different':
                def differs(vname):
                    # simple helper function which compares a variable
                    # across all datasets and indicates whether that
                    # variable differs or not.
                    v = datasets[0].variables[vname]
                    return any(not ds.variables[vname].equals(v)
                               for ds in datasets[1:])
                # all nonindexes that are not the same in each dataset
                concat_new = set(k for k in getattr(datasets[0], subset)
                                 if k not in concat_over and differs(k))
            elif opt == 'all':
                concat_new = (set(getattr(datasets[0], subset)) -
                              set(datasets[0].dims))
            elif opt == 'minimal':
                concat_new = set()
            else:
                raise ValueError("unexpected value for concat_%s: %s"
                                 % (subset, opt))
        else:
            invalid_vars = [k for k in opt
                            if k not in getattr(datasets[0], subset)]
            if invalid_vars:
                raise ValueError('some variables in %s are not '
                                 '%s on the first dataset: %s'
                                 % (subset, subset_long_name, invalid_vars))
            concat_new = set(opt)
        return concat_new

    concat_over = set()
    for ds in datasets:
        concat_over.update(k for k, v in ds.variables.items()
                           if dim in v.dims)
    concat_over.update(process_subset_opt(data_vars, 'data_vars'))
    concat_over.update(process_subset_opt(coords, 'coords'))
    if dim in datasets[0]:
        concat_over.add(dim)

    return concat_over
Get the result of the RPC, or possibly raise an exception.
dataset/ETHPy150Open pydata/xarray/xarray/core/combine.py/_calc_concat_over--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/apiproxy_stub_map.py/UserRPC.get_result