|
25 | 25 | ``` |
26 | 26 |
|
27 | 27 | """ |
28 | | -from absl import app |
29 | | -from absl import flags |
30 | 28 |
|
31 | | -from tensorflow_docs.api_generator import doc_controls |
32 | | -from tensorflow_docs.api_generator import generate_lib |
33 | | -from tensorflow_docs.api_generator import public_api |
34 | | -import tensorflow_transform.beam as tft_beam |
| 29 | +from absl import app, flags |
| 30 | +from tensorflow_docs.api_generator import doc_controls, generate_lib, public_api |
35 | 31 |
|
| 32 | +import tensorflow_transform.beam as tft_beam |
36 | 33 |
|
37 | | -flags.DEFINE_string('output_dir', '/tmp/tft_beam_api/', |
38 | | - 'The path to output the files to') |
| 34 | +flags.DEFINE_string( |
| 35 | + "output_dir", "/tmp/tft_beam_api/", "The path to output the files to" |
| 36 | +) |
39 | 37 |
|
40 | 38 | flags.DEFINE_string( |
41 | | - 'code_url_prefix', |
42 | | - 'https://github.com/tensorflow/transform/tree/master/tensorflow_transform', |
43 | | - 'The url prefix for links to code.') |
| 39 | + "code_url_prefix", |
| 40 | + "https://github.com/tensorflow/transform/tree/master/tensorflow_transform", |
| 41 | + "The url prefix for links to code.", |
| 42 | +) |
44 | 43 |
|
45 | | -flags.DEFINE_bool('search_hints', True, |
46 | | - 'Include metadata search hints in the generated files') |
| 44 | +flags.DEFINE_bool( |
| 45 | + "search_hints", True, "Include metadata search hints in the generated files" |
| 46 | +) |
47 | 47 |
|
48 | | -flags.DEFINE_string('site_path', 'tfx/transform/api_docs/python', |
49 | | - 'Path prefix in the _toc.yaml') |
| 48 | +flags.DEFINE_string( |
| 49 | + "site_path", "tfx/transform/api_docs/python", "Path prefix in the _toc.yaml" |
| 50 | +) |
50 | 51 |
|
51 | 52 | FLAGS = flags.FLAGS |
52 | 53 |
|
53 | 54 |
|
54 | 55 | def main(args): |
55 | | - if args[1:]: |
56 | | - raise ValueError('Unrecognized Command line args', args[1:]) |
| 56 | + if args[1:]: |
| 57 | + raise ValueError("Unrecognized Command line args", args[1:]) |
57 | 58 |
|
58 | | - doc_controls.do_not_generate_docs(tft_beam.analyzer_impls) |
| 59 | + doc_controls.do_not_generate_docs(tft_beam.analyzer_impls) |
59 | 60 |
|
60 | | - doc_generator = generate_lib.DocGenerator( |
61 | | - root_title='TFT-Beam', |
62 | | - py_modules=[('tft_beam', tft_beam)], |
63 | | - code_url_prefix=FLAGS.code_url_prefix + '/beam', |
64 | | - search_hints=FLAGS.search_hints, |
65 | | - site_path=FLAGS.site_path, |
66 | | - callbacks=[ |
67 | | - public_api.explicit_package_contents_filter, |
68 | | - public_api.local_definitions_filter |
69 | | - ]) |
| 61 | + doc_generator = generate_lib.DocGenerator( |
| 62 | + root_title="TFT-Beam", |
| 63 | + py_modules=[("tft_beam", tft_beam)], |
| 64 | + code_url_prefix=FLAGS.code_url_prefix + "/beam", |
| 65 | + search_hints=FLAGS.search_hints, |
| 66 | + site_path=FLAGS.site_path, |
| 67 | + callbacks=[ |
| 68 | + public_api.explicit_package_contents_filter, |
| 69 | + public_api.local_definitions_filter, |
| 70 | + ], |
| 71 | + ) |
70 | 72 |
|
71 | | - doc_generator.build(FLAGS.output_dir) |
| 73 | + doc_generator.build(FLAGS.output_dir) |
72 | 74 |
|
73 | 75 |
|
74 | | -if __name__ == '__main__': |
75 | | - app.run(main) |
| 76 | +if __name__ == "__main__": |
| 77 | + app.run(main) |
0 commit comments