code: def bytes_check(*args, func=None):
      
      func = func or inspect.stack()[2][3]
      for var in args:
          if not isinstance(var, (bytes, collections.abc.ByteString)):
              name = type(var).__name__
              raise BytesError(
                  f'Function {func} expected bytes, {name} got instead.')
docs: Check if arguments are bytes type.