MCPcopy Create free account
hub / github.com/BVLC/caffe / parse_readme_frontmatter

Function parse_readme_frontmatter

scripts/download_model_binary.py:31–39  ·  view source on GitHub ↗
(dirname)

Source from the content-addressed store, hash-verified

29
30
31def parse_readme_frontmatter(dirname):
32 readme_filename = os.path.join(dirname, 'readme.md')
33 with open(readme_filename) as f:
34 lines = [line.strip() for line in f.readlines()]
35 top = lines.index('---')
36 bottom = lines.index('---', top + 1)
37 frontmatter = yaml.load('\n'.join(lines[top + 1:bottom]))
38 assert all(key in frontmatter for key in required_keys)
39 return dirname, frontmatter
40
41
42def valid_dirname(dirname):

Callers 1

valid_dirnameFunction · 0.85

Calls 2

joinMethod · 0.80
indexMethod · 0.80

Tested by

no test coverage detected