<s> from __future__ import division <EOL> import numpy as np <EOL> import matplotlib as mpl <EOL> import matplotlib . pyplot as plt <EOL> __call__ = [ "<STR_LIT>" , "<STR_LIT>" ] <EOL> def palplot ( pal , size = <NUM_LIT:1> ) : <EOL> """<STR_LIT>""" <EOL> n = len ( pal ) <EOL> f , ax = plt . subplots ( <NUM_LIT:1> , <NUM_LIT:1> , figsize = ( n * size , size ) ) <EOL> ax . imshow ( np . arange ( n ) . reshape ( <NUM_LIT:1> , n ) , <EOL> cmap = mpl . colors . ListedColormap ( list ( pal ) ) , <EOL> interpolation = "<STR_LIT>" , aspect = "<STR_LIT>" ) <EOL> ax . set_xticks ( np . arange ( n ) - <NUM_LIT> ) <EOL> ax . set_yticks ( [ - <NUM_LIT> , <NUM_LIT> ] ) <EOL> ax . set_xticklabels ( [ ] ) <EOL> ax . set_yticklabels ( [ ] ) <EOL> def puppyplot ( grown_up = False ) : <EOL> """<STR_LIT>""" <EOL> from . external . six . moves . urllib . request import urlopen <EOL> from IPython . display import HTML <EOL> try : <EOL> from bs4 import BeautifulSoup <EOL> url = "<STR_LIT>" <EOL> if grown_up : <EOL> url += "<STR_LIT>" <EOL> html_doc = urlopen ( url ) <EOL> soup = BeautifulSoup ( html_doc ) <EOL> puppy = soup . find ( "<STR_LIT>" , { "<STR_LIT:class>" : "<STR_LIT>" } ) <EOL> return HTML ( str ( puppy . img ) ) <EOL> except ImportError : <EOL> html = ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> return HTML ( html ) </s>
