Add command line options for the freeze operation
435488
def freeze_args(subparsers):
    """"""
    freeze_parser = subparsers.add_parser('freeze')
    freeze_parser.add_argument('--icefile-prefix',
                               dest='icefile_prefix',
                               help='Prefix of icefilename')
    secretfile_args(freeze_parser)
    archive_args(freeze_parser)
    vars_args(freeze_parser)
    base_args(freeze_parser)
1055022
def freeze_bn(self):
        ''''''
        for layer in self.modules():
            if isinstance(layer, nn.BatchNorm2d):
                layer.eval()
445288
function _freezeConfig(config) {
    Object.freeze(config);

    for (var key in config) {
        if (typeof config[key] === "object") {
            _freezeConfig(config[key]);
        }
    }
}
805473
def _parser_options():
    """"""
    import argparse
    parser = argparse.ArgumentParser(description="UNCLE Cron Server")
    parser.add_argument("-examples", action="store_true",
                        help="Display examples of how to use this script.")
    parser.add_argument("-setup", action="store_true",
                        help=("Setup the cron tab and script database for this server so "
                              "that it is ready to have repositories installed."))
    parser.add_argument("-rollback", action="store_true",
                        help=("Remove this script's cron tab and reverse other things done "
                              "by this script. This does not delete this script."))
    parser.add_argument("-enable", action="store_true",
                        help="Re-enable the continuous integration server.")
    parser.add_argument("-disable", action="store_true",
                        help=("Disable the continuous integration server so that it no longer "
                              "monitors the installed repositories."))
    parser.add_argument("-cron", action="store_true",
                        help=("Run the continuous integration routines for all the repos installed "
                              "in this script's database."))
    parser.add_argument("-list", action="store_true",
                        help="List all the repositories in the CI server's database.")
    parser.add_argument("-install", nargs="+",
                        help=("Install the specified XML file(s) as repositories to be monitored "
                              "by the CI server."))
    parser.add_argument("-uninstall", nargs="+",
                        help=("Uninstall the specified XML file(s) as repositories from "
                              "the CI server."))
    parser.add_argument("--verbose", nargs="?", type=int, const=1,
                        help="Runs the CI server in verbose mode.")
    parser.add_argument("-cronfreq", type=int, default=1,
                        help="Specify the frequency at which the cron runs.")
    parser.add_argument("-nolive", action="store_true",
                        help=("For unit testing, when specified no live requests are made to "
                              "servers and all the class actions are performed in test mode. "
                              "This also prevents the cron tab from being installed."))

    global args
    args = vars(parser.parse_known_args()[0])

    if args["examples"]:
        examples()
        exit(0)

    return args
1138365
def freeze():
    '''
    
    '''
    installations = {}
    for dist in get_installed_distributions():
        req = pip.FrozenRequirement.from_dist(dist, [], find_tags=False)
        installations[req.name] = req

    return [str(installation).rstrip() for installation in
        sorted(installations.values(), key=lambda x: x.name.lower())]
1204172
def add_command_line_options(cls, parser):
        """"""
        if "add_argument" in dir(parser):
            return cls.add_command_line_options_argparse(parser)
        else:
            return cls.add_command_line_options_optparse(parser)
97840
def AddProcessingOptions(self, argument_group):
    
    argument_group.add_argument(
        '--single_process', '--single-process', dest='single_process',
        action='store_true', default=False, help=(
            'Indicate that the tool should run in a single process.'))

    argument_helper_names = ['temporary_directory', 'workers', 'zeromq']
    if self._CanEnforceProcessMemoryLimit():
      argument_helper_names.append('process_resources')
    helpers_manager.ArgumentHelperManager.AddCommandLineArguments(
        argument_group, names=argument_helper_names)
256881
def freeze(self, freeze: bool = True):
        
        for topic in self._topics.values():
            topic.freeze()
        self._frozen = freeze
578715
def options(self, context, module_options):
        '''
           
        '''
        self.command = 'privilege::debug sekurlsa::logonpasswords exit'
        if module_options and 'COMMAND' in module_options:
            self.command = module_options['COMMAND']

        self.ps_script = obfs_ps_script('powersploit/Exfiltration/Invoke-Mimikatz.ps1')
