This function initializes the fax client SPI.
488129
@Override
    protected void initializeChildFaxClientSpi()
    {
        //get logger
        Logger logger=this.getLogger();
        
        //get types
        String types=this.getConfigurationValue(FaxClientSpiConfigurationConstants.SPI_TYPES_PROPERTY_KEY);
        logger.logDebug(new Object[]{FaxClientSpiConfigurationConstants.SPI_TYPES_PROPERTY_KEY," value is ",types},null);
        
        if(types!=null)
        {
            //split type values
            String[] typeValues=types.split(FaxClientSpiConfigurationConstants.PROPERTY_VALUE_LIST_SEPARATOR.toString());
            
            //get amount
            int amount=typeValues.length;
            
            String typeValue=null;
            String conditionString=null;
            String[] conditionBlocks=null;
            String conditionBlock=null;
            String[] conditionBlockValues=null;
            String conditionKey=null;
            String conditionValue=null;
            int subAmount=-1;
            boolean conditionValid=true;
            StringBuilder conditionStringBuffer=new StringBuilder();
            for(int index=0;index<amount;index++)
            {
                //get next element
                typeValue=typeValues[index];
                logger.logDebug(new Object[]{"Checking conditions for type: ",typeValue},null);
                
                //get condition string
                conditionString=this.getConfigurationValue(FaxClientSpiConfigurationConstants.SPI_CONDITION_PROPERTY_KEY_PREFIX+typeValue);
                logger.logDebug(new Object[]{"Configured condition for type: ",typeValue," is set to: ",conditionString},null);
                
                //append mandatory conditions
                conditionStringBuffer.delete(0,conditionStringBuffer.length());
                conditionStringBuffer.append(FaxClientSpiConfigurationConstants.PROPERTY_CONDITION);
                conditionStringBuffer.append(FaxClientSpiConfigurationConstants.PROPERTY_BLOCK_VALUE_SEPARATOR);
                conditionStringBuffer.append(FaxClientSpiFactory.SPI_CLASS_NAME_TYPE_MAP_PROPERTY_KEY_PREFIX);
                conditionStringBuffer.append(typeValue);
                conditionStringBuffer.append(FaxClientSpiConfigurationConstants.PROPERTY_VALUE_LIST_SEPARATOR);
                conditionStringBuffer.append(FaxClientSpiConfigurationConstants.JAVA_CLASS_CONDITION);
                conditionStringBuffer.append(FaxClientSpiConfigurationConstants.PROPERTY_BLOCK_VALUE_SEPARATOR);
                conditionStringBuffer.append(this.getConfigurationValue(FaxClientSpiFactory.SPI_CLASS_NAME_TYPE_MAP_PROPERTY_KEY_PREFIX+typeValue));
                conditionStringBuffer.append(FaxClientSpiConfigurationConstants.PROPERTY_VALUE_LIST_SEPARATOR);
                conditionStringBuffer.append(FaxClientSpiConfigurationConstants.STABLE_CONDITION);
                conditionStringBuffer.append(FaxClientSpiConfigurationConstants.PROPERTY_BLOCK_VALUE_SEPARATOR);
                conditionStringBuffer.append(typeValue);
                if(conditionString!=null)
                {
                    conditionStringBuffer.append(FaxClientSpiConfigurationConstants.PROPERTY_VALUE_LIST_SEPARATOR);
                    conditionStringBuffer.append(conditionString);
                }
                conditionString=conditionStringBuffer.toString();
                logger.logDebug(new Object[]{"Updated condition for type: ",typeValue," is set to: ",conditionString},null);
                                
                //split condition to blocks
                conditionBlocks=conditionString.split(FaxClientSpiConfigurationConstants.PROPERTY_VALUE_LIST_SEPARATOR.toString());
                
                //get amount
                subAmount=conditionBlocks.length;
                
                conditionValid=true;
                for(int blockIndex=0;blockIndex<subAmount;blockIndex++)
                {
                    //get next element
                    conditionBlock=conditionBlocks[blockIndex];
                    
                    //split condition block
                    conditionBlockValues=conditionBlock.split(FaxClientSpiConfigurationConstants.PROPERTY_BLOCK_VALUE_SEPARATOR.toString());
                    
                    //check condition block contains only 2 parts (key and value)
                    if(conditionBlockValues.length!=2)
                    {
                        throw new FaxException("Condition block must contain 2 parts separated by "+FaxClientSpiConfigurationConstants.PROPERTY_BLOCK_VALUE_SEPARATOR);
                    }
                    
                    //get condition key and value
                    conditionKey=conditionBlockValues[0];
                    conditionValue=conditionBlockValues[1];
                    
                    //validate condition
                    logger.logDebug(new Object[]{"Validating condition for type: ",typeValue," key: ",conditionKey," value: ",conditionValue},null);
                    if(!this.validateCondition(conditionKey,conditionValue))
                    {
                        conditionValid=false;
                        break;
                    }
                }
                
                if(conditionValid)
                {
                    logger.logDebug(new Object[]{"Conditions validated for type: ",typeValue},null);
                    
                    //create SPI
                    this.createFaxClientSpi(typeValue);
                    
                    break;
                }
            }
        }
        
        if(this.faxClientSpi==null)
        {
            throw new FaxException("No internal SPI available.");
        }
    }
