class_docstr: A wallet stores the balance of a specific instrument on a specific exchange.
  
  Parameters
  ----------
  exchange : `Exchange`
      The exchange associated with this wallet.
  balance : `Quantity`
      The initial balance quantity for the wallet.
docstr: Unlocks a certain amount from the locked funds of the wallet that
  are associated with the given `quantity` path id.
  
  Parameters
  ----------
  quantity : `Quantity`
      The quantity to unlock from the funds.
  reason : str
      The reason for unlocking funds.
  
  Returns
  -------
  `Quantity`
      The free quantity.
  
  Raises
  ------
  DoubleUnlockedFunds
      Raised if `quantity` is not a locked quantity.
  QuantityNotLocked
      Raised if  `quantity` has a path id that is not currently allocated
      in this wallet.
  InsufficientFunds
      Raised if `quantity` is greater than the amount currently allocated
      for the associated path id.
docstr_tok: ["Unlocks","a","certain","amount","from","the","locked","funds","of","the","wallet","that","are","associated","with","the","given","`","quantity","`","path","id",".","Parameters","--","--","--","--","--","quantity",":","`","Quantity","`","The","quantity","to","unlock","from","the","funds",".","reason",":","str","The","reason","for","unlocking","funds",".","Returns","--","--","--","-","`","Quantity","`","The","free","quantity",".","Raises","--","--","--","DoubleUnlockedFunds","Raised","if","`","quantity","`","is","not","a","locked","quantity",".","QuantityNotLocked","Raised","if","`","quantity","`","has","a","path","id","that","is","not","currently","allocated","in","this","wallet",".","InsufficientFunds","Raised","if","`","quantity","`","is","greater","than","the","amount","currently","allocated","for","the","associated","path","id","."]
code: def unlock(self, quantity: "Quantity", reason: str) -> "Quantity":
      """Unlocks a certain amount from the locked funds of the wallet that
      are associated with the given `quantity` path id.
  
      Parameters
      ----------
      quantity : `Quantity`
          The quantity to unlock from the funds.
      reason : str
          The reason for unlocking funds.
  
      Returns
      -------
      `Quantity`
          The free quantity.
  
      Raises
      ------
      DoubleUnlockedFunds
          Raised if `quantity` is not a locked quantity.
      QuantityNotLocked
          Raised if  `quantity` has a path id that is not currently allocated
          in this wallet.
      InsufficientFunds
          Raised if `quantity` is greater than the amount currently allocated
          for the associated path id.
      """
      if not quantity.is_locked:
          raise DoubleUnlockedQuantity(quantity)
  
      if quantity.path_id not in self._locked:
          raise QuantityNotLocked(quantity)
  
      if quantity > self._locked[quantity.path_id]:
          raise InsufficientFunds(
              self._locked[quantity.path_id], quantity
          )
  
      self._locked[quantity.path_id] -= quantity
      self.balance += quantity.free()
  
      self._locked[quantity.path_id] = self._locked[
          quantity.path_id
      ].quantize()
      self.balance = self.balance.quantize()
  
      self.ledger.commit(
          wallet=self,
          quantity=quantity,
          source="{}:{}/locked".format(
              self.exchange.name, self.instrument
          ),
          target="{}:{}/free".format(
              self.exchange.name, self.instrument
          ),
          memo="UNLOCK {} ({})".format(self.instrument, reason),
      )
  
      return quantity
  
imports: from typing import Dict, Tuple
  from collections import namedtuple
  from decimal import Decimal
  import numpy
  from tensortrade.core import Identifiable
  from tensortrade.core.exceptions import InsufficientFunds, DoubleLockedQuantity, DoubleUnlockedQuantity, QuantityNotLocked
  from tensortrade.oms.instruments import Instrument, Quantity, ExchangePair
  from tensortrade.oms.orders import Order
  from tensortrade.oms.exchanges import Exchange
  from tensortrade.oms.wallets.ledger import Ledger
label_desc: Use image node_id 6 for calling the Wallet obj's underlying member method code with example usage: obj.unlock(quantity, reason) and returns: quantity