Setup
        :return:
976281
def __setup(self):
        
        if not os.path.exists(self.__local_download_dir_warc):
            os.makedirs(self.__local_download_dir_warc)

        # make loggers quite
        configure_logging({"LOG_LEVEL": "ERROR"})
        logging.getLogger('requests').setLevel(logging.CRITICAL)
        logging.getLogger('readability').setLevel(logging.CRITICAL)
        logging.getLogger('PIL').setLevel(logging.CRITICAL)
        logging.getLogger('newspaper').setLevel(logging.CRITICAL)
        logging.getLogger('newsplease').setLevel(logging.CRITICAL)
        logging.getLogger('urllib3').setLevel(logging.CRITICAL)

        # set own logger
        logging.basicConfig(level=self.__log_level)
        self.__logger = logging.getLogger(__name__)
        self.__logger.setLevel(self.__log_level)
26281
def _setup(self):
        
        if not os.path.isdir(self.inventory_directory):
            os.makedirs(self.inventory_directory)
800381
def setup(options, **kwargs):
	
	params = dict(kwargs)
	params.update(level=options.log_level)
	logging.basicConfig(**params)
817410
def setup():
    

    global CONFIG, BING_KEY, GENIUS_KEY, config_path, LOG_FILENAME, LOG_LINE_SEPERATOR 

    LOG_FILENAME = 'musicrepair_log.txt'
    LOG_LINE_SEPERATOR = '........................\n'

    CONFIG = configparser.ConfigParser()
    config_path = realpath(__file__).replace(basename(__file__),'')
    config_path = config_path + 'config.ini'
    CONFIG.read(config_path)

    GENIUS_KEY = CONFIG['keys']['genius_key']
722164
def setUp(self):
        
        if self.__class__ is HarnessCase:
            return

        logger.info('Setting up')
        # clear files
        logger.info('Deleting all .pdf')
        os.system('del /q "%HOMEDRIVE%%HOMEPATH%\\Downloads\\NewPdf_*.pdf"')
        logger.info('Deleting all .xlsx')
        os.system('del /q "%HOMEDRIVE%%HOMEPATH%\\Downloads\\ExcelReport*.xlsx"')
        logger.info('Deleting all .pcapng')
        os.system('del /q "%s\\Captures\\*.pcapng"' % settings.HARNESS_HOME)

        # using temp files to fix excel downloading fail
        logger.info('Empty files in temps')
        os.system('del /q "%s\\Thread_Harness\\temp\\*.*"' % settings.HARNESS_HOME)

        # create directory
        os.system('mkdir %s' % self.result_dir)
        self._init_harness()
        self._init_devices()
        self._init_dut()
        self._init_rf_shield()
508364
def _setup_configuration(self):
        
        self.configuration = dict(
            schema_cls=self.schema_cls,
            allowed_actions=self.allowed_actions,
            filter_by_fields=self.filter_by_fields,
            order_by_fields=self.order_by_fields,
            aggregate_by_fields=self.aggregate_by_fields,
            default_offset=self.default_offset,
            default_limit=self.default_limit)

        authentication = self.authentication_cls(schema_cls=self.schema_cls)
        authorization = self.authorization_cls(schema_cls=self.schema_cls)
        request_params_validation = self.request_params_validation_cls(
            schema_cls=self.schema_cls,
            filter_by_fields=self.filter_by_fields,
            order_by_fields=self.order_by_fields,
            aggregate_by_fields=self.aggregate_by_fields
        )
        schema_validation = self.schema_validation_cls(
            schema_cls=self.schema_cls)
        data_cleaner = self.data_cleaner_cls(schema_cls=self.schema_cls)
        entity_actions = self.entity_actions_cls(
            schema_cls=self.schema_cls,
            default_limit=self.default_limit,
            default_offset=self.default_offset)
        post_action_hooks = self.post_action_hooks_cls(
            schema_cls=self.schema_cls)
        response_converter = self.response_converter_cls(
            schema_cls=self.schema_cls)
        serializer = self.serializer_cls(schema_cls=self.schema_cls)

        self.configuration.update(dict(
            authentication=authentication,
            authorization=authorization,
            request_params_validation=request_params_validation,
            schema_validation=schema_validation,
            data_cleaner=data_cleaner,
            entity_actions=entity_actions,
            post_action_hooks=post_action_hooks,
            response_converter=response_converter,
            serializer=serializer))
