Python code

can i use python code in filter

No, but you could use a ruby filter to invoke a Python script (although that'll be very inefficient).