Skip to content

Commit

Permalink
fix: IPython.display check
Browse files Browse the repository at this point in the history
  • Loading branch information
Yazawazi committed Feb 28, 2024
1 parent bcc89da commit 3cac765
Showing 1 changed file with 37 additions and 24 deletions.
61 changes: 37 additions & 24 deletions backend/funix/decorator/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,32 +494,45 @@ def anal_function_result(

if single_return_type in supported_basic_file_types:
if isinstance(call_result[position], list):
call_result[position] = [
handle_ipython_audio_image_video(single)
if isinstance(
single,
(
__ipython_display.Audio,
__ipython_display.Video,
__ipython_display.Image,
),
)
else get_static_uri(single)
for single in call_result[position]
]
if __ipython_use:
call_result[position] = [
handle_ipython_audio_image_video(single)
if isinstance(
single,
(
__ipython_display.Audio,
__ipython_display.Video,
__ipython_display.Image,
),
)
else get_static_uri(single)
for single in call_result[position]
]
else:
call_result[position] = [
get_static_uri(single)
for single in call_result[position]
]
else:
call_result[position] = (
handle_ipython_audio_image_video(call_result[position])
if isinstance(
call_result[position],
(
__ipython_display.Audio,
__ipython_display.Video,
__ipython_display.Image,
),
if __ipython_use:
call_result[position] = (
handle_ipython_audio_image_video(
call_result[position]
)
if isinstance(
call_result[position],
(
__ipython_display.Audio,
__ipython_display.Video,
__ipython_display.Image,
),
)
else get_static_uri(call_result[position])
)
else:
call_result[position] = get_static_uri(
call_result[position]
)
else get_static_uri(call_result[position])
)
return call_result
else:
if return_type_parsed == "Figure":
Expand Down

0 comments on commit 3cac765

Please sign in to comment.