idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
7,800 | public void setFile ( File file ) throws IOException { if ( ! file . isFile ( ) ) throw new IllegalArgumentException ( file + " must be a file." ) ; else { if ( file . getName ( ) . endsWith ( "gz" ) ) initGzReader ( file ) ; else initReader ( file ) ; } } | Read from a specified file . Also supports gzipped files . |
7,801 | public void setFileFromAJar ( String fileName ) { InputStream is = this . getClass ( ) . getResourceAsStream ( fileName ) ; if ( is != null ) { this . fileName = fileName ; reader = new InputStreamReader ( is ) ; } } | Read a file resouce located in a jar |
7,802 | private TypeInfo getTypeInfo ( Map < String , TypeInfo > typeMaps , String path , Class < ? > superType ) { TypeInfo typeInfo = typeMaps . get ( path ) ; if ( typeInfo == null ) { typeInfo = new TypeInfo ( superType ) ; typeMaps . put ( path , typeInfo ) ; } return typeInfo ; } | Get the TypeInfo object from specified path or return the new one if it does not exist . |
7,803 | protected void successfulAuthentication ( PortletRequest request , PortletResponse response , Authentication authResult ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Authentication success: " + authResult ) ; } SecurityContextHolder . getContext ( ) . setAuthentication ( authResult ) ; if ( this . eventPub... | Puts the Authentication instance returned by the authentication manager into the secure context . |
7,804 | public ApiResponse < Templates > deleteTemplatesWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = deleteTemplatesValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < Templates > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; } | Delete Templates . deleteTemplates |
7,805 | public ApiResponse < ApiEndpointsSuccess > getApiEndpointsWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = getApiEndpointsValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < ApiEndpointsSuccess > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarR... | Get apiEndpoints . Get api - endpoints |
7,806 | public ApiResponse < Templates > getTemplatesWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = getTemplatesValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < Templates > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; } | Get Templates . getTemplates |
7,807 | public ApiResponse < ApiPostEndpointsSuccess > postApiEndpointsWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = postApiEndpointsValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < ApiPostEndpointsSuccess > ( ) { } . getType ( ) ; return apiClient . execute ( call ,... | Post apiEndpoints . Post api - endpoints |
7,808 | public ApiResponse < Templates > postTemplatesWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = postTemplatesValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < Templates > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; } | Post Templates . postTemplates |
7,809 | public ApiResponse < Templates > putTemplatesWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = putTemplatesValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < Templates > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; } | Put Templates . putTemplates |
7,810 | public ApiResponse < GetLogout > getLogoutWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = getLogoutValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < GetLogout > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; } | Logout user Logout the user by deleting the session and removing the associated cookie . |
7,811 | public ApiResponse < ApiSuccessResponse > initProvisioningWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = initProvisioningValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarR... | Init Session The GET operation will init user session . |
7,812 | public static < T > T dtoFromScratch ( T entity , DTO dtoTemplate ) throws HyalineException { return dtoFromScratch ( entity , dtoTemplate , "Hyaline$Proxy$" + System . currentTimeMillis ( ) ) ; } | It lets you create a new DTO from scratch . This means that any annotation from JAXB Jackson or whatever serialization framework you are using on your entity T will be ignored . The only annotation - based configuration that will be used is the one you are defining in this invocation . |
7,813 | public static < T > T dtoFromScratch ( T entity , DTO dtoTemplate , String proxyClassName ) throws HyalineException { try { return createDTO ( entity , dtoTemplate , true , proxyClassName ) ; } catch ( CannotInstantiateProxyException | DTODefinitionException e ) { e . printStackTrace ( ) ; throw new HyalineException ( ... | It lets you create a new DTO from scratch . This means that any annotation for JAXB Jackson or whatever serialization framework you are using on your entity T will be ignored . The only annotation - based configuration that will be used is the one you are defining in this invocation . |
7,814 | public ApiResponse < GetEnabledResponse > getEnabledWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = getEnabledValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < GetEnabledResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ... | Get SAML state . Returns SAML current state . |
7,815 | public ApiResponse < GetLocationResponse > getLocationsWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = getLocationsValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < GetLocationResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnT... | Get exist locations . Returns exist locations . |
7,816 | public ApiResponse < PostLocationResponse > postLocationWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = postLocationValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < PostLocationResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarRetur... | Set main settings . Change global settings . |
7,817 | public ApiResponse < GetSubResponse > checkMigrateConflictsWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = checkMigrateConflictsValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < GetSubResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVa... | Get migrate check for conflicts . Get migrate check for conflicts |
7,818 | public ApiResponse < CheckPostMigrateStatistic > checkPostMigrateStatisticWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = checkPostMigrateStatisticValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < CheckPostMigrateStatistic > ( ) { } . getType ( ) ; return apiCli... | Post statistic migrate . Post statistic migrate |
7,819 | public ApiResponse < GetExportStatisticDefinitions > getExportStatisticDefinitionsWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = getExportStatisticDefinitionsValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < GetExportStatisticDefinitions > ( ) { } . getType ( )... | Get export statistic definitions . Get export statistic definitions |
7,820 | public ApiResponse < GetStatisticDefinitionsResponse > getStatisticDefinitionsWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = getStatisticDefinitionsValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < GetStatisticDefinitionsResponse > ( ) { } . getType ( ) ; retur... | Get statistic definitions . Returns statistic definitions records . |
7,821 | public ApiResponse < PostImportStatisticDefinitions > postImportStatisticDefinitionsWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = postImportStatisticDefinitionsValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < PostImportStatisticDefinitions > ( ) { } . getType... | Post import statistic definitions . Post import statistic definitions |
7,822 | public ApiResponse < GetStatisticDefinitionsResponse > postStatisticDefinitionsWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = postStatisticDefinitionsValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < GetStatisticDefinitionsResponse > ( ) { } . getType ( ) ; ret... | Post statistic definitions . Returns statistic definitions records . |
7,823 | public static QueueConfiguration customGame ( boolean force , String gameId , int team ) { return new CustomGameQueueConfiguration ( force , gameId , team ) ; } | Joins custom game . |
7,824 | public static PortletApplicationContext getPortletApplicationContext ( PortletRequest request , PortletContext portletContext ) throws IllegalStateException { PortletApplicationContext portletApplicationContext = ( PortletApplicationContext ) request . getAttribute ( ContribDispatcherPortlet . PORTLET_APPLICATION_CONTE... | Look for the PortletApplicationContext associated with the DispatcherPortlet that has initiated request processing and for the global context if none was found associated with the current request . This method is useful to allow components outside the framework such as JSP tag handlers to access the most specific appli... |
7,825 | public static ApplicationContext getWebApplicationContext ( PortletRequest request , PortletContext portletContext ) throws IllegalStateException { PortletApplicationContext portletApplicationContext = ( PortletApplicationContext ) request . getAttribute ( ContribDispatcherPortlet . PORTLET_APPLICATION_CONTEXT_ATTRIBUT... | Look for the PortletApplicationContext associated with the DispatcherPortlet that has initiated request processing for the global portlet context if none was found associated with the current request and for the global context if no global portlet context was found . This method is useful to allow components outside th... |
7,826 | public void initializeWithCode ( String authCode , String redirectUri ) throws ProvisioningApiException { initialize ( null , authCode , redirectUri ) ; } | Initialize the API with an code from the auth service . |
7,827 | public UpdatableGameState update ( GameUpdateApiResponse gameUpdateData ) { return new UpdatableGameState ( gameUpdateData . getTurn ( ) , startData , MapPatcher . patch ( gameUpdateData . getMapDiff ( ) , rawMapArray ) , MapPatcher . patch ( gameUpdateData . getCitiesDiff ( ) , rawCitiesArray ) , gameUpdateData . getG... | Updates game state from previous turn with new information received from server . The method only works fine if updates are applied in sequence as server is only sending map differences in update messages . |
7,828 | public ApiResponse < GetMOHFilesResponse > getMOHFilesWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = getMOHFilesValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < GetMOHFilesResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnTyp... | Get WAV files for MOH . Returns exist WAV files . |
7,829 | public ApiResponse < GetMOHSettings > getMOHSettingsWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = getMOHSettingsValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < GetMOHSettings > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ... | Get exist setting . Returns exist setting from MOH . |
7,830 | public ApiResponse < PostCheckInactivity > checkInactivityWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = checkInactivityValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < PostCheckInactivity > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarR... | Inactivity . Inactivity . |
7,831 | public ApiResponse < GetSubResponse > getSubWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = getSubValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < GetSubResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; } | Get sub . Sub |
7,832 | public ApiResponse < PostImportResponse > postImportWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = postImportValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < PostImportResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ... | PostImport . postImport |
7,833 | public ApiResponse < PostUsers > postUsersWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = postUsersValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < PostUsers > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; } | Post users . postUsers |
7,834 | public ApiResponse < PostValidateImportResponse > postValidateImportWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = postValidateImportValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < PostValidateImportResponse > ( ) { } . getType ( ) ; return apiClient . execut... | Post Validate Import . post validate import |
7,835 | public ApiResponse < PutUsers > putUsersWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = putUsersValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < PutUsers > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; } | Put users . putUsers |
7,836 | protected Class < ? > determineContextClass ( PortletContext portletContext ) { String contextClassName = portletContext . getInitParameter ( CONTEXT_CLASS_PARAM ) ; if ( contextClassName != null ) { try { return ClassUtils . forName ( contextClassName , ClassUtils . getDefaultClassLoader ( ) ) ; } catch ( ClassNotFoun... | Return the PortletApplicationContext implementation class to use either the default XmlPortletApplicationContext or a custom context class if specified . |
7,837 | public ApiResponse < GetArgsResponse > argsWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = argsValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < GetArgsResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; } | Get provisioning arguments . Returns some of provisioning variables . |
7,838 | public ApiResponse < DynconfigGetConfigResponse > dynconfigGetConfigWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = dynconfigGetConfigValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < DynconfigGetConfigResponse > ( ) { } . getType ( ) ; return apiClient . execut... | Get config . json file . Returns config . json file . |
7,839 | public ApiResponse < GetConfigResponse > getConfigWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = getConfigValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < GetConfigResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; } | Get analytics config . Returns exist config . |
7,840 | public void deleteUser ( String userDBID , Boolean keepPlaces ) throws ProvisioningApiException { try { ApiSuccessResponse resp = usersApi . deleteUser ( userDBID , keepPlaces ) ; if ( ! resp . getStatus ( ) . getCode ( ) . equals ( 0 ) ) { throw new ProvisioningApiException ( "Error deleting user. Code: " + resp . get... | Deletes a user with the given DBID . |
7,841 | public void updateUser ( String userDBID , User user ) throws ProvisioningApiException { try { ApiSuccessResponse resp = usersApi . updateUser ( userDBID , new UpdateUserData ( ) . data ( Converters . convertUserToUpdateUserDataData ( user ) ) ) ; if ( ! resp . getStatus ( ) . getCode ( ) . equals ( 0 ) ) { throw new P... | Updates the attributes of a user with the given DBID . |
7,842 | public Results < DnGroup > searchDnGroups ( SearchParams searchParams ) throws ProvisioningApiException { return searchDnGroups ( searchParams . getLimit ( ) , searchParams . getOffset ( ) , searchParams . getSearchTerm ( ) , searchParams . getSearchKey ( ) , searchParams . getMatchMethod ( ) , searchParams . getSortKe... | Get Dn groups . Get Dn groups from Configuration Server with the specified filters . |
7,843 | public ApiResponse < GetInboundResponse > getInboundSettingsWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = getInboundSettingsValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < GetInboundResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , local... | Get inbound settings . Returns inbound settings . |
7,844 | public ApiResponse < GetOutboundResponse > getOutboundSettingsWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = getOutboundSettingsValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < GetOutboundResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , l... | Get outbound settings . Returns outbound settings . |
7,845 | private static Element lookupId ( List < Element > fields ) { Element objectIdField = null ; Element uuidField = null ; Element _idField = null ; Element idField = null ; for ( Element field : fields ) { if ( field . getAnnotation ( Id . class ) != null ) { return field ; } if ( isObjectId ( field ) ) { objectIdField =... | Find a field with the |
7,846 | public User getUser ( String fieldName , String fieldValue ) { Select q = new Select ( ) . from ( User . class ) ; String nameColumn = ModelReflector . instance ( User . class ) . getColumnDescriptor ( fieldName ) . getName ( ) ; q . where ( new Expression ( q . getPool ( ) , nameColumn , Operator . EQ , new BindVariab... | Can be cast to any user model class as the proxy implements all the user classes . |
7,847 | public Response intercept ( Chain chain ) throws IOException { Request request = chain . request ( ) ; request = request . newBuilder ( ) . addHeader ( TRACEID_HEADER , makeUniqueId ( ) ) . addHeader ( SPANID_HEADER , makeUniqueId ( ) ) . build ( ) ; return chain . proceed ( request ) ; } | 64 - bit ids |
7,848 | public ApiResponse < GetAuditResponse > getAuditWithHttpInfo ( ) throws ApiException { com . squareup . okhttp . Call call = getAuditValidateBeforeCall ( null , null ) ; Type localVarReturnType = new TypeToken < GetAuditResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; } | Get audit records . Returns audit records . |
7,849 | public Options getOptions ( String personDBID , String agentGroupDBID ) throws ProvisioningApiException { try { OptionsGetResponseSuccess resp = optionsApi . optionsGet ( personDBID , agentGroupDBID ) ; if ( ! resp . getStatus ( ) . getCode ( ) . equals ( 0 ) ) { throw new ProvisioningApiException ( "Error getting opti... | Get options . Get options for a specified application and merge them with the person and agent group annexes . |
7,850 | public void modifyOptions ( Map < String , Object > options ) throws ProvisioningApiException { try { OptionsPostResponseStatusSuccess resp = optionsApi . optionsPost ( new OptionsPost ( ) . data ( new OptionsPostData ( ) . options ( options ) ) ) ; if ( ! resp . getStatus ( ) . getCode ( ) . equals ( 0 ) ) { throw new... | Modify options . Replace the existing application options with the specified new values . |
7,851 | public void updateOptions ( Map < String , Object > newOptions , Map < String , Object > changedOptions , Map < String , Object > deletedOptions ) throws ProvisioningApiException { try { OptionsPutResponseStatusSuccess resp = optionsApi . optionsPut ( new OptionsPut ( ) . data ( new OptionsPutData ( ) . newOptions ( ne... | Add edit or delete options values . Add edit or delete option values for the specified application . |
7,852 | private final EvalResult doDefine ( List < SExpression > subexpressions , Environment environment , ParametricBfgBuilder builder , EvalContext context ) { int nameToBind = subexpressions . get ( 1 ) . getConstantIndex ( ) ; if ( subexpressions . size ( ) == 3 ) { Object valueToBind = eval ( subexpressions . get ( 2 ) ,... | Evaluates the define special form . |
7,853 | public static String password ( int length ) { StringBuilder result = new StringBuilder ( ) ; byte [ ] values = byteArray ( length ) ; int index = 0 ; for ( int i = 0 ; i < length ; i ++ ) { index += ( values [ i ] & 0xff ) ; index = index % passwordCharacters . length ( ) ; result . append ( passwordCharacters . charA... | Generates a random password . |
7,854 | public CcgSyntaxTree getSyntacticParse ( ) { HeadedSyntacticCategory originalSyntax = null ; if ( unaryRule != null ) { originalSyntax = unaryRule . getUnaryRule ( ) . getInputSyntacticCategory ( ) . getCanonicalForm ( ) ; } else { originalSyntax = syntax ; } if ( isTerminal ( ) ) { return CcgSyntaxTree . createTermina... | Gets a representation of the syntactic structure of this parse omitting all semantic information . |
7,855 | public Expression2 getLogicalForm ( ) { Expression2 preUnaryLogicalForm = getPreUnaryLogicalForm ( ) ; if ( unaryRule == null ) { return preUnaryLogicalForm ; } else if ( preUnaryLogicalForm == null || unaryRule . getUnaryRule ( ) . getLogicalForm ( ) == null ) { return null ; } else { return Expression2 . nested ( una... | Gets the logical form for this CCG parse . |
7,856 | public SpannedExpression getLogicalFormForSpan ( int spanStart , int spanEnd ) { CcgParse spanningParse = getParseForSpan ( spanStart , spanEnd ) ; Expression2 lf = spanningParse . getPreUnaryLogicalForm ( ) ; if ( lf != null ) { return new SpannedExpression ( spanningParse . getHeadedSyntacticCategory ( ) , spanningPa... | Returns the logical form for the smallest subtree of the parse which completely contains the given span . |
7,857 | public List < SpannedExpression > getSpannedLogicalForms ( ) { List < SpannedExpression > spannedExpressions = Lists . newArrayList ( ) ; getSpannedLogicalFormsHelper ( spannedExpressions ) ; return spannedExpressions ; } | Gets the logical forms for every subspan of this parse tree . Many of the returned logical forms combine with each other during the parse of the sentence . |
7,858 | public List < String > getSpannedWords ( ) { if ( isTerminal ( ) ) { return words ; } else { List < String > words = Lists . newArrayList ( ) ; words . addAll ( left . getSpannedWords ( ) ) ; words . addAll ( right . getSpannedWords ( ) ) ; return words ; } } | Gets all of the words spanned by this node of the parse tree in sentence order . |
7,859 | public List < String > getSpannedPosTags ( ) { if ( isTerminal ( ) ) { return posTags ; } else { List < String > tags = Lists . newArrayList ( ) ; tags . addAll ( left . getSpannedPosTags ( ) ) ; tags . addAll ( right . getSpannedPosTags ( ) ) ; return tags ; } } | Gets all of the part - of - speech tags spanned by this node of the parse tree in sentence order . |
7,860 | public List < LexiconEntryInfo > getSpannedLexiconEntries ( ) { if ( isTerminal ( ) ) { return Arrays . asList ( lexiconEntry ) ; } else { List < LexiconEntryInfo > lexiconEntries = Lists . newArrayList ( ) ; lexiconEntries . addAll ( left . getSpannedLexiconEntries ( ) ) ; lexiconEntries . addAll ( right . getSpannedL... | Gets the lexicon entries for all terminal children of this parse tree node in left - to - right order . |
7,861 | public List < DependencyStructure > getAllDependencies ( ) { List < DependencyStructure > deps = Lists . newArrayList ( ) ; if ( ! isTerminal ( ) ) { deps . addAll ( left . getAllDependencies ( ) ) ; deps . addAll ( right . getAllDependencies ( ) ) ; } deps . addAll ( dependencies ) ; return deps ; } | Gets all dependency structures populated during parsing . |
7,862 | public Multimap < Integer , DependencyStructure > getAllDependenciesIndexedByHeadWordIndex ( ) { Multimap < Integer , DependencyStructure > map = HashMultimap . create ( ) ; for ( DependencyStructure dep : getAllDependencies ( ) ) { map . put ( dep . getHeadWordIndex ( ) , dep ) ; } return map ; } | Gets all dependency structures populated during parsing indexed by the word that projects the dependency . |
7,863 | public void load ( UnitDaoFactory unitDaoFactory ) { BufferedReader reader = new BufferedReader ( new InputStreamReader ( fileInputStream ) ) ; BufferedReaderIterator iterator = new BufferedReaderIterator ( reader ) ; StringBuilder currentQuery = new StringBuilder ( ) ; while ( iterator . hasNext ( ) ) { String line = ... | Execute the SQL file s content . |
7,864 | private static ParserInfo createParser ( LexiconInductionCcgParserFactory factory , SufficientStatistics currentParameters , Collection < LexiconEntry > currentLexicon ) { ParametricCcgParser family = factory . getParametricCcgParser ( currentLexicon ) ; SufficientStatistics newParameters = family . getNewSufficientSta... | Creates a CCG parser given parameters and a lexicon . |
7,865 | private double getPartitionFunction ( List < CcgParse > parses ) { double partitionFunction = 0.0 ; for ( CcgParse parse : parses ) { partitionFunction += parse . getSubtreeProbability ( ) ; } return partitionFunction ; } | Gets the sum total probability assigned to all parses . |
7,866 | public static ParametricFactorGraph buildSequenceModel ( Iterable < String > emissionFeatureLines , String featureDelimiter ) { List < String > words = StringUtils . readColumnFromDelimitedLines ( emissionFeatureLines , 0 , featureDelimiter ) ; List < String > labels = StringUtils . readColumnFromDelimitedLines ( emiss... | Constructs a sequence model from the lines of a file containing features of the emission distribution . |
7,867 | public void addConstantFactor ( String factorName , PlateFactor factor ) { constantFactors . add ( factor ) ; constantFactorNames . add ( factorName ) ; } | Adds an unparameterized dynamically - instantiated factor to the model under construction . |
7,868 | public void addFactor ( String factorName , T factor , VariablePattern factorPattern ) { parametricFactors . add ( factor ) ; factorPatterns . add ( factorPattern ) ; parametricFactorNames . add ( factorName ) ; } | Adds a parameterized factor to the log linear model being constructed . |
7,869 | public void load ( UnitDaoFactory unitDaoFactory ) { for ( String query : queries ) { unitDaoFactory . getUnitDao ( ) . execute ( query ) ; } } | Execute the SQL queries . |
7,870 | private static final boolean longMultisetsEqual ( long [ ] firstDeps , long [ ] secondDeps ) { if ( firstDeps . length != secondDeps . length ) { return false ; } Arrays . sort ( firstDeps ) ; Arrays . sort ( secondDeps ) ; for ( int i = 0 ; i < firstDeps . length ; i ++ ) { if ( firstDeps [ i ] != secondDeps [ i ] ) {... | Checks if two multisets of long numbers contain the same keys with the same frequency |
7,871 | public int add ( T item ) { if ( itemIndex . containsKey ( item ) ) { return itemIndex . get ( item ) ; } int index = items . size ( ) ; itemIndex . put ( item , index ) ; items . add ( item ) ; return index ; } | Add a new element to this set . Note that there can only be a single copy of any given item in the list . Returns the index of the added item . |
7,872 | public int getIndex ( Object item ) { if ( ! itemIndex . containsKey ( item ) ) { throw new NoSuchElementException ( "No such item: " + item ) ; } return itemIndex . get ( item ) ; } | Get the index in the list of the specified item . |
7,873 | public T get ( int index ) { if ( index >= items . size ( ) || index < 0 ) { throw new IndexOutOfBoundsException ( "size: " + items . size ( ) + " index: " + index ) ; } return items . get ( index ) ; } | Get the item with the specified index . |
7,874 | public int getParentExpressionIndex ( int index ) { if ( index == 0 ) { return - 1 ; } else { int [ ] parts = findSubexpression ( index ) ; int parentIndex = subexpressions . get ( parts [ 0 ] ) . getParentExpressionIndex ( parts [ 1 ] ) ; if ( parentIndex == - 1 ) { return 0 ; } else { return parentIndex + parts [ 2 ]... | Get the index of the parent expression that contains the given index . Returns - 1 if the indexed expression has no parent . |
7,875 | public void nextState ( IncEvalState prev , IncEvalState next , Object continuation , Environment env , Object denotation , Object diagram , Object otherArgs , LogFunction log ) { next . set ( continuation , env , denotation , diagram , prev . getProb ( ) , null ) ; } | Override this method in subclasses to implement scoring of search states and accumulating features . |
7,876 | public static Object convert ( String dataType , Object record ) { if ( record == null ) { return null ; } if ( dataType . equals ( UUID ) ) { return java . util . UUID . fromString ( record . toString ( ) ) ; } else { return record ; } } | Based on the generic data type convert record to an appropriate Java Data type |
7,877 | public ModelDef [ ] correct ( ) { for ( ModelDef m : modelList ) { this . model = m ; correct1to1Detail ( ) ; } for ( ModelDef m : modelList ) { this . model = m ; removeUnnecessaryHasOneToSelf ( ) ; } for ( ModelDef m : modelList ) { this . model = m ; removeUnnecessaryHasManyToSelf ( ) ; } for ( ModelDef m : modelLis... | Run each one at a time for all models in such a way that it won t disturb the other |
7,878 | private void removeHasOneToBothPrimaryAndForeignKey ( ) { String [ ] primaryKeys = model . getPrimaryAttributes ( ) ; String [ ] hasOne = model . getHasOne ( ) ; String [ ] hasOneLocal = model . getHasOneLocalColumn ( ) ; String [ ] hasOneReferenced = model . getHasOneReferencedColumn ( ) ; for ( String pk : primaryKey... | user_info . user_id is the primary key while it is refering to users . user_id user_info . User will create a cyclic recursive mapping to users and user_info and back . Remove that hasOne which is both primary and foreign to prevent that . |
7,879 | private void correct1to1Detail ( ) { String [ ] hasManyTables = model . getHasMany ( ) ; for ( String hasMany : hasManyTables ) { if ( shouldBeMoved ( model , hasMany ) ) { model = moveFromHasManyToHasOne ( model , hasMany ) ; } } } | If the localColum of that hasMany table is the primary attributes AND it refer to the primary column of this table |
7,880 | private void crossOutLinkerTables ( ) { String [ ] primaryKeys = model . getPrimaryAttributes ( ) ; if ( primaryKeys != null && primaryKeys . length == 2 ) { String [ ] hasOne = model . getHasOne ( ) ; String [ ] hasOneLocalColum = model . getHasOneLocalColumn ( ) ; String [ ] hasOneReferencedColumn = model . getHasOne... | Remove a linker table present in the hasMany then short circuit right away to the linked table |
7,881 | public Map < U , Double > getActiveFeatures ( Tensor featureVector ) { Preconditions . checkArgument ( featureVector . getDimensionSizes ( ) . length == 1 && featureVector . getDimensionSizes ( ) [ 0 ] == getNumberOfFeatures ( ) ) ; Map < U , Double > features = Maps . newHashMap ( ) ; Iterator < KeyValue > keyValueIte... | Given a feature vector get the features which were active for it . This method inverts the mapping from feature sets to feature vectors performed by this class . |
7,882 | public void sendAdvertisement ( final BasicTrustGraphAdvertisement message , final TrustGraphNodeId sender , final TrustGraphNodeId toNeighbor , final int ttl ) { final BasicTrustGraphAdvertisement outboundMessage = message . copyWith ( sender , ttl ) ; final TrustGraphNode toNode = nodes . get ( toNeighbor ) ; toNode ... | send a local advertisement to the node specified with the given ttl . |
7,883 | public LocalTrustGraphNode addNode ( final TrustGraphNodeId nodeId ) { final LocalTrustGraphNode node = createNode ( nodeId ) ; addNode ( node ) ; return node ; } | Create and add a new trust graph node with the given id . |
7,884 | public void addDirectedRoute ( final LocalTrustGraphNode from , final LocalTrustGraphNode to ) { from . getRoutingTable ( ) . addNeighbor ( to . getId ( ) ) ; } | Add a directed trust graph link between two nodes . |
7,885 | public void addDirectedRoute ( final TrustGraphNodeId from , final TrustGraphNodeId to ) { final TrustGraphNode fromNode = nodes . get ( from ) ; fromNode . getRoutingTable ( ) . addNeighbor ( to ) ; } | create a directed trust link between two nodes . The node with id from will trust the node with id to . |
7,886 | public void addRoute ( final TrustGraphNodeId a , final TrustGraphNodeId b ) { addDirectedRoute ( a , b ) ; addDirectedRoute ( b , a ) ; } | create a bidirectional trust link between the nodes with ids a and b |
7,887 | public void addRoute ( final LocalTrustGraphNode a , final LocalTrustGraphNode b ) { addDirectedRoute ( a , b ) ; addDirectedRoute ( b , a ) ; } | add bidirectioanl trust graph links between two nodes . |
7,888 | public static Status valueOf ( int code ) { Status result = null ; switch ( code ) { case 100 : result = INFO_CONTINUE ; break ; case 101 : result = INFO_SWITCHING_PROTOCOL ; break ; case 102 : result = INFO_PROCESSING ; break ; case 200 : result = SUCCESS_OK ; break ; case 201 : result = SUCCESS_CREATED ; break ; case... | Returns the status associated to a code . If an existing constant exists then it is returned otherwise a new instance is created . |
7,889 | private < T > T populateEntity ( final T t , final Map < Field , Long > enumeratesMap , final Set < Field > nullableFields , final int currentEmbeddedDepth ) { final Map < Field , GenContainer > genContainers = this . populateScanner . scan ( t . getClass ( ) ) ; for ( final Map . Entry < Field , GenContainer > annotat... | Populate single entity |
7,890 | private Object generateObject ( final Field field , final GenContainer container , final Map < Field , Long > enumerateMap , final Set < Field > nullableFields , final int currentEmbeddedDepth ) { final IGenerator generator = genStorage . getGenInstance ( container . getGeneratorClass ( ) ) ; final Annotation annotatio... | Generate populate field value |
7,891 | private Object generateEmbeddedObject ( final Annotation annotation , final Field field , final Set < Field > nullableFields , final int currentEmbeddedDepth ) { final int fieldDepth = getDepth ( annotation ) ; if ( fieldDepth < currentEmbeddedDepth ) return null ; final Object embedded = instantiate ( field . getType ... | Generate embedded field value |
7,892 | private Object generateEnumerateObject ( final Field field , final Map < Field , Long > enumerateMap ) { final Long currentEnumerateValue = enumerateMap . get ( field ) ; Object objValue = BasicCastUtils . castToNumber ( currentEnumerateValue , field . getType ( ) ) ; enumerateMap . computeIfPresent ( field , ( k , v )... | Generate enumerate field next value |
7,893 | private Map < Field , Long > buildEnumerateMap ( final Class t ) { return this . enumerateScanner . scan ( t ) . entrySet ( ) . stream ( ) . collect ( Collectors . toMap ( Map . Entry :: getKey , e -> ( ( GenEnumerate ) e . getValue ( ) . get ( 0 ) ) . from ( ) ) ) ; } | Setup map for enumerate fields |
7,894 | public Factor getRootFactor ( ExpressionTree tree , VariableNumMap expressionVar ) { List < Assignment > roots = Lists . newArrayList ( ) ; if ( tree . getSubstitutions ( ) . size ( ) == 0 ) { roots . add ( expressionVar . outcomeArrayToAssignment ( tree . getExpressionNode ( ) ) ) ; } else { for ( ExpressionTree subst... | This method is a hack that enables the use of the substitutions field of ExpressionTree at the root of the CFG parse . In the future these substitutions should be handled using unary rules in the CFG parser . |
7,895 | public synchronized void clearDisappearedJob ( ) { getCron4jJobList ( ) . stream ( ) . filter ( job -> job . isDisappeared ( ) ) . forEach ( job -> { final LaJobKey jobKey = job . getJobKey ( ) ; jobKeyJobMap . remove ( jobKey ) ; jobOrderedList . remove ( job ) ; job . getJobUnique ( ) . ifPresent ( jobUnique -> jobUn... | Clear disappeared jobs from job list if it exists . |
7,896 | public void addUnreplicatedFactor ( String factorName , Factor factor , VariableNumMap vars ) { plateFactors . add ( new ReplicatedFactor ( factor , new WrapperVariablePattern ( vars ) ) ) ; plateFactorNames . add ( factorName ) ; } | Adds an unreplicated factor to the model being constructed . The factor will match only the variables which it is defined over . |
7,897 | private boolean isComplex ( final Field field ) { final Class < ? > declaringClass = field . getType ( ) ; return ( declaringClass . equals ( List . class ) || declaringClass . equals ( Set . class ) || declaringClass . equals ( Map . class ) ) || declaringClass . getTypeName ( ) . endsWith ( "[][]" ) || declaringClass... | Check if the field have complex suitable generator |
7,898 | private GenContainer findGenAnnotation ( final Field field ) { for ( Annotation annotation : field . getDeclaredAnnotations ( ) ) { for ( Annotation inline : annotation . annotationType ( ) . getDeclaredAnnotations ( ) ) { if ( isGen . test ( inline ) ) { return GenContainer . asGen ( inline , annotation ) ; } } } retu... | Found only first found gen annotation on field |
7,899 | private static void markEntityVars ( HeadedSyntacticCategory cat , int [ ] uniqueVars , boolean [ ] isEntityVar ) { if ( cat . isAtomic ( ) ) { for ( int var : cat . getUniqueVariables ( ) ) { int index = Ints . indexOf ( uniqueVars , var ) ; isEntityVar [ index ] = true ; } } else { markEntityVars ( cat . getArgumentT... | Marks all unique variables in a syntactic category associated with atomic syntactic categories . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.