8000 No public description by copybara-service[bot] · Pull Request #5879 · googlecolab/colabtools · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions google/colab/_inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ def info(self, obj, formatter=None, info=None, detail_level=0):
if filename and (
filename.endswith(('.py', '.py3', '.pyc'))
or 'ipython-input-' in filename
or 'ipykernel_' in filename
):
out['file'] = filename

Expand Down
3 changes: 2 additions & 1 deletion google/colab/_reprs.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ def _function_repr(obj):
)

result += html.escape(docs) + '</pre>'
if filename and 'ipython-input' not in filename:
jupyter_paths = ('ipython-input', 'ipykernel_')
if filename and all(path not in filename for path in jupyter_paths):
line = oinspect.find_source_lines(obj)
result += f"""
<script>
Expand Down
0