def __init__(self):
        self._logger = None

        # Load configuration information from the config file, which will
        # be over-ridden if settings are set on the command line
        config, preferences = PreferencesEditor.map_configuration()

        # Parse command line arguments
        parser = argparse.ArgumentParser(prog="shootoff.py")
        parser.add_argument("-d", "--debug", action="store_true", 
            help="turn on debug log messages")
        parser.add_argument("-r", "--detection-rate", type=self._check_rate,
            help="sets the rate at which shots are detected in milliseconds. " +
                "this should be set to about the length of time your laser trainer " +
                "stays on for each shot, typically about 100 ms")
        parser.add_argument("-i", "--laser-intensity", type=self._check_intensity, 
            help="sets the intensity threshold for detecting the laser [1,255]. " +
                "this should be as high as you can set it while still detecting " +
                "shots")
        parser.add_argument("-m", "--marker-radius", type=self._check_radius,
            help="sets the radius of shot markers in pixels [1,20]")
        parser.add_argument("-v", "--vidcam", type=self._check_vidcam,
            help="sets video camera to use [0,2]")
        parser.add_argument("-c", "--ignore-laser-color",
            type=self._check_ignore_laser_color,
            help="sets the color of laser that should be ignored by ShootOFF (green " +
                "or red). No color is ignored by default")
        parser.add_argument("-u", "--use-virtual-magazine",
            type=self._check_virtual_magazine,
            help="turns on the virtual magazine and sets the number rounds it holds")
        parser.add_argument("-f", "--use-malfunctions",
            type=self._check_malfunctions,
            help="turns on malfunctions and sets the probability of them happening")
	
        args = parser.parse_args()

        preferences[DEBUG] = args.debug

        if args.detection_rate:
            preferences[DETECTION_RATE] = int(args.detection_rate)

        if args.laser_intensity:
            preferences[LASER_INTENSITY] = int(args.laser_intensity)

        if args.marker_radius:
            preferences[MARKER_RADIUS] = int(args.marker_radius)
            
        if args.vidcam >= 0:
            preferences[VIDCAM] = int(args.vidcam)

        if args.ignore_laser_color:
            preferences[IGNORE_LASER_COLOR] = args.ignore_laser_color

        if args.use_virtual_magazine:
            preferences[USE_VIRTUAL_MAGAZINE] = True
            preferences[VIRTUAL_MAGAZINE] = int(args.use_virtual_magazine)

        if args.use_malfunctions:
            preferences[USE_MALFUNCTIONS] = True
            preferences[MALFUNCTION_PROBABILITY] = float(args.use_malfunctions)

        self._preferences = preferences
        self._config_parser = config
dataset/ETHPy150Open phrack/ShootOFF-legacy/configurator.py/Configurator.__init__/original