Accepts a HoloMap and a dynamic callback function creating
        an equivalent DynamicMap from the HoloMap.
194018
def _make_dynamic(self, hmap, dynamic_fn, streams):
        
        if isinstance(hmap, ViewableElement):
            return DynamicMap(dynamic_fn, streams=streams)
        dim_values = zip(*hmap.data.keys())
        params = util.get_param_values(hmap)
        kdims = [d(values=list(util.unique_iterator(values))) for d, values in
                 zip(hmap.kdims, dim_values)]
        return DynamicMap(dynamic_fn, streams=streams, **dict(params, kdims=kdims))
640135
function createLNodeObject(type, currentView, parent, native, state, queries) {
    return {
        native: native,
        view: currentView,
        nodeInjector: parent ? parent.nodeInjector : null,
        data: state,
        queries: queries,
        tNode: null,
        dynamicLContainerNode: null
    };
}
803394
function( map ) {
					var code;
					if ( map ) {
						if ( completed ) {

							// Execute the appropriate callbacks
							jqXHR.always( map[ jqXHR.status ] );
						} else {

							// Lazy-add the new callbacks in a way that preserves old ones
							for ( code in map ) {
								statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
							}
						}
					}
					return this;
				}
369948
function StackMapper(sourcemap) {
  if (!(this instanceof StackMapper)) return new StackMapper(sourcemap);
  if (typeof sourcemap !== 'object') 
    throw new Error('sourcemap needs to be an object, please use convert-source-map module to convert it from any other format\n' +
                    'See: https://github.com/thlorenz/stack-mapper#obtaining-the-source-map');

  this._sourcemap = sourcemap;
  this._prepared = false;
}
191121
function (id, callback) {
    this.loadViewModel(id, function (err, vm) {
      if (err) {
        return callback(err);
      }

      if (!vm || vm.actionOnCommit === 'create') {
        return callback(null, null);
      }

      callback(null, vm);
    });
  }
864719
function ValueMapper(input, options) {
  // Save input for later
  this.input = input;

  // Save placeholder middlewares
  this.middlewares = [];

  // Fallback options
  options = options || {};

  // Add each of the middlewares
  var middlewares = options.middlewares || [];
  middlewares.forEach(this.addMiddleware, this);
}
418129
def _execute_callback(self, *args):
        ""
        self._validate_key(args)      # Validate input key

        # Additional validation needed to ensure kwargs don't clash
        kdims = [kdim.name for kdim in self.kdims]
        kwarg_items = [s.contents.items() for s in self.streams]
        hash_items = tuple(tuple(sorted(s.hashkey.items())) for s in self.streams)+args
        flattened = [(k,v) for kws in kwarg_items for (k,v) in kws
                     if k not in kdims]

        if self._posarg_keys:
            kwargs = dict(flattened, **dict(zip(self._posarg_keys, args)))
            args = ()
        else:
            kwargs = dict(flattened)
        if not isinstance(self.callback, Generator):
            kwargs['_memoization_hash_'] = hash_items

        with dynamicmap_memoization(self.callback, self.streams):
            retval = self.callback(*args, **kwargs)
        return self._style(retval)
1210777
def get_nested_dmaps(dmap):
    
    if not isinstance(dmap, DynamicMap):
        return []
    dmaps = [dmap]
    for o in dmap.callback.inputs:
        dmaps.extend(get_nested_dmaps(o))
    return list(set(dmaps))
890149
public static <K, V> Map<K, V> newMap(Map<K, V> initMap) {
        return new HashMap<>(initMap);
    }
1146266
function createMap(mapConfig) {
      app.debug('MapActions >>> createMap');
      var basemap = (0, _jsUtilsParams.getUrlParams)(location.href)[_jsConstantsAppConstants.MAP.basemap];
      if (basemap) {
        mapConfig.options.basemap = basemap;
      }
      var deferred = new Promise(function (resolve) {
        app.map = new _EsriMap['default'](mapConfig.id, mapConfig.options);
        app.map.on('load', function () {
          resolve();
        });
      });

      return deferred;
    }
930723
def build_map_async(coro=None, *, mode=None, unpack: bool = False):
    
    _mode = mode

    def _build_map_async(coro):
        @wraps(coro)
        def _wrapper(*args, mode=None, **kwargs) -> MapAsync:
            if 'unpack' in kwargs:
                raise TypeError('"unpack" has to be defined by decorator')
            if mode is None:
                mode = MODE.CONCURRENT if _mode is None else _mode
            return MapAsync(coro, *args, mode=mode, unpack=unpack, **kwargs)
        return _wrapper

    if coro:
        return _build_map_async(coro)

    return _build_map_async
756865
function exportResolverMap(backing: SchemaBacking) {
  backing.validate();
  return reduce(
    backing.types,
    (rmap, config, name) => {
      const fields = reduce(
        config.fields,
        (fmap, field, fieldName) => {
          if (_.isFunction(field.resolve)) {
            fmap[fieldName] = field.resolve;
          }
          return fmap;
        },
        {},
        true,
      );
      return _.keys(fields).length ? _.merge(rmap, { [name]: fields }) : rmap;
    },
    {},
    true,
  );
}
1299619
public <T> DynamicJdbcMapper<T> newMapper(final TypeReference<T> target) {
        return newMapper(target.getType());
    }
863069
private void buildSymbolsMap()
    {
        int sid = myFirstLocalSid;
        for (int i = 0; i < mySymbolNames.length; i++, sid++)
        {
            String symbolText = mySymbolNames[i];
            if (symbolText != null)
            {
                putToMapIfNotThere(mySymbolsMap, symbolText, sid);
            }
        }
    }
1018893
function createPiGlow(callback) {
    var myPiGlow = new PiGlowBackend();
    var myInterface = piGlowInterface(myPiGlow);

    myPiGlow
        .on('initialize', function() {
            callback(null, myInterface);
        })
        .on('error', function(error) {
            callback(error, null);
        });
}
1037743
function callApi(method, parameters, callback) {

    if (typeof parameters === 'undefined') {
        throw new Error('undefined is not a valid parameters object.');
    }

    if( typeof parameters !== 'object' ){
        throw new Error('valid parameters object required.');
    }

    var opts = this.options;

    var noCallback = !callback || typeof callback !== 'function';
    let noApiKey = typeof opts.API_KEY !== 'string' || opts.API_KEY.length === 0 || typeof opts.API_SECRET !== 'string' || opts.API_SECRET.length === 0;
    if( noApiKey ){
        if( noCallback ){
            throw new Error('API key and API secret required.');
        }
        return callback(new Error("API key and API secret required."));
    }

    opts.method = method;

    //
    // final API url with hashes
    //
    let url = makeApiUrl(opts, parameters);

    let reqOptions = {
        uri: url,
        json: true,
        timeout: process.env.CF_TIMEOUT || opts.DEFAULT_TIMEOUT
    };


    //
    // callback not exists, just return the request modules Request class instance for event
    //
    if( noCallback ){
        return new Request(reqOptions);
    }

    //
    // callback exists, return Request for streaming and handle callback for error handling and custom formatted data
    //
    return callRequest(reqOptions, handleCallback.bind(null,callback) );
}
859149
def func_factory(p, method: str) -> callable:
    

    def callback(pretty: bool = False):
        res = getattr(p, method)
        dump = partial(json.dumps, indent=4) if pretty else partial(json.dumps)
        click.echo(dump(res))

    return callback