<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def simple_balance(self, as_of=None, raw=False, leg_query=None, **kwargs):
 """Get the balance for this account, ignoring all child accounts Args: as_of (Date):
 Only include transactions on or before this date raw (bool):
 If true the returned balance should not have its sign adjusted for display purposes. leg_query (models.Q):
 Django Q-expression, will be used to filter the transaction legs. allows for more complex filtering than that provided by **kwargs. kwargs (dict):
 Will be used to filter the transaction legs Returns: Balance """

        legs = self.legs
        if as_of:
            legs = legs.filter(transaction__date__lte=as_of)

        if leg_query or kwargs:
            leg_query = leg_query or models.Q()
            legs = legs.filter(leg_query, **kwargs)

        return legs.sum_to_balance() * (1 if raw else self.sign) + self._zero_balance()