code: def parse_options():
      
  
      parser = optparse.OptionParser(usage=USAGE, version=VERSION)
  
      parser.add_option("-q", "--query",
              action="store", type="string", default="", dest="query",
              help="SPARQL query string")
  
      parser.add_option("-f", "--format",
              action="store", type="string", default="JSON", dest="format",
              help="Results format: one of JSON, XML")
  
      parser.add_option("-d", "--describe",
              action="store", type="string", default="", dest="describe",
              help="Describe Query: just pass a URI")
  
      parser.add_option("-a", "--alltriples",
              action="store", type="string", default="", dest="alltriples",
              help="Get all available triples for a URI")
  
      parser.add_option("-o", "--ontology",
              action="store_true", default=False, dest="ontology",
              help="Get all entities of type owl:Class - aka the ontology")
  
      opts, args = parser.parse_args()
  
      if len(args) > 0:  #dont take no args
          parser.print_help()
          raise SystemExit, 1
      if not (opts.query or opts.describe or opts.alltriples or opts.ontology):
          parser.print_help()
          raise SystemExit, 1
      return opts, args
docs: parse_options() -> opts, args
  
      Parse any command-line options given returning both
      the parsed options and arguments.