61508
def setup(self):
        
        self.log.info('starting the ``setup`` method')

        # RECURSIVELY CREATE MISSING DIRECTORIES
        if not os.path.exists(self.pathToWorkspace):
            os.makedirs(self.pathToWorkspace)
        if not os.path.exists(self.pathToWorkspace + "/qubits_output"):
            os.makedirs(self.pathToWorkspace + "/qubits_output")

        # FIND RESOURCES
        spectralDB = os.path.dirname(
            __file__) + "/resources/qubits_spectral_database"
        qubitsSettings = os.path.dirname(
            __file__) + "/resources/qubits_settings.yaml"
        dstSettings = self.pathToWorkspace + "/qubits_settings.yaml"

        # CHECK FOR PRE-EXISTANCE
        if os.path.exists(self.pathToWorkspace + "/qubits_spectral_database") or os.path.exists(dstSettings):
            self.log.warning(
                "A qubits workspace seems to already exist in this location")
            sys.exit(0)

        # COPY ASSETS TO REQUESTED LOCATION
        shutil.copytree(spectralDB, self.pathToWorkspace +
                        "/qubits_spectral_database")
        shutil.copyfile(qubitsSettings, dstSettings)

        # ADD USER'S HOME FOLDER INTO SETTINGS
        pathToReadFile = dstSettings
        try:
            self.log.debug("attempting to open the file %s" %
                           (pathToReadFile,))
            readFile = codecs.open(pathToReadFile, encoding='utf-8', mode='r')
            thisData = readFile.read()
            readFile.close()
        except IOError, e:
            message = 'could not open the file %s' % (pathToReadFile,)
            self.log.critical(message)
            raise IOError(message)

        readFile.close()
        thisData = thisData.replace("/Users/XXXX", self.home)
        try:
            self.log.debug("attempting to open the file %s" %
                           (pathToReadFile,))
            writeFile = codecs.open(pathToReadFile, encoding='utf-8', mode='w')
        except IOError, e:
            message = 'could not open the file %s' % (pathToReadFile,)
            self.log.critical(message)
            raise IOError(message)
        writeFile.write(thisData)
        writeFile.close()

        self.log.info('completed the ``setup`` method')
        return None
1057706
def SETUP(self):
        """"""
        message = "SETUP " + self.session.control_url + " RTSP/1.0\r\n"
        message += self.sequence
        message += self.authentication
        message += self.user_agent
        message += self.transport
        message += '\r\n'
        return message
1191350
def setup(self):
        
        r = self.call_ext_prog(self.get_option("script"))
        if r['status'] == 0:
            tarfile = ""
            for line in r['output']:
                line = line.strip()
                tarfile = self.do_regex_find_all(r"ftp (.*tar.gz)", line)
            if len(tarfile) == 1:
                self.add_copy_spec(tarfile[0])
1319872
def setup():
    
    from trading_bots.bots import bots
    from trading_bots.conf import settings

    bots.populate(settings.installed_bots)
726583
def setup(self):
        
        self._init_vrep_streaming()

        # Init lifo for temperature spoofing
        for m in self.motors:
            m.__dict__['_load_fifo'] = deque(200 * [1], maxlen=200)

        self.update()
709102
def setup(self):
        
        self.pre_handlers = pre_handlers = {}
        self.post_handlers = post_handlers = {}
        for name in sorted(vars(type(self))):
            if name.startswith('init_'):
                getattr(self, name)()
            elif name.startswith('pre_'):
                pre_handlers[name[4:]] = getattr(self, name)
            elif name.startswith('post_'):
                post_handlers[name[5:]] = getattr(self, name)
324243
def setup_router(self, args, kwargs, **fkwargs):
        
        self._ready = self._setup_router(args=args, kwargs=kwargs, **fkwargs)

        return self._ready