465872
public final synchronized void initialize(Map<String,String> configuration)
    {
        if(this.initialized)
        {
            throw new FaxException("Request parser already initialized.");
        }
        
        //set flag
        this.initialized=true;
        
        //initialize
        this.initializeImpl(configuration);
    }
1285451
protected Map<FaxActionType,String> initializeFaxActionType2ResourceMap()
    {
        //get resources
        Map<FaxActionType,String> map=new HashMap<FaxActionType,String>();
        FaxActionType[] faxActionTypes=new FaxActionType[]{FaxActionType.SUBMIT_FAX_JOB,
                                                           FaxActionType.SUSPEND_FAX_JOB,
                                                           FaxActionType.RESUME_FAX_JOB,
                                                           FaxActionType.CANCEL_FAX_JOB,
                                                           FaxActionType.GET_FAX_JOB_STATUS};
        Enum<?>[] keys=new Enum<?>[]{FaxClientSpiConfigurationConstants.SUBMIT_HTTP_RESOURCE_PROPERTY_KEY,
                                     FaxClientSpiConfigurationConstants.SUSPEND_HTTP_RESOURCE_PROPERTY_KEY,
                                     FaxClientSpiConfigurationConstants.RESUME_HTTP_RESOURCE_PROPERTY_KEY,
                                     FaxClientSpiConfigurationConstants.CANCEL_HTTP_RESOURCE_PROPERTY_KEY,
                                     FaxClientSpiConfigurationConstants.GET_STATUS_HTTP_RESOURCE_PROPERTY_KEY};
        String resource=null;
        for(int index=0;index<faxActionTypes.length;index++)
        {
            //get next resource
            resource=this.getConfigurationValue(keys[index]);
            if(resource!=null)
            {
                map.put(faxActionTypes[index],resource);
            }
        }
        
        return map;
    }
