'%%  a single % character
%c  core file size soft resource limit of crashing process (since Linux 2.6.24)
%d  dump modeâsame as value returned by prctl(2) PR_GET_DUMPABLE (since Linux 3.7)
%e  executable filename (without path prefix)
%E  pathname of executable, with slashes (\'/\') replaced by exclamation marks (\'!\') (since Linux 3.0).
%g  (numeric) real GID of dumped process
%h  hostname (same as nodename returned by uname(2))
%i  TID of thread that triggered core dump, as seen in the PID namespace in which the thread resides (since Linux 3.18)
%I  TID of thread that triggered core dump, as seen in the initial PID namespace (since Linux 3.18)
%p  PID of dumped process, as seen in the PID namespace in which the process resides
%P  PID of dumped process, as seen in the initial PID namespace (since Linux 3.12)
%s  number of signal causing dump
%t  time of dump, expressed as seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC)
%u  (numeric) real UID of dumped process'

def native_corefile_pattern(self):

    replace = {'%%': '%', '%e': self.basename, '%E': self.exe.replace('/', '!'), '%g': str(self.gid), '%h': socket.gethostname(), '%i': str(self.pid), '%I': str(self.pid), '%p': str(self.pid), '%P': str(self.pid), '%s': str((- self.process.poll())), '%u': str(self.uid)}
    replace = dict(((re.escape(k), v) for (k, v) in replace.iteritems()))
    pattern = re.compile('|'.join(replace.keys()))
    core_pattern = self.kernel_core_pattern
    corefile_path = pattern.sub((lambda m: replace[re.escape(m.group(0))]), core_pattern)
    if self.kernel_core_uses_pid:
        corefile_path += ('.%i' % self.pid)
    if (os.pathsep not in corefile_path):
        corefile_path = os.path.join(self.cwd, corefile_path)
    log.debug(('Trying    corefile_path:    %r' % corefile_path))
    try:
        self.read(corefile_path)
        return corefile_path
    except Exception as e:
        log.debug(('No    dice:    %s' % e))
