def check_path(options, rootdir=None, candidates=None, code=None):
 if (not candidates):
  candidates = []
  for path_ in options.paths:
   path = op.abspath(path_)
   if op.isdir(path):
    for (root, _, files) in walk(path):
     candidates += [op.relpath(op.join(root, f), CURDIR) for f in files]
   else:
    candidates.append(path)
 if (rootdir is None):
  rootdir = (path if op.isdir(path) else op.dirname(path))
 paths = []
 for path in candidates:
  if ((not options.force) and (not any((l.allow(path) for (_, l) in options.linters)))):
   continue
  if (not op.exists(path)):
   continue
  paths.append(path)
 if options.async:
  return check_async(paths, options, rootdir)
 errors = []
 for path in paths:
  errors += run(path=path, code=code, rootdir=rootdir, options=options)
 return errors

def check_path ( options , rootdir = None , candidates = None , code = None ) : if ( not candidates ) : candidates = [ ] for path_ in options . paths : path = op . abspath ( path_ ) if op . isdir ( path ) : for ( root , _ , files ) in walk ( path ) : candidates += [ op . relpath ( op . join ( root , f ) , CURDIR ) for f in files ] else : candidates . append ( path ) if ( rootdir is None ) : rootdir = ( path if op . isdir ( path ) else op . dirname ( path ) ) paths = [ ] for path in candidates : if ( ( not options . force ) and ( not any ( ( l . allow ( path ) for ( _ , l ) in options . linters ) ) ) ) : continue if ( not op . exists ( path ) ) : continue paths . append ( path ) if options . async : return check_async ( paths , options , rootdir ) errors = [ ] for path in paths : errors += run ( path = path , code = code , rootdir = rootdir , options = options ) return errors
check sys .