Handle the debugging to a file
14986
def debug(self, msg):
        '''
        
        '''
        # If debug is not disabled
        if self.__debug is not False:

            # If never was set, try to set it up
            if self.__debug is None:

                # Check what do we have inside settings
                debug_filename = getattr(settings, "AD_DEBUG_FILE", None)
                if debug_filename:
                    # Open the debug file pointer
                    self.__debug = open(settings.AD_DEBUG_FILE, 'a')
                else:
                    # Disable debuging forever
                    self.__debug = False

            if self.__debug:
                # Debug the given message
                self.__debug.write("{}\n".format(msg))
                self.__debug.flush()
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")
1348206
def write_debug_log(self, file_path):
        
        with open(file_path, "wb+") as fh:
            fh.write(system.get_system_info().encode('utf-8'))
            # writing to debug stream
            self._debug_stream.seek(0)
            fh.write(self._debug_stream.read().encode('utf-8'))
            fh.write("The following errors occured:\n".encode('utf-8'))
            for error in self._errors:
                fh.write((error + "\n").encode('utf-8'))
            for k, v in self._error_dict.items():
                if len(v) > 0:
                    fh.write(("Error(s) in %s with formula %s:\n" % k).encode('utf-8'))
                    for error in v:
                        fh.write((error + "\n").encode('utf-8'))
1042949
def debug_transform(ctx, transform, params, value, fields):
    """"""
    from canari.commands.debug_transform import debug_transform
    debug_transform(transform, value, fields, params, ctx.project, ctx.config)
1355987
def debug (logname, msg, *args, **kwargs):
    
    log = logging.getLogger(logname)
    if log.isEnabledFor(logging.DEBUG):
        _log(log.debug, msg, args, **kwargs)
975390
def debug(self, message, *args, **kwargs):
        
        self._log(logging.DEBUG, message, *args, **kwargs)
1087757
def ap_debug(object, options = {})
      object.ai(
        options.merge(html: true)
      ).sub(
        /^<pre([\s>])/,
        '<pre class="debug_dump"\\1'
      )
    end
545532
def remote_debug(sig,frame):
    """"""
    def _raiseEx(ex):
        """Raise specified exception in the remote process"""
        _raiseEx.ex = ex
    _raiseEx.ex = None
    
    try:
        # Provide some useful functions.
        locs = {'_raiseEx' : _raiseEx}
        locs.update(frame.f_locals)  # Unless shadowed.
        globs = frame.f_globals
        
        pid = os.getpid()  # Use pipe name based on pid
        pipe = NamedPipe(pipename(pid))
    
        old_stdout, old_stderr = sys.stdout, sys.stderr
        txt = ''
        pipe.put("Interrupting process at following point:\n" + 
               ''.join(traceback.format_stack(frame)) + ">>> ")
        
        try:
            while pipe.is_open() and _raiseEx.ex is None:
                line = pipe.get()
                if line is None: continue # EOF
                txt += line
                try:
                    code = codeop.compile_command(txt)
                    if code:
                        sys.stdout = six.StringIO()
                        sys.stderr = sys.stdout
                        six.exec_(code, globs, locs)
                        txt = ''
                        pipe.put(sys.stdout.getvalue() + '>>> ')
                    else:
                        pipe.put('... ')
                except:
                    txt='' # May be syntax err.
                    sys.stdout = six.StringIO()
                    sys.stderr = sys.stdout
                    traceback.print_exc()
                    pipe.put(sys.stdout.getvalue() + '>>> ')
        finally:
            sys.stdout = old_stdout # Restore redirected output.
            sys.stderr = old_stderr
            pipe.close()

    except Exception:  # Don't allow debug exceptions to propogate to real program.
        traceback.print_exc()
        
    if _raiseEx.ex is not None: raise _raiseEx.ex
628996
def debug(self, request, message, extra_tags='', fail_silently=False):
        """"""
        add(self.target_name, request, constants.DEBUG, message, extra_tags=extra_tags,
            fail_silently=fail_silently)
347361
def handle_debug_break(self, call_id, payload):
        """"""
        line = payload['line']
        config = self.launcher.config  # TODO: make an attribute of client
        path = os.path.relpath(payload['file'], config['root-dir'])

        self.editor.raw_message(feedback['notify_break'].format(line, path))
        self.debug_thread_id = payload["threadId"]
918313
def debug(value):
    
    print("%s %s: " % (type(value), value))
    print(dir(value))
    print('\n\n')
    return ''
1228701
def debug_callback(event, *args, **kwds):
    '''
    '''
    l = ['event %s' % (event.type,)]
    if args:
        l.extend(map(str, args))
    if kwds:
        l.extend(sorted('%s=%s' % t for t in kwds.items()))
    print('Debug callback (%s)' % ', '.join(l))
604376
def parse_debug(self, inputstring):
        """"""
        return self.parse(inputstring, self.file_parser, {"strip": True}, {"header": "none", "initial": "none", "final_endline": False})
616498
public void dumpDebugFile() {
    try {
      File f = File.createTempFile("elki-debug", ".svg");
      f.deleteOnExit();
      this.saveAsSVG(f);
      LoggingUtil.warning("Saved debug file to: " + f.getAbsolutePath());
    }
    catch(Throwable err) {
      // Ignore.
    }
  }
165067
def debug(*args):
    """"""
    for i in args:
        click.echo('D:%s' % str(i), err=True)
606767
def set_debug_listener(stream):
    """"""

    def debugger(sig, frame):
        launch_debugger(frame, stream)

    if hasattr(signal, 'SIGUSR1'):
        signal.signal(signal.SIGUSR1, debugger)
    else:
        logger.warn("Cannot set SIGUSR1 signal for debug mode.")
173433
def set_debug(self, status):
        """"""
        if status:
            self.logger.setLevel('DEBUG')
        else:
            self.logger.setLevel('INFO')