Get the caller information, it'll return: module, filename, line_no
552868
def get_caller(skip=None):
    
    import inspect
    from fnmatch import fnmatch

    try:
        stack = inspect.stack()
    except:
        stack = [None, inspect.currentframe()]
    if len(stack) > 1:
        stack.pop(0)
        if skip and not isinstance(skip, (list, tuple)):
            skip = [skip]
        else:
            skip = []
        ptn = [os.path.splitext(s.replace('\\', '/'))[0] for s in skip]
        for frame in stack:
            #see doc: inspect
            #the frame object, the filename, the line number of the current line, 
            #the function name, a list of lines of context from the source code, 
            #and the index of the current line within that list
            if isinstance(frame, tuple):
                filename, funcname, lineno = frame[1], frame[3], frame[2]
            else:
                filename, funcname, lineno = frame.f_code.co_filename, frame.f_code.co_name, frame.f_lineno
            del frame
            found = False
            for k in ptn:
                filename = os.path.splitext(filename.replace('\\', '/'))[0]
                if fnmatch(filename, k):
                    found = True
                    break
            if not found:
                return filename, lineno, funcname
658053
def _get_callable_from_trace_tuple(
        self, trace_tuple: TraceTuple
    ) -> Tuple[str, str]:
        
        trace_frame = trace_tuple.trace_frame
        if trace_tuple.placeholder:
            return trace_frame.caller, trace_frame.caller_port
        return trace_frame.callee, trace_frame.callee_port
999827
def _getFilename(self, fileNumber):
        
        cur = self._connection.cursor()
        cur.execute('SELECT name FROM files WHERE id = ?', (fileNumber,))
        row = cur.fetchone()
        if row is None:
            return None
        else:
            return row[0]
266814
def module_getmtime(filename):
    
    if os.path.splitext(filename)[1].lower() in (".pyc", ".pyo") and os.path.exists(filename[:-1]):
        return os.path.getmtime(filename[:-1])
    if os.path.exists(filename):
        return os.path.getmtime(filename)
    return None
762844
function getCaller (offset) {
  /* eslint-disable handle-callback-err */
  if (typeof offset !== 'number') offset = 1
  var old = Error.prepareStackTrace
  var err = new Error()
  Error.prepareStackTrace = function (err, stack) {
    return stack
  }
  var fname = err.stack[1 + offset].getFileName()
  Error.prepareStackTrace = old
  return fname
}
591017
public static function caller ( )
	{
		$backtrace = V(debug_backtrace());

		foreach ($backtrace as $line) {
			$line = A($line);

			if ($line->class === 'Bacon\Log') continue;

			return A([
				'class'  => $line->class,
				'file'   => $line->file,
				'method' => $line->function,
				'object' => $line->object
			]);
		}

		/*
		if (isset($backtrace[2]['class'])) {
			return $backtrace[2]['class'];
		} elseif (isset($backtrace[2]['file'])) {
			return $backtrace[2]['file'];
		} else {
			return $backtrace[0]['file'];
		}
		 */
	}
176583
public static function caller()
    {
        $bt = debug_backtrace();
        $caller = isset($bt[2]) ? $bt[2] : array();
        $caller['line'] = $bt[1]['line'];
        $caller['file'] = $bt[1]['file'];
        if (!isset($caller['class'])) {
            $caller['class'] = '';
        }
        if (!isset($caller['type'])) {
            $caller['type'] = '';
        }
        if (!isset($caller['function'])) {
            $caller['function'] = '';
        }
        return $caller;
    }
999995
def _module_name(self) -> str:
        """"""
        name = self.f.__module__
        if name == '__main__':
            return importer.main_module_name()
        return name
950444
def exc_info(hide_calls = 0):
    ''''''
    ErrorType, thrownError, traceback = sys.exc_info()
    for i in range(hide_calls):
        if traceback.tb_next:
            traceback = traceback.tb_next
    err = withTracebackPrint(ErrorType, thrownError, traceback)
    return type(err), err, traceback
897973
def _get_vispy_caller():
    """"""
    records = inspect.stack()
    # first few records are vispy-based logging calls
    for record in records[5:]:
        module = record[0].f_globals['__name__']
        if module.startswith('vispy'):
            line = str(record[0].f_lineno)
            func = record[3]
            cls = record[0].f_locals.get('self', None)
            clsname = "" if cls is None else cls.__class__.__name__ + '.'
            caller = "{0}:{1}{2}({3}): ".format(module, clsname, func, line)
            return caller
    return 'unknown'
