Outputs a whole load of debugging information, including the current
    context and imported modules.

    Sample usage::

        <pre>
            {% debug %}
        </pre>
429444
def debug(context):
    

    from pprint import pformat
    output = [pformat(val) for val in context]
    output.append('\n\n')
    output.append(pformat(sys.modules))
    return ''.join(output)
1145038
def export_debug(self, output_path):
        

        file_hash = hashlib.md5(open(output_path, 'rb').read()).hexdigest()
        avm_name = os.path.splitext(os.path.basename(output_path))[0]

        json_data = self.generate_debug_json(avm_name, file_hash)

        mapfilename = output_path.replace('.avm', '.debug.json')
        with open(mapfilename, 'w+') as out_file:
            out_file.write(json_data)
1020635
def _debug(self, message, load=False, no_prefix=False):
        
        if self.args.debug_analysis:
            if load:
                message = '\r\n'.join(
                    ['# ' + line for line in message.strip().split('\r\n')]
                )
                print '{0}\n{1}\n{0}'.format('#' * 78, message)
            else:
                # If open message and no_prefix is False
                if (len(self.messages) > 0 and not
                        self.messages[-1].write_closed) and not no_prefix:
                    print '--OPEN--> {0}'.format(message)
                else:
                    print message
709810
def _debug_info(self):
        
        self._msg('DEBUG')
        self._msg2('WorkDir: {0}'.format(self._curdir))
        self._msg2('Cookies: {0}'.format(self._session.cookies))
        self._msg2('Headers: {0}'.format(self._session.headers))
        self._msg2('Configs: {0}'.format(self._config))
        self._msg2('Customs: {0}'.format(self._custom))
        self._msg2('Account: {0}'.format(self._account))
469291
def debug(text):
    
    frame = inspect.currentframe().f_back
    module = frame.f_globals['__name__']
    func = frame.f_code.co_name
    msg = "%s.%s: %s" % (module, func, text)
    _LOGGER.debug(msg)
1128176
def debug(level=logging.DEBUG):
    
    from jcvi.apps.console import magenta, yellow

    format = yellow("%(asctime)s [%(module)s]")
    format += magenta(" %(message)s")
    logging.basicConfig(level=level,
            format=format,
            datefmt="%H:%M:%S")
608623
private static function debugEnd()
    {
        // SWATDB_DEBUG is legacy, use SwatDB::setDebug() instead
        if (defined('SWATDB_DEBUG') || self::$debug) {
            self::$debug_wrapper_depth--;

            if (self::$debug_wrapper_depth === 0) {
                $count = 0;
                $depth = 0;

                foreach (self::$debug_info as $info) {
                    if ($info['depth'] < $depth) {
                        echo str_repeat(
                            '</blockquote>',
                            $depth - $info['depth']
                        );
                    } elseif ($info['depth'] > $depth) {
                        echo '<blockquote class="swat-db-debug">';
                    } elseif ($info['depth'] === 0) {
                        echo '<hr />';
                    }

                    echo "\n" . $info['message'] . "\n";

                    $locale = SwatI18NLocale::get();
                    printf(
                        "<p>Query #%s</p>\n",
                        $locale->formatNumber($info['count'])
                    );

                    if (count(self::$debug_info) > $count + 1) {
                        $time = self::$debug_info[$count + 1]['time'];
                    } else {
                        $time = microtime(true) * 1000;
                    }

                    $ms = $time - $info['time'];

                    printf(
                        "<p><strong>%s ms</strong></p>\n",
                        $locale->formatNumber($ms, 3)
                    );

                    if ($info['depth'] === 0 && count(self::$debug_info) > 1) {
                        $ms =
                            microtime(true) * 1000 -
                            self::$debug_info[0]['time'];

                        echo '<p><strong>';

                        printf(
                            Swat::_(
                                'Total time: %s ms (includes ' .
                                    'queries within the wrapper)'
                            ),
                            $locale->formatNumber($ms, 3)
                        );

                        echo '</strong></p>';
                    }

                    $count++;
                    $depth = $info['depth'];
                }

                if ($depth > 0) {
                    echo str_repeat('</blockquote>', $depth);
                }

                // reset debug info for the next query
                self::$debug_info = array();
            }
        }
    }
220483
def load(self, context):
    
    if not (context.flags.debugger_data_server_grpc_port > 0 or
            context.flags.debugger_port > 0):
      return None
    flags = context.flags
    try:
      # pylint: disable=g-import-not-at-top,unused-import
      import tensorflow
    except ImportError:
      raise ImportError(
          'To use the debugger plugin, you need to have TensorFlow installed:\n'
          '  pip install tensorflow')
    try:
      # pylint: disable=line-too-long,g-import-not-at-top
      from tensorboard.plugins.debugger import debugger_plugin as debugger_plugin_lib
      from tensorboard.plugins.debugger import interactive_debugger_plugin as interactive_debugger_plugin_lib
      # pylint: enable=line-too-long,g-import-not-at-top
    except ImportError as e:
      e_type, e_value, e_traceback = sys.exc_info()
      message = e.msg if hasattr(e, 'msg') else e.message  # Handle py2 vs py3
      if 'grpc' in message:
        e_value = ImportError(
            message +
            '\n\nTo use the debugger plugin, you need to have '
            'gRPC installed:\n  pip install grpcio')
      six.reraise(e_type, e_value, e_traceback)
    if flags.debugger_port > 0:
      interactive_plugin = (
          interactive_debugger_plugin_lib.InteractiveDebuggerPlugin(context))
      logger.info('Starting Interactive Debugger Plugin at gRPC port %d',
                   flags.debugger_data_server_grpc_port)
      interactive_plugin.listen(flags.debugger_port)
      return interactive_plugin
    elif flags.debugger_data_server_grpc_port > 0:
      noninteractive_plugin = debugger_plugin_lib.DebuggerPlugin(context)
      logger.info('Starting Non-interactive Debugger Plugin at gRPC port %d',
                   flags.debugger_data_server_grpc_port)
      noninteractive_plugin.listen(flags.debugger_data_server_grpc_port)
      return noninteractive_plugin
    raise AssertionError()
