#NEWLINE# def create_correlation( self , dataset , args = None , wait_time = 3 , retries = 10 ) : #NEWLINE# #INDENT# 'Creates a correlation from a `dataset`.\n\n        ' #NEWLINE# dataset_id = None #NEWLINE# resource_type = get_resource_type ( dataset ) #NEWLINE# if ( resource_type == DATASET_PATH ) : #NEWLINE# #INDENT# dataset_id = get_dataset_id ( dataset ) #NEWLINE# check_resource ( dataset_id , query_string = TINY_RESOURCE , wait_time = wait_time , retries = retries , raise_on_error = True , api = self ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise Exception ( ( 'A dataset id is needed to create a correlation. %s found.' % resource_type ) ) #NEWLINE# #UNINDENT# create_args = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( wait_time is not None ) : #NEWLINE# #INDENT# create_args . update ( args ) #NEWLINE# #UNINDENT# create_args . update ( { #NEWLINE# #INDENT# 'dataset' : dataset_id , #NEWLINE# #UNINDENT# } ) #NEWLINE# body = json . dumps ( create_args ) #NEWLINE# return self . _create ( self . correlation_url , body )