MCPcopy Index your code
hub / github.com/evalplus/evalplus / get_first_indent_size

Function get_first_indent_size

evalplus/perf/sampling.py:24–29  ·  view source on GitHub ↗
(source, body_char_start_idx)

Source from the content-addressed store, hash-verified

22def insert_contract(entry_point: str, code: str, contract: str):
23 # why is this so complicated? because the contract might be mis-indented...
24 def get_first_indent_size(source, body_char_start_idx):
25 assert source.strip()
26 indent_size = 0
27 while source[body_char_start_idx - indent_size - 1] == " ":
28 indent_size += 1
29 return indent_size
30
31 code = code.replace("\t", " " * 4)
32 contract = contract.replace("\t", " " * 4)

Callers 1

insert_contractFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…