code: def AsParameterType(type: ContractParameterType, item: StackItem):
          
          if type == ContractParameterType.Integer:
              return ContractParameter(type, value=item.GetBigInteger())
          elif type == ContractParameterType.Boolean:
              return ContractParameter(type, value=item.GetBoolean())
          elif type == ContractParameterType.Array:
              output = [ContractParameter.ToParameter(subitem) for subitem in item.GetArray()]
              return ContractParameter(type, value=output)
          elif type == ContractParameterType.String:
              return ContractParameter(type, value=item.GetString())
          elif type == ContractParameterType.InteropInterface:
              return ContractParameter(type, value=item.GetInterface())
          # all other types return a byte array
          else:
              return ContractParameter(type, value=item.GetByteArray())
docs: Convert a StackItem to a ContractParameter object of a specified ContractParameterType
          Args:
              type (neo.SmartContract.ContractParameterType): The ContractParameterType to convert to
              item (neo.VM.InteropService.StackItem): The item to convert to a ContractParameter object
  
          Returns: