<gh_stars>0
from dill.source import getname

per_srx = {
    'device_type': 'juniper',
    'ip': '172.16.58.3',
    'username': 'pyclass',
    'port': 22,
}

def get_name_of_obj(obj):
	for objname,oid in globals().items():
		if oid is obj:
			return objname

print get_name_of_obj(per_srx)

from dill.source import getname

per_srx = {
    'device_type': 'juniper',
    'ip': '172.16.58.3',
    'username': 'pyclass',
    'port': 22,
}

def get_name_of_obj(obj):
	for objname,oid in globals().items():
		if oid is obj:
			return objname

print get_name_of_obj(per_srx)