def METHOD_NAME(
        date_from=None, date_to=None,
        user=None, asset=None, account=None,
        input=None, session=None, risk_level=None, org_id=None):
    filter_kwargs = {}
    date_from_default = timezone.now() - datetime.timedelta(days=7)
    date_to_default = timezone.now()
    if not date_from and not session:
        date_from = date_from_default
    if not date_to and not session:
        date_to = date_to_default
    if date_from is not None:
        if isinstance(date_from, datetime.datetime):
            date_from = date_from.timestamp()
        filter_kwargs['timestamp__gte'] = int(date_from)
    if date_to is not None:
        if isinstance(date_to, datetime.datetime):
            date_to = date_to.timestamp()
        filter_kwargs['timestamp__lte'] = int(date_to)
    if user:
        filter_kwargs["user__startswith"] = user
    if asset:
        filter_kwargs['asset'] = asset
    if account:
        filter_kwargs['account'] = account
    if input:
        filter_kwargs['input__icontains'] = input
    if session:
        filter_kwargs['session'] = session
    if org_id is not None:
        filter_kwargs['org_id'] = org_id
    if risk_level is not None:
        filter_kwargs['risk_level'] = risk_level
    return filter_kwargs