function taken from markings support in Flot
490630
function extractRange(ranges, coord) {
            var axis, from, to, key, axes = plot.getAxes();

            for (var k in axes) {
                axis = axes[k];
                if (axis.direction == coord) {
                    key = coord + axis.n + "axis";
                    if (!ranges[key] && axis.n == 1)
                        key = coord + "axis"; // support x1axis as xaxis
                    if (ranges[key]) {
                        from = ranges[key].from;
                        to = ranges[key].to;
                        break;
                    }
                }
            }

            // backwards-compat stuff - to be removed in future
            if (!ranges[key]) {
                axis = coord == "x" ? plot.getXAxes()[0] : plot.getYAxes()[0];
                from = ranges[coord + "1"];
                to = ranges[coord + "2"];
            }

            // auto-reverse as an added bonus
            if (from != null && to != null && from > to) {
                var tmp = from;
                from = to;
                to = tmp;
            }
            
            return { from: from, to: to, axis: axis };
        }
570774
function(oRm, aNotifiers) {
			for ( var i = 0; i < aNotifiers.length; i++) {
				fnRenderNotifier(oRm, aNotifiers[i], false);
			}
		}
325851
def visit_FunctionDef(self, node):
        """"""
        # [[[cog
        # cog.out("print(pcolor('Enter function visitor', 'magenta'))")
        # ]]]
        # [[[end]]]
        in_class = self._in_class(node)
        decorator_list = [
            dobj.id if hasattr(dobj, "id") else dobj.attr
            for dobj in node.decorator_list
            if hasattr(dobj, "id") or hasattr(dobj, "attr")
        ]
        node.decorator_list = []
        # Callable can be:
        # a) A class property defined via decorated methods
        # b) A class method
        # c) A function
        # Get callable information (name, line number, etc.)
        action = (
            "getter"
            if "property" in decorator_list
            else (
                "setter"
                if "setter" in decorator_list
                else ("deleter" if "deleter" in decorator_list else None)
            )
        )
        element_type = "meth" if in_class else "func"
        element_full_name = self._pop_indent_stack(node, element_type, action=action)
        code_id = (self._fname, node.lineno)
        self._processed_line = node.lineno
        self._callables_db[element_full_name] = {
            "name": element_full_name,
            "type": element_type,
            "code_id": code_id,
            "last_lineno": None,
        }
        self._reverse_callables_db[code_id] = element_full_name
        # [[[cog
        # code = """
        # print(
        #     pcolor(
        #         'Visiting callable {0}  @ {1}'.format(
        #             element_full_name, code_id[1]
        #         ),
        #         'green'
        #     )
        # )
        # print(pcolor('    in_class = {}'.format(in_class), 'yellow'))
        # """
        # cog.out(code)
        # ]]]
        # [[[end]]]
        self.generic_visit(node)
51537
def _make_ufunc(func, index=Ellipsis, **kwargs):  # noqa: D202
    """"""

    def _ufunc(ary):
        target = np.empty(ary.shape[:-2])
        for idx in np.ndindex(target.shape):
            target[idx] = np.asarray(func(ary[idx].ravel(), **kwargs))[index]
        return target

    return _ufunc
414979
def trace(fn): # pragma: no cover
    
    def wrapped(*args, **kwargs):
        msg = []
        msg.append('Enter {}('.format(fn.__name__))

        if args:
            msg.append(', '.join([str(x) for x in args]))

        if kwargs:
            kwargs_str = ', '.join(['{}={}'.format(k, v) for k, v in list(kwargs.items())])
            if args:
                msg.append(', ')
            msg.append(kwargs_str)
        msg.append(')')
        print(''.join(msg))
        ret = fn(*args, **kwargs)
        print('Return {}'.format(ret))
        return ret
    return wrapped
1048543
function highlightDataPoints({values}) {
            let accumulator = 0;

            cleanDataPointHighlights();

            // ensure order stays constant
            let sortedValues = order.reduce((acc, current) => {
                return [...acc, values.find(({name}) => name === current)];
            },[]);

            sortedValues.forEach((d, index) => {
                let marker = verticalMarkerContainer
                    .append('g')
                    .classed('circle-container', true)
                        .append('circle')
                        .classed('data-point-highlighter', true)
                        .attr('cx', highlightCircleSize)
                        .attr('cy', 0)
                        .attr('r', highlightCircleRadius)
                        .style('stroke-width', highlightCircleStroke)
                        .style('stroke', categoryColorMap[d.name])
                        .style('cursor', 'pointer')
                        .on('click', function() {
                            addGlowFilter(this);
                            handleHighlightClick(this, d);
                        })
                        .on('mouseout', function() {
                            removeFilter(this);
                        });

                accumulator = accumulator + sortedValues[index][valueLabel];

                marker.attr('transform', `translate( ${(- highlightCircleSize)}, ${(yScale(accumulator))} )` );
            });
        }
1354709
function printLintSummary(
  label: string,
  errors: number,
  warnings: number,
): void {
  const text = ` ${label}: ${errors} errors, ${warnings} warnings `

  let coloredText

  if (errors) {
    coloredText = chalk.white(chalk.bgRed(text))
  } else if (warnings) {
    coloredText = chalk.bgYellow(text)
  } else {
    coloredText = chalk.bgGreen(text)
  }

  const boldColoredText = chalk.bold(coloredText)

  console.log(`${boldColoredText}\n`)
}
926366
def trace(function, *args, **k) :
	""""""

	if doTrace : print ("> "+function.__name__, args, k)
	result = function(*args, **k)
	if doTrace : print ("< "+function.__name__, args, k, "->", result)
	return result
