<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def normalize(self, inplace: bool = False, percent: bool = False) -> "HistogramBase": """Normalize the histogram, so that the total weight is equal to 1. Parameters inplace: If True, updates itself. If False (default), returns copy percent: If True, normalizes to percent instead of 1. Default: False Returns ------- HistogramBase : either modified copy or self See also -------- densities HistogramND.partial_normalize """

        if inplace:
            self /= self.total * (.01 if percent else 1)
            return self
        else:
            return self / self.total * (100 if percent else 1)