python3.7+ breakpoint()
558685
def visit_Call(self, node):  # type: (ast.Call) -> None
        """"""
        if isinstance(node.func, ast.Name) and node.func.id == 'breakpoint':
            st = Debug(node.lineno, node.col_offset, node.func.id, 'called')
            self.breakpoints.append(st)
        self.generic_visit(node)
1189128
function processBreakpoints(root, breakpointsOption) {
  if (breakpointsOption && !Array.isArray(breakpointsOption)) {
    throw new Error('Breakpoints option must be of type Array.');
  }

  const defaultBreakpoints = [
    {
      prefix: 'xs-',
      mediaQuery: '(max-width: 40em)',
    },
    {
      prefix: 'sm-',
      mediaQuery: '(min-width: 40em)',
    },
    {
      prefix: 'md-',
      mediaQuery: '(min-width: 52em)',
    },
    {
      prefix: 'lg-',
      mediaQuery: '(min-width: 64em)',
    },
  ];

  const mergedBreakpoints = merge([], defaultBreakpoints, breakpointsOption);
  return mergedBreakpoints.map((breakpoint) => processBreakpoint(root, breakpoint));
}
505613
def entry_point(__func: Callable) -> Callable:
    
    if __func.__module__ == '__main__':
        import sys
        sys.exit(__func())
    else:
        return __func
918313
def debug(value):
    
    print("%s %s: " % (type(value), value))
    print(dir(value))
    print('\n\n')
    return ''
688862
def debug(*args, **kwargs):
    
    if kwargs.get('file', None) is None:
        kwargs['file'] = sys.stderr
    msg = kwargs.get('sep', ' ').join(str(a) for a in args)
    print('debug: {}'.format(msg), **kwargs)
1133304
def debug(self, defn, args, kwargs, fmt=None, color='green'):
    
    ta = datetime.datetime.now()
    rs = defn(*args, **kwargs)  
    tb = datetime.datetime.now() - ta
    fmt = fmt or "processed {defn} in {ms}ms"
    logmsg = fmt.format(ms=tb.microseconds/1000.0, defn=defn)
    "terminal output"
    print cl(logmsg, color)
    "logging output"
    logging.debug(logmsg)
    return rs
930686
def do_bp(self, arg):
        
        pid = self.get_process_id_from_prefix()
        if not self.debug.is_debugee(pid):
            raise CmdError("target process is not being debugged")
        process     = self.get_process(pid)
        token_list  = self.split_tokens(arg, 1, 1)
        try:
            address = self.input_address(token_list[0], pid)
            deferred = False
        except Exception:
            address = token_list[0]
            deferred = True
        if not address:
            address = token_list[0]
            deferred = True
        self.debug.break_at(pid, address)
        if deferred:
            print("Deferred breakpoint set at %s" % address)
        else:
            print("Breakpoint set at %s" % address)
1164486
def debug(s, *args):
    """"""
    # Get the path name and line number of the function which called us.
    previous_frame = inspect.currentframe().f_back
    try:
        pathname, lineno, _, _, _ = inspect.getframeinfo(previous_frame)
        # if path is in cwd, simplify it
        cwd = os.path.abspath(os.getcwd())
        pathname = os.path.abspath(pathname)
        if os.path.commonprefix([cwd, pathname]) == cwd:
            pathname = os.path.relpath(pathname, cwd)
    except Exception:  # pylint: disable=broad-except
        pathname = '<UNKNOWN-FILE>.py'
        lineno = 0
    if _FORMATTER: # log could have not been initialized.
        _FORMATTER.pathname = pathname
        _FORMATTER.lineno = lineno
    logger = logging.getLogger(__package__)
    logger.debug(s.format(*args))
28007
def do_break(self, arg):
        
        debug   = self.debug
        system  = debug.system
        targets = self.input_process_list( self.split_tokens(arg) )
        if not targets:
            targets = debug.get_debugee_pids()
            targets.sort()
        if self.lastEvent:
            current = self.lastEvent.get_pid()
        else:
            current = None
        for pid in targets:
            if pid != current and debug.is_debugee(pid):
                process = system.get_process(pid)
                try:
                    process.debug_break()
                except WindowsError:
                    print("Can't force a debug break on process (%d)")
1163444
def main():
	
	# Create base shutit object.
	shutit = shutit_global.shutit_global_object.shutit_objects[0]
	if sys.version_info[0] == 2:
		if sys.version_info[1] < 7:
			shutit.fail('Python version must be 2.7+') # pragma: no cover
	try:
		shutit.setup_shutit_obj()
	except KeyboardInterrupt:
		shutit_util.print_debug(sys.exc_info())
		shutit_global.shutit_global_object.shutit_print('Keyboard interrupt caught, exiting with status 1')
		sys.exit(1)
