code: def check_sha1(filename, sha1_hash):
      
      sha1 = hashlib.sha1()
      with open(filename, 'rb') as f:
          while True:
              data = f.read(1048576)
              if not data:
                  break
              sha1.update(data)
  
      return sha1.hexdigest() == sha1_hash
docs: Check whether the sha1 hash of the file content matches the expected hash.
  
      Parameters
      ----------
      filename : str
          Path to the file.
      sha1_hash : str
          Expected sha1 hash in hexadecimal digits.
  
      Returns
      -------
      bool
          Whether the file content matches the expected hash.