MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / get_rule_text

Function get_rule_text

src/licensedcode/models.py:1168–1176  ·  view source on GitHub ↗

Return the rule ``text`` prepared for indexing. ############### # IMPORTANT: we use the same process as used to load query text for symmetry ###############

(location=None, text=None)

Source from the content-addressed store, hash-verified

1166
1167
1168def get_rule_text(location=None, text=None):
1169 """
1170 Return the rule ``text`` prepared for indexing.
1171 ###############
1172 # IMPORTANT: we use the same process as used to load query text for symmetry
1173 ###############
1174 """
1175 numbered_lines = query_lines(location=location, query_string=text, plain_text=True)
1176 return '\n'.join(l.strip() for _, l in numbered_lines)
1177
1178
1179def get_all_spdx_keys(licenses_db):

Calls 2

query_linesFunction · 0.90
joinMethod · 0.45