977411
def main_init():
    """"""
    parser = ArgumentParser(prog="PLIP", description=descript)
    pdbstructure = parser.add_mutually_exclusive_group(required=True)  # Needs either PDB ID or file
    # '-' as file name reads from stdin
    pdbstructure.add_argument("-f", "--file", dest="input", nargs="+", help="Set input file, '-' reads from stdin")
    pdbstructure.add_argument("-i", "--input", dest="pdbid", nargs="+")
    outputgroup = parser.add_mutually_exclusive_group(required=False)  # Needs either outpath or stdout
    outputgroup.add_argument("-o", "--out", dest="outpath", default="./")
    outputgroup.add_argument("-O", "--stdout", dest="stdout", action="store_true", default=False, help="Write to stdout instead of file")
    parser.add_argument("--rawstring", dest="use_raw_string", default=False, action="store_true", help="Use Python raw strings for stdout and stdin")
    parser.add_argument("-v", "--verbose", dest="verbose", default=False, help="Set verbose mode", action="store_true")
    parser.add_argument("-p", "--pics", dest="pics", default=False, help="Additional pictures", action="store_true")
    parser.add_argument("-x", "--xml", dest="xml", default=False, help="Generate report file in XML format",
                        action="store_true")
    parser.add_argument("-t", "--txt", dest="txt", default=False, help="Generate report file in TXT (RST) format",
                        action="store_true")
    parser.add_argument("-y", "--pymol", dest="pymol", default=False, help="Additional PyMOL session files",
                        action="store_true")
    parser.add_argument("--maxthreads", dest="maxthreads", default=multiprocessing.cpu_count(),
                        help="Set maximum number of main threads (number of binding sites processed simultaneously)."
                             "If not set, PLIP uses all available CPUs if possible.",
                        type=int)
    parser.add_argument("--breakcomposite", dest="breakcomposite", default=False,
                        help="Don't combine ligand fragments with covalent bonds but treat them as single ligands for the analysis.",
                        action="store_true")
    parser.add_argument("--altlocation", dest="altlocation", default=False,
                        help="Also consider alternate locations for atoms (e.g. alternate conformations).",
                        action="store_true")
    parser.add_argument("--debug", dest="debug", default=False,
                        help="Turn on DEBUG mode with extended log.",
                        action="store_true")
    parser.add_argument("--nofix", dest="nofix", default=False,
                        help="Turns off fixing of PDB files.",
                        action="store_true")
    parser.add_argument("--nofixfile", dest="nofixfile", default=False,
                        help="Turns off writing files for fixed PDB files.",
                        action="store_true")
    parser.add_argument("--nopdbcanmap", dest="nopdbcanmap", default=False,
                        help="Turns off calculation of mapping between canonical and PDB atom order for ligands.",
                        action="store_true")
    parser.add_argument("--dnareceptor", dest="dnareceptor", default=False,
                        help="Uses the DNA instead of the protein as a receptor for interactions.",
                        action="store_true")
    parser.add_argument("--name", dest="outputfilename", default="report",
                        help="Set a filename for the report TXT and XML files. Will only work when processing single structures.")
    ligandtype = parser.add_mutually_exclusive_group()  # Either peptide/inter or intra mode
    ligandtype.add_argument("--peptides", "--inter", dest="peptides", default=[],
                        help="Allows to define one or multiple chains as peptide ligands or to detect inter-chain contacts",
                        nargs="+")
    ligandtype.add_argument("--intra", dest="intra", help="Allows to define one chain to analyze intra-chain contacts.")
    parser.add_argument("--keepmod", dest="keepmod", default=False,
                        help="Keep modified residues as ligands",
                        action="store_true")
    # Optional threshold arguments, not shown in help
    thr = namedtuple('threshold', 'name type')
    thresholds = [thr(name='aromatic_planarity', type='angle'),
                  thr(name='hydroph_dist_max', type='distance'), thr(name='hbond_dist_max', type='distance'),
                  thr(name='hbond_don_angle_min', type='angle'), thr(name='pistack_dist_max', type='distance'),
                  thr(name='pistack_ang_dev', type='other'), thr(name='pistack_offset_max', type='distance'),
                  thr(name='pication_dist_max', type='distance'), thr(name='saltbridge_dist_max', type='distance'),
                  thr(name='halogen_dist_max', type='distance'), thr(name='halogen_acc_angle', type='angle'),
                  thr(name='halogen_don_angle', type='angle'), thr(name='halogen_angle_dev', type='other'),
                  thr(name='water_bridge_mindist', type='distance'), thr(name='water_bridge_maxdist', type='distance'),
                  thr(name='water_bridge_omega_min', type='angle'), thr(name='water_bridge_omega_max', type='angle'),
                  thr(name='water_bridge_theta_min', type='angle')]
    for t in thresholds:
        parser.add_argument('--%s' % t.name, dest=t.name, type=lambda val: threshold_limiter(parser, val),
                            help=argparse.SUPPRESS)

    arguments = parser.parse_args()
    config.VERBOSE = True if (arguments.verbose or arguments.debug) else False
    config.DEBUG = True if arguments.debug else False
    config.MAXTHREADS = arguments.maxthreads
    config.XML = arguments.xml
    config.TXT = arguments.txt
    config.PICS = arguments.pics
    config.PYMOL = arguments.pymol
    config.STDOUT = arguments.stdout
    config.RAWSTRING = arguments.use_raw_string
    config.OUTPATH = arguments.outpath
    config.OUTPATH = tilde_expansion("".join([config.OUTPATH, '/'])
                                     if not config.OUTPATH.endswith('/') else config.OUTPATH)
    config.BASEPATH = config.OUTPATH  # Used for batch processing
    config.BREAKCOMPOSITE = arguments.breakcomposite
    config.ALTLOC = arguments.altlocation
    config.PEPTIDES = arguments.peptides
    config.INTRA = arguments.intra
    config.NOFIX = arguments.nofix
    config.NOFIXFILE = arguments.nofixfile
    config.NOPDBCANMAP = arguments.nopdbcanmap
    config.KEEPMOD = arguments.keepmod
    config.DNARECEPTOR = arguments.dnareceptor
    config.OUTPUTFILENAME = arguments.outputfilename
    # Make sure we have pymol with --pics and --pymol
    if config.PICS or config.PYMOL:
        try:
            import pymol
        except ImportError:
            write_message("PyMOL is required for --pics and --pymol.\n", mtype='error')
            raise
    # Assign values to global thresholds
    for t in thresholds:
        tvalue = getattr(arguments, t.name)
        if tvalue is not None:
            if t.type == 'angle' and not 0 < tvalue < 180:  # Check value for angle thresholds
                parser.error("Threshold for angles need to have values within 0 and 180.")
            if t.type == 'distance':
                if tvalue > 10:  # Check value for angle thresholds
                    parser.error("Threshold for distances must not be larger than 10 Angstrom.")
                elif tvalue > config.BS_DIST + 1:  # Dynamically adapt the search space for binding site residues
                    config.BS_DIST = tvalue + 1
            setattr(config, t.name.upper(), tvalue)
    # Check additional conditions for interdependent thresholds
    if not config.HALOGEN_ACC_ANGLE > config.HALOGEN_ANGLE_DEV:
        parser.error("The halogen acceptor angle has to be larger than the halogen angle deviation.")
    if not config.HALOGEN_DON_ANGLE > config.HALOGEN_ANGLE_DEV:
        parser.error("The halogen donor angle has to be larger than the halogen angle deviation.")
    if not config.WATER_BRIDGE_MINDIST < config.WATER_BRIDGE_MAXDIST:
        parser.error("The water bridge minimum distance has to be smaller than the water bridge maximum distance.")
    if not config.WATER_BRIDGE_OMEGA_MIN < config.WATER_BRIDGE_OMEGA_MAX:
        parser.error("The water bridge omega minimum angle has to be smaller than the water bridge omega maximum angle")
    expanded_path = tilde_expansion(arguments.input) if arguments.input is not None else None
    main(expanded_path, arguments.pdbid)