1163711
def config_args(self):
        """"""
        # Module list options:
        self.arg_parser.add_argument('--version', action='version',
                version='%(prog)s ' + str(__version__))
        self.arg_parser.add_argument('--verbose',
                action='store_true', dest = 'verbosemode',
                help=_('set verbose terminal output'))
        self.arg_parser.add_argument('-s',
                action='store_true', dest = 'silentmode',
                help=_('silence terminal output'))
        self.arg_parser.add_argument('--list-parsers',
                action='store_true', dest='list_parsers',
                help=_('return a list of available parsers'))
        self.arg_parser.add_argument('-p',
                action='store', dest='parser', default='syslog',
                help=_('select a parser (default: syslog)'))
        self.arg_parser.add_argument('-z', '--unzip',
                action='store_true', dest='unzip',
                help=_('include files compressed with gzip'))
        self.arg_parser.add_argument('-t',
                action='store', dest='tzone',
                help=_('specify timezone offset to UTC (e.g. \'+0500\')'))
        self.arg_parser.add_argument('files',
                # nargs needs to be * not + so --list-filters/etc
                # will work without file arg
                metavar='file', nargs='*',
                help=_('specify input files'))

        # self.arg_parser.add_argument_group(self.parse_args)
        self.arg_parser.add_argument_group(self.filter_args)
        self.arg_parser.add_argument_group(self.output_args)
        self.args = self.arg_parser.parse_args()
826243
def edit_command(self, payload):
        """"""
        key = payload['key']
        command = payload['command']
        if self.queue[key]:
            if self.queue[key]['status'] in ['queued', 'stashed']:
                self.queue[key]['command'] = command
                answer = {'message': 'Command updated', 'status': 'error'}
            else:
                answer = {'message': "Entry is not 'queued' or 'stashed'",
                          'status': 'error'}
        else:
            answer = {'message': 'No entry with this key', 'status': 'error'}

        # Pause all processes and the daemon
        return answer
1228418
def add_command(subparsers):
  """"""

  parser = subparsers.add_parser('create', help=create.__doc__)

  parser.add_argument('-R', '--recreate', action='store_true', help="If set, I'll first erase the current database")
  parser.add_argument('-v', '--verbose', action='count', help="Do SQL operations in a verbose way?")
  parser.add_argument('-D', '--imagedir', metavar='DIR', default='/home/bob/BTAS_Keystroke_files_SingleFile', help="Change the relative path to the directory containing the images of the ATVS Keystroke database.")

  parser.set_defaults(func=create)
128738
def freeze(session):
    
    sconf = {'session_name': session['session_name'], 'windows': []}

    for w in session.windows:
        wconf = {
            'options': w.show_window_options(),
            'window_name': w.name,
            'layout': w.layout,
            'panes': [],
        }
        if w.get('window_active', '0') == '1':
            wconf['focus'] = 'true'

        # If all panes have same path, set 'start_directory' instead
        # of using 'cd' shell commands.
        def pane_has_same_path(p):
            return w.panes[0].current_path == p.current_path

        if all(pane_has_same_path(p) for p in w.panes):
            wconf['start_directory'] = w.panes[0].current_path

        for p in w.panes:
            pconf = {'shell_command': []}

            if 'start_directory' not in wconf:
                pconf['shell_command'].append('cd ' + p.current_path)

            if p.get('pane_active', '0') == '1':
                pconf['focus'] = 'true'

            current_cmd = p.current_command

            def filter_interpretters_and_shells():
                return current_cmd.startswith('-') or any(
                    current_cmd.endswith(cmd) for cmd in ['python', 'ruby', 'node']
                )

            if filter_interpretters_and_shells():
                current_cmd = None

            if current_cmd:
                pconf['shell_command'].append(current_cmd)
            else:
                if not len(pconf['shell_command']):
                    pconf = 'pane'

            wconf['panes'].append(pconf)

        sconf['windows'].append(wconf)

    return sconf
234933
def auto_thaw(vault_client, opt):
    """"""
    icefile = opt.thaw_from
    if not os.path.exists(icefile):
        raise aomi.exceptions.IceFile("%s missing" % icefile)

    thaw(vault_client, icefile, opt)
    return opt
417176
def thaw_from_args(parser):
    """"""
    parser.add_argument('--thaw-from',
                        dest='thaw_from',
                        help='Thaw an ICE file containing secrets')
    parser.add_argument('--gpg-password-path',
                        dest='gpg_pass_path',
                        help='Vault path of GPG passphrase location')
562848
def freeze_options
      @opts.freeze
      @opts.each_key { |key| @opts[key].freeze }
      @opts[:cookies].each_key { |key| @opts[:cookies][key].freeze } rescue nil
    end
1078514
def handle_cmd_options():
    '''
    
    '''
    parser = OptionParser()
    parser.add_option("-s", "--silent", action="store_true", dest="silent",
                      help="print any warnings", default=False)
    (options, args) = parser.parse_args()
    return options, args