The purpose of this code is to ping IP's that are under the detected specific interfaces using napalm.
NAPALM (Network Automation and Programmability Abstraction Layer with Multivendor support) is a Python library that implements a set of functions to interact with different network device Operating Systems using a unified API.