code: def from_center_of_mass(cls,
                              inputs,
                              window_length,
                              center_of_mass,
                              **kwargs):
          
          return cls(
              inputs=inputs,
              window_length=window_length,
              decay_rate=(1.0 - (1.0 / (1.0 + center_of_mass))),
              **kwargs
          )
docs: Convenience constructor for passing `decay_rate` in terms of center of
          mass.
  
          Forwards `decay_rate` as `1 - (1 / 1 + center_of_mass)`.  This provides
          behavior equivalent to passing `center_of_mass` to pandas.ewma.
  
          Examples
          --------
          .. code-block:: python
  
              # Equivalent to:
              # my_ewma = EWMA(
              #    inputs=[EquityPricing.close],
              #    window_length=30,
              #    decay_rate=(1 - (1 / 15.0)),
              # )
              my_ewma = EWMA.from_center_of_mass(
                  inputs=[EquityPricing.close],
                  window_length=30,
                  center_of_mass=15,
              )
  
          Notes
          -----
          This classmethod is provided by both
          :class:`ExponentialWeightedMovingAverage` and
          :class:`ExponentialWeightedMovingStdDev`.