inspects a frame and returns a string with the following

        <src-path>:<src-line> -> <function-name>
        <source-code>
193472
def get_frame_src(f:Frame) -> str:
    ''' 
    '''
    path, line, src, fn = _get_frame(
        inspect.getframeinfo(f)
    )
    return '{}:{} -> {}\n{}'.format(
        path.split(os.sep)[-1],
        line,
        fn,
        repr(src[0][:-1]) # shave off \n
    )
458977
def get_source_link(file, line, display_text="[source]", **kwargs)->str:
    ""
    link = f"{SOURCE_URL}{file}#L{line}"
    if display_text is None: return link
    return f'<a href="{link}" class="source_link" style="float:right">{display_text}</a>'
1164696
def inspect
      str = Inspect.dashed_line(self.class)
      headers.each do |header|
        str << header.inspect
      end
      str << Inspect.inspect_body(body)
    end
1170372
def src_paths(self):
        
        return {src for src, summary in self._diff_violations().items()
                   if len(summary.measured_lines) > 0}
562172
function getInlineScriptFromCallerSource(callerFnSource, eligibleScripts) {
  var i, inlineScriptText,
      script = null,
      callerSourceText = normalizeWhitespace(callerFnSource);

  eligibleScripts = eligibleScripts || scripts;

  if (callerFnSource && callerSourceText) {
    for (i = eligibleScripts.length; i--; ) {
      // Only look at inline scripts
      if (!eligibleScripts[i].hasAttribute("src")) {
        inlineScriptText = normalizeWhitespace(eligibleScripts[i].text);
        if (inlineScriptText.indexOf(callerSourceText) !== -1) {
          // If more than one match is found, don't return any
          if (script) {
            script = null;
            break;
          }
          script = eligibleScripts[i];
        }
      }
    }
  }

  return script;
}
1281953
def _get_src_file(self, val, default='Unknown'):
        '''
        
        '''
        path = default

        try:
            # http://stackoverflow.com/questions/6761337/inspect-getfile-vs-inspect-getsourcefile
            # first try and get the actual source file
            source_file = inspect.getsourcefile(val)
            if not source_file:
                # get the raw file since val doesn't have a source file (could be a .pyc or .so file)
                source_file = inspect.getfile(val)

            if source_file:
                path = os.path.realpath(source_file)

        except TypeError as e:
            path = default

        return path
379447
def inspect_file(path):
    
    with open(path, 'rb') as f:
        labels, count = inspect(tx.decode(line) for line in f)
    return labels, count
28227
function getSourceCode(filepath) {
      // The current folder
      var dir = filepath.substring(0, filepath.lastIndexOf("/") + 1);

      // Regex for file import
      var fileRegex = /(?:["'])<!=\s*(.+)\b\s*!>(?:["'])?;?/;
      // Regex for file extension
      var fileExtRegex = /\..+$/;

      // Read the file and check if anything should be imported into it; loop through them
      return grunt.file.read(filepath).replace(new RegExp(fileRegex.source, "g"), function(match) {
        // Log the number of imports we did
        files += 1;

        // Get the filename
        var file = match.match(fileRegex)[1];

        // Check if it has an extension
        if(file.match(fileExtRegex) === null) {
          file += options.defaultExtension; // Add it
        }

        var source = "";

        // Loop through files
        glob.sync(dir + file).forEach(function(filename) {
          // Read file
          var src = grunt.file.read(filename);

          // Check if it has imports too
          source += (function() {
                return fileRegex.test(src) ? getSourceCode(filename) : src;
              })() + options.separator; // Add separator
        });
        return source;
      });
    }
803056
function inspect(callback) {
  return function (filename) {
    var chunks = [];

    function transform(chunk, encoding, done) {
      /* jshint validthis:true */
      chunks.push(chunk);
      this.push(chunk);
      done();
    }

    function flush(done) {
      callback(filename, chunks.join(''), done);
      if (callback.length < 3) {
        done();
      }
    }

    return through(transform, flush);
  }
}
810336
def get_line(thing):
    
    try:
        return inspect.getsourcelines(thing)[1]
    except TypeError:
        # Might be a property
        return inspect.getsourcelines(thing.fget)[1]
    except Exception as e:
        # print(thing)
        raise e
1276014
def get_path(src):  # pragma: no cover
    
    res = None
    while not res:
        if res is False:
            print(colored('You must provide a path to an existing directory!', 'red'))
        print('You need a local clone or release of (a fork of) '
              'https://github.com/{0}'.format(src))
        res = input(colored('Local path to {0}: '.format(src), 'green', attrs=['blink']))
        if res and Path(res).exists():
            return Path(res).resolve()
        res = False
639255
function getFrameLocation(stackFrame) {
  var frameString = stackFrame.toString()
  var lastParenIndex = frameString.lastIndexOf('(')
  return lastParenIndex === -1 ? frameString : frameString.slice(lastParenIndex + 1, -1)
}
252741
function(src, filepath) {
					/*
					return '// Source: ' + filepath + '\n' +
						src.replace(/##VERSION##/g, '##FOUND##');
					*/
					src = src.replace(/##ID##/g, options.id);
					src = src.replace(/##VERSION##/g, options.version);
					src = src.replace(/##CODEBASE##/g, options.extension.updateUrl);
					return src;
				}
1346249
def find_importer_frame():
    
    byte = lambda ch: ord(ch) if PY2 else ch
    frame = inspect.currentframe()
    try:
        while frame:
            code = frame.f_code
            lasti = frame.f_lasti
            if byte(code.co_code[lasti]) == dis.opmap['IMPORT_NAME']:
                # FIXME: Support EXTENDED_ARG.
                arg = (
                    byte(code.co_code[lasti + 1])
                    + byte(code.co_code[lasti + 2]) * 256)
                name = code.co_names[arg]
                if name == 'end':
                    break
                end
            end
            frame = frame.f_back
        end
        return frame
    finally:
        del frame
    end
1231804
function getSource(fn) {
      var result = '';
      if (isStringable(fn)) {
        result = String(fn);
      } else if (support.decompilation) {
        // Escape the `{` for Firefox 1.
        result = _.result(/^[^{]+\{([\s\S]*)\}\s*$/.exec(fn), 1);
      }
      // Trim string.
      result = (result || '').replace(/^\s+|\s+$/g, '');

      // Detect strings containing only the "use strict" directive.
      return /^(?:\/\*+[\w\W]*?\*\/|\/\/.*?[\n\r\u2028\u2029]|\s)*(["'])use strict\1;?$/.test(result)
        ? ''
        : result;
    }
49908
function getCode(code, opts, attrs, url) {
  var type = getType(attrs),
    parserOpts = getParserOptions(attrs)

  //#if NODE
  // istanbul ignore else
  if (url) {
    var src = getAttr(attrs, 'src')
    if (src) {
      var
        charset = getAttr(attrs, 'charset'),
        file = path.resolve(path.dirname(url), src)
      code = require('fs').readFileSync(file, charset || 'utf8')
    }
  }
  //#endif
  return _compileJS(code, opts, type, parserOpts, url)
}
659155
function rPath (htmlyFile, sourceFilepath) {
  htmlyFile = pathResolve(__dirname, htmlyFile)
  htmlyFile = pathRelative(dirname(sourceFilepath), htmlyFile)
  htmlyFile = slash(htmlyFile)
  if (!/^(\.|\/)/.test(htmlyFile)) {
    return './' + htmlyFile
  } else {
    return htmlyFile
  }
}