class_docstr: StockPortfolio is the main class of `pyrtfolio` which is going to manage all the introduced stocks.
  
  This class is the one that contains the stocks information and the one that will be used by the user in order to
  generate a custom portfolio. So on, this function implements the methods to calculate all the values required in a
  basic portfolio and, as already mentioned, the method to add stocks.
  
  Attributes:
      stocks (:obj:`list`, protected):
          this list contains all the introduced stocks, which will later be used to generate the portfolio.
      stock_objs (:obj:`list`, protected):
          this list contains all the introduced Stock objects, in order to be able to refresh them.
      data (:obj:`pandas.DataFrame`): it is the generated portfolio, once the addition of every stock is validated.
class_docstr_tok: ["StockPortfolio","is","the","main","class","of","`","pyrtfolio","`","which","is","going","to","manage","all","the","introduced","stocks",".","This","class","is","the","one","that","contains","the","stocks","information","and","the","one","that","will","be","used","by","the","user","in","order","to","generate","a","custom","portfolio",".","So","on",",","this","function","implements","the","methods","to","calculate","all","the","values","required","in","a","basic","portfolio","and",",","as","already","mentioned",",","the","method","to","add","stocks",".","Attributes",":","stocks","(",":","obj",":","`","list","`",",","protected",")",":","this","list","contains","all","the","introduced","stocks",",","which","will","later","be","used","to","generate","the","portfolio",".","stock_objs","(",":","obj",":","`","list","`",",","protected",")",":","this","list","contains","all","the","introduced","Stock","objects",",","in","order","to","be","able","to","refresh","them",".","data","(",":","obj",":","`","pandas.DataFrame","`",")",":","it","is","the","generated","portfolio",",","once","the","addition","of","every","stock","is","validated","."]
docstr: This method calculates the total dividend's value which is the sum of all the dividends paid in the time
  range that the user owned/owns the stock shares. Each dividend is paid per the number of stock shares hold
  by the user.
docstr_tok: ["This","method","calculates","the","total","dividend","'s","value","which","is","the","sum","of","all","the","dividends","paid","in","the","time","range","that","the","user","owned\/owns","the","stock","shares",".","Each","dividend","is","paid","per","the","number","of","stock","shares","hold","by","the","user","."]
code: def calculate_total_dividends(dividends, num_of_shares):
      """
      This method calculates the total dividend's value which is the sum of all the dividends paid in the time
      range that the user owned/owns the stock shares. Each dividend is paid per the number of stock shares hold
      by the user.
      """
      total_dividends = 0
      for _, dividend in dividends.iterrows():
          total_dividends += dividend["Dividend"] * num_of_shares
      return total_dividends
  
file_path: pyrtfolio/pyrtfolio/StockPortfolio.py
imports: from datetime import date
  import investpy
  import pandas
  from pyrtfolio.Stock import Stock
label_desc: Use image node_id 8 for calling the StockPortfolio obj's underlying member method code with example usage: obj.calculate_total_dividends(dividends, num_of_shares) and returns: total_dividends