import IPython
js_code = '''
document.querySelector("#output-area").appendChild(document.createTextNode("hello world!"));
'''
display(IPython.display.Javascript(js_code))

"""
Explanation: View in Colaboratory
<img height="60px" src="https://colab.research.google.com/img/colab_favicon.ico" align="left" hspace="20px" vspace="5px">
Welcome to Colaboratory!
Colaboratory is a free Jupyter notebook environment that requires no setup and runs entirely in the cloud. See our FAQ for more info.
End of explanation
"""


import tensorflow as tf

input1 = tf.ones((2, 3))
input2 = tf.reshape(tf.range(1, 7, dtype=tf.float32), (2, 3))
output = input1 + input2

with tf.Session():
  result = output.eval()
result  

"""
Explanation: Getting Started

Overview of Colaboratory
Loading and saving data: Local files, Drive, Sheets, Google Cloud Storage
Importing libraries and installing dependencies
Using Google Cloud BigQuery
Forms, Charts, Markdown, & Widgets
TensorFlow with GPU
Machine Learning Crash Course: Intro to Pandas & First Steps with TensorFlow

Highlighted Features
Seedbank
Looking for Colab notebooks to learn from? Check out Seedbank, a place to discover interactive machine learning examples.
TensorFlow execution
Colaboratory allows you to execute TensorFlow code in your browser with a single click. The example below adds two matrices.
$\begin{bmatrix}
  1. & 1. & 1. \
  1. & 1. & 1. \
\end{bmatrix} +
\begin{bmatrix}
  1. & 2. & 3. \
  4. & 5. & 6. \
\end{bmatrix} =
\begin{bmatrix}
  2. & 3. & 4. \
  5. & 6. & 7. \
\end{bmatrix}$
End of explanation
"""


import matplotlib.pyplot as plt
import numpy as np

x = np.arange(20)
y = [x_i + np.random.randn(1) for x_i in x]
a, b = np.polyfit(x, y, 1)
_ = plt.plot(x, y, 'o', np.arange(20), a*np.arange(20)+b, '-')

"""
Explanation: GitHub
You can save a copy of your Colab notebook to Github by using File > Save a copy to GitHub…
You can load any .ipynb on GitHub by just adding the path to colab.research.google.com/github/ . For example, colab.research.google.com/github/tensorflow/models/blob/master/samples/core/get_started/_index.ipynb will load this .ipynb on GitHub.
Visualization
Colaboratory includes widely used libraries like matplotlib, simplifying visualization.
End of explanation
"""


!pip install -q matplotlib-venn

from matplotlib_venn import venn2
_ = venn2(subsets = (3, 2, 1))

"""
Explanation: Want to use a new library?  pip install it at the top of the notebook. Then that library can be used anywhere else in the notebook. For recipes to import commonly used libraries, refer to the importing libraries example notebook.
End of explanation
"""


#@title Examples

text = 'value' #@param 
date_input = '2018-03-22' #@param {type:"date"}
number_slider = 0 #@param {type:"slider", min:-1, max:1, step:0.1}
dropdown = '1st option' #@param ["1st option", "2nd option", "3rd option"]


"""
Explanation: Forms
Forms can be used to parameterize code. See the forms example notebook for more details.
End of explanation
"""


