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

Function combine_expressions

src/packagedcode/utils.py:136–148  ·  view source on GitHub ↗

Return a combined license expression string with relation, given a sequence of license ``expressions`` strings or LicenseExpression objects.

(
    expressions,
    relation='AND',
    unique=True,
    licensing=_LICENSING,
)

Source from the content-addressed store, hash-verified

134
135
136def combine_expressions(
137 expressions,
138 relation='AND',
139 unique=True,
140 licensing=_LICENSING,
141):
142 """
143 Return a combined license expression string with relation, given a sequence of
144 license ``expressions`` strings or LicenseExpression objects.
145 """
146 if not licensing:
147 raise Exception('combine_expressions: cannot combine combine_expressions without license_expression package.')
148 return expressions and str(le_combine_expressions(expressions, relation, unique, licensing)) or None
149
150
151def get_ancestor(levels_up, resource, codebase):

Calls

no outgoing calls

Tested by

no test coverage detected