code: def make_pkh_output_script(pubkey, witness=False):
      '''
      bytearray -> bytearray
      '''
      if witness and not riemann.network.SEGWIT:
          raise ValueError(
              'Network {} does not support witness scripts.'
              .format(riemann.get_current_network_name()))
  
      output_script = bytearray()
  
      if type(pubkey) is not bytearray and type(pubkey) is not bytes:
          raise ValueError('Unknown pubkey format. '
                           'Expected bytes. Got: {}'.format(type(pubkey)))
  
      pubkey_hash = utils.hash160(pubkey)
  
      if witness:
          output_script.extend(riemann.network.P2WPKH_PREFIX)
          output_script.extend(pubkey_hash)
      else:
          output_script.extend(b'\x76\xa9\x14')  # OP_DUP OP_HASH160 PUSH14
          output_script.extend(pubkey_hash)
          output_script.extend(b'\x88\xac')  # OP_EQUALVERIFY OP_CHECKSIG
      return output_scripf make_pkh_output_script(pubkey, witness=False):
      '''
      bytearray -> bytearray
      '''
      if witness and not riemann.network.SEGWIT:
          raise ValueError(
              'Network {} does not support witness scripts.'
              .format(riemann.get_current_network_name()))
  
      output_script = bytearray()
  
      if type(pubkey) is not bytearray and type(pubkey) is not bytes:
          raise ValueError('Unknown pubkey format. '
                           'Expected bytes. Got: {}'.format(type(pubkey)))
  
      pubkey_hash = utils.hash160(pubkey)
  
      if witness:
          output_script.extend(riemann.network.P2WPKH_PREFIX)
          output_script.extend(pubkey_hash)
      else:
          output_script.extend(b'\x76\xa9\x14')  # OP_DUP OP_HASH160 PUSH14
          output_script.extend(pubkey_hash)
          output_script.extend(b'\x88\xac')  # OP_EQUALVERIFY OP_CHECKSIG
      return output_script
docs: bytearray -> bytearray