135675
function getSignature (sp, fn) {
  var start = null
    , sig = ''
    , timer;

  var handleSignature = function(data) {
    if (data)
      sig += data.toString() || '';

    clearTimeout(timer);

    if (!start && data) {
      start = Date.now();
    } else if (Date.now() - start > 100) {
      sp.removeListener('data', handleSignature);
      return fn(null, sig.trim());
    }

    timer = setTimeout(handleSignature, 100);
  };

  sp.on('data', handleSignature);
}
364666
def tracer(object):
    

    @functools.wraps(object)
    @functools.partial(validate_tracer, object)
    def tracer_wrapper(*args, **kwargs):
        """
        Traces execution.

        :param \*args: Arguments.
        :type \*args: \*
        :param \*\*kwargs: Keywords arguments.
        :type \*\*kwargs: \*\*
        :return: Object.
        :rtype: object
        """

        code = object.func_code
        args_count = code.co_argcount
        args_names = code.co_varnames[:args_count]
        function_defaults = object.func_defaults or list()
        args_defaults = dict(zip(args_names[-len(function_defaults):], function_defaults))

        positional_args = map(format_argument, zip(args_names, args))
        defaulted_args = [format_argument((name, args_defaults[name]))
                          for name in args_names[len(args):] if name not in kwargs]
        nameless_args = map(repr, args[args_count:])
        keyword_args = map(format_argument, kwargs.items())
        sys.stdout.write("{0}({1})\n".format(get_trace_name(object),
                                             ", ".join(itertools.chain(positional_args,
                                                                       defaulted_args,
                                                                       nameless_args,
                                                                       keyword_args))))
        return object(*args, **kwargs)

    return tracer_wrapper
1320659
def decorator(target):
    """"""

    def decorate(fn):
        spec = inspect.getargspec(fn)
        names = tuple(spec[0]) + spec[1:3] + (fn.__name__,)
        targ_name, fn_name = unique_symbols(names, 'target', 'fn')

        metadata = dict(target=targ_name, fn=fn_name)
        metadata.update(format_argspec_plus(spec, grouped=False))

        code = 'lambda %(args)s: %(target)s(%(fn)s, %(apply_kw)s)' % (
                metadata)
        decorated = eval(code, {targ_name: target, fn_name: fn})
        decorated.__defaults__ = getattr(fn, 'im_func', fn).__defaults__
        return update_wrapper(decorated, fn)
    return update_wrapper(decorate, target)
1309041
def trace(self, func):
        """"""

        def wrapper(*args, **kwargs):
            # Print out the call to the function with its arguments.
            s = self.Stanza(self.indent)
            s.add([self.GREEN, func.__name__, self.NORMAL, '('])
            s.indent += 4
            sep = ''
            for arg in args:
                s.add([self.CYAN, self.safe_repr(arg), self.NORMAL], sep)
                sep = ', '
            for name, value in sorted(kwargs.items()):
                s.add([name + '=', self.CYAN, self.safe_repr(value),
                       self.NORMAL], sep)
                sep = ', '
            s.add(')', wrap=False)
            self.writer.write(s.chunks)

            # Call the function.
            self.indent += 2
            try:
                result = func(*args, **kwargs)
            except:
                # Display an exception.
                self.indent -= 2
                etype, evalue, etb = self.sys.exc_info()
                info = self.inspect.getframeinfo(etb.tb_next, context=3)
                s = self.Stanza(self.indent)
                s.add([self.RED, '!> ', self.safe_repr(evalue), self.NORMAL])
                s.add(['at ', info.filename, ':', info.lineno], ' ')
                lines = self.unindent(info.code_context)
                firstlineno = info.lineno - info.index
                fmt = '%' + str(len(str(firstlineno + len(lines)))) + 'd'
                for i, line in enumerate(lines):
                    s.newline()
                    s.add([
                        i == info.index and self.MAGENTA or '',
                        fmt % (i + firstlineno),
                        i == info.index and '> ' or ': ', line, self.NORMAL])
                self.writer.write(s.chunks)
                raise

            # Display the return value.
            self.indent -= 2
            s = self.Stanza(self.indent)
            s.add([self.GREEN, '-> ', self.CYAN, self.safe_repr(result),
                   self.NORMAL])
            self.writer.write(s.chunks)
            return result
        return self.functools.update_wrapper(wrapper, func)
943029
function (lineData) {
                    return function (e, shape, chart, series) {
                        d3.select(shape).style("opacity", (series.lineMarkers || lineData.data.length < 2 ? dimple._helpers.opacity(e, chart, series) : 0));
                        dimple._removeTooltip(e, shape, chart, series);
                    };
                }
1041246
def _get_markers(marks, order, bins):
        

        if callable(marks):
            markers = [x for x in order if marks(x)]
        elif isinstance(marks, list):
            markers = [order[x] for x in marks]
        elif isinstance(marks, tuple):
            markers = marks
        else:
            nth_mark = np.ceil(len(order) / marks).astype(int)
            markers = order[::nth_mark]

        return np.array([bins[x][1] for x in markers])
730884
function annotate(fn) {
  var matched = /function +[^\(]*\(([^\)]*)\).*/.exec(fn.toString());
  var names = _.reject(matched[1].split(',') || [], _.isEmpty);

  return _.map(names, function(name) {
    return name.replace(/\s+/g, '');
  });
}
131293
def trace(fun, *a, **k):
    
    @wraps(fun)
    def tracer(*a, **k):
        ret = fun(*a, **k)
        print('trace:fun: %s\n ret=%s\n a=%s\nk%s\n' %
              (str(fun), str(ret), str(a), str(k)))
        return ret
    return tracer
645516
def setSr(self, fs):
        """"""
        self.tracePlot.setSr(fs)
        self.stimPlot.setSr(fs)