819770
def get_debug():
    
    try:
        import IPython

    except ImportError:
        debug = None

    else:
        old_excepthook = sys.excepthook

        def debug(frame=None):
            if IPython.__version__ >= '0.11':
                from IPython.core.debugger import Pdb

                try:
                    ip = get_ipython()

                except NameError:
                    from IPython.frontend.terminal.embed \
                         import InteractiveShellEmbed
                    ip = InteractiveShellEmbed()

                colors = ip.colors

            else:
                from IPython.Debugger import Pdb
                from IPython.Shell import IPShell
                from IPython import ipapi

                ip = ipapi.get()
                if ip is None:
                    IPShell(argv=[''])
                    ip = ipapi.get()

                colors = ip.options.colors

            sys.excepthook = old_excepthook

            if frame is None:
                frame = sys._getframe().f_back

            Pdb(colors).set_trace(frame)

    if debug is None:
        import pdb
        debug = pdb.set_trace

    debug.__doc__ = """
    Start debugger on line where it is called, roughly equivalent to::

        import pdb; pdb.set_trace()

    First, this function tries to start an `IPython`-enabled
    debugger using the `IPython` API.

    When this fails, the plain old `pdb` is used instead.
    """

    return debug
486101
def debug(trace=True, backtrace=1, other=None, output=sys.stderr):
    """"""
    from pprint import pprint
    import traceback
    def debugdeco(func):
        def tracer(frame, event, arg):
            print>>output, '--- Tracer: %s, %r' % (event, arg)
            traceback.print_stack(frame, 1, output)
            return tracer
        def wrapped(*a, **k):
            print>>output
            print>>output, '--- Calling %s.%s with:' % (
                getattr(func, '__module__', ''),
                func.__name__
            )
            for i in enumerate(a):
                print>>output, '    | %s: %s' % i
            print>>output, '    | ',
            pprint(k, output)
            print>>output, '    From:'
            for i in traceback.format_stack(sys._getframe(1), backtrace):
                print>>output, i,
            if other:
                print>>output, '---      [ %r ]' % (other(func,a,k))
            if trace: sys.settrace(tracer)
            ret = func(*a, **k)
            if trace: sys.settrace(None)
            #~ a = list(a)
            print>>output, '--- %s.%s returned: %r' % (
                getattr(func, '__module__', ''),
                func.__name__,
                #~ ret not in a and ret or "ARG%s"%a.index(ret)
                ret
            )
            return ret
        return wrapped
    return debugdeco
276040
public String debugInfo() {
        if (!isDebug || debugEntries.size() == 0) {
            return "";
        }
        StringBuffer ret = new StringBuffer();
        for (int i = debugEntries.size() - 1;i >= 0;i--) {
            Entry entry = debugEntries.get(i);
            ret.append(entry.timestamp).append(": ").append(entry.message).append("\n");
            if (entry.throwable != null) {
                StringWriter writer = new StringWriter();
                entry.throwable.printStackTrace(new PrintWriter(writer));
                ret.append(writer.toString());
            }
        }
        return ret.toString();
    }
288201
def debugDumpNodeList(self, output, depth):
        
        libxml2mod.xmlDebugDumpNodeList(output, self._o, depth)
578991
def debug_info(self):
        """"""
        return [tuple(map(int, x.split('='))) for x in
                self._debug_info.split('&')]
335824
def debug(self, *msg):
        
        label = colors.yellow("DEBUG")
        self._msg(label, *msg)
246232
def print_context_info(self):
        
        print("Context Version:")
        print('ModernGL:', moderngl.__version__)
        print('vendor:', self.ctx.info['GL_VENDOR'])
        print('renderer:', self.ctx.info['GL_RENDERER'])
        print('version:', self.ctx.info['GL_VERSION'])
        print('python:', sys.version)
        print('platform:', sys.platform)
        print('code:', self.ctx.version_code)
494421
def debug(depth = 0)
      if debug?
        debug_info = yield
        debug_info = debug_info.inspect unless debug_info.is_a?(String)
        STDERR.puts debug_info.split("\n").map {|s| "  " * depth + s }
      end
    end
94812
def debugging():
    """"""
    print("In debugging")
    json_file = r"C:\Scripting\Processing\Cell" \
                r"data\outdata\SiBEC\cellpy_batch_bec_exp02.json"

    b = init(default_log_level="DEBUG")
    b.load_info_df(json_file)
    print(b.info_df.head())

    # setting some variables
    b.export_raw = False
    b.export_cycles = False
    b.export_ica = False
    b.save_cellpy_file = True
    b.force_raw_file = False
    b.force_cellpy_file = True

    b.load_and_save_raw(parent_level="cellpydata")