code: def CRRAutility(c, gam):
      '''
      Evaluates constant relative risk aversion (CRRA) utility of consumption c
      given risk aversion parameter gam.
  
      Parameters
      ----------
      c : float
          Consumption value
      gam : float
          Risk aversion
  
      Returns
      -------
      (unnamed) : float
          Utility
  
      Tests
      -----
      Test a value which should pass:
      >>> c, gamma = 1.0, 2.0    # Set two values at once with Python syntax
      >>> utility(c=c, gam=gamma)
      -1.0
      '''
      if gam == 1:
          return np.log(c)
      else:
          return( c**(1.0 - gam) / (1.0 - gam) f CRRAutility(c, gam):
      '''
      Evaluates constant relative risk aversion (CRRA) utility of consumption c
      given risk aversion parameter gam.
  
      Parameters
      ----------
      c : float
          Consumption value
      gam : float
          Risk aversion
  
      Returns
      -------
      (unnamed) : float
          Utility
  
      Tests
      -----
      Test a value which should pass:
      >>> c, gamma = 1.0, 2.0    # Set two values at once with Python syntax
      >>> utility(c=c, gam=gamma)
      -1.0
      '''
      if gam == 1:
          return np.log(c)
      else:
          return( c**(1.0 - gam) / (1.0 - gam) )
docs: Evaluates constant relative risk aversion (CRRA) utility of consumption c
      given risk aversion parameter gam.
  
      Parameters
      ----------
      c : float
          Consumption value
      gam : float
          Risk aversion
  
      Returns
      -------
      (unnamed) : float
          Utility
  
      Tests
      -----
      Test a value which should pass:
      >>> c, gamma = 1.0, 2.0    # Set two values at once with Python syntax
      >>> utility(c=c, gam=gamma)
      -1.0