original_docstring:  Publish trained model to shipped brain
  
      :param flavor: flavor of the logged model; must be a valid mlflow flavor
      :param model_name: name of the model to publish on app.shippedbrain.com
      :param signature: ModelSignature describes model input and output Schema. The model signature can be inferred from
      datasets with valid model input and valid model output
      :param email: shipped brain account email
      :param password: shipped brain account password
      :param login_url: login url to shipped brain
      :param upload_url: upload_url to shipped brain
      :param **kwargs: required named arguments by the mlflow.<flavor>.log_model function
      
docstring: Publish trained model to shipped brain
docstring_tokens: Publish trained model to shipped brain
code: def upload_model(flavor: str,
                   model_name: str,
                   input_example: Optional[Union[pandas.core.frame.DataFrame, numpy.ndarray, dict, list]],
                   signature: mlflow.models.signature.ModelSignature,
                   email: Optional[str] = None,
                   password: Optional[str] = None,
                   login_url: str = LOGIN_URL,
                   upload_url: str = UPLOAD_URL,
                   **kwargs) -> requests.Response:
      """ Publish trained model to shipped brain
  
      :param flavor: flavor of the logged model; must be a valid mlflow flavor
      :param model_name: name of the model to publish on app.shippedbrain.com
      :param signature: ModelSignature describes model input and output Schema. The model signature can be inferred from
      datasets with valid model input and valid model output
      :param email: shipped brain account email
      :param password: shipped brain account password
      :param login_url: login url to shipped brain
      :param upload_url: upload_url to shipped brain
      :param **kwargs: required named arguments by the mlflow.<flavor>.log_model function
      """
      assert _is_valid_flavor(flavor), f"Failed to validate model flavor. Bad model flavor '{flavor}'."
  
      email = email if email else os.getenv("SHIPPED_BRAIN_EMAIL")
      password = password if password else os.getenv("SHIPPED_BRAIN_PASSWORD")
  
      assert email,\
          f"Bad email. Environment variable SHIPPED_BRAIN_EMAIL is not defined or you did not provide the email argument."
      assert password,\
          f"Bad password. Environment variable SHIPPED_BRAIN_PASSWORD is not defined or you did not provide the " \
          f"password argument."
      assert _validate_model_name(model_name), f"Bad model name '{model_name}'! Please provide a valid model name"
  
      model_run = _log_flavor(flavor=flavor, input_example=input_example, signature=signature, **kwargs)
  
      assert model_run is not None,\
          "An error occurred while trying to log model to user's mlflow tracking uri - model_run is None. "
  
      # No need to validate [model_run], [upload_run] function already does
      upload_response = upload_run(run_id=model_run.info.run_id,
                                   model_name=model_name, email=email,
                                   password=password,
                                   flavor=flavor,
                                   login_url=login_url,
                                   upload_url=upload_url)
  
      return upload_response
code_tokens: def upload_model ( flavor : str , model_name : str , input_example : Optional [ Union [ pandas . core . frame . DataFrame , numpy . ndarray , dict , list ] ] , signature : mlflow . models . signature . ModelSignature , email : Optional [ str ] = None , password : Optional [ str ] = None , login_url : str = LOGIN_URL , upload_url : str = UPLOAD_URL , ** kwargs ) -> requests . Response : assert _is_valid_flavor ( flavor ) , f"Failed to validate model flavor. Bad model flavor '{flavor}'." email = email if email else os . getenv ( "SHIPPED_BRAIN_EMAIL" ) password = password if password else os . getenv ( "SHIPPED_BRAIN_PASSWORD" ) assert email , f"Bad email. Environment variable SHIPPED_BRAIN_EMAIL is not defined or you did not provide the email argument." assert password , f"Bad password. Environment variable SHIPPED_BRAIN_PASSWORD is not defined or you did not provide the " f"password argument." assert _validate_model_name ( model_name ) , f"Bad model name '{model_name}'! Please provide a valid model name" model_run = _log_flavor ( flavor = flavor , input_example = input_example , signature = signature , ** kwargs ) assert model_run is not None , "An error occurred while trying to log model to user's mlflow tracking uri - model_run is None. " upload_response = upload_run ( run_id = model_run . info . run_id , model_name = model_name , email = email , password = password , flavor = flavor , login_url = login_url , upload_url = upload_url ) return upload_response
short_docstring: Publish trained model to shipped brain
short_docstring_tokens: Publish trained model to shipped brain
comment: """ Publish trained model to shipped brain
  
      :param flavor: flavor of the logged model; must be a valid mlflow flavor
      :param model_name: name of the model to publish on app.shippedbrain.com
      :param signature: ModelSignature describes model input and output Schema. The model signature can be inferred from
      datasets with valid model input and valid model output
      :param email: shipped brain account email
      :param password: shipped brain account password
      :param login_url: login url to shipped brain
      :param upload_url: upload_url to shipped brain
      :param **kwargs: required named arguments by the mlflow.<flavor>.log_model function
      """$SEP$# No need to validate [model_run], [upload_run] function already does