code: def upload_file(self, file_name, file_path):
          
  
          request = urllib.request.Request(self.url + '/rest/v1/data/upload/job_input?name=' + file_name)
          if self.authorization_header() is not None:
              request.add_header('Authorization', self.authorization_header())
          request.add_header('User-Agent', 'GenePatternRest')
          with open(file_path, 'rb') as f:
              data = f.read()
  
          try:
              response = urllib.request.urlopen(request, data)
          except IOError:
              print("authentication failed")
              return None
  
          if response.getcode() != 201:
              print("file upload failed, status code = %i" % response.getcode())
              return None
  
          return GPFile(self, response.info().get('Location'))
docs: Upload a file to a server
  
          Attempts to upload a local file with path filepath, to the server, where it
          will be named filename.
  
          Args:
              :param file_name: The name that the uploaded file will be called on the server.
              :param file_path: The path of the local file to upload.
  
          Returns:
              :return: A GPFile object that wraps the URI of the uploaded file, or None if the upload fails.