from __future__ import print_function

import sys

from .api import parse


def main():
    result = parse(sys.argv[1])
    print(result)

from __future__ import print_function

import sys

from .api import parse


def main():
    if sys.stdin.isatty():
        result = parse(sys.argv[1])
    else:
        result = parse(sys.stdin.read())
    print(result)

Read from stdin if available.
Read from stdin if available.

  from __future__ import print_function
  
  import sys
  
  from .api import parse
  
  
  def main():
+     if sys.stdin.isatty():
-     result = parse(sys.argv[1])
+         result = parse(sys.argv[1])
+     else:
+         result = parse(sys.stdin.read())
      print(result)
  
Read from stdin if available.
## Code Before:
from __future__ import print_function

import sys

from .api import parse


def main():
    result = parse(sys.argv[1])
    print(result)

## Instruction:
Read from stdin if available.
## Code After:
from __future__ import print_function

import sys

from .api import parse


def main():
    if sys.stdin.isatty():
        result = parse(sys.argv[1])
    else:
        result = parse(sys.stdin.read())
    print(result)
