def handle(self, **options):
        address = options.get('address')

        # Break address into host:port
        if address:
            if ':' in address:
                host, port = address.split(':', 1)
                port = int(port)
            else:
                host = address
                port = None
        else:
            host, port = None, None

        services = {
            'http': http.NsotHTTPServer,
        }

        # Ensure we perform an upgrade before starting any service.
        if options.get('upgrade'):
            print("Performing upgrade before service startup...")
            call_command(
                'upgrade', verbosity=0, noinput=options.get('noinput')
            )

        # Ensure we collect static before starting any service, but only if
        # SERVE_STATIC_FILES=True.
        if options.get('collectstatic') and settings.SERVE_STATIC_FILES:
            print("Performing collectstatic before service startup...")
            call_command('collectstatic', interactive=False, ignore=['src'])

        service_name = options.get('service')
        try:
            service_class = services[service_name]
        except __HOLE__:
            raise CommandError('%r is not a valid service' % service_name)

        service = service_class(
            debug=options.get('debug'),
            host=host,
            port=port,
            workers=options.get('workers'),
            worker_class=options.get('worker_class'),
            timeout=options.get('timeout'),
            max_requests=options.get('max_requests'),
            max_requests_jitter=options.get('max_requests_jitter'),
            preload=options.get('preload'),
        )

        # Remove command line arguments to avoid optparse failures with service
        # code that calls call_command which reparses the command line, and if
        # --no-upgrade is supplied a parse error is thrown.
        sys.argv = sys.argv[:1]

        service.run()
dataset/ETHPy150Open dropbox/nsot/nsot/management/commands/start.py/Command.handle