code: def get_generation_code(self):
          
          if len(self.gates) < 1:
              code = ''
          else:
              import_list = set([gate._gencode_gate_class for gate in self.gates])
              import_list = 'from FlowCytometryTools import ' + ', '.join(import_list)
              code_list = [gate.get_generation_code() for gate in self.gates]
              code_list.sort()
              code_list = '\n'.join(code_list)
              code = import_list + 2 * '\n' + code_list
  
          self.callback(Event('generated_code',
                              {'code': code}))
          return code
docs: Return python code that generates all drawn gates.