<jupyter_start><jupyter_text>Magics PlayWherein we play with line and cell magics... An example line magic: "pwd"<jupyter_code>%pwd
import os.path
os.path.split(_1)<jupyter_output><empty_output><jupyter_text>An example cell magic: "bash"<jupyter_code>%%bash
waitamin() {
sleep 5
ls -1
}
waitamin
%%markdown
## Custom magics

Ala https://ipython.readthedocs.io/en/stable/config/custommagics.html
%load_ext mymagics
%myline testing 1 2 3
%%mycell testing 1 2 3
So what I'm expecting is 'testing 1 2 3'
for the first value of the result tuple!
type(_8)
%load_ext mymagics
%reload_ext mymagics
%myline 1 + 2 + 3<jupyter_output><empty_output><jupyter_text>What do we do with unfamiliar objects?We use the Python `dir()` function to query the member functions and values in the object.<jupyter_code>dir(_12)
from ast import dump
dump(_12)
result = dump(_12, indent=2)
print(result)
%reload_ext mymagics
%%mycell 4 + 5 + 6
# Meanwhile...
the_result = 42
print(the_result)
mycells_line, mycells_cell = _18
print(dump(mycells_line, indent=2))
print(dump(mycells_cell, indent=2))<jupyter_output>Expression(
  body=BinOp(
    left=BinOp(
      left=Constant(value=4),
      op=Add(),
      right=Constant(value=5)),
    op=Add(),
    right=Constant(value=6)))
Module(
  body=[
    Assign(
      targets=[
        Name(id='the_result', ctx=Store())],
      value=Constant(value=42)),
    Expr(
      value=Call(
        func=Name(id='print', ctx=Load()),
        args=[
          Name(id='the_result', ctx=Load())],
        keywords=[]))],
  type_ignores=[])
{'fraction_non_alphanumeric': 0.1351875808538163, 'fraction_numerical': 0.023932729624838292, 'mean_word_length': 4.605072463768116, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '359000', 'license': 'MIT', 'n_tokens_mistral': 588, 'n_tokens_neox': 550, 'n_words': 140, 'path': 'ohop/MagicsPlay.ipynb', 'repo_name': 'gitter-badger/ohop', 'size': '1546'}