79535
def breakpoint(args):
    
    from jcvi.formats.blast import bed
    from jcvi.utils.range import range_interleave

    p = OptionParser(breakpoint.__doc__)
    p.add_option("--xdist", type="int", default=20,
                 help="xdist (in related genome) cutoff [default: %default]")
    p.add_option("--ydist", type="int", default=200000,
                 help="ydist (in current genome) cutoff [default: %default]")
    p.add_option("-n", type="int", default=5,
                 help="number of markers in a block [default: %default]")
    opts, args = p.parse_args(args)

    if len(args) != 2:
        sys.exit(not p.print_help())

    blastfile, bedfile = args
    order = Bed(bedfile).order
    blastbedfile = bed([blastfile])
    bbed = Bed(blastbedfile)
    for scaffold, bs in bbed.sub_beds():
        blocks = get_blocks(scaffold, bs, order,
                            xdist=opts.xdist, ydist=opts.ydist, N=opts.n)
        sblocks = []
        for block in blocks:
            xx, yy = zip(*block)
            sblocks.append((scaffold, min(yy), max(yy)))
        iblocks = range_interleave(sblocks)
        for ib in iblocks:
            ch, start, end = ib
            print("{0}\t{1}\t{2}".format(ch, start - 1, end))
886292
def _DebuggerMain():
  """"""
  global _flags

  # The first argument is cdbg module, which we don't care.
  del sys.argv[0]

  # Parse debugger flags until we encounter '--'.
  _flags = {}
  while sys.argv[0]:
    arg = sys.argv[0]
    del sys.argv[0]

    if arg == '--':
      break

    (name, value) = arg.strip('-').split('=', 2)
    _flags[name] = value

  _StartDebugger()

  # Run the app. The following code was mostly copied from pdb.py.
  app_path = sys.argv[0]

  sys.path[0] = os.path.dirname(app_path)

  import __main__  # pylint: disable=g-import-not-at-top
  __main__.__dict__.clear()
  __main__.__dict__.update({'__name__': '__main__',
                            '__file__': app_path,
                            '__builtins__': __builtins__})
  locals = globals = __main__.__dict__  # pylint: disable=redefined-builtin

  sys.modules['__main__'] = __main__

  with open(app_path) as f:
    code = compile(f.read(), app_path, 'exec')
    exec(code, globals, locals)
275464
def eval_condition(self, event):
        
        condition = self.get_condition()
        if condition is True:   # shortcut for unconditional breakpoints
            return True
        if callable(condition):
            try:
                return bool( condition(event) )
            except Exception:
                e = sys.exc_info()[1]
                msg = ("Breakpoint condition callback %r"
                       " raised an exception: %s")
                msg = msg % (condition, traceback.format_exc(e))
                warnings.warn(msg, BreakpointCallbackWarning)
                return False
        return bool( condition )
1199579
def main(args=None):
    """"""
    retcode = 0
    try:
        ci = CliInterface()
        args = ci.parser.parse_args()
        result = args.func(args)
        if result is not None:
            print(result)
        retcode = 0
    except Exception:
        retcode = 1
        traceback.print_exc()
    sys.exit(retcode)
148006
function BreakpointController(options) {
  if (!(this instanceof BreakpointController)) {
    return new BreakpointController(options);
  }

  Emitter.mixin(this);

  var breakpointStream = BreakpointStream.create(options.breakpoints, {
    throttleMs: options.throttleMs,
    debounceMs: options.debounceMs
  });

  var activeBreakpoints = {};

  var self = this;
  Stream.onValue(breakpointStream, function(e) {
    activeBreakpoints[e[0]] = e[1];

    var namedState = e[1] ? 'enter' : 'exit';
    self.trigger('breakpoint', [e[0], namedState]);
    self.trigger('breakpoint:' + e[0], [e[0], namedState]);
  });

  this.getActiveBreakpoints = function getActiveBreakpoints() {
    var isActive = Util.compose(Util.isTrue, Util.get(activeBreakpoints));
    return Util.select(isActive, Util.objectKeys(activeBreakpoints));
  };
}
1191347
def CompleteBreakpoint(self, breakpoint_id):
    
    with self._lock:
      self._completed.add(breakpoint_id)
      if breakpoint_id in self._active:
        self._active.pop(breakpoint_id).Clear()
981545
def get_breaks_lno(self, filename):
        """"""
        return list(
            filter(
                lambda x: x is not None, [
                    getattr(breakpoint, 'line', None)
                    for breakpoint in self.breakpoints
                    if breakpoint.on_file(filename)
                ]
            )
        )