parameters: (cls, oid)
docstring: Checks if a `oid` string is valid or not.
  
          :Parameters:
            - `oid`: the object id to validate
  
          .. versionadded:: 2.3
docstring_summary: Checks if a `oid` string is valid or not.
docstring_tokens: Checks if a oid string is valid or not .
function: def is_valid(cls, oid):
          """Checks if a `oid` string is valid or not.
  
          :Parameters:
            - `oid`: the object id to validate
  
          .. versionadded:: 2.3
          """
          try:
              ObjectId(oid)
              return True
          except (InvalidId, TypeError):
              return False
function_tokens: def is_valid ( cls , oid ) : try : ObjectId ( oid ) return True except ( InvalidId , TypeError ) : return False