<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 <img src="images/charmander.png" alt="Beginner" width="200">
<img src="images/coffee_machine.jpeg" width="300" style="float
Step1:  In good mathematical tradition, I've named various things x, y and z and re-used them in various lines of the program. You are free to choose whatever names you like, but there are some rules. For example, you cannot name a result +, since that would be very confusing. Another important restriction is that names can not have spaces. For example, the answer is not a valid name, but the_answer is (notice I used an underscore "_" character instead of a space, which is a common thing that programmers do).
Naming things is terribly important in programming, for it bestows meaning. When you get down to it, a computer is just a pile of carefully arranged sand with a rectangle of little lights. It takes a human to bestow meaning to the patterns of light and currents of electricity flowing through the machine. Do the numbers mean sheep to barter? Nuclear missiles to fire? Thoughts in a persons brain?
Your turn, mighty human. Write an elegant program to solve the following math problem
Step2:  Your turn. Write a program that computes the cosine of 5. The function to compute the cosine is called cos and can also be found inside the math module (remember to import it first!). You can use the cell below to write your program in
Step3:  Try running the above code cell. It doesn't seem to work??!! Nothing happened!
Actually, the program did work, but the computer is keeping silent. As we have seen, the computer will tell you the result that was produced by the last line in your program, but only if you did not assign that result to a variable. It was a choice made by programmers that were of the opinion that their computers were being too chatty.
<img src="images/printer.jpeg" width="300" style="float
Step4:  Ok, your turn. Write a program that assigns the cosine of 2 to the variable my_result. Use the print function to display the variable to check that it has changed.
Working with text
Here is a little program that makes the computer say hello
Step5:  In the Python programming language, literal text needs to always be surrounded by ' quotation marks. Without quotation marks, the program above would try to display the contents of a variable named hello. Try running this example and you'll see what I mean
Step6:  The print function can write multiple things at the same time by giving it more than one argument. To give multiple arguments, put a comma between them, like this
Step7:  As a child, I would write little programs like this
Step8:  To familiarize yourself with manipulating text in a programming language, try modifying the program above to tell a story of your own.
Loading some EEG data
Finally! We got all the ingredients we need to use MNE-Python, which is a Python module full of functions for analyzing EEG and MEG data.
You now know how to import a module, use its functions, and save the results to variables so you can re-use them.
These concepts allow us to do pretty powerful things.
We're going to instruct the computer to "load" some EEG data.
The EEG data is currently stored as a file on the hard drive, called
Step9:  Now, everything you've learned so far needs to come together. I'm going to leave it up to you to use the function correctly.
Make the computer load the EEG data and put it inside a variable called raw, by writing a single line of code.
Here are some pointers to help you along
Step10:  Visualizing the EEG data
Now that the EEG data has been loaded into memory, we can look at it. The data is in it's "raw" form, meaning it has come straight out of the EEG system and nothing has been done to it yet. MNE-Python has a visualization tool for data in it's raw form, called plot_raw. In programmer lingo, visualizing data points is referred to as "plotting".
Again, I'll write the code to import the plot_raw function for you. This time, I'm also going to add some housekeeping code that will instruct the computer to send the graphics to your browser.
<ASSISTANT_TASK:>
Python Code:
x = 1
y = 2
z = x + y
z * 3
Explanation: <img src="images/charmander.png" alt="Beginner" width="200">
<img src="images/coffee_machine.jpeg" width="300" style="float: right; margin-top: 30px">
Introduction to programming
Welcome!
Our goal in this module will be to let you have a taste of what programming is like.
I'm going to assume that until now, all your interactions with a computer have been through a graphical user interface (GUI).
These interfaces completely revolutionized how we interact with computers by simplifying what is an enormously complex machine into an appliance that has only a few functions.
Each function can be executed by pressing a button.
Like it's a coffee machine.
But the computer you are talking to right now is not a coffee machine.
Once you drop the GUI mask and start interacting with the computer itself, its full potential becomes available to you!
We're going to have to start from scratch. So settle in. You've got a lot to learn about programming before we can get to data visualization.
Your first ever program
Programming code is written in a programming language.
You'll have to learn this language in order to talk with the computer.
Don't worry though, programming languages are designed to be very easy to learn.
For the purposes of this hands-on session, you only need to know a little of the vocabulary and grammar of a programming language called Python.
The text you are reading now is inside a "cell". This notebook contains both text cells like this one, and "code cells" in which you can write programming code and have the computer "execute" it.
The first thing I'm going to teach you is how to use the computer as a calculator. In Python, arithmetic works just as you would expect it to work. Try typing 1 + 1 in the cell below and press Ctrl + Enter (both keys on your keyboard at the same time) to execute the code.
<div style="border: 3px solid #aaccff; margin: 10px 100px; padding: 10px">
    <b>Note about colors</b>
