Bokeh-internal function to check callback signature
426258
def _check_callback(callback, fargs, what="Callback functions"):
    ''''''
    sig = signature(callback)
    formatted_args = format_signature(sig)
    error_msg = what + " must have signature func(%s), got func%s"

    all_names, default_values = get_param_info(sig)

    nargs = len(all_names) - len(default_values)
    if nargs != len(fargs):
        raise ValueError(error_msg % (", ".join(fargs), formatted_args))
1040774
def _hline_bokeh_(self, col):
        
        c = hv.HLine(self.df[col].mean())
        return c
665049
def _extern_decl(return_type, arg_types):
  
  def wrapper(func):
    signature = _ExternSignature(
      return_type=str(return_type),
      method_name=str(func.__name__),
      arg_types=tuple(arg_types))
    func.extern_signature = signature
    return func
  return wrapper
1274313
function (callback) {
                var boundCallback = _gpfArrayBind(callback, arguments);
                return !_gpfArrayEveryOwnFrom0(this, function (item, index, array) {
                    return !boundCallback(item, index, array);
                });
            }
488109
def callback(name, params, returns)
      params, returns = generate_signature(params, returns)
      super name.to_sym, params, returns
    end
997153
function callback (start, end, props) {
        if (props === undefined) {
            props = {};
        }
        key = blockKey + KEY_SEPARATOR + decorationId;
        decorated[blockKey][decorationId] = props;
        decorateRange(decorations, start, end, key);
        decorationId++;
    }
759206
def _function_signature(func):
    
    if sys.version_info.major > 2:
        # Python 3 already implements this functionality
        return func.__name__ + str(inspect.signature(func))

    # In Python 2 we have to do it manually, unfortunately
    spec = inspect.getargspec(func)
    posargs = spec.args
    defaults = spec.defaults if spec.defaults is not None else []
    varargs = spec.varargs
    kwargs = spec.keywords
    deflen = 0 if defaults is None else len(defaults)
    nodeflen = 0 if posargs is None else len(posargs) - deflen

    args = ['{}'.format(arg) for arg in posargs[:nodeflen]]
    args.extend('{}={}'.format(arg, dval)
                for arg, dval in zip(posargs[nodeflen:], defaults))
    if varargs:
        args.append('*{}'.format(varargs))
    if kwargs:
        args.append('**{}'.format(kwargs))

    argstr = ', '.join(args)

    return '{}({})'.format(func.__name__, argstr)
237232
function checkFunction(node) {
            const parent = node.parent;

            if (parent.type === "CallExpression") {
                callbackStack.push(node);
            }

            if (callbackStack.length > THRESHOLD) {
                const opts = { num: callbackStack.length, max: THRESHOLD };

                context.report({ node, messageId: "exceed", data: opts });
            }
        }
669230
function(callback) {
      var i = 0,
          keys = this.keys(),
          returned;

      for (i; i < keys.length; i++) {
        returned = callback(keys[i], this.get(keys[i]));
        if (returned === false) { return false; }
      };
    }
1275313
function(cur, depth, context, callback, stop) {
        if(stop[0]) {
            return true;
        }
        if(depth === this.dimensionsList.length) {
            stop[0] = !callback(this._contextToObject(context), cloneDeep(cur));
            return stop[0];
        }
        var key;
        for(key in cur) {
            if(this._walkSettingsHelper(cur[key], depth+1, context.concat(key), callback, stop)) {
                return true;
            }
        }
    }
1263056
def is_cython_function(fn):
    """"""
    if hasattr(fn, "__func__"):
        fn = fn.__func__  # Class method, static method
    name = type(fn).__name__
    return (
        name == "method_descriptor"
        or name == "cython_function_or_method"
        or name == "builtin_function_or_method"
    )
746540
def __callback (self, odom):
        '''
        

        '''
        pose = odometry2Pose3D(odom)

        self.lock.acquire()
        self.data = pose
        self.lock.release()
1294746
def validate_callback_data(method):
    
    @wraps(method)
    def method_wrapper(*args, **kwargs):
        """

        Parameters
        ----------
        *args
        **kwargs

        Returns
        -------
        method's output
        """
        expected = method.__code__.co_varnames

        # rename curret gam object
        if 'self' in kwargs:
            gam = kwargs['self']
            del(kwargs['self'])
            kwargs['gam'] = gam

        # loop once to check any missing
        missing = []
        for e in expected:
            if e == 'self':
                continue
            if e not in kwargs:
                missing.append(e)
        assert len(missing) == 0, 'CallBack cannot reference: {}'.\
                                  format(', '.join(missing))

        # loop again to extract desired
        kwargs_subset = {}
        for e in expected:
            if e == 'self':
                continue
            kwargs_subset[e] = kwargs[e]

        return method(*args, **kwargs_subset)

    return method_wrapper
