module PryNav

def check_file_context(target)

https://github.com/pry/pry/blob/master/lib/pry/default_commands/context.rb
Checks that a binding is in a local file context. Extracted from
def check_file_context(target)
  file = if target.respond_to?(:source_location)
    target.source_location.first
  else
    target.eval('__FILE__')
  end
  file == Pry.eval_path || (file !~ /(\(.*\))|<.*>/ && file != '' && file != '-e')
end