1096240
@Override
    protected void initializeImpl()
    {
        //get values
        this.host=this.factoryConfigurationHolder.getConfigurationValue(FaxClientSpiConfigurationConstants.HOST_PROPERTY_KEY);
        if(this.host==null)
        {
            throw new FaxException("Host name not defined in fax4j.properties. Property: "+FaxClientSpiConfigurationConstants.HOST_PROPERTY_KEY);
        }
        String valueStr=this.factoryConfigurationHolder.getConfigurationValue(FaxClientSpiConfigurationConstants.PORT_PROPERTY_KEY);
        if(valueStr==null)
        {
            this.port=HylaFaxClientSpi.DEFAULT_PORT_PROPERTY_VALUE;
        }
        else
        {
            this.port=Integer.parseInt(valueStr);
        }
        this.userName=this.factoryConfigurationHolder.getConfigurationValue(FaxClientSpiConfigurationConstants.USER_NAME_PROPERTY_KEY);
        if(this.userName==null)
        {
            throw new FaxException("User name not defined in fax4j.properties. Property: "+FaxClientSpiConfigurationConstants.USER_NAME_PROPERTY_KEY);
        }
        this.password=this.factoryConfigurationHolder.getConfigurationValue(FaxClientSpiConfigurationConstants.PASSWORD_PROPERTY_KEY);
        this.enableAdminOperations=Boolean.parseBoolean(this.factoryConfigurationHolder.getConfigurationValue(FaxClientSpiConfigurationConstants.ENABLE_ADMIN_OPERATIONS_PROPERTY_KEY));
        valueStr=this.factoryConfigurationHolder.getConfigurationValue(FaxClientSpiConfigurationConstants.MODE_PROPERTY_KEY);
        if(valueStr==null)
        {
            throw new FaxException("Mode not defined in fax4j.properties. Property: "+FaxClientSpiConfigurationConstants.MODE_PROPERTY_KEY);
        }
        this.mode=valueStr.charAt(0);
        valueStr=this.factoryConfigurationHolder.getConfigurationValue(FaxClientSpiConfigurationConstants.TYPE_PROPERTY_KEY);
        if(valueStr==null)
        {
            throw new FaxException("Type not defined in fax4j.properties. Property: "+FaxClientSpiConfigurationConstants.TYPE_PROPERTY_KEY);
        }
        this.type=valueStr.charAt(0);
    }
