code: def upload(self, local_path, remote_path):
      if not os.path.isfile(local_path):
          print(
              "ERROR: Impossible to upload non-existed file '%s'."
              % local_path
          )
          return False
  
      file_descriptor = open(local_path, "rb")
      binary_file = file_descriptor.read()
      file_descriptor.close()
  
      result, response_content = self.__send_request(
          "GET",
          yandex_disk.__HTTP_RESOURCES_UPLOAD,
          {"path": remote_path},
      )
      if result != 200:
          print(
              "ERROR: Impossible to obtain link to upload file to '%s' (code: '%d', description: '%s')"
              % (remote_path, result, response_content)
          )
          return False
  
      json_content = json.loads(response_content)
      upload_link = json_content["href"]
      result = self.__upload_request(binary_file, upload_link)
      if result != 201:
          print(
              "ERROR: Impossible to upload file using link '%s' (code: '%d')."
              % (upload_link, result)
          )
          return False
  
      return True
  
file_path: pyclustering/ci/cloud/cloud/yandex_disk.py
imports: import http.client
  import json
  import os.path
  import urllib.request
  from urllib.parse import urlparse
label_desc: Use image node_id 4 for calling the yandex_disk obj's underlying member method code with example usage: obj.upload(local_path, remote_path) and returns: True, False, False, False