code: def authenticate(self):
          
  
          config_data = {}
  
          # Step 1: try getting username/password from environment
          config_data = self.read_config_environment(config_data)
  
          # Step 2: if credentials were not in env read in configuration file
          if self.CONFIG_NAME_USER not in config_data \
                  or self.CONFIG_NAME_KEY not in config_data:
              if os.path.exists(self.config):
                  config_data = self.read_config_file(config_data)
              else:
                  raise IOError('Could not find {}. Make sure it\'s located in'
                                ' {}. Or use the environment method.'.format(
                                    self.config_file, self.config_dir))
  
          # Step 3: load into configuration!
          self._load_config(config_data)
docs: authenticate the user with the Kaggle API. This method will generate
             a configuration, first checking the environment for credential
             variables, and falling back to looking for the .kaggle/kaggle.json
             configuration file.