def get_dataset_file(dataset, default_dataset, origin):
 (data_dir, data_file) = os.path.split(dataset)
 if ((data_dir == '') and (not os.path.isfile(dataset))):
  new_path = os.path.join(os.path.split(__file__)[0], '..', 'data', dataset)
  if (os.path.isfile(new_path) or (data_file == default_dataset)):
   dataset = new_path
 if ((not os.path.isfile(dataset)) and (data_file == default_dataset)):
  from six.moves import urllib
  print(('Downloading data from %s' % origin))
  urllib.request.urlretrieve(origin, dataset)
 return dataset

def get_dataset_file ( dataset , default_dataset , origin ) : ( data_dir , data_file ) = os . path . split ( dataset ) if ( ( data_dir == '' ) and ( not os . path . isfile ( dataset ) ) ) : new_path = os . path . join ( os . path . split ( __file__ ) [ 0 ] , '..' , 'data' , dataset ) if ( os . path . isfile ( new_path ) or ( data_file == default_dataset ) ) : dataset = new_path if ( ( not os . path . isfile ( dataset ) ) and ( data_file == default_dataset ) ) : from six . moves import urllib print ( ( 'Downloading data from %s' % origin ) ) urllib . request . urlretrieve ( origin , dataset ) return dataset
look for it as if it was a full path .