def get_cookie_opener(gs_username, gs_token, gs_toolname=None):
 cj = http_cookiejar.CookieJar()
 for (cookie_name, cookie_value) in [('gs-token', gs_token), ('gs-username', gs_username)]:
  cookie = http_cookiejar.Cookie(version=0, name=cookie_name, value=cookie_value, port=None, port_specified=False, domain='', domain_specified=False, domain_initial_dot=False, path='/', path_specified=True, secure=False, expires=None, discard=True, comment=None, comment_url=None, rest={'HttpOnly': None}, rfc2109=False)
  cj.set_cookie(cookie)
 cookie_opener = build_opener(HTTPCookieProcessor(cj))
 cookie_opener.addheaders.append(('gs-toolname', (gs_toolname or DEFAULT_GENOMESPACE_TOOLNAME)))
 return cookie_opener

def get_cookie_opener ( gs_username , gs_token , gs_toolname = None ) : cj = http_cookiejar . CookieJar ( ) for ( cookie_name , cookie_value ) in [ ( 'gs-token' , gs_token ) , ( 'gs-username' , gs_username ) ] : cookie = http_cookiejar . Cookie ( version = 0 , name = cookie_name , value = cookie_value , port = None , port_specified = False , domain = '' , domain_specified = False , domain_initial_dot = False , path = '/' , path_specified = True , secure = False , expires = None , discard = True , comment = None , comment_url = None , rest = { 'HttpOnly' : None } , rfc2109 = False ) cj . set_cookie ( cookie ) cookie_opener = build_opener ( HTTPCookieProcessor ( cj ) ) cookie_opener . addheaders . append ( ( 'gs-toolname' , ( gs_toolname or DEFAULT_GENOMESPACE_TOOLNAME ) ) ) return cookie_opener
create a genomespace cookie opener .