MCPcopy Create free account
hub / github.com/django/code.djangoproject.com / has_shadow

Function has_shadow

noshadows.py:58–70  ·  view source on GitHub ↗
(rule)

Source from the content-addressed store, hash-verified

56
57
58def has_shadow(rule):
59 if not rule.content:
60 return False
61
62 for a, b, c in tripletwise(skip_whitespace(rule.content)):
63 if isinstance(a, tokens.IdentToken) and a.value in SHADOW_CSS_PROPERTIES:
64 assert isinstance(
65 c, (tokens.IdentToken, tokens.DimensionToken, tokens.NumberToken)
66 ), f"Unexpected node type {c.type}"
67 if isinstance(c, (tokens.DimensionToken, tokens.NumberToken)):
68 return True
69
70 return False
71
72
73def find_shadow(rules):

Callers 2

find_shadowFunction · 0.85
test_has_shadowMethod · 0.85

Calls 2

tripletwiseFunction · 0.85
skip_whitespaceFunction · 0.85

Tested by 1

test_has_shadowMethod · 0.68