|
Download tasks/codeql_python_benchmark51_v2/pyvul-15c0ad3037992bda1b19/post_context.md from Benchanything/checkerbench: direct link, hf CLI and curl.
- Browser
- Download file 1.33 kB
-
https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/codeql_python_benchmark51_v2/pyvul-15c0ad3037992bda1b19/post_context.md
- Command line
-
hf download hf://datasets/Benchanything/checkerbench/tasks/codeql_python_benchmark51_v2/pyvul-15c0ad3037992bda1b19/post_context.md
-
curl -L -o post_context.md https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/codeql_python_benchmark51_v2/pyvul-15c0ad3037992bda1b19/post_context.md
1.33 kB
Patch-overlapping Python context after the fix
svglib/svglib.py — function:svg2rlg (lines 1406-1429)
def svg2rlg(path, resolve_entities=False, **kwargs):
"Convert an SVG file to an RLG Drawing object."
# unzip .svgz file into .svg
unzipped = False
if isinstance(path, str) and os.path.splitext(path)[1].lower() == ".svgz":
with gzip.open(path, 'rb') as f_in, open(path[:-1], 'wb') as f_out:
shutil.copyfileobj(f_in, f_out)
path = path[:-1]
unzipped = True
svg_root = load_svg_file(path, resolve_entities=resolve_entities)
if svg_root is None:
return
# convert to a RLG drawing
svgRenderer = SvgRenderer(path, **kwargs)
drawing = svgRenderer.render(svg_root)
# remove unzipped .svgz file (.svg)
if unzipped:
os.remove(path)
return drawing
svglib/svglib.py — function:load_svg_file (lines 1432-1442)
def load_svg_file(path, resolve_entities=False):
parser = etree.XMLParser(
remove_comments=True, recover=True, resolve_entities=resolve_entities
)
try:
doc = etree.parse(path, parser=parser)
svg_root = doc.getroot()
except Exception as exc:
logger.error("Failed to load input file! (%s)" % exc)
else:
return svg_root