803056
function inspect(callback) {
  return function (filename) {
    var chunks = [];

    function transform(chunk, encoding, done) {
      /* jshint validthis:true */
      chunks.push(chunk);
      this.push(chunk);
      done();
    }

    function flush(done) {
      callback(filename, chunks.join(''), done);
      if (callback.length < 3) {
        done();
      }
    }

    return through(transform, flush);
  }
}
808610
def _TypecheckFunction(function, parent_type_check_dict, stack_location,
                      self_name):
  """"""
  type_check_dict = _CollectTypeChecks(function, parent_type_check_dict,
                                      stack_location + 1, self_name)
  if not type_check_dict:
    return function

  def TypecheckWrapper(*args, **kwargs):
    arg_dict = _CollectArguments(function, args, kwargs)
    errors = _ValidateArguments(arg_dict, type_check_dict)
    if errors:
      raise TypeError("\n".join(errors))

    return_value = function(*args, **kwargs)

    errors = _ValidateReturnValue(return_value, type_check_dict)
    if errors:
      raise TypeError("\n".join(errors))
    return return_value

  TypecheckWrapper.__doc__ = function.__doc__
  TypecheckWrapper.__name__ = function.__name__
  TypecheckWrapper.type_check_dict = type_check_dict
  TypecheckWrapper.wrapped_function = function

  return TypecheckWrapper
56689
function (callback) {
        if (!self._image) {
          var paths = (process.env.PATH || '').split(delimiter);
          if (!_.find(paths, function(p) {
            if (fs.existsSync(p + '/imagecrunch')) {
              self._image = require('./lib/image/imagecrunch.js')();
              return true;
            }
            // Allow for Windows and Unix filenames for identify. Silly oversight
            // after getting delimiter right (:
            if (fs.existsSync(p + '/identify') || fs.existsSync(p + '/identify.exe')) {
              self._image = require('./lib/image/imagemagick.js')();
              return true;
            }
          })) {
            // Fall back to jimp, no need for an error
            self._image = require('./lib/image/jimp.js')();
          }
        }
        return callback(null);
      }
208272
function(callback) {
		
		if(!this.ifLoad) {
			this.history.push('add to stack task: bmpToData');
			this.stack(this.bmpToData, callback);
			return;
		} 
		
		this.history.push('bmp decode');
		
		var fileSize, headerLength, i, magic, offset, b, data, g, r, w, x, y, _ref;
		this.pos = 0;
		this.bpp = 24;
		
		magic = ((function() {
			var _results;
			_results = [];
			for (i = 0; i < 2; i++) {
				_results.push(String.fromCharCode(this.data[this.pos++]));
			}
			return _results;
		}).call(this)).join('');
		
		if (magic !== 'BM') {
			throw 'Invalid BMP file.';
		}
		
		fileSize = this._readUInt32Bmp();
		this.pos += 4;
		offset = this._readUInt32Bmp();
		headerLength = this._readUInt32Bmp();
		this.width = this._readUInt32Bmp();
		this.height = this._readUInt32Bmp();
		this.colorPlaneCount = this._readUInt16Bmp();
		this.bitsPerPixel = this._readUInt16Bmp();
		this.compressionMethod = this._readUInt32Bmp();
		this.rawSize = this._readUInt32Bmp();
		this.hResolution = this._readUInt32Bmp();
		this.vResolution = this._readUInt32Bmp();
		this.paletteColors = this._readUInt32Bmp();
		this.importantColors = this._readUInt32Bmp();


		var Ndata = [];

		for(y = this.height; y > 0; y--) {
			i = 4 * y * this.width;
			
			for (var x = 0; x < this.width; x++) {
				
				b = this.data[this.pos++];
				g = this.data[this.pos++];
				r = this.data[this.pos++];
				
				Ndata[i++] = r;
				Ndata[i++] = g;
				Ndata[i++] = b;
				Ndata[i++] = 255;
			}
			
			if(this.width%2) {
				this.pos++;
			}
			
			if(this.width%4) {
				this.pos++;
				this.pos++;
			}
		}
	
		for(var i=0, null_elems=0; i < Ndata.length; i ++) {
			if(Ndata[i] != null) {
				break;
			}
			null_elems++;
		}
		
		Ndata.splice(0, this.width*4);
		
		this.data = Ndata;
		callback.call(this);
		
		return;
	}