title: Import a function from one python file and use that function as a step function in metaflow
body: <p>I have a function <code>sayHello</code> defined in one python file <code>utils.py</code>. I also have a python file <code>flow.py</code> that runs a simple metaflow. I want to import <code>sayHello</code> from <code>utils.py</code> and use <code>sayHello</code> as a step function in <code>flow.py</code>. Is it possible to do that? This might be hard because we need <code>self</code> in the class. If it's possible, one question is that we how do pass output from the previous step into the function and pass the output to next step. The following is my attempt.</p>
  <pre><code>#utils.py
  def sayHello():
      print(&quot;hello world&quot;)
  </code></pre>
  <hr />
  <pre><code>#flow.py
  from metaflow import FlowSpec, step, Parameter
  from metaflow import Metaflow
  from utils import sayHello
  
  def function(p):
      return p
  
  class BranchFlow(FlowSpec):
      @step
      def start(self):
          self.next(self.a, self.b, self.sayHello)
  
      @step
      def a(self):
          self.x = 1
          self.next(self.join)
  
      @step
      def b(self):
          self.x = 2
          self.next(self.join)
  
  
      @step
      def join(self, inputs):
          print('a is %s' % inputs.a.x)
          print('b is %s' % inputs.b.x)
          print('total is %d' % sum(input.x for input in inputs))
          self.next(self.end)
  
      @step
      def end(self):
          pass
  
  if __name__ == '__main__':
       BranchFlow()    
  </code></pre>