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

Function get_api_md5

tools/sampcd_processor_utils.py:330–355  ·  view source on GitHub ↗

read the api spec file, and scratch the md5sum value of every api's docstring. Args: path: the api spec file. ATTENTION the path relative Returns: api_md5(dict): key is the api's real fullname, value is the md5sum.

(path)

Source from the content-addressed store, hash-verified

328
329
330def get_api_md5(path):
331 """
332 read the api spec file, and scratch the md5sum value of every api's docstring.
333
334 Args:
335 path: the api spec file. ATTENTION the path relative
336
337 Returns:
338 api_md5(dict): key is the api's real fullname, value is the md5sum.
339 """
340 api_md5 = {}
341 API_spec = os.path.abspath(os.path.join(os.getcwd(), "..", path))
342 if not os.path.isfile(API_spec):
343 return api_md5
344
345 with open(API_spec) as f:
346 for line in f:
347 mo = PAT_API_SPEC_MEMBER.search(line)
348
349 if mo:
350 api_md5[mo.group(1)] = mo.group(2)
351 else:
352 mo = PAT_API_SPEC_SIGNATURE.search(line)
353 api_md5[mo.group(1)] = f'{mo.group(2)}, {mo.group(3)}'
354
355 return api_md5
356
357
358def get_incrementapi(

Callers 3

test_get_api_md5Method · 0.90
get_incrementapiFunction · 0.85

Calls 3

joinMethod · 0.45
searchMethod · 0.45
groupMethod · 0.45

Tested by 1

test_get_api_md5Method · 0.72