MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / parse_args

Function parse_args

tools/check_api_compatible.py:137–166  ·  view source on GitHub ↗

Parse input arguments

()

Source from the content-addressed store, hash-verified

135
136
137def parse_args():
138 """
139 Parse input arguments
140 """
141 global arguments
142 parser = argparse.ArgumentParser(
143 description='check api compatible across versions'
144 )
145 parser.add_argument('--debug', dest='debug', action="store_true")
146 parser.add_argument(
147 'prev',
148 type=argparse.FileType('r'),
149 help='the previous version (the version from develop branch)',
150 )
151 parser.add_argument(
152 'post',
153 type=argparse.FileType('r'),
154 help='the post version (the version from PullRequest)',
155 )
156 for item in arguments:
157 parser.add_argument(
158 item[0], dest=item[1], help=item[4], type=item[2], default=item[3]
159 )
160
161 if len(sys.argv) < 2:
162 parser.print_help()
163 sys.exit(1)
164
165 args = parser.parse_args()
166 return args
167
168
169if __name__ == '__main__':

Callers 1

Calls 2

exitMethod · 0.80
parse_argsMethod · 0.45

Tested by

no test coverage detected