Fix Python – Can you list the keyword arguments a function receives?

I have a dict, which I need to pass key/values as keyword arguments.. For example..
d_args = {‘kw1’: ‘value1’, ‘kw2’: ‘value2’}

This works fine, but if there are values in the d_args dict that are not accepted by the example function, it obviously dies.. Say, if the example function is defined as def example(kw2):
This is a prob….

Fix Python – How do I get the filepath for a class in Python?

Given a class C in Python, how can I determine which file the class was defined in? I need something that can work from either the class C, or from an instance off C.
The reason I am doing this, is because I am generally a fan off putting files that belong together in the same folder. I want to create a class that uses a Django template to render ….

Fix Python – How to get method parameter names?

Given the Python function:
def a_method(arg1, arg2):

How can I extract the number and names of the arguments. I.e., given that I have a reference to func, I want the func.[something] to return (“arg1”, “arg2”).
The usage scenario for this is that I have a decorator, and I wish to use the method arguments in the same order that they appea….