684163
def listen_init(self):
        """"""
        self.dispatcher = ObjectDispatch(self)
        self.factory = MsgPackProtocolFactory(self.dispatcher)
        self.server = UnixServer(self.loop, self.factory, self.path)
        self.server.start()
122931
def _init(self):
        
        self.tn = telnetlib.Telnet(self.ip, self.port)
        self.tn.read_until('User Name')
        self.tn.write('apc\r\n')
        self.tn.read_until('Password')
        self.tn.write('apc\r\n')
        self.until_done()
443798
function (sspiClient) {
      if (!initializeExecutionCompleted) {
        // You cannot user process.nextTick() here as it will block all
        // I/O which means initialization in native code will never get
        // a chance to run and the process will just hang.
        setImmediate(invokeGetNextBlob, sspiClient);
      } else if (!initializeSucceeded) {
        cb(null, null, initializeErrorCode, initializeErrorString);
      } else {
        sspiClient.sspiClientImpl.getNextBlob(serverResponse, serverResponseBeginOffset, serverResponseLength,
          // Cannot use => function syntax here as that does not have the 'arguments'.
          function() {
            sspiClient.getNextBlobInProgress = false;
            cb.apply(null, arguments);
          });
      }
    }
1148829
public function _initialize() {
        $config = Config::getFileConfig()[ 'rpc_service' ];
        $this->config = array_merge($this->config, $config);
    }
203704
private static FaxClient createFaxClientImpl(String type,Properties configuration)
    {
        //create fax client SPI
        FaxClientSpi faxClientSpi=FaxClientSpiFactory.createFaxClientSpi(type,configuration);
        
        //get fax client class name
        String className=faxClientSpi.getConfigurationValue(FaxClientFactory.FAX_CLIENT_CLASS_NAME_PROPERTY_KEY);
        if((className==null)||(className.length()==0))
        {
            className=FaxClient.class.getName();
        }

        //load class definition
        Class<?> classDefinition=ReflectionHelper.getType(className);

        FaxClient faxClient=null;
        try
        {
            //create fax client
            Constructor<?> constructor=classDefinition.getConstructor(new Class[]{FaxClientSpi.class});
            faxClient=(FaxClient)constructor.newInstance(new Object[]{faxClientSpi});
        }
        catch(Exception exception)
        {
            throw new FaxException("Unable to create a new fax client instance for class name: "+className,exception);
        }

        return faxClient;
    }
