human
I am working on the file "Lectures/Week 2 - Python and Jupyter for Big-Data/Lecture 2 continued.ipynb".
The first task is:
args and kwargs
higher order function support - functions on functions
Can you write Python code for it?
 Can you provide a the Python code you requested?
assistant
#Here is the Python code you requested.

def doubler(f):
    def g(x):
        return 2 * f(x)
    return g

def f1(x):
    return x+1

g= doubler(f1)

print g(3)

def magic(*args, **kwargs):
    print "unamed args", args
    print "Key word args", kwargs
    
magic(1,2,key1="word1",key2="word2")