277918
def _get_arg_info(self):
        '''
        
        '''
        ret_dict = {
            'args': [],
            #'frame': None,
            'line': 'Unknown',
            'file': 'Unknown',
            'arg_names': []
        }
        arg_vals = self.arg_vals
        #modname = self.modname

        c = self.call
        ret_dict.update(c.info)

        if len(arg_vals) > 0:
            args = []

            if len(ret_dict['arg_names']) > 0:
                # match the found arg names to their respective values
                for i, arg_name in enumerate(ret_dict['arg_names']):
                    args.append({'name': arg_name, 'val': arg_vals[i]})

            else:
                # we can't autodiscover the names, in an interactive shell session?
                for i, arg_val in enumerate(arg_vals):
                    args.append({'name': 'Unknown {}'.format(i), 'val': arg_val})

            ret_dict['args'] = args

        return ret_dict
1236080
def get_caller_text(frame):
    
    def find_match_node(node):
        "Find a candidate ast node"
        match_node = None
        for chd in ast.iter_child_nodes(node):
            if getattr(chd, "lineno", 0) > frame.f_back.f_lineno:
                break
            match_node = node if isinstance(chd, ast.Name) and isinstance(node, ast.Call) else match_node
            match_node = find_match_node(chd) or match_node
        return match_node
    lines, _ = inspect.findsource(frame.f_back.f_code)
    match_node = find_match_node(ast.parse("".join(lines)))
    return unparse(match_node).strip().replace(', ', ',') if match_node is not None else None
331207
def getCallSet(self, id_):
        
        if id_ not in self._callSetIdMap:
            raise exceptions.CallSetNotFoundException(id_)
        return self._callSetIdMap[id_]
230678
function getCaller3Info() {
    if (this === undefined) {
        // Cannot access caller info in 'strict' mode.
        return;
    }
    var obj = {};
    var saveLimit = Error.stackTraceLimit;
    var savePrepare = Error.prepareStackTrace;
    Error.stackTraceLimit = 3;

    Error.prepareStackTrace = function (_, stack) {
        var caller = stack[2];
        if (sourceMapSupport) {
            caller = sourceMapSupport.wrapCallSite(caller);
        }
        obj.file = caller.getFileName();
        obj.line = caller.getLineNumber();
        var func = caller.getFunctionName();
        if (func)
            obj.func = func;
    };
    Error.captureStackTrace(this, getCaller3Info);
    // call prepareStackTrace
    this.stack

    Error.stackTraceLimit = saveLimit;
    Error.prepareStackTrace = savePrepare;
    return obj;
  }
1301402
function getCaller3Info(limit) {
    if (this === undefined) {
        // Cannot access caller info in 'strict' mode.
        return;
    }
    limit = limit || options.callee;
    var obj = {};
    var saveLimit = Error.stackTraceLimit;
    var savePrepare = Error.prepareStackTrace;
    Error.stackTraceLimit = limit;

    Error.prepareStackTrace = function(_, stack) {
        var caller = stack[limit - 1];
        obj.file = caller.getFileName().replace(options.root + "/", '');
        obj.line = caller.getLineNumber();
        var func = caller.getFunctionName();
        if (func)
            obj.func = func;
    };
    Error.captureStackTrace(this, getCaller3Info);
    this.stack;

    Error.stackTraceLimit = saveLimit;
    Error.prepareStackTrace = savePrepare;
    return obj;
}
658799
def get_caller(*caller_class, **params):
    
    (frame, file, line, func, contextlist, index) = inspect.stack()[1]

    try: class_name = frame.f_locals["self"].__class__.__name__
    except: class_name = None

    if class_name:
        name = class_name + '.'
    elif caller_class != ():                                                                    # pragma: no cover
        name = inspect.getmodule(caller_class[0]).__name__ + '.'
    elif hasattr(inspect.getmodule(frame), '__name__'):
        name = inspect.getmodule(frame).__name__ + '.'
    else:                                                                                       # pragma: no cover
        name = ''

    if func == '__init__' and class_name:
        name = class_name + '()'
    elif name == '__main__.':                                                                   # pragma: no cover
        name = func + '()'
    else:
        name += func + '()'

    if 'persist_place' in params:
        get_caller._Persist_Place = params['persist_place']

    log = params.get('log', logging.getLogger())
    if get_caller._Persist_Place or params.get('place') or log.isEnabledFor(logging.DEBUG):
        name += ' [+{} {}]'.format(line, os.path.basename(file))
    return name
693168
def _get_ex_data(self):
        """"""
        func_id, func_name = self._get_callable_path()
        if self._full_cname:
            func_name = self.encode_call(func_name)
        return func_id, func_name