As you type in programming code in the cell below, you will notice the computer will automatically color parts of the text. These colors are purely a visual aid for you, the programmer, and have no meaning in the programming language.
</div>
Did it work? Hopefully the computer answered back with "2". Phenomenal computer power at work ladies and gentlemen! In the Python language, +, -, *, / all do what you would expect them to do. For example, to compute the average of 5, 3, 7 and 10, we would write:
python
(5 + 3 + 7 + 10) / 4
just like you would write it in math. Try it in the code cell above if you like.
Variables
The computer ran your little program, reported the answer back to you, and by now has forgotten all about it.
If we wish for the computer to remember the result of a computation, so we may use it in another computation, we need to give it a name by using the = character. Try running the program below and you'll see what I mean:
End of explanation
from math import sin
sin(2)
Explanation: In good mathematical tradition, I've named various things x, y and z and re-used them in various lines of the program. You are free to choose whatever names you like, but there are some rules. For example, you cannot name a result +, since that would be very confusing. Another important restriction is that names can not have spaces. For example, the answer is not a valid name, but the_answer is (notice I used an underscore "_" character instead of a space, which is a common thing that programmers do).
Naming things is terribly important in programming, for it bestows meaning. When you get down to it, a computer is just a pile of carefully arranged sand with a rectangle of little lights. It takes a human to bestow meaning to the patterns of light and currents of electricity flowing through the machine. Do the numbers mean sheep to barter? Nuclear missiles to fire? Thoughts in a persons brain?
Your turn, mighty human. Write an elegant program to solve the following math problem:
Jan has 5 coins and Mary has 3 coins.
How much coins do Jan and Mary have together?
Functions and modules
For our next program, let's do something more difficult and compute the sine of 2 (it should be around 0.9). We can't easily compute that with just +, -, *, and /.
Programming languages are inspired a lot by the language of mathematics. In math, we would write the sine of 2 as:
$$\sin 2$$
Where "$\sin$" is a placeholder for "use whatever method you want to compute the sine". More formally, $\sin$ is called a function and 2 is an argument to this function.
Functions are central to programming. They are the verbs of the programming language. Once you've learned a few verbs you can say lots of things!
If numbers are your raw material, functions are the tools you use to manipulate them.
There are tons of functions available to you.
So many, that to keep track of them all, they are organized in different "modules".
You can think of a module as a toolbox that has a nice label on it so we know what is inside.
The sin function we want to use is kept inside the math module.
<img src="images/toolbox.png" alt="Functions are like tools. Modules are like toolboxes">
In order for us to use the sin function, we must first "import" it from the math module.
In our metaphor, importing a function is like taking a tool from a toolbox and placing it on our workbench.
In the grammar of our programming language, you say:
python
from math import sin
From that point on, the sin function is available for you to use. Computing the sine of two is then sin(2).
<img src="images/function.png" alt="sin(2)" width="400">
I've filled in the program for you below. Try running it.
End of explanation
my_result = sin(2)
Explanation: Your turn. Write a program that computes the cosine of 5. The function to compute the cosine is called cos and can also be found inside the math module (remember to import it first!). You can use the cell below to write your program in:
We can combine functions with variables. Unfortunately, the answer to the cosine of 5 you have so cleverly computed above is already gone with the wind. You can "assign" the result of a function to a variable, just as we did above with numbers.
For example: here is how to assign the sine of 2 to a variable called my_result:
End of explanation
my_result = sin(2)
print(my_result)
Explanation: Try running the above code cell. It doesn't seem to work??!! Nothing happened!
Actually, the program did work, but the computer is keeping silent. As we have seen, the computer will tell you the result that was produced by the last line in your program, but only if you did not assign that result to a variable. It was a choice made by programmers that were of the opinion that their computers were being too chatty.
<img src="images/printer.jpeg" width="300" style="float: right; margin-top: 30px">
Explicitly telling the computer to display something
There is a function that is not part of any module and is always available to you. This function will make the computer display things. It is called print and it writes text to the screen. Its name is a leftover from the times when computer monitors did not exist yet and the computer could only print things on paper. Funny how etymology applies to programming languages too.
Anyway, here is an example of the print function in action:
End of explanation
print('hello')
Explanation: Ok, your turn. Write a program that assigns the cosine of 2 to the variable my_result. Use the print function to display the variable to check that it has changed.
Working with text
Here is a little program that makes the computer say hello:
End of explanation
hello = 'Hello, world!'
print(hello)
Explanation: In the Python programming language, literal text needs to always be surrounded by ' quotation marks. Without quotation marks, the program above would try to display the contents of a variable named hello. Try running this example and you'll see what I mean:
End of explanation
print('The man said:', hello, 'How are you?')
Explanation: The print function can write multiple things at the same time by giving it more than one argument. To give multiple arguments, put a comma between them, like this:
End of explanation
name = input('What is your name?')
age = input('What is your age?')
color = input('What is your favorite color?')
pet = input('What kind of pet would you like?')
job = input('What do you want to be when you grow up?')
print('')
print('There once was a', pet, 'named', name)
print('Every day,', name, 'bought', age, 'bottles of lemonade.')
print('Until one day it turned', color, 'from drinking too much.')
print('It was rushed to the hospital by a', job)
Explanation: As a child, I would write little programs like this:
End of explanation
from mne.io import read_raw_bdf
Explanation: To familiarize yourself with manipulating text in a programming language, try modifying the program above to tell a story of your own.
Loading some EEG data
Finally! We got all the ingredients we need to use MNE-Python, which is a Python module full of functions for analyzing EEG and MEG data.
You now know how to import a module, use its functions, and save the results to variables so you can re-use them.
These concepts allow us to do pretty powerful things.
We're going to instruct the computer to "load" some EEG data.
The EEG data is currently stored as a file on the hard drive, called:
data/magic-trick-raw.bdf
The above "file path" may look weird to you if you are used to Windows.
The computer you are talking to is a linux machine.
Paths look a little different.
To "load" a file means to make it available as a variable so we can use it in our programming code.
MNE-Python has a function that we can use to do this for us.
It's called read_raw_bdf and it lives in the mne.io module.
Executing the cell below will import the function for you, so you can use it.
Importing a function will make it available "from now on", also in future cells.
End of explanation
print(raw)
Explanation: Now, everything you've learned so far needs to come together. I'm going to leave it up to you to use the function correctly.
Make the computer load the EEG data and put it inside a variable called raw, by writing a single line of code.
Here are some pointers to help you along:
 1. The function you want to call is named: read_raw_bdf. It has already been imported.
 2. Call it with a single argument: the name of the file to load. Remember the example sin(2) 
 3. The name of the file to load is data/magic-trick-raw.bdf
 4. The name of the file is text. Remember what you know about text and quotation ' marks!
 5. Assign the result to a variable with the name raw using the = symbol.
Write your single line of code in the cell below:
If your code above was correct, executing the cell below will display some information about the data you've just loaded:
End of explanation
%matplotlib notebook
print('From now on, all graphics will send to your browser.')
from mne.viz import plot_raw
Explanation: Visualizing the EEG data
Now that the EEG data has been loaded into memory, we can look at it. The data is in it's "raw" form, meaning it has come straight out of the EEG system and nothing has been done to it yet. MNE-Python has a visualization tool for data in it's raw form, called plot_raw. In programmer lingo, visualizing data points is referred to as "plotting".
Again, I'll write the code to import the plot_raw function for you. This time, I'm also going to add some housekeeping code that will instruct the computer to send the graphics to your browser.
End of explanation
<END_TASK>