import requests
multipart_form_data = {    "file": ("videos_s_9", open('videos_s_9.mp4', 'rb'), "video/mp4"),    "title": ("", "videos_s_9.mp4"),    "language_model": ("", "en-US_BroadbandModel")}
multipart_form_data = {    "file": ("agent", open('agent.jpg', 'rb'), "image/jpeg")}
r = requests.post("https://openwhisk-darkvisionapp-ics.mybluemix.net/upload",        files = multipart_form_data    )
print (r.text)print ("URL: " + "https://openwhisk-darkvisionapp-ics.mybluemix.net/#!/videos/" + r.json()['id'])
notifyURL = "https://openwhisk-darkvisionapp-ics.mybluemix.net/#!/videos/" + r.json()['id']headers={'Content-Type': 'application/json'}data='{"URL": %s}' % (notifyURL)
r = requests.post("https://iot-platform-ics.mybluemix.net/notification", data=data, headers=headers)
print (r.text)

@@ -1,8 +1,19 @@
+import sys%0A
 import r
@@ -20,16 +20,261 @@
 equests%0A
+%0ADARK_VISION_BASE = %22https://openwhisk-darkvisionapp-ics.mybluemix.net/%22%0ADARK_VISION_UPLOAD = %22upload%22%0ADARK_VISION_VIDEO = %22#!/videos/%22%0A%0ABM_NOTIFICATION = %22https://iot-platform-ics.mybluemix.net/notification%22%0A%0Adef postDarkVision(videofile):%0A    
 multipar
@@ -280,35 +280,40 @@
 rt_form_data = %7B
-%C2%A0%C2%A0%C2%A0
+%0A       
  %22file%22: (%22video
@@ -310,43 +310,33 @@
 %22: (
-%22
 video
-s_s_9%22
+file
 , open(
-'
 video
-s_s_9.mp4'
+file
 , 'r
@@ -353,19 +353,24 @@
 o/mp4%22),
-%C2%A0%C2%A0%C2%A0
+%0A       
  %22title%22
@@ -380,29 +380,27 @@
 %22%22, 
-%22
 video
-s_s_9.mp4%22),%C2%A0%C2%A0%C2%A0
+file),%0A       
  %22la
@@ -442,18 +442,29 @@
 dModel%22)
-%7D
 %0A
+    %7D%0A%0A#    
 multipar
@@ -478,19 +478,25 @@
 data = %7B
-%C2%A0%C2%A0%C2%A0
+%0A#       
  %22file%22:
@@ -548,94 +548,105 @@
 eg%22)
-%7D%0Ar = requests.post(%22https://openwhisk-darkvisionapp-ics.mybluemix.net/upload%22,%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0
+%0A#    %7D%0A%0A    upload_url = DARK_VISION_BASE + DARK_VISION_UPLOAD%0A    r = requests.post(upload_url,
  fil
@@ -673,14 +673,15 @@
 data
-%C2%A0%C2%A0%C2%A0 )%0A
+)%0A%0A    
 prin
@@ -690,16 +690,21 @@
 (r.text)
+%0A    
 print (%22
@@ -716,89 +716,167 @@
 %22 + 
-%22https://openwhisk-darkvisionapp-ics.mybluemix.net/#!/videos/%22 + r.json()%5B'id'%5D)%0A
+DARK_VISION_BASE + DARK_VISION_VIDEO + r.json()%5B'id'%5D)%0A    return DARK_VISION_BASE + DARK_VISION_VIDEO + r.json()%5B'id'%5D%0A%0Adef postNotification(notifyURL):%0A#    
 noti
@@ -962,16 +962,21 @@
 ()%5B'id'%5D
+%0A    
 headers=
@@ -1011,16 +1011,21 @@
 n/json'%7D
+%0A    
 data='%7B%22
@@ -1049,16 +1049,20 @@
 ifyURL)%0A
+    
 r = requ
@@ -1075,63 +1075,25 @@
 ost(
-%22https://iot-platform-ics.mybluemix.net/notification%22,%C2%A0
+BM_NOTIFICATION, 
 data
@@ -1116,16 +1116,21 @@
 eaders)%0A
+%0A    
 print (r
@@ -1116,28 +1116,265 @@
 eaders)%0A%0A    print (r.text)%0A
+%0Aif __name__ == %22__main__%22:%0A    argv = sys.argv%0A    argc = len(argv)%0A    if (argc != 2):%0A        print ('Usage: # python %25s %5Bvideo file%5D' %25 argv%5B0%5D)%0A        quit()%0A%0A    notifyURL = postDarkVision(argv%5B1%5D)%0A    postNotification(notifyURL)%0A

make a checkpoint