1050599
def Setup():
    '''
    

    '''

    if not os.path.exists(os.path.join(EVEREST_DAT, 'k2', 'cbv')):
        os.makedirs(os.path.join(EVEREST_DAT, 'k2', 'cbv'))
    GetK2Stars(clobber=False)
617631
def _setup(self, name=None):
        
        envvar = self.__dict__['env_var']
        if envvar:
            settings_file = os.environ.get(envvar)
        else:
            settings_file = self.__dict__['file_path']

        if not settings_file:
            msg = ("Requested settings, but none can be obtained for the envvar."
                   "Since no config filepath can be obtained, a default config "
                   "will be used.")
            logger.error(msg)
            raise OSError(msg)

        self._wrapped = Settings(settings_file)
632186
function setup() {
    return browser.getProcessedConfig()
        .then((configuration) => {
            let cucumberFormat = configuration.cucumberOpts.format;

            IS_JSON_FORMAT = cucumberFormat && cucumberFormat.includes('json');

            if (Array.isArray(cucumberFormat)) {
                IS_JSON_FORMAT = cucumberFormat.find((format) => {
                    cucumberFormat = format;
                    return format.includes('json')
                });
            }

            if (IS_JSON_FORMAT) {
                /**
                 * If options are provided override the values to the PLUGIN_CONFIG object
                 */
                if (this.config.options) {
                    Object.assign(PLUGIN_CONFIG, this.config.options);
                }

                /**
                 * Get the JSON folder path and file name if they are still empty
                 */
                const formatPathMatch = cucumberFormat.match(/(.+):(.+)/);
                const filePathMatch = formatPathMatch[2].match(/(.*)\/(.*)\.json/);

                // Get the cucumber results path
                PLUGIN_CONFIG.cucumberResultsPath = filePathMatch[1];

                // Get the cucumber report name
                PLUGIN_CONFIG.cucumberReportName = filePathMatch[2];

                /**
                 * If the json output folder is still default, then create a new one
                 */
                if (PLUGIN_CONFIG.jsonOutputPath === JSON_OUTPUT_FOLDER) {
                    PLUGIN_CONFIG.jsonOutputPath = path.join(PLUGIN_CONFIG.cucumberResultsPath, JSON_OUTPUT_FOLDER);
                }

                /**
                 * Check whether the file name need to be unique
                 */
                PLUGIN_CONFIG.uniqueReportFileName = (Array.isArray(configuration.multiCapabilities)
                    && configuration.multiCapabilities.length > 0)
                    || typeof configuration.getMultiCapabilities === 'function'
                    || configuration.capabilities.shardTestFiles;

                /**
                 * Prepare the PID_INSTANCE_DATA
                 */
                const metadata = {
                    browser: {
                        name: '',
                        version: ''
                    },
                    device: '',
                    platform: {
                        name: '',
                        version: ''
                    }
                };

                PID_INSTANCE_DATA = {
                    pid: process.pid,
                    metadata: Object.assign(metadata, configuration.capabilities[PLUGIN_CONFIG.metadataKey] || {})
                };

                /**
                 * Create the needed folders if they are not present
                 */
                fs.ensureDirSync(PLUGIN_CONFIG.cucumberResultsPath);
                fs.ensureDirSync(PLUGIN_CONFIG.jsonOutputPath);
            } else {
                console.warn('\n### NO `JSON` FORMAT IS SPECIFIED IN THE PROTRACTOR CONF FILE UNDER `cucumberOpts.format ###`\n');
            }
        });
}
1217033
def setup(self, glbls):
        
        if not self.pluginPath() in sys.path:
            log.debug(self.pluginPath())
            sys.path.append(self.pluginPath())
        
        glbls['find'] = self.find
        glbls['listdir'] = self.listdir
        glbls['load'] = self.load
        glbls['read'] = self.read
        glbls['exists'] = self.exists
        glbls['setdefault'] = self.setDefault
        glbls['basePath'] = self.basePath
        glbls['setBasePath'] = self.setBasePath
        glbls['walk'] = self.walk
        glbls['isdir'] = self.isdir
        glbls['isfile'] = self.isfile
        glbls['init'] = self.init
        
        # setup the build system
        if 'python' in sys.executable and not self.useFilepath():
            self.build()