<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def main():
 """Script that finds and runs flatc built from source."""

  if len(sys.argv) < 2:
    sys.stderr.write('Usage: run_flatc.py flatbuffers_dir [flatc_args]\n')
    return 1
  cwd = os.getcwd()
  flatc = ''
  flatbuffers_dir = sys.argv[1]
  for path in FLATC_SEARCH_PATHS:
    current = os.path.join(flatbuffers_dir, path,
                           'flatc' + EXECUTABLE_EXTENSION)
    if os.path.exists(current):
      flatc = current
      break
  if not flatc:
    sys.stderr.write('flatc not found\n')
    return 1
  command = [flatc] + sys.argv[2:]
  return subprocess.call(command)