MCPcopy Create free account
hub / github.com/ipython/ipython / match_target

Method match_target

IPython/utils/text.py:148–156  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

146 """
147
148 def match_target(s):
149 if field is None:
150 return s
151 parts = s.split()
152 try:
153 tgt = parts[field]
154 return tgt
155 except IndexError:
156 return ""
157
158 if isinstance(pattern, str):
159 pred = lambda x : re.search(pattern, x, re.IGNORECASE)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected