class_docstr: A collection of parameters, metrics, and artifacts to create a ML model.
class_docstr_tok: ["A","collection","of","parameters",",","metrics",",","and","artifacts","to","create","a","ML","model","."]
docstr: Check if the input is valid or not
  
  Args:
      input_type (str): The type of the input, one of ``parameter``, ``metric``.
      field_name (str): The name of the field to be checked.
      field_value (str or int or float): The value of the field to be checked.
docstr_tok: ["Check","if","the","input","is","valid","or","not","Args",":","input_type","(","str",")",":","The","type","of","the","input",",","one","of","``","parameter","``",",","``","metric","``",".","field_name","(","str",")",":","The","name","of","the","field","to","be","checked",".","field_value","(","str","or","int","or","float",")",":","The","value","of","the","field","to","be","checked","."]
code: def _is_input_valid(input_type, field_name, field_value) -> bool:
      """Check if the input is valid or not
  
      Args:
          input_type (str): The type of the input, one of ``parameter``, ``metric``.
          field_name (str): The name of the field to be checked.
          field_value (str or int or float): The value of the field to be checked.
      """
      if isinstance(field_value, Number) and (
          isnan(field_value) or isinf(field_value)
      ):
          logger.warning(
              "Failed to log %s %s. Received invalid value: %s.",
              input_type,
              field_name,
              field_value,
          )
          return False
      return True
  
imports: from __future__ import absolute_import
  import datetime
  import logging
  from enum import Enum
  from math import isnan, isinf
  from numbers import Number
  from typing import Optional, List, Dict, TYPE_CHECKING, Union
  import dateutil
  from numpy import array
  from sagemaker.apiutils import _utils
  from sagemaker.experiments import _api_types
  from sagemaker.experiments._api_types import TrialComponentArtifact, _TrialComponentStatusType
  from sagemaker.experiments._helper import _ArtifactUploader, _LineageArtifactTracker, _DEFAULT_ARTIFACT_PREFIX
  from sagemaker.experiments._environment import _RunEnvironment
  from sagemaker.experiments._run_context import _RunContext
  from sagemaker.experiments.experiment import Experiment
  from sagemaker.experiments._metrics import _MetricsManager
  from sagemaker.experiments.trial import _Trial
  from sagemaker.experiments.trial_component import _TrialComponent
  from sagemaker.utils import get_module, unique_name_from_base, format_tags, Tags, TagsDict
  from sagemaker.experiments._utils import guess_media_type, resolve_artifact_name, verify_length_of_true_and_predicted, validate_invoked_inside_run_context, get_tc_and_exp_config_from_job_env, verify_load_input_names, is_run_trial_component
label_desc: Use image node_id 13 for calling the Run obj's underlying member method code with example usage: obj._is_input_valid(input_type, field_name, field_value) and returns: True, False