code: def get_percent_alloc(values):
      """
      Determines a portfolio's allocations.
  
      Parameters
      ----------
      values : pd.DataFrame
          Contains position values or amounts.
  
      Returns
      -------
      allocations : pd.DataFrame
          Positions and their allocations.
      """
  
      return values.divide(values.sum(axis="columns"), axis="rows")
  
file_path: pyfolio/pyfolio/pos.py
imports: from __future__ import division
  import pandas
  import numpy
  import warnings
label_desc: Use image node_id 1 for calling a global function with example usage: get_percent_alloc(values) and returns: values