<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def action(self):
 """ Invoke functions according to the supplied flags """


        user = self.args['--user'] if self.args['--user'] else None
        reset = True if self.args['--reset'] else False

        if self.args['generate']:
            generate_network(user, reset)
        elif self.args['publish']:
            publish_network(user, reset)