code: def passwd_check(hashed_passphrase, passphrase):
      """Verify that a given passphrase matches its hashed version.
  
      Parameters
      ----------
      hashed_passphrase : str
          Hashed password, in the format returned by `passwd`.
      passphrase : str
          Passphrase to validate.
  
      Returns
      -------
      valid : bool
          True if the passphrase matches the hash.
  
      Examples
      --------
      >>> from IPython.lib.security import passwd_check
      >>> passwd_check('sha1:0e112c3ddfce:a68df677475c2b47b6e86d0467eec97ac5f4b85a',
      ...              'mypassword')
      True
  
      >>> passwd_check('sha1:0e112c3ddfce:a68df677475c2b47b6e86d0467eec97ac5f4b85a',
      ...              'anotherpassword')
      False
      """
      try:
          algorithm, salt, pw_digest = hashed_passphrase.split(":", 2)
      except (ValueError, TypeError):
          return False
  
      try:
          h = hashlib.new(algorithm)
      except ValueError:
          return False
  
      if len(pw_digest) == 0:
          return False
  
      h.update(
          cast_bytes(passphrase, "utf-8") + cast_bytes(salt, "ascii")
      )
  
      return h.hexdigest() == pw_digest
  
imports: import getpass
  import hashlib
  import random
  from IPython.core.error import UsageError
  from IPython.utils.py3compat import cast_bytes, str_to_bytes
label_desc: Use image node_id 2 for calling a global function with example usage: passwd_check(hashed_passphrase, passphrase) and returns: unknown, False, False, False