docstr: Deploys a Python function as an endpoint in the server.
  
  Parameters
  ----------
  name : str
      A unique identifier for the endpoint.
  
  obj :  function
      Refers to a user-defined function with any signature. However both
      input and output of the function need to be JSON serializable.
  
  description : str, optional
      The description for the endpoint. This string will be returned by
      the ``endpoints`` API.
  
  schema : dict, optional
      The schema of the function, containing information about input and
      output parameters, and respective examples. Providing a schema for
      a deployed function lets other users of the service discover how to
      use it. Refer to schema.generate_schema for more information on
      how to generate the schema.
  
  override : bool
      Whether to override (update) an existing endpoint. If False and
      there is already an endpoint with that name, it will raise a
      RuntimeError. If True and there is already an endpoint with that
      name, it will deploy a new version on top of it.
  
  See Also
  --------
  remove, get_endpoints
docstr_tok: ["Deploys","a","Python","function","as","an","endpoint","in","the","server",".","Parameters","--","--","--","--","--","name",":","str","A","unique","identifier","for","the","endpoint",".","obj",":","function","Refers","to","a","user-defined","function","with","any","signature",".","However","both","input","and","output","of","the","function","need","to","be","JSON","serializable",".","description",":","str",",","optional","The","description","for","the","endpoint",".","This","string","will","be","returned","by","the","``","endpoints","``","API",".","schema",":","dict",",","optional","The","schema","of","the","function",",","containing","information","about","input","and","output","parameters",",","and","respective","examples",".","Providing","a","schema","for","a","deployed","function","lets","other","users","of","the","service","discover","how","to","use","it",".","Refer","to","schema.generate_schema","for","more","information","on","how","to","generate","the","schema",".","override",":","bool","Whether","to","override","(","update",")","an","existing","endpoint",".","If","False","and","there","is","already","an","endpoint","with","that","name",",","it","will","raise","a","RuntimeError",".","If","True","and","there","is","already","an","endpoint","with","that","name",",","it","will","deploy","a","new","version","on","top","of","it",".","See","Also","--","--","--","--","remove",",","get_endpoints"]
code: def deploy(
      self, name, obj, description="", schema=None, override=False
  ):
      """Deploys a Python function as an endpoint in the server.
  
      Parameters
      ----------
      name : str
          A unique identifier for the endpoint.
  
      obj :  function
          Refers to a user-defined function with any signature. However both
          input and output of the function need to be JSON serializable.
  
      description : str, optional
          The description for the endpoint. This string will be returned by
          the ``endpoints`` API.
  
      schema : dict, optional
          The schema of the function, containing information about input and
          output parameters, and respective examples. Providing a schema for
          a deployed function lets other users of the service discover how to
          use it. Refer to schema.generate_schema for more information on
          how to generate the schema.
  
      override : bool
          Whether to override (update) an existing endpoint. If False and
          there is already an endpoint with that name, it will raise a
          RuntimeError. If True and there is already an endpoint with that
          name, it will deploy a new version on top of it.
  
      See Also
      --------
      remove, get_endpoints
      """
      endpoint = self.get_endpoints().get(name)
      version = 1
      if endpoint:
          if not override:
              raise RuntimeError(
                  f"An endpoint with that name ({name}) already"
                  ' exists. Use "override = True" to force update '
                  "an existing endpoint."
              )
  
          version = endpoint.version + 1
  
      obj = self._gen_endpoint(name, obj, description, version, schema)
  
      self._upload_endpoint(obj)
  
      if version == 1:
          self._service.add_endpoint(Endpoint(**obj))
      else:
          self._service.set_endpoint(Endpoint(**obj))
  
      self._wait_for_endpoint_deployment(obj["name"], obj["version"])
  
imports: import copy
  from re import compile
  import time
  import requests
  from .rest import RequestsNetworkWrapper, ServiceClient
  from .rest_client import RESTServiceClient, Endpoint
  from .custom_query_object import CustomQueryObject
  import os
  import logging
label_desc: Use image node_id 9 for calling the Client obj's underlying member method code with example usage: obj.deploy(name, obj, description, schema, override) without return types