dynamic inventory not working

can you please let me know where to change in ec2.py to get dynamic inventory success

getting unreachable error