title: get the lists of functions used/called within a function in python
body: <p>Is there any tool/library through which the list of methods/functions called within another methods/functions can be listed?</p>
  
  <p>For example:
  If that tool or library runs for below method</p>
  
  <pre><code>def calculate(a: int, b: int, operator: Operator):
      if operator == Operator.add:
          add(a, b)
      elif operator == Operator.subtract
          subtract(a, b)
  </code></pre>
  
  <p>then it should return</p>
  
  <pre><code>1. add
  2. subtract
  </code></pre>
  
  <p>This question is almost same as <a href="https://stackoverflow.com/questions/13659042/how-to-find-all-methods-called-in-a-method">this one</a> but it's for Java. </p>
  
  <p>This is basically same as what <code>PyCharm</code> does for <code>Find Usage</code>.
  Thanks!</p>