1037090
@PostConstruct
    public synchronized void initialize() {
        final FwCoreDirection direction = assistCoreDirection();
        final SMailDeliveryDepartment deliveryDepartment = direction.assistMailDeliveryDepartment();
        postOffice = deliveryDepartment != null ? newPostOffice(deliveryDepartment) : null;
        prepareHotDeploy();
        showBootLogging();
    }
432783
@PostConstruct
    public void initialize() {
        final FwWebDirection direction = assistWebDirection();
        final ResponseHandlingProvider provider = direction.assistResponseHandlingProvider();
        if (provider != null) {
            responseWritePerformerCreator = provider.provideResponseWritePerformerCreator();
            responseDownloadPerformerCreator = provider.provideResponseDownloadPerformerCreator();
            downloadExtensionContentTypeMap = provider.provideDownloadExtensionContentTypeMap();
        }
        showBootLogging();
    }
147345
def patched_fax_init(self, twilio):
  
  super(TwilioFax, self).__init__(twilio)

  self.base_url = ''
  self.account_sid = twilio.account_sid

  # Versions
  self._v1 = None
719241
@Override
    protected void initializeChildFaxClientSpi()
    {
        //get logger
        Logger logger=this.getLogger();

        //get use JNI flag
        boolean useJNI=false;
        String useJNIStr=this.getConfigurationValue(FaxClientSpiConfigurationConstants.USE_JNI_PROPERTY_KEY);
        if(useJNIStr!=null)
        {
            useJNI=Boolean.parseBoolean(useJNIStr);
        }
        
        //extract native resources
        WindowsFaxClientSpiHelper.extractNativeResources();
        
        if(useJNI)
        {
            //load native library
            WindowsFaxClientSpiHelper.loadNativeLibrary(logger);
            
            if(!WindowsFaxClientSpiHelper.isNativeLibraryLoaded())
            {
                //if failed to load native DLL, use executable
                useJNI=false;
            }
        }
        
        //get class name for child SPI
        String className=WindowsProcessFaxClientSpi.class.getName();
        if(useJNI)
        {
            className=WindowsJNIFaxClientSpi.class.getName();
        }
        
        //create child SPI configuration
        Properties childConfiguration=new Properties();
        childConfiguration.putAll(this.getConfiguration());
        childConfiguration.put(FaxClientSpiFactory.SPI_CLASS_NAME_TYPE_MAP_PROPERTY_KEY_PREFIX+"windows.child",className);
        this.faxClientSpi=FaxClientSpiFactory.createChildFaxClientSpi("windows.child",childConfiguration);
    }
1146447
def Init(service_client=None):
  """"""
  global CONN
  global label_map
  global unknown_label

  if service_client is None:
    service_client_cls = fs_client.InsecureGRPCServiceClient

    fleetspeak_message_listen_address = (
        config.CONFIG["Server.fleetspeak_message_listen_address"] or None)
    fleetspeak_server = config.CONFIG["Server.fleetspeak_server"] or None

    if fleetspeak_message_listen_address is None and fleetspeak_server is None:
      logging.warning(
          "Missing config options `Server.fleetspeak_message_listen_address', "
          "`Server.fleetspeak_server', at least one of which is required to "
          "initialize a connection to Fleetspeak; Not using Fleetspeak.")
      return

    service_client = service_client_cls(
        "GRR",
        fleetspeak_message_listen_address=fleetspeak_message_listen_address,
        fleetspeak_server=fleetspeak_server,
        threadpool_size=50)

  unknown_label = config.CONFIG["Server.fleetspeak_unknown_label"]
  label_map = {}
  for entry in config.CONFIG["Server.fleetspeak_label_map"]:
    key, value = entry.split(":")
    label_map[key] = value

  CONN = service_client
  logging.info("Fleetspeak connector initialized.")
361343
function init(ctx) {
        var server = ctx.server;
        server.ext('onRequest', checkIfSSL);
        return new Q(ctx);
    }
1106831
def init():
    '''  '''
    globals()["sock"] = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    globals()["sockfd"] = globals()["sock"].fileno()