text:
<extensionPoints>
  <extensionPoint name="errorOptionsProvider" beanClass="com.intellij.profile.codeInspection.ui.ErrorOptionsProviderEP"/>
  <extensionPoint name="codeFoldingOptionsProvider" beanClass="com.intellij.application.options.editor.CodeFoldingOptionsProviderEP"/>
  <extensionPoint name="autoImportOptionsProvider" beanClass="com.intellij.application.options.editor.AutoImportOptionsProviderEP"/>
  <extensionPoint name="moduleService" beanClass="com.intellij.openapi.components.ServiceDescriptor"/>

  <extensionPoint name="moduleConfigurable"
                  beanClass="com.intellij.openapi.options.ModuleConfigurableEP"
                  area="IDEA_MODULE"/>

  <extensionPoint name="indexPatternProvider"
                  interface="com.intellij.psi.search.IndexPatternProvider"/>

  <extensionPoint name="refGraphAnnotator"
                  interface="com.intellij.codeInspection.reference.RefGraphAnnotator"/>

  <!-- Code Insight -->
  <extensionPoint name="highlightVisitor"
                  interface="com.intellij.codeInsight.daemon.impl.HighlightVisitor"
                  area="IDEA_PROJECT"/>
  <extensionPoint name="highlightErrorFilter"
                  interface="com.intellij.codeInsight.highlighting.HighlightErrorFilter"
                  area="IDEA_PROJECT"/>
  <extensionPoint name="errorQuickFixProvider"
                  interface="com.intellij.codeInsight.daemon.impl.analysis.ErrorQuickFixProvider"/>

  <extensionPoint name="pathReferenceProvider"
                  interface="com.intellij.openapi.paths.PathReferenceProvider"/>
  <extensionPoint name="anchorReferenceProvider"
                  interface="com.intellij.openapi.paths.PathReferenceProvider"/>
  <extensionPoint name="dynamicContextProvider"
                  interface="com.intellij.openapi.paths.DynamicContextProvider"/>

  <extensionPoint name="intentionAction"
                  beanClass="com.intellij.codeInsight.intention.IntentionActionBean"/>

  <extensionPoint name="codeInsight.unresolvedReferenceQuickFixProvider"
                  interface="com.intellij.codeInsight.quickfix.UnresolvedReferenceQuickFixProvider"/>

  <extensionPoint name="braceMatcher"
                  beanClass="com.intellij.openapi.fileTypes.FileTypeExtensionPoint"/>
  <extensionPoint name="quoteHandler"
                  beanClass="com.intellij.codeInsight.editorActions.QuoteHandlerEP"/>
  <extensionPoint name="extendWordSelectionHandler"
                  interface="com.intellij.codeInsight.editorActions.ExtendWordSelectionHandler"/>
  <extensionPoint name="basicWordSelectionFilter"
                  interface="com.intellij.openapi.util.Condition"/>
  <extensionPoint name="typedHandler"
                  interface="com.intellij.codeInsight.editorActions.TypedHandlerDelegate"/>
  <extensionPoint name="joinLinesHandler"
                  interface="com.intellij.codeInsight.editorActions.JoinLinesHandlerDelegate"/>
  <extensionPoint name="enterHandlerDelegate" interface="com.intellij.codeInsight.editorActions.enter.EnterHandlerDelegate"/>
  <extensionPoint name="backspaceHandlerDelegate" interface="com.intellij.codeInsight.editorActions.BackspaceHandlerDelegate"/>

  <extensionPoint name="codeStyleSettingsProvider"
                  interface="com.intellij.psi.codeStyle.CodeStyleSettingsProvider"/>

  <extensionPoint name="daemon.highlightInfoFilter"
                  interface="com.intellij.codeInsight.daemon.impl.HighlightInfoFilter"/>

  <extensionPoint name="daemon.externalAnnotatorsFilter"
                  interface="com.intellij.lang.ExternalAnnotatorsFilter"/>

  <extensionPoint name="severitiesProvider"
                  interface="com.intellij.codeInsight.daemon.impl.SeveritiesProvider"/>

  <extensionPoint name="implicitUsageProvider"
                  interface="com.intellij.codeInsight.daemon.ImplicitUsageProvider"/>

  <extensionPoint name="daemon.changeLocalityDetector"
                  interface="com.intellij.codeInsight.daemon.ChangeLocalityDetector"/>

  <extensionPoint name="languageInjector"
                  interface="com.intellij.psi.LanguageInjector"/>
  <extensionPoint name="concatenationAwareInjector"
                  interface="com.intellij.lang.injection.ConcatenationAwareInjector"
                  area="IDEA_PROJECT"/>
  <extensionPoint name="multiHostInjector"
                  interface="com.intellij.lang.injection.MultiHostInjector"
                  area="IDEA_PROJECT"/>

  <extensionPoint name="annotator"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="externalAnnotator"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.refactoringSupport"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.refactoringSupport.classMembersRefactoringSupport"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.documentationProvider"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.namesValidator"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.findUsagesProvider"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.commenter"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.literalEscaper"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.braceMatcher"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.foldingBuilder"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.psiStructureViewFactory"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.ast.factory"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.formatter" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.importOptimizer" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.surroundDescriptor" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.unwrapDescriptor" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.parserDefinition" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.treePatcher" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.tokenSeparatorGenerator" beanClass="com.intellij.lang.LanguageExtensionPoint"/>

  <extensionPoint name="lang.psiAugmentProvider" interface="com.intellij.psi.augment.PsiAugmentProvider"/>

  <extensionPoint name="lang.fileViewProviderFactory" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="fileType.fileViewProviderFactory" beanClass="com.intellij.openapi.fileTypes.FileTypeExtensionPoint"/>
  <extensionPoint name="multiLangCommenter"
                  interface="com.intellij.psi.templateLanguages.MultipleLangCommentProvider"/>

  <extensionPoint name="cacheBuilder"
                  beanClass="com.intellij.lang.cacheBuilder.CacheBuilderEP"/>

  <extensionPoint name="referencesSearch" interface="com.intellij.util.QueryExecutor"/>
  <extensionPoint name="definitionsSearch" interface="com.intellij.util.QueryExecutor"/>

  <extensionPoint name="useScopeEnlarger" interface="com.intellij.psi.search.UseScopeEnlarger"/>
  <extensionPoint name="resolveScopeEnlarger" interface="com.intellij.psi.ResolveScopeEnlarger"/>

  <extensionPoint name="gotoClassContributor"
                  interface="com.intellij.navigation.ChooseByNameContributor"/>
  <extensionPoint name="gotoSymbolContributor"
                  interface="com.intellij.navigation.ChooseByNameContributor"/>
  <extensionPoint name="gotoFileContributor"
                  interface="com.intellij.navigation.ChooseByNameContributor"/>

  <extensionPoint name="projectExtension" interface="com.intellij.openapi.roots.ProjectExtension" area="IDEA_PROJECT"/>
  <extensionPoint name="roots.watchedRootsProvider" interface="com.intellij.openapi.roots.WatchedRootsProvider" area="IDEA_PROJECT"/>
  <extensionPoint name="moduleExtension" interface="com.intellij.openapi.roots.ModuleExtension" area="IDEA_MODULE"/>
  <extensionPoint name="orderRootType" interface="com.intellij.openapi.roots.OrderRootType"/>
  <extensionPoint name="orderEnumerationHandler" interface="com.intellij.openapi.roots.OrderEnumerationHandler"/>
  <extensionPoint name="directoryIndexExcludePolicy" interface="com.intellij.openapi.roots.impl.DirectoryIndexExcludePolicy"
                  area="IDEA_PROJECT"/>

  <extensionPoint name="smartPointerElementInfoFactory" interface="com.intellij.psi.impl.smartPointers.SmartPointerElementInfoFactory"/>
  <extensionPoint name="elementSignatureProvider" interface="com.intellij.codeInsight.folding.impl.ElementSignatureProvider"/>
  <extensionPoint name="preFormatProcessor" interface="com.intellij.psi.impl.source.codeStyle.PreFormatProcessor"/>
  <extensionPoint name="postFormatProcessor" interface="com.intellij.psi.impl.source.codeStyle.PostFormatProcessor"/>

  <extensionPoint name="declarationRangeHandler" beanClass="com.intellij.util.MixinEP"/>
  <extensionPoint name="highlightUsagesHandlerFactory" interface="com.intellij.codeInsight.highlighting.HighlightUsagesHandlerFactory"/>

  <extensionPoint name="usageTargetProvider"
                  interface="com.intellij.usages.UsageTargetProvider"/>
  <extensionPoint name="usageToPsiElementProvider" interface="com.intellij.usages.UsageToPsiElementProvider" />

  <extensionPoint name="customScopesProvider"
                  interface="com.intellij.psi.search.scope.packageSet.CustomScopesProvider"
                  area="IDEA_PROJECT"/>

  <extensionPoint name="scopeDescriptorProvider" interface="com.intellij.ide.util.scopeChooser.ScopeDescriptorProvider"/>
  <extensionPoint name="patternDialectProvider" interface="com.intellij.packageDependencies.ui.PatternDialectProvider"/>

  <extensionPoint name="inspectionToolProvider"
                  interface="com.intellij.codeInspection.InspectionToolProvider"/>
  <extensionPoint name="inspectionToolsFactory"
                  interface="com.intellij.codeInspection.InspectionToolsFactory"/>
  <extensionPoint name="codeInspection.InspectionExtension" interface="com.intellij.codeInspection.lang.InspectionExtensionsFactory"/>

  <extensionPoint name="customPasteProvider" interface="com.intellij.ide.PasteProvider"/>

  <extensionPoint name="copyPastePreProcessor" interface="com.intellij.codeInsight.editorActions.CopyPastePreProcessor"/>
  <extensionPoint name="copyPastePostProcessor" interface="com.intellij.codeInsight.editorActions.CopyPastePostProcessor"/>

  <extensionPoint name="liveTemplateContext" interface="com.intellij.codeInsight.template.TemplateContextType"/>
  <extensionPoint name="liveTemplateMacro" interface="com.intellij.codeInsight.template.Macro"/>
  <extensionPoint name="liveTemplateOptionalProcessor" interface="com.intellij.codeInsight.template.impl.TemplateOptionalProcessor"/>
  <extensionPoint name="liveTemplatePreprocessor" interface="com.intellij.codeInsight.template.impl.TemplatePreprocessor"/>
  <extensionPoint name="customLiveTemplate" interface="com.intellij.codeInsight.template.CustomLiveTemplate"/>

  <extensionPoint name="fileTemplateGroup"
                  interface="com.intellij.ide.fileTemplates.FileTemplateGroupDescriptorFactory"/>
  <extensionPoint name="iconProvider"
                  interface="com.intellij.ide.IconProvider"/>
  <extensionPoint name="createFromTemplateHandler"
                  interface="com.intellij.ide.fileTemplates.CreateFromTemplateHandler"/>
  <extensionPoint name="defaultTemplatePropertiesProvider"
                  interface="com.intellij.ide.fileTemplates.DefaultTemplatePropertiesProvider"/>
  <extensionPoint name="internalFileTemplate"
                  beanClass="com.intellij.ide.fileTemplates.InternalTemplateBean"/>
  <extensionPoint name="saveFileAsTemplateHandler"
                  interface="com.intellij.ide.actions.SaveFileAsTemplateHandler"/>

  <extensionPoint name="favoriteNodeProvider"
                  interface="com.intellij.ide.favoritesTreeView.FavoriteNodeProvider"
                  area="IDEA_PROJECT"/>

  <!-- File-Based Index-->
  <extensionPoint name="fileBasedIndex" interface="com.intellij.util.indexing.FileBasedIndexExtension"/>
  <extensionPoint name="stubIndex" interface="com.intellij.psi.stubs.StubIndexExtension"/>
  <extensionPoint name="indexedRootsProvider" interface="com.intellij.util.indexing.IndexedRootsProvider"/>
  <extensionPoint name="include.provider" interface="com.intellij.psi.impl.include.FileIncludeProvider"/>

  <extensionPoint name="refactoring.copyHandler" interface="com.intellij.refactoring.copy.CopyHandlerDelegate"/>
  <extensionPoint name="refactoring.moveHandler" interface="com.intellij.refactoring.move.MoveHandlerDelegate"/>
  <extensionPoint name="refactoring.moveClassHandler" interface="com.intellij.refactoring.move.moveClassesOrPackages.MoveClassHandler"/>
  <extensionPoint name="refactoring.moveMemberHandler" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="refactoring.helper" interface="com.intellij.refactoring.RefactoringHelper"/>
  <extensionPoint name="refactoring.inlineHandler" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="refactoring.safeDeleteProcessor" interface="com.intellij.refactoring.safeDelete.SafeDeleteProcessorDelegate"/>
  <extensionPoint name="refactoring.extractIncludeHandler"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="refactoring.changeSignatureUsageProcessor"
                  interface="com.intellij.refactoring.changeSignature.ChangeSignatureUsageProcessor"/>

  <extensionPoint name="elementDescriptionProvider" interface="com.intellij.psi.ElementDescriptionProvider"/>

  <extensionPoint name="structureViewBuilder"
                  beanClass="com.intellij.openapi.extensions.KeyedFactoryEPBean"/>

  <extensionPoint name="macro" interface="com.intellij.ide.macro.Macro"/>
  <extensionPoint name="printOption" interface="com.intellij.codeEditor.printing.PrintOption"/>

  <extensionPoint name="indexPatternBuilder" interface="com.intellij.psi.impl.search.IndexPatternBuilder"/>

  <extensionPoint name="configurationType"
                  interface="com.intellij.execution.configurations.ConfigurationType"/>

  <extensionPoint name="programRunner"
                  interface="com.intellij.execution.runners.ProgramRunner"/>

  <extensionPoint name="executor"
                  interface="com.intellij.execution.Executor"/>

  <extensionPoint name="runConfigurationExtension"
                  interface="com.intellij.execution.RunConfigurationExtension"/>

  <extensionPoint name="stepsBeforeRunProvider"
                  interface="com.intellij.execution.BeforeRunTaskProvider"
                  area="IDEA_PROJECT"/>

  <extensionPoint name="consoleFilterProvider" interface="com.intellij.execution.filters.ConsoleFilterProvider"/>

  <extensionPoint name="console.folding" interface="com.intellij.execution.ConsoleFolding"/>

  <extensionPoint name="configurationProducer"
                  interface="com.intellij.execution.junit.RuntimeConfigurationProducer"/>

  <extensionPoint name="hectorComponentProvider" interface="com.intellij.openapi.editor.HectorComponentPanelsProvider" area="IDEA_PROJECT"/>
  <extensionPoint name="scopeTreeExpander" interface="com.intellij.ide.scopeView.ScopeTreeStructureExpander" area="IDEA_PROJECT"/>

  <extensionPoint name="lang.elementManipulator" beanClass="com.intellij.openapi.fileTypes.ClassExtensionPoint"/>
  <extensionPoint name="fileContextProvider" interface="com.intellij.psi.FileContextProvider" area="IDEA_PROJECT"/>
  <extensionPoint name="psi.fileReferenceHelper" interface="com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReferenceHelper"/>

  <extensionPoint name="psi.referenceContributor" interface="com.intellij.psi.PsiReferenceContributor"/>
  <extensionPoint name="psi.referenceProvider" beanClass="com.intellij.psi.PsiReferenceProviderBean"/>
  <extensionPoint name="patterns.patternClass" beanClass="com.intellij.patterns.compiler.PatternClassBean"/>

  <extensionPoint name="pom.declarationSearcher" interface="com.intellij.pom.PomDeclarationSearcher"/>

  <extensionPoint name="statistician" beanClass="com.intellij.psi.statistics.StatisticsExtensionPoint"/>
  <extensionPoint name="weigher" beanClass="com.intellij.psi.WeigherExtensionPoint"/>
  <extensionPoint name="completion.contributor" beanClass="com.intellij.codeInsight.completion.CompletionContributorEP"/>
  <extensionPoint name="completion.confidence" beanClass="com.intellij.codeInsight.completion.CompletionConfidenceEP"/>
  <extensionPoint name="completion.skip" interface="com.intellij.codeInsight.completion.CompletionPreselectSkipper"/>
  <extensionPoint name="lookup.charFilter" interface="com.intellij.codeInsight.lookup.CharFilter"/>
  <extensionPoint name="lookup.actionProvider" interface="com.intellij.codeInsight.lookup.LookupActionProvider"/>

  <extensionPoint name="highlightRangeExtension" interface="com.intellij.codeInsight.daemon.impl.HighlightRangeExtension"/>

  <extensionPoint name="elementsToHighlightFilter" interface="com.intellij.openapi.util.Condition"/>

  <extensionPoint name="sdkType" interface="com.intellij.openapi.projectRoots.SdkType"/>

  <extensionPoint name="library.presentationProvider" interface="com.intellij.openapi.roots.libraries.LibraryPresentationProvider"/>
  <extensionPoint name="library.type" interface="com.intellij.openapi.roots.libraries.LibraryType"/>

  <extensionPoint name="lang.implementationTextSelectioner"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.lineWrapStrategy"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="lang.whiteSpaceFormattingStrategy"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>

  <extensionPoint name="gotoDeclarationHandler"
                  interface="com.intellij.codeInsight.navigation.actions.GotoDeclarationHandler"/>
  <extensionPoint name="typeDeclarationProvider"
                  interface="com.intellij.codeInsight.navigation.actions.TypeDeclarationProvider"/>
  <extensionPoint name="gotoTargetRendererProvider"
                  interface="com.intellij.codeInsight.navigation.GotoTargetRendererProvider"/>

  <extensionPoint name="navbar" interface="com.intellij.ide.navigationToolbar.NavBarModelExtension"/>

  <extensionPoint name="renameHandler" interface="com.intellij.refactoring.rename.RenameHandler"/>
  <extensionPoint name="renamePsiElementProcessor" interface="com.intellij.refactoring.rename.RenamePsiElementProcessor"/>
  <extensionPoint name="updateAddedFileProcessor" interface="com.intellij.psi.impl.file.UpdateAddedFileProcessor"/>
  <extensionPoint name="moveFileHandler" interface="com.intellij.refactoring.move.moveFilesOrDirectories.MoveFileHandler"/>
  <extensionPoint name="automaticRenamerFactory" interface="com.intellij.refactoring.rename.naming.AutomaticRenamerFactory"/>
  <extensionPoint name="nameSuggestionProvider" interface="com.intellij.refactoring.rename.NameSuggestionProvider"/>
  <extensionPoint name="vetoRenameCondition" interface="com.intellij.openapi.util.Condition"/>
  <extensionPoint name="rename.inplace.resolveSnapshotProvider"
                  beanClass="com.intellij.lang.LanguageExtensionPoint" />
  <extensionPoint name="renameInputValidator" interface="com.intellij.refactoring.rename.RenameInputValidator"/>

  <extensionPoint name="findUsagesHandlerFactory" interface="com.intellij.find.findUsages.FindUsagesHandlerFactory" area="IDEA_PROJECT"/>

  <extensionPoint name="readWriteAccessDetector" interface="com.intellij.codeInsight.highlighting.ReadWriteAccessDetector"/>

  <extensionPoint name="scopeParserExtension" interface="com.intellij.psi.search.scope.packageSet.PackageSetParserExtension"/>
  <extensionPoint name="referenceProviderType" beanClass="com.intellij.util.KeyedLazyInstanceEP"/>
  <extensionPoint name="colorSettingsPage"
                  interface="com.intellij.openapi.options.colors.ColorSettingsPage"/>

  <extensionPoint name="codeInsight.parameterInfo" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="editorOptionsProvider" beanClass="com.intellij.application.options.editor.EditorOptionsProviderEP"/>
  <extensionPoint name="fileTypeIndentOptionsProvider" interface="com.intellij.psi.codeStyle.FileTypeIndentOptionsProvider"/>
  <extensionPoint name="referenceImporter" interface="com.intellij.codeInsight.daemon.ReferenceImporter"/>
  <extensionPoint name="elementLookupRenderer" interface="com.intellij.codeInsight.lookup.impl.ElementLookupRenderer"/>

  <extensionPoint name="qualifiedNameProvider" interface="com.intellij.ide.actions.QualifiedNameProvider"/>

  <extensionPoint name="completionData"
                  beanClass="com.intellij.codeInsight.completion.CompletionDataEP"/>

  <extensionPoint name="usageFilteringRuleProvider"
                  interface="com.intellij.usages.rules.UsageFilteringRuleProvider"/>
  <extensionPoint name="importFilteringRule"
                  interface="com.intellij.usages.rules.ImportFilteringRule"/>
  <extensionPoint name="usageGroupingRuleProvider"
                  interface="com.intellij.usages.rules.UsageGroupingRuleProvider"/>
  <extensionPoint name="usageTypeProvider"
                  interface="com.intellij.usages.impl.rules.UsageTypeProvider"/>
  <extensionPoint name="fileStructureGroupRuleProvider"
                  interface="com.intellij.usages.impl.FileStructureGroupRuleProvider"/>

  <extensionPoint name="treeStructureProvider"
                  interface="com.intellij.ide.projectView.TreeStructureProvider"
                  area="IDEA_PROJECT"/>

  <extensionPoint name="defaultLiveTemplatesProvider"
                  interface="com.intellij.codeInsight.template.impl.DefaultLiveTemplatesProvider"/>

  <extensionPoint name="codeInsight.implementMethod" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="codeInsight.overrideMethod" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="codeInsight.delegateMethods" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="codeInsight.gotoSuper" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="codeInsight.lineMarkerProvider" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="codeInsight.surroundWithRangeAdjuster" interface="com.intellij.codeInsight.generation.surroundWith.SurroundWithRangeAdjuster"/>

  <extensionPoint name="lang.substitutor" beanClass="com.intellij.lang.LanguageExtensionPoint"/>

  <extensionPoint name="createFromTemplateActionReplacer"
                  interface="com.intellij.ide.fileTemplates.CreateFromTemplateActionReplacer"/>

  <extensionPoint name="filetype.stubBuilder"
                  beanClass="com.intellij.openapi.fileTypes.FileTypeExtensionPoint"/>
  <extensionPoint name="stubElementTypeHolder"
                  beanClass="com.intellij.psi.stubs.StubElementTypeHolderEP"/>

  <extensionPoint name="moduleType"
                  beanClass="com.intellij.openapi.module.ModuleTypeEP"/>
  <extensionPoint name="moduleBuilder"
                  beanClass="com.intellij.ide.util.projectWizard.ModuleBuilderFactory"/>
  <extensionPoint name="facetType"
                  interface="com.intellij.facet.FacetType"/>

  <extensionPoint name="methodNavigationOffsetProvider"
                  interface="com.intellij.codeInsight.navigation.MethodNavigationOffsetProvider"/>

  <extensionPoint name="filePasteProvider"
                  interface="com.intellij.ide.PasteProvider"/>

  <extensionPoint name="testFinder"
                  interface="com.intellij.testIntegration.TestFinder"/>
  <extensionPoint name="testSrcLocator"
                  interface="com.intellij.testIntegration.TestLocationProvider"/>
  <extensionPoint name="testCreator"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>

  <extensionPoint name="lang.smartEnterProcessor"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>

  <extensionPoint name="moduleConfigurationEditorProvider"
                  interface="com.intellij.openapi.roots.ui.configuration.ModuleConfigurationEditorProvider"
                  area="IDEA_MODULE"/>

  <extensionPoint name="callHierarchyProvider" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="methodHierarchyProvider" beanClass="com.intellij.lang.LanguageExtensionPoint"/>
  <extensionPoint name="typeHierarchyProvider" beanClass="com.intellij.lang.LanguageExtensionPoint"/>

  <extensionPoint name="editorAppearanceConfigurable" beanClass="com.intellij.application.options.editor.EditorAppearanceConfigurableEP"/>
  <extensionPoint name="editorSmartKeysConfigurable" beanClass="com.intellij.application.options.editor.EditorSmartKeysConfigurableEP"/>
  <extensionPoint name="optionsApplicabilityFilter" interface="com.intellij.application.options.OptionsApplicabilityFilter"/>

  <extensionPoint name="metaDataContributor" interface="com.intellij.psi.meta.MetaDataContributor"/>

  <extensionPoint name="documentationProvider"
                  interface="com.intellij.lang.documentation.DocumentationProvider"/>

  <extensionPoint name="templateCompletionProcessor"
                  interface="com.intellij.codeInsight.template.macro.TemplateCompletionProcessor"/>

  <extensionPoint name="targetElementEvaluator" beanClass="com.intellij.lang.LanguageExtensionPoint"/>

  <extensionPoint name="statementUpDownMover" interface="com.intellij.codeInsight.editorActions.moveUpDown.StatementUpDownMover"/>

  <extensionPoint name="fileLookupInfoProvider" interface="com.intellij.psi.file.FileLookupInfoProvider"/>

  <extensionPoint name="idIndexer" beanClass="com.intellij.openapi.fileTypes.FileTypeExtensionPoint"/>
  <extensionPoint name="todoIndexer" beanClass="com.intellij.openapi.fileTypes.FileTypeExtensionPoint"/>

  <extensionPoint name="refactoring.elementListenerProvider" interface="com.intellij.refactoring.listeners.RefactoringElementListenerProvider"
                  area="IDEA_PROJECT"/>

  <extensionPoint name="fileTemplateDefaultExtension" beanClass="com.intellij.ide.fileTemplates.FileTemplateDefaultExtension"/>

  <extensionPoint name="problemFileHighlightFilter" interface="com.intellij.openapi.util.Condition" area="IDEA_PROJECT"/>

  <extensionPoint name="problemHighlightFilter" interface="com.intellij.codeInsight.daemon.ProblemHighlightFilter"/>

  <extensionPoint name="uiDebuggerExtension" interface="com.intellij.ui.debugger.UiDebuggerExtension"/>

  <extensionPoint name="projectViewPane" interface="com.intellij.ide.projectView.impl.AbstractProjectViewPane" area="IDEA_PROJECT"/>

  <extensionPoint name="inlineActionHandler" interface="com.intellij.lang.refactoring.InlineActionHandler"/>

  <extensionPoint name="projectViewNodeDecorator" interface="com.intellij.ide.projectView.ProjectViewNodeDecorator" area="IDEA_PROJECT"/>

  <extensionPoint name="previewHintProvider" interface="com.intellij.codeInsight.preview.PreviewHintProvider"/>
  <extensionPoint name="testActionProvider" interface="com.intellij.execution.testframework.ToggleModelActionProvider"/>

  <extensionPoint name="psiViewerExtension" interface="com.intellij.internal.psiView.PsiViewerExtension"/>

  <extensionPoint name="diffPreviewProvider" interface="com.intellij.openapi.diff.impl.settings.DiffPreviewProvider"/>

  <extensionPoint name="filePropertyPusher" interface="com.intellij.openapi.roots.impl.FilePropertyPusher"/>

  <extensionPoint name="langCodeStyleSettingsProvider" interface="com.intellij.psi.codeStyle.LanguageCodeStyleSettingsProvider"/>

  <extensionPoint name="semContributor"
                  beanClass="com.intellij.semantic.SemContributorEP" area="IDEA_PROJECT"/>

  <extensionPoint name="typeName" beanClass="com.intellij.ide.TypeNameEP"/>

  <extensionPoint name="typeIcon" beanClass="com.intellij.ide.TypeIconEP"/>

  <extensionPoint name="analyzeStacktraceFilter" interface="com.intellij.execution.filters.Filter" area="IDEA_PROJECT"/>

  <extensionPoint name="stacktrace.fold" beanClass="com.intellij.execution.console.CustomizableConsoleFoldingBean"/>
  <extensionPoint name="changeSignatureDetector"
                  beanClass="com.intellij.lang.LanguageExtensionPoint"/>

  <extensionPoint name="preserveIndentOnPaste" beanClass="com.intellij.codeInsight.editorActions.PreserveIndentOnPasteBean"/>

  <extensionPoint name="aliasingPsiTargetMapper" interface="com.intellij.psi.targets.AliasingPsiTargetMapper"/>

  <extensionPoint name="sourceRootFinder" interface="com.intellij.ide.util.newProjectWizard.SourceRootFinder"/>
</extensionPoints>


text:
<?php

namespace app\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use app\models\ObjetivosHistoricos;

/**
 * ObjetivosHistoricosSearch represents the model behind the search form about `app\models\ObjetivosHistoricos`.
 */
class ObjetivosHistoricosSearch extends ObjetivosHistoricos
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id'], 'integer'],
            [['objetivo_historico'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = ObjetivosHistoricos::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'id' => $this->id,
        ]);

        $query->andFilterWhere(['like', 'objetivo_historico', $this->objetivo_historico]);

        return $dataProvider;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package com.ibm.util.merge.template.content;

import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;

import com.ibm.util.merge.exception.Merge500;
import com.ibm.util.merge.template.Wrapper;

/**
 * Template Content - the root of a circular dual linked list
 *
Content is a dual linked list of Segments that are either Text, a Replace Tag or a Book Mark.
 * Segments are parsed at construction based on the Content Wrapper provided. Note that the wrappers
 * caon only appear in the content to identify a Tag or Bookmark segment, invalid content will throw
 * an exception on creation.

 *
 *
These optimizations replace string pattern matching and global search replace functions
 * with code that maintains and preserves string pointers and optimizes Java GC

 *
 * @author Mike Storey
 * @see com.ibm.util.merge.template.content.TagSegment
 * @see com.ibm.util.merge.template.content.BookmarkSegment
 *
 */
public class Content extends Segment {
	static final String BOOKMARK = "bookmark";

	private String source = "";
	private String open = "";
	private String close = "";

	public Content() {
		this.setNext(this);
		this.setPrevious(this);
	}

	/**
	 * Instantiate a content object
	 *
	 * @param wrapper Content wrapper used
	 * @param content Content to parse
	 * @param encodeDefault Encoding default
	 * @throws Merge500 on processing errors
	 */
	public Content(Wrapper wrapper, String content, int encodeDefault) throws Merge500 {
		initialize(wrapper.front, wrapper.back, content, encodeDefault);
	}

	/**
	 * Instantiate a content object
	 *
	 * @param open The open wrapper
	 * @param close The close wrapper
	 * @param content The content to parse
	 * @param encodeDefault The encoding default
	 * @throws Merge500 on processing errors
	 */
	public Content(String open, String close, String content, int encodeDefault) throws Merge500 {
		initialize(open, close, content, encodeDefault);
	}

	@Override
	public Content getMergable() {
		Content mergable = new Content();
		mergable.source = this.source;
		mergable.open = this.open;
		mergable.close = this.close;
		Segment segment = this.getFirst();
		while (segment != this) {
			mergable.insert(segment.getMergable());
			segment = segment.getNext();
		}
		return mergable;
	}
	/**
	 * Common initialization - Parse content
	 * @param open The open wrapper
	 * @param close The close wrapper
	 * @param content The content to parse
	 * @param encodeDefault The encoding default
	 * @throws Merge500 on processing errors
	 */
	private void initialize(String open, String close, String content, int encodeDefault) throws Merge500 {
		this.source = content;
		this.open = open;
		this.close = close;
		this.setNext(this);
		this.setPrevious(this);

		int startIndex = 0;
		int endIndex = content.indexOf(open, startIndex);

		while (endIndex >= 0) {
			if (endIndex > startIndex) this.insert(new TextSegment(content.substring(startIndex,endIndex)));
			startIndex = endIndex + open.length();
			endIndex = content.indexOf(close, startIndex);
			if (endIndex < 0) throw new Merge500("Invalid Content - Missing End Tag!");
			String segment = content.substring(startIndex, endIndex);
			if (segment.startsWith(BOOKMARK)) {
				BookmarkSegment newSeg = new BookmarkSegment(segment);
				this.insert(newSeg);
			} else {
				TagSegment newSeg = new TagSegment(open, close, segment, encodeDefault);
				this.insert(newSeg);
			}
			startIndex = endIndex + close.length();
			endIndex = content.indexOf(open,startIndex);
		}

		if (startIndex < content.length()) {
			String value = content.substring(startIndex);
			this.insert(new TextSegment(value));
		}

	}

	@Override
	public String getValue() {
		StringBuilder value = new StringBuilder();
		Segment seg = this.getFirst();
		while (seg != this) {
			value.append(seg.getValue());
			seg = seg.getNext();
		}
		return value.toString();
	}

	/**
	 * Write the content to an output stream
	 *
	 * @param stream The stream to write to
	 * @throws Merge500 on processing errors
	 */
	public void streamValue(OutputStream stream) throws Merge500 {
		Segment seg = this.getFirst();
		while (seg != this) {
			try {
				stream.write(seg.getValue().getBytes());
			} catch (IOException e) {
				throw new Merge500(e.getMessage());
			}
			seg = seg.getNext();
		}
	}

	/**
	 * Replace all Tag's with values from Replace
	 *
	 * @param replace From/To values for replace
	 * @param require Require all tags
	 * @param nestLimit Tag Replace nesting limit
	 * @throws Merge500 on processing errors
	 */
	public void replace(HashMap<String,String> replace, boolean require, int nestLimit) throws Merge500 {
		Segment seg = this.getFirst();
		while (seg != this) {
			if (seg instanceof TagSegment) {
				((TagSegment) seg).replace(replace, require, nestLimit);
			}
			seg = seg.getNext();
		}
	}

	/**
	 * Remove all bookmarks (called prior to inserting sub-template
	 *
	 * @throws Merge500 on Processing Errors
	 */
	public void removeBookmarks() throws Merge500 {
		Segment seg = this.getFirst();
		while (seg != this) {
			Segment segNext = seg.getNext();
			if (seg instanceof BookmarkSegment) {
				seg.remove();
			}
			seg = segNext;
		}
	}

	/**
	 * Get list of Tag segments
	 * @return Tag List
	 */
	public ArrayList<TagSegment> getTags() {
		ArrayList<TagSegment> tags = new ArrayList<TagSegment>();
		Segment seg = this.getFirst();
		while (seg != this) {
			if (seg instanceof TagSegment) {
				tags.add((TagSegment) seg);
			}
			seg = seg.getNext();
		}
		return tags;
	}

	/**
	 * Get list of Bookmark Segments
	 * @return Bookmark List
	 */
	public ArrayList<BookmarkSegment> getBookmarks() {
		ArrayList<BookmarkSegment> bookmarks = new ArrayList<BookmarkSegment>();
		Segment seg = this.getFirst();
		while (seg != this) {
			if (seg instanceof BookmarkSegment) {
				bookmarks.add((BookmarkSegment) seg);
			}
			seg = seg.getNext();
		}
		return bookmarks;
	}

	/**
	 * Get list of Text Segments
	 * @return Segment List
	 */
	public ArrayList<TextSegment> getTexts() {
		ArrayList<TextSegment> texts = new ArrayList<TextSegment>();
		Segment seg = this.getFirst();
		while (seg != this) {
			if (seg instanceof TextSegment) {
				texts.add((TextSegment) seg);
			}
			seg = seg.getNext();
		}
		return texts;
	}

	/**
	 * @return Source
	 */
	public String getSource() {
		return source;
	}

	/**
	 * @return Opening Wrapper
	 */
	public String getOpen() {
		return open;
	}

	/**
	 * @return Closing Wrapper
	 */
	public String getClose() {
		return close;
	}

	/**
	 * @return First Element
	 */
	public Segment getFirst() {
		return this.getNext();
	}

	/**
	 * @return Last Element
	 */
	public Segment getLast() {
		return this.getPrevious();
	}
}


text:
namespace google_apis {
class ResourceEntry;
}

namespace drive {

class DriveFileSystemObserver;
class DriveResourceMetadata;

typedef std::vector<DriveEntryProto> DriveEntryProtoVector;

// Information about search result returned by Search Async callback.
// This is data needed to create a file system entry that will be used by file
// browser.
struct SearchResultInfo {
  SearchResultInfo(const base::FilePath& path,
                   const DriveEntryProto& entry_proto)
      : path(path),
        entry_proto(entry_proto) {
  }

  base::FilePath path;
  DriveEntryProto entry_proto;
};

// Struct to represent a search result for SearchMetadata().
struct MetadataSearchResult {
  MetadataSearchResult(const base::FilePath& in_path,
                       const DriveEntryProto& in_entry_proto,
                       const std::string& in_highlighted_base_name)
      : path(in_path),
        entry_proto(in_entry_proto),
        highlighted_base_name(in_highlighted_base_name) {
  }

  // The two members are used to create FileEntry object.
  base::FilePath path;
  DriveEntryProto entry_proto;

  // The base name to be displayed in the UI. The parts matched the search
  // query are highlighted with <b> tag. Meta characters are escaped like <
  //
  // Why HTML? we could instead provide matched ranges using pairs of
  // integers, but this is fragile as we'll eventually converting strings
  // from UTF-8 (StringValue in base/values.h uses std::string) to UTF-16
  // when sending strings from C++ to JavaScript.
  //
  // Why <b> instead of <strong>? Because <b> is shorter.
  std::string highlighted_base_name;
};

typedef std::vector<MetadataSearchResult> MetadataSearchResultVector;

// Used to get files from the file system.
typedef base::Callback<void(DriveFileError error,
                            const base::FilePath& file_path,
                            const std::string& mime_type,
                            DriveFileType file_type)> GetFileCallback;

// Used to read a directory from the file system.
// Similar to ReadDirectoryCallback but this one provides
// |hide_hosted_documents|
// If |error| is not DRIVE_FILE_OK, |entries| is set to NULL.
// |entries| are contents, both files and directories, of the directory.
typedef base::Callback<void(DriveFileError error,
                            bool hide_hosted_documents,
                            scoped_ptr<DriveEntryProtoVector> entries)>
    ReadDirectoryWithSettingCallback;

// Used to get drive content search results.
// If |error| is not DRIVE_FILE_OK, |result_paths| is empty.
typedef base::Callback<void(
    DriveFileError error,
    const GURL& next_feed,
    scoped_ptr<std::vector<SearchResultInfo> > result_paths)> SearchCallback;

// Callback for SearchMetadata(). On success, |error| is DRIVE_FILE_OK, and
// |result| contains the search result.
typedef base::Callback<void(
    DriveFileError error,
    scoped_ptr<MetadataSearchResultVector> result)> SearchMetadataCallback;

// Used to open files from the file system. |file_path| is the path on the local
// file system for the opened file.
typedef base::Callback<void(DriveFileError error,
                            const base::FilePath& file_path)> OpenFileCallback;

// Used to get available space for the account from Drive.
typedef base::Callback<void(DriveFileError error,
                            int64 bytes_total,
                            int64 bytes_used)> GetAvailableSpaceCallback;

// Used to get drive filesystem metadata.
typedef base::Callback<void(const DriveFileSystemMetadata&)>
    GetFilesystemMetadataCallback;

// Priority of a job.  Higher values are lower priority.
enum ContextType {
  USER_INITIATED,
  BACKGROUND,
  PREFETCH,
};

struct DriveClientContext {
  explicit DriveClientContext(ContextType in_type) : type(in_type) {}
  ContextType type;
};

// Option enum to control eligible entries for searchMetadata().
// SEARCH_METADATA_ALL is the default to investigate all the entries.
// SEARCH_METADATA_EXCLUDE_HOSTED_DOCUMENTS excludes the hosted documents.
// SEARCH_METADATA_EXCLUDE_DIRECTORIES excludes the directories from the result.
// SEARCH_METADATA_SHARED_WITH_ME targets only "shared-with-me" entries.
// TODO(haruki): Add option for offline.
enum SearchMetadataOptions {
  SEARCH_METADATA_ALL = 0,
  SEARCH_METADATA_EXCLUDE_HOSTED_DOCUMENTS = 1,
  SEARCH_METADATA_EXCLUDE_DIRECTORIES = 1 << 1,
  SEARCH_METADATA_SHARED_WITH_ME = 1 << 2,
};

// Drive file system abstraction layer.
// The interface is defined to make DriveFileSystem mockable.
class DriveFileSystemInterface {
 public:
  virtual ~DriveFileSystemInterface() {}

  // Initializes the object. This function should be called before any
  // other functions.
  virtual void Initialize() = 0;

  // Adds and removes the observer.
  virtual void AddObserver(DriveFileSystemObserver* observer) = 0;
  virtual void RemoveObserver(DriveFileSystemObserver* observer) = 0;

  // Starts initial feed fetch from the server.
  virtual void StartInitialFeedFetch() = 0;

  // Starts and stops periodic polling.
  virtual void StartPolling() = 0;
  virtual void StopPolling() = 0;

  // Sets the availability of push notification when its status is changed.
  virtual void SetPushNotificationEnabled(bool enabled) = 0;

  // Notifies the file system was just mounted.
  virtual void NotifyFileSystemMounted() = 0;

  // Notifies the file system is going to be unmounted.
  virtual void NotifyFileSystemToBeUnmounted() = 0;

  // Checks for updates on the server.
  virtual void CheckForUpdates() = 0;

  // Finds an entry (file or directory) by using |resource_id|. This call
  // does not initiate content refreshing.
  //
  // |callback| must not be null.
  virtual void GetEntryInfoByResourceId(
      const std::string& resource_id,
      const GetEntryInfoWithFilePathCallback& callback) = 0;

  // Initiates transfer of |remote_src_file_path| to |local_dest_file_path|.
  // |remote_src_file_path| is the virtual source path on the Drive file system.
  // |local_dest_file_path| is the destination path on the local file system.
  //
  // |callback| must not be null.
  virtual void TransferFileFromRemoteToLocal(
      const base::FilePath& remote_src_file_path,
      const base::FilePath& local_dest_file_path,
      const FileOperationCallback& callback) = 0;

  // Initiates transfer of |local_src_file_path| to |remote_dest_file_path|.
  // |local_src_file_path| must be a file from the local file system.
  // |remote_dest_file_path| is the virtual destination path within Drive file
  // system.
  //
  // |callback| must not be null.
  virtual void TransferFileFromLocalToRemote(
      const base::FilePath& local_src_file_path,
      const base::FilePath& remote_dest_file_path,
      const FileOperationCallback& callback) = 0;

  // Retrieves a file at the virtual path |file_path| on the Drive file system
  // onto the cache, and mark it dirty. The local path to the cache file is
  // returned to |callback|. After opening the file, both read and write
  // on the file can be done with normal local file operations.
  //
  // |CloseFile| must be called when the modification to the cache is done.
  // Otherwise, Drive file system does not pick up the file for uploading.
  //
  // |callback| must not be null.
  virtual void OpenFile(const base::FilePath& file_path,
                        const OpenFileCallback& callback) = 0;

  // Closes a file at the virtual path |file_path| on the Drive file system,
  // which is opened via OpenFile(). It commits the dirty flag on the cache.
  //
  // |callback| must not be null.
  virtual void CloseFile(const base::FilePath& file_path,
                         const FileOperationCallback& callback) = 0;

  // Copies |src_file_path| to |dest_file_path| on the file system.
  // |src_file_path| can be a hosted document (see limitations below).
  // |dest_file_path| is expected to be of the same type of |src_file_path|
  // (i.e. if |src_file_path| is a file, |dest_file_path| will be created as
  // a file).
  //
  // This method also has the following assumptions/limitations that may be
  // relaxed or addressed later:
  // - |src_file_path| cannot be a regular file (i.e. non-hosted document)
  //   or a directory.
  // - |dest_file_path| must not exist.
  // - The parent of |dest_file_path| must already exist.
  //
  // The file entries represented by |src_file_path| and the parent directory
  // of |dest_file_path| need to be present in the in-memory representation
  // of the file system.
  //
  // |callback| must not be null.
  virtual void Copy(const base::FilePath& src_file_path,
                    const base::FilePath& dest_file_path,
                    const FileOperationCallback& callback) = 0;

  // Moves |src_file_path| to |dest_file_path| on the file system.
  // |src_file_path| can be a file (regular or hosted document) or a directory.
  // |dest_file_path| is expected to be of the same type of |src_file_path|
  // (i.e. if |src_file_path| is a file, |dest_file_path| will be created as
  // a file).
  //
  // This method also has the following assumptions/limitations that may be
  // relaxed or addressed later:
  // - |dest_file_path| must not exist.
  // - The parent of |dest_file_path| must already exist.
  //
  // The file entries represented by |src_file_path| and the parent directory
  // of |dest_file_path| need to be present in the in-memory representation
  // of the file system.
  //
  // |callback| must not be null.
  virtual void Move(const base::FilePath& src_file_path,
                    const base::FilePath& dest_file_path,
                    const FileOperationCallback& callback) = 0;

  // Removes |file_path| from the file system.  If |is_recursive| is set and
  // |file_path| represents a directory, we will also delete all of its
  // contained children elements. The file entry represented by |file_path|
  // needs to be present in in-memory representation of the file system that
  // in order to be removed.
  //
  // TODO(satorux): is_recursive is not supported yet. crbug.com/138282
  //
  // |callback| must not be null.
  virtual void Remove(const base::FilePath& file_path,
                      bool is_recursive,
                      const FileOperationCallback& callback) = 0;

  // Creates new directory under |directory_path|. If |is_exclusive| is true,
  // an error is raised in case a directory is already present at the
  // |directory_path|. If |is_recursive| is true, the call creates parent
  // directories as needed just like mkdir -p does.
  //
  // |callback| must not be null.
  virtual void CreateDirectory(const base::FilePath& directory_path,
                               bool is_exclusive,
                               bool is_recursive,
                               const FileOperationCallback& callback) = 0;

  // Creates a file at |file_path|. If the flag |is_exclusive| is true, an
  // error is raised when a file already exists at the path. It is
  // an error if a directory or a hosted document is already present at the
  // path, or the parent directory of the path is not present yet.
  //
  // |callback| must not be null.
  virtual void CreateFile(const base::FilePath& file_path,
                          bool is_exclusive,
                          const FileOperationCallback& callback) = 0;

  // Gets |file_path| from the file system. The file entry represented by
  // |file_path| needs to be present in in-memory representation of the file
  // system in order to be retrieved. If the file is not cached, the file
  // will be downloaded through GData API or Drive V2 API.
  //
  // |callback| must not be null.
  virtual void GetFileByPath(const base::FilePath& file_path,
                             const GetFileCallback& callback) = 0;

  // Gets a file by the given |resource_id| from the Drive server. Used for
  // fetching pinned-but-not-fetched files.
  //
  // |get_file_callback| must not be null.
  // |get_content_callback| may be null.
  virtual void GetFileByResourceId(
      const std::string& resource_id,
      const DriveClientContext& context,
      const GetFileCallback& get_file_callback,
      const google_apis::GetContentCallback& get_content_callback) = 0;

  // Cancels the file fetch of |drive_file_path|, which can be retieved by
  // GetEntryInfoByResourceId.
  // The currently the running task is identified by file path on drive,
  // so this method takes it as a task identifier.
  // Note that we will moving tha task managing into DriveScheduler, and
  // currently it is planned to use some task ID at that time.
  // Once it is done, we can use the ID from this method.
  // Also note that the interface looks a little bit weird because the task
  // is started by GetFileByResourceId, which identifies a file by
  // |resource_id|, but this method does by |drive_file_path|. This
  // inconsistency is introduced to work with the existing code and should be
  // cleaned up.
  virtual void CancelGetFile(const base::FilePath& drive_file_path) = 0;

  // Updates a file by the given |resource_id| on the Drive server by
  // uploading an updated version. Used for uploading dirty files. The file
  // should already be present in the cache.
  //
  // TODO(satorux): As of now, the function only handles files with the dirty
  // bit committed. We should eliminate the restriction. crbug.com/134558.
  //
  // |callback| must not be null.
  virtual void UpdateFileByResourceId(
      const std::string& resource_id,
      const DriveClientContext& context,
      const FileOperationCallback& callback) = 0;

  // Finds an entry (a file or a directory) by |file_path|. This call will also
  // retrieve and refresh file system content from server and disk cache.
  //
  // |callback| must not be null.
  virtual void GetEntryInfoByPath(const base::FilePath& file_path,
                                  const GetEntryInfoCallback& callback) = 0;

  // Finds and reads a directory by |file_path|. This call will also retrieve
  // and refresh file system content from server and disk cache.
  //
  // |callback| must not be null.
  virtual void ReadDirectoryByPath(
      const base::FilePath& file_path,
      const ReadDirectoryWithSettingCallback& callback) = 0;

  // Refreshes the directory pointed by |file_path| (i.e. fetches the latest
  // metadata of files in the target directory).
  //
  // In particular, this function is used to get the latest thumbnail
  // URLs. Thumbnail URLs change periodically even if contents of files are
  // not changed, hence we should get the new thumbnail URLs manually if we
  // detect that the existing thumbnail URLs are stale.
  //
  // Upon success, the metadata of files in the target directory is updated
  // and the change is notified via Observer::OnDirectoryChanged().
  // |callback| is called with an error code regardless of whether the
  // refresh was success or not. Note that this function ignores changes in
  // directories in the target directory. Changes in directories are handled
  // via the change lists.
  //
  // |callback| must not be null.
  virtual void RefreshDirectory(const base::FilePath& file_path,
                                const FileOperationCallback& callback) = 0;

  // Does server side content search for |search_query|.
  // If |next_feed| is set, this is the feed url that will be fetched.
  // Search results will be returned as a list of results' |SearchResultInfo|
  // structs, which contains file's path and is_directory flag.
  //
  // |callback| must not be null.
  virtual void Search(const std::string& search_query,
                      const GURL& next_feed,
                      const SearchCallback& callback) = 0;

  // Searches the local resource metadata, and returns the entries
  // |at_most_num_matches| that contain |query| in their base names. Search is
  // done in a case-insensitive fashion. The eligible entries are selected based
  // on the given |options|, which is a bit-wise OR of SearchMetadataOptions.
  // SEARCH_METADATA_EXCLUDE_HOSTED_DOCUMENTS will be automatically added based
  // on the preference. |callback| must not be null. Must be called on UI
  // thread. Empty |query| matches any base name. i.e. returns everything.
  virtual void SearchMetadata(const std::string& query,
                              int  options,
                              int at_most_num_matches,
                              const SearchMetadataCallback& callback) = 0;

  // Fetches the user's Account Metadata to find out current quota information
  // and returns it to the callback.
  virtual void GetAvailableSpace(const GetAvailableSpaceCallback& callback) = 0;

  // Adds a file entry from |doc_entry|, and modifies the cache state.
  // Adds a new file entry, and store its content from |file_content_path| into
  // the cache.
  //
  // |callback| must not be null.
  virtual void AddUploadedFile(scoped_ptr<google_apis::ResourceEntry> doc_entry,
                               const base::FilePath& file_content_path,
                               const FileOperationCallback& callback) = 0;

  // Returns miscellaneous metadata of the file system like the largest
  // timestamp. Used in chrome:drive-internals. |callback| must not be null.
  virtual void GetMetadata(
      const GetFilesystemMetadataCallback& callback) = 0;

  // Reloads the file system feeds from the server.
  virtual void Reload() = 0;
};

}  // namespace drive

#endif  // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_INTERFACE_H_


text:
<?php

namespace Goodby\CSV\Import\Standard;

use Goodby\CSV\Import\Protocol\InterpreterInterface;
use Goodby\CSV\Import\Protocol\Exception\InvalidLexicalException;
use Goodby\CSV\Import\Standard\Exception\StrictViolationException;

require_once $_SESSION['settings']['cpassman_dir']."/includes/libraries/Goodby/CSV/Import/Protocol/InterpreterInterface.php";
require_once $_SESSION['settings']['cpassman_dir']."/includes/libraries/Goodby/CSV/Import/Protocol/Exception/InvalidLexicalException.php";
require_once $_SESSION['settings']['cpassman_dir']."/includes/libraries/Goodby/CSV/Import/Standard/Exception/StrictViolationException.php";
/**
 * standard interpreter
 *
 */
class Interpreter implements InterpreterInterface
{
    /**
     * @var array
     */
    private $observers = array();

    /**
     * @var int
     */
    private $rowConsistency = null;

    /**
     * @var bool
     */
    private $strict = true;

    /**
     * interpret line
     *
     * @param $line
     * @return void
     * @throws \Goodby\CSV\Import\Protocol\Exception\InvalidLexicalException
     */
    public function interpret($line)
    {
        $this->checkRowConsistency($line);

        if (!is_array($line)) {
            throw new InvalidLexicalException('line is must be array');
        }

        $this->notify($line);
    }

    public function unstrict()
    {
        $this->strict = false;
    }

    /**
     * add observer
     *
     * @param callable $observer
     */
    public function addObserver($observer)
    {
        $this->checkCallable($observer);

        $this->observers[] = $observer;
    }

    /**
     * notify to observers
     *
     * @param $line
     */
    private function notify($line)
    {
        $observers = $this->observers;

        foreach ($observers as $observer) {
            $this->delegate($observer, $line);
        }
    }

    /**
     * delegate to observer
     *
     * @param $observer
     * @param $line
     */
    private function delegate($observer, $line)
    {
        call_user_func($observer, $line);
    }

    /**
     * check observer is callable
     *
     * @param $observer
     * @throws \InvalidArgumentException
     */
    private function checkCallable($observer)
    {
        if (!is_callable($observer)) {
            throw new \InvalidArgumentException('observer must be callable');
        }
    }

    private function checkRowConsistency($line)
    {
        if (!$this->strict) {
            return;
        }

        $current = count($line);

        if ($this->rowConsistency === null) {
            $this->rowConsistency = $current;
        }

        if ($current !== $this->rowConsistency) {
            throw new StrictViolationException(sprintf('Column size should be %u, but %u columns given', $this->rowConsistency, $current));
        }

        $this->rowConsistency = $current;
    }
}


text:
require File.expand_path(File.join(File.dirname(__FILE__), "spec_helper"))

describe "Struct aligns fields correctly" do
  it "char, followed by an int" do
    class CIStruct < FFI::Struct
      layout :c => :char, :i => :int
    end
    expect(CIStruct.size).to eq(8)
  end

  it "short, followed by an int" do
    class SIStruct < FFI::Struct
      layout :s => :short, :i => :int
    end
    expect(SIStruct.size).to eq(8)
  end

  it "int, followed by an int" do
    class IIStruct < FFI::Struct
      layout :i1 => :int, :i => :int
    end
    expect(IIStruct.size).to eq(8)
  end

  it "long long, followed by an int" do
    class LLIStruct < FFI::Struct
      layout :l => :long_long, :i => :int
    end
    expect(LLIStruct.size).to eq(FFI::TYPE_UINT64.alignment == 4 ? 12 : 16)
  end
end

describe "Struct tests" do
  StructTypes = {
    's8' => :char,
    's16' => :short,
    's32' => :int,
    's64' => :long_long,
    'long' => :long,
    'f32' => :float,
    'f64' => :double
  }
  module LibTest
    extend FFI::Library
    ffi_lib TestLibrary::PATH
    attach_function :ptr_ret_pointer, [ :pointer, :int], :string
    begin
      attach_function :ptr_ret_int32_t, [ :pointer, :int ], :int
    rescue FFI::NotFoundError
      # NetBSD uses #define instead of typedef for these
      attach_function :ptr_ret_int32_t, :ptr_ret___int32_t, [ :pointer, :int ], :int
    end
    attach_function :ptr_from_address, [ :ulong ], :pointer
    attach_function :string_equals, [ :string, :string ], :int
    [ 's8', 's16', 's32', 's64', 'f32', 'f64', 'long' ].each do |t|
      attach_function "struct_align_#{t}", [ :pointer ], StructTypes[t]
    end
  end
  class PointerMember < FFI::Struct
    layout :pointer, :pointer
  end
  class StringMember < FFI::Struct
    layout :string, :string
  end

  it "Struct#[:pointer]" do
    magic = 0x12345678
    mp = FFI::MemoryPointer.new :long
    mp.put_long(0, magic)
    smp = FFI::MemoryPointer.new :pointer
    smp.put_pointer(0, mp)
    s = PointerMember.new smp
    expect(s[:pointer]).to eq(mp)
  end

  it "Struct#[:pointer].nil? for NULL value" do
    magic = 0x12345678
    mp = FFI::MemoryPointer.new :long
    mp.put_long(0, magic)
    smp = FFI::MemoryPointer.new :pointer
    smp.put_pointer(0, nil)
    s = PointerMember.new smp
    expect(s[:pointer].null?).to be true
  end

  it "Struct#[:pointer]=" do
    magic = 0x12345678
    mp = FFI::MemoryPointer.new :long
    mp.put_long(0, magic)
    smp = FFI::MemoryPointer.new :pointer
    s = PointerMember.new smp
    s[:pointer] = mp
    expect(smp.get_pointer(0)).to eq(mp)
  end

  it "Struct#[:pointer]=struct" do
    smp = FFI::MemoryPointer.new :pointer
    s = PointerMember.new smp
    expect { s[:pointer] = s }.not_to raise_error Exception
    expect { s[:pointer].nil? }.not_to raise_error Exception
  end

  it "Struct#[:pointer]=nil" do
    smp = FFI::MemoryPointer.new :pointer
    s = PointerMember.new smp
    s[:pointer] = nil
    expect(smp.get_pointer(0)).to be_null
  end

  it "Struct#[:string]" do
    magic = "test"
    mp = FFI::MemoryPointer.new 1024
    mp.put_string(0, magic)
    smp = FFI::MemoryPointer.new :pointer
    smp.put_pointer(0, mp)
    s = StringMember.new smp
    expect(s[:string]).to eq(magic)
  end

  it "Struct#[:string].nil? for NULL value" do
    smp = FFI::MemoryPointer.new :pointer
    smp.put_pointer(0, nil)
    s = StringMember.new smp
    expect(s[:string]).to be_nil
  end

  it "Struct#layout works with :name, :type pairs" do
    class PairLayout < FFI::Struct
      layout :a, :int, :b, :long_long
    end
    ll_off = (FFI::TYPE_UINT64.alignment == 4 ? 4 : 8)
    expect(PairLayout.size).to eq((ll_off + 8))
    mp = FFI::MemoryPointer.new(PairLayout.size)
    s = PairLayout.new mp
    s[:a] = 0x12345678
    expect(mp.get_int(0)).to eq(0x12345678)
    s[:b] = 0xfee1deadbeef
    expect(mp.get_int64(ll_off)).to eq(0xfee1deadbeef)
  end

  it "Struct#layout works with :name, :type, offset tuples" do
    class PairLayout < FFI::Struct
      layout :a, :int, 0, :b, :long_long, 4
    end
    expect(PairLayout.size).to eq((FFI::TYPE_UINT64.alignment == 4 ? 12 : 16))
    mp = FFI::MemoryPointer.new(PairLayout.size)
    s = PairLayout.new mp
    s[:a] = 0x12345678
    expect(mp.get_int(0)).to eq(0x12345678)
    s[:b] = 0xfee1deadbeef
    expect(mp.get_int64(4)).to eq(0xfee1deadbeef)
  end

  it "Struct#layout works with mixed :name,:type and :name,:type,offset" do
    class MixedLayout < FFI::Struct
      layout :a, :int, :b, :long_long, 4
    end
    expect(MixedLayout.size).to eq((FFI::TYPE_UINT64.alignment == 4 ? 12 : 16))
    mp = FFI::MemoryPointer.new(MixedLayout.size)
    s = MixedLayout.new mp
    s[:a] = 0x12345678
    expect(mp.get_int(0)).to eq(0x12345678)
    s[:b] = 0xfee1deadbeef
    expect(mp.get_int64(4)).to eq(0xfee1deadbeef)
  end

  rb_maj, rb_min = RUBY_VERSION.split('.')
  if rb_maj.to_i >= 1 && rb_min.to_i >= 9 || RUBY_PLATFORM =~ /java/
    it "Struct#layout withs with a hash of :name => type" do
      class HashLayout < FFI::Struct
        layout :a => :int, :b => :long_long
      end
      ll_off = (FFI::TYPE_UINT64.alignment == 4 ? 4 : 8)
      expect(HashLayout.size).to eq(ll_off + 8)
      mp = FFI::MemoryPointer.new(HashLayout.size)
      s = HashLayout.new mp
      s[:a] = 0x12345678
      expect(mp.get_int(0)).to eq(0x12345678)
      s[:b] = 0xfee1deadbeef
      expect(mp.get_int64(ll_off)).to eq(0xfee1deadbeef)
    end
  end

  it "subclass overrides initialize without calling super" do
    class InitializeWithoutSuper < FFI::Struct
      layout :a, :int, :b, :long_long, :d, [:double, 2]

      def initialize(a, b)
        self[:a] = a
        self[:b] = b
        self[:d][0] = 1.2
        self[:d][1] = 3.4
      end

    end
    s = InitializeWithoutSuper.new(0x1eefbeef, 0xdeadcafebabe)
    expect(s[:a]).to eq(0x1eefbeef)
    expect(s[:b]).to eq(0xdeadcafebabe)
  end

  it "Can use Struct subclass as parameter type" do
    expect(module StructParam
      extend FFI::Library
      ffi_lib TestLibrary::PATH
      class TestStruct < FFI::Struct
        layout :c, :char
      end
      attach_function :struct_field_s8, [ TestStruct.in ], :char
    end).to be_an_instance_of FFI::Function
  end

  it "Can use Struct subclass as IN parameter type" do
    expect(module StructParam2
      extend FFI::Library
      ffi_lib TestLibrary::PATH
      class TestStruct < FFI::Struct
        layout :c, :char
      end
      attach_function :struct_field_s8, [ TestStruct.in ], :char
    end).to be_an_instance_of FFI::Function
  end

  it "Can use Struct subclass as OUT parameter type" do
    expect(module StructParam3
      extend FFI::Library
      ffi_lib TestLibrary::PATH
      class TestStruct < FFI::Struct
        layout :c, :char
      end
      attach_function :struct_field_s8, [ TestStruct.out ], :char
    end).to be_an_instance_of FFI::Function
  end

  it "can be passed directly as a :pointer parameter" do
    class TestStruct < FFI::Struct
      layout :i, :int
    end
    s = TestStruct.new
    s[:i] = 0x12
    expect(LibTest.ptr_ret_int32_t(s, 0)).to eq(0x12)
  end

  it ":char member aligned correctly" do
    class AlignChar < FFI::Struct
      layout :c, :char, :v, :char
    end
    s = AlignChar.new
    s[:v] = 0x12
    expect(LibTest.struct_align_s8(s.pointer)).to eq(0x12)
  end

  it ":short member aligned correctly" do
    class AlignShort < FFI::Struct
      layout :c, :char, :v, :short
    end
    s = AlignShort.alloc_in
    s[:v] = 0x1234
    expect(LibTest.struct_align_s16(s.pointer)).to eq(0x1234)
  end

  it ":int member aligned correctly" do
    class AlignInt < FFI::Struct
      layout :c, :char, :v, :int
    end
    s = AlignInt.alloc_in
    s[:v] = 0x12345678
    expect(LibTest.struct_align_s32(s.pointer)).to eq(0x12345678)
  end

  it ":long_long member aligned correctly" do
    class AlignLongLong < FFI::Struct
      layout :c, :char, :v, :long_long
    end
    s = AlignLongLong.alloc_in
    s[:v] = 0x123456789abcdef0
    expect(LibTest.struct_align_s64(s.pointer)).to eq(0x123456789abcdef0)
  end

  it ":long member aligned correctly" do
    class AlignLong < FFI::Struct
      layout :c, :char, :v, :long
    end
    s = AlignLong.alloc_in
    s[:v] = 0x12345678
    expect(LibTest.struct_align_long(s.pointer)).to eq(0x12345678)
  end

  it ":float member aligned correctly" do
    class AlignFloat < FFI::Struct
      layout :c, :char, :v, :float
    end
    s = AlignFloat.alloc_in
    s[:v] = 1.23456
    expect((LibTest.struct_align_f32(s.pointer) - 1.23456).abs).to be < 0.00001
  end

  it ":double member aligned correctly" do
    class AlignDouble < FFI::Struct
      layout :c, :char, :v, :double
    end
    s = AlignDouble.alloc_in
    s[:v] = 1.23456789
    expect((LibTest.struct_align_f64(s.pointer) - 1.23456789).abs).to be < 0.00000001
  end

  it ":ulong, :pointer struct" do
    class ULPStruct < FFI::Struct
      layout :ul, :ulong, :p, :pointer
    end
    s = ULPStruct.alloc_in
    s[:ul] = 0xdeadbeef
    s[:p] = LibTest.ptr_from_address(0x12345678)
    expect(s.pointer.get_ulong(0)).to eq(0xdeadbeef)
  end
  def test_num_field(type, v)
    klass = Class.new(FFI::Struct)
    klass.layout :v, type, :dummy, :long

    s = klass.new
    s[:v] = v
    expect(s.pointer.send("get_#{type.to_s}", 0)).to eq(v)
    s.pointer.send("put_#{type.to_s}", 0, 0)
    expect(s[:v]).to eq(0)
  end
  def self.int_field_test(type, values)
    values.each do |v|
      it "#{type} field r/w (#{v.to_s(16)})" do
        test_num_field(type, v)
      end
    end
  end
  int_field_test(:char, [ 0, 127, -128, -1 ])
  int_field_test(:uchar, [ 0, 0x7f, 0x80, 0xff ])
  int_field_test(:short, [ 0, 0x7fff, -0x8000, -1 ])
  int_field_test(:ushort, [ 0, 0x7fff, 0x8000, 0xffff ])
  int_field_test(:int, [ 0, 0x7fffffff, -0x80000000, -1 ])
  int_field_test(:uint, [ 0, 0x7fffffff, 0x80000000, 0xffffffff ])
  int_field_test(:long_long, [ 0, 0x7fffffffffffffff, -0x8000000000000000, -1 ])
  int_field_test(:ulong_long, [ 0, 0x7fffffffffffffff, 0x8000000000000000, 0xffffffffffffffff ])
  if FFI::Platform::LONG_SIZE == 32
    int_field_test(:long, [ 0, 0x7fffffff, -0x80000000, -1 ])
    int_field_test(:ulong, [ 0, 0x7fffffff, 0x80000000, 0xffffffff ])
  else
    int_field_test(:long, [ 0, 0x7fffffffffffffff, -0x8000000000000000, -1 ])
    int_field_test(:ulong, [ 0, 0x7fffffffffffffff, 0x8000000000000000, 0xffffffffffffffff ])
  end

  it ":float field r/w" do
    klass = Class.new(FFI::Struct)
    klass.layout :v, :float, :dummy, :long

    s = klass.new
    value = 1.23456
    s[:v] = value
    expect((s.pointer.get_float(0) - value).abs).to be < 0.0001
  end

  it ":double field r/w" do
    klass = Class.new(FFI::Struct)
    klass.layout :v, :double, :dummy, :long

    s = klass.new
    value = 1.23456
    s[:v] = value
    expect((s.pointer.get_double(0) - value).abs).to be < 0.0001
  end
  module EnumFields
    extend FFI::Library
    TestEnum = enum :test_enum, [:c1, 10, :c2, 20, :c3, 30, :c4, 40]
    class TestStruct < FFI::Struct
      layout :a, :int, :c, :test_enum,
        :d, [ TestEnum, TestEnum.symbols.length ]
    end
  end

  it ":enum field r/w" do
    s = EnumFields::TestStruct.new
    s[:c] = :c3

    expect(s.pointer.get_uint(FFI::Type::INT32.size)).to eq(30)
    expect(s[:c]).to eq(:c3)
  end

  it "array of :enum field" do
    s = EnumFields::TestStruct.new
    EnumFields::TestEnum.symbols.each_with_index do |val, i|
      s[:d][i] = val
    end

    EnumFields::TestEnum.symbols.each_with_index do |val, i|
      expect(s.pointer.get_uint(FFI::Type::INT32.size * (2 + i))).to eq(EnumFields::TestEnum[val])
    end

    s[:d].each_with_index do |val, i|
      expect(val).to eq(EnumFields::TestEnum.symbols[i])
    end
  end

  module CallbackMember
    extend FFI::Library
    ffi_lib TestLibrary::PATH
    callback :add, [ :int, :int ], :int
    callback :sub, [ :int, :int ], :int
    class TestStruct < FFI::Struct
      layout :add, :add,
        :sub, :sub
    end
    attach_function :struct_call_add_cb, [TestStruct.in, :int, :int], :int
    attach_function :struct_call_sub_cb, [TestStruct.in, :int, :int], :int
  end

  it "Can have CallbackInfo struct field" do
      s = CallbackMember::TestStruct.new
      add_proc = lambda { |a, b| a+b }
      sub_proc = lambda { |a, b| a-b }
      s[:add] = add_proc
      s[:sub] = sub_proc
      expect(CallbackMember.struct_call_add_cb(s, 40, 2)).to eq(42)
      expect(CallbackMember.struct_call_sub_cb(s, 44, 2)).to eq(42)
  end

  it "Can return its members as a list" do
    class TestStruct < FFI::Struct
      layout :a, :int, :b, :int, :c, :int
    end
    expect(TestStruct.members).to include(:a, :b, :c)
  end

  it "Can return its instance members and values as lists" do
    class TestStruct < FFI::Struct
      layout :a, :int, :b, :int, :c, :int
    end
    s = TestStruct.new
    expect(s.members).to include(:a, :b, :c)
    s[:a] = 1
    s[:b] = 2
    s[:c] = 3
    expect(s.values).to include(1, 2, 3)
  end

  it 'should return an ordered field/offset pairs array' do
    class TestStruct < FFI::Struct
      layout :a, :int, :b, :int, :c, :int
    end
    s = TestStruct.new
    expect(s.offsets).to eq([[:a, 0], [:b, 4], [:c, 8]])
    expect(TestStruct.offsets).to eq([[:a, 0], [:b, 4], [:c, 8]])
  end

  it "Struct#offset_of returns offset of field within struct" do
    class TestStruct < FFI::Struct
      layout :a, :int, :b, :int, :c, :int
    end
    expect(TestStruct.offset_of(:a)).to eq(0)
    expect(TestStruct.offset_of(:b)).to eq(4)
    expect(TestStruct.offset_of(:c)).to eq(8)
  end
end

describe FFI::Struct, ".layout" do
  module FFISpecs
    module LibTest
      extend FFI::Library
      ffi_lib TestLibrary::PATH
      begin
        attach_function :ptr_ret_int32_t, [ :pointer, :int ], :int
      rescue FFI::NotFoundError
        # NetBSD uses #define instead of typedef for these
        attach_function :ptr_ret_int32_t, :ptr_ret___int32_t, [ :pointer, :int ], :int
      end
    end
  end

  describe "when derived class is not assigned to any constant" do
    it "resolves a built-in type" do
      klass = Class.new FFI::Struct
      klass.layout :number, :int

      instance = klass.new
      instance[:number] = 0xA1
      expect(FFISpecs::LibTest.ptr_ret_int32_t(instance, 0)).to eq(0xA1)
    end
  end

  describe "when derived class is assigned to a constant" do
    it "resolves a built-in type" do
      class FFISpecs::TestStruct < FFI::Struct
        layout :number, :int
      end

      instance = FFISpecs::TestStruct.new
      instance[:number] = 0xA1
      expect(FFISpecs::LibTest.ptr_ret_int32_t(instance, 0)).to eq(0xA1)
    end

    it "resolves a type from the enclosing module" do
      module FFISpecs::LibTest
        typedef :uint, :custom_int

        class TestStruct < FFI::Struct
          layout :number, :custom_int
        end
      end

      instance = FFISpecs::LibTest::TestStruct.new
      instance[:number] = 0xA1
      expect(FFISpecs::LibTest.ptr_ret_int32_t(instance, 0)).to eq(0xA1)
    end
  end
end

describe FFI::Struct, ' with a nested struct field'  do
  module LibTest
    extend FFI::Library
    ffi_lib TestLibrary::PATH
    class NestedStruct < FFI::Struct
      layout :i, :int
    end
    class ContainerStruct < FFI::Struct
      layout :first, :char, :ns, NestedStruct
    end
    attach_function :struct_align_nested_struct, [ :pointer ], :int
    attach_function :struct_make_container_struct, [ :int ], :pointer
  end
  before do
    @cs = LibTest::ContainerStruct.new
  end

  it 'should align correctly nested struct field' do
    @cs[:ns][:i] = 123
    expect(LibTest.struct_align_nested_struct(@cs.to_ptr)).to eq(123)
  end

  it 'should correctly calculate Container size (in bytes)' do
    expect(LibTest::ContainerStruct.size).to eq(8)
  end

  it 'should return a Struct object when the field is accessed' do
    expect(@cs[:ns].is_a?(FFI::Struct)).to be true
  end

  it 'should read a value from memory' do
    @cs = LibTest::ContainerStruct.new(LibTest.struct_make_container_struct(123))
    expect(@cs[:ns][:i]).to eq(123)
  end

  it 'should write a value to memory' do
    @cs = LibTest::ContainerStruct.new(LibTest.struct_make_container_struct(123))
    @cs[:ns][:i] = 456
    expect(LibTest.struct_align_nested_struct(@cs.to_ptr)).to eq(456)
  end

  it 'should be able to assign struct instance to nested field' do
    cs = LibTest::ContainerStruct.new(LibTest.struct_make_container_struct(123))
    ns = LibTest::NestedStruct.new
    ns[:i] = 567
    cs[:ns] = ns
    expect(cs[:ns][:i]).to eq(567)
    expect(LibTest.struct_align_nested_struct(cs.to_ptr)).to eq(567)
  end
end

describe FFI::Struct, ' with a nested array of structs'  do
  module InlineArrayOfStructs
    extend FFI::Library
    ffi_lib TestLibrary::PATH
    class NestedStruct < FFI::Struct
      layout :i, :int
    end
    class ContainerStruct < FFI::Struct
      layout :first, :char, :ns, [ NestedStruct, 1 ]
    end
    attach_function :struct_align_nested_struct, [ :pointer ], :int
    attach_function :struct_make_container_struct, [ :int ], :pointer
  end

  before do
    @cs = InlineArrayOfStructs::ContainerStruct.new
  end

  it 'should align correctly nested struct field' do
    @cs[:ns][0][:i] = 123
    expect(InlineArrayOfStructs.struct_align_nested_struct(@cs.to_ptr)).to eq(123)
  end

  it 'should correctly calculate Container size (in bytes)' do
    expect(InlineArrayOfStructs::ContainerStruct.size).to eq(8)
  end

  it 'should return a Struct object when the field is accessed' do
    expect(@cs[:ns][0].is_a?(FFI::Struct)).to be true
  end

  it 'should read a value from memory' do
    @cs = InlineArrayOfStructs::ContainerStruct.new(InlineArrayOfStructs.struct_make_container_struct(123))
    expect(@cs[:ns][0][:i]).to eq(123)
  end

  it 'should write a value to memory' do
    @cs = InlineArrayOfStructs::ContainerStruct.new(InlineArrayOfStructs.struct_make_container_struct(123))
    @cs[:ns][0][:i] = 456
    expect(InlineArrayOfStructs.struct_align_nested_struct(@cs.to_ptr)).to eq(456)
  end

  it 'should support Enumerable#each' do
    @cs = InlineArrayOfStructs::ContainerStruct.new(InlineArrayOfStructs.struct_make_container_struct(123))
    ints = []
    @cs[:ns].each { |s| ints << s[:i] }
    expect(ints[0]).to eq(123)
  end
end

describe FFI::Struct, ' by value'  do
  module LibTest
    extend FFI::Library
    ffi_lib TestLibrary::PATH

    class S8S32 < FFI::Struct
      layout :s8, :char, :s32, :int
    end

    class StructString < FFI::Struct
      layout :bytes, :string, :len, :int
    end

    attach_function :struct_return_s8s32, [ ], S8S32.by_value
    attach_function :struct_s8s32_set, [ :char, :int ], S8S32.by_value
    attach_function :struct_s8s32_get_s8, [ S8S32.by_value ], :char
    attach_function :struct_s8s32_get_s32, [ S8S32.by_value ], :int
    attach_function :struct_s8s32_s32_ret_s32, [ S8S32.by_value, :int ], :int
    attach_function :struct_s8s32_s64_ret_s64, [ S8S32.by_value, :long_long ], :long_long
    attach_function :struct_s8s32_ret_s8s32, [ S8S32.by_value ], S8S32.by_value
    attach_function :struct_s32_ptr_s32_s8s32_ret_s32, [ :int, :pointer, :int, S8S32.by_value ], :int
    attach_function :struct_varargs_ret_struct_string, [ :int, :varargs ], StructString.by_value
  end

  it 'return using pre-set values' do
    s = LibTest.struct_return_s8s32
    expect(s[:s8]).to eq(0x7f)
    expect(s[:s32]).to eq(0x12345678)
  end

  it 'return using passed in values' do
    s = LibTest.struct_s8s32_set(123, 456789)
    expect(s[:s8]).to eq(123)
    expect(s[:s32]).to eq(456789)
  end

  it 'parameter' do
    s = LibTest::S8S32.new
    s[:s8] = 0x12
    s[:s32] = 0x34567890
    expect(LibTest.struct_s8s32_get_s8(s)).to eq(0x12)
    expect(LibTest.struct_s8s32_get_s32(s)).to eq(0x34567890)
  end

  it 'parameter with following s32' do
    s = LibTest::S8S32.new
    s[:s8] = 0x12
    s[:s32] = 0x34567890

    expect(LibTest.struct_s8s32_s32_ret_s32(s, 0x1eefdead)).to eq(0x1eefdead)
  end

  # it 'parameter with following s64' do
  #   s = LibTest::S8S64.new
  #   s[:s8] = 0x12
  #   s[:s64] = 0x34567890
  #
  #
  #   LibTest.struct_s8s64_s64_ret_s64(s, 0x1eefdead1eefdead).should == 0x1eefdead1eefdead
  # end

  it 'parameter with preceding s32,ptr,s32' do
    s = LibTest::S8S32.new
    s[:s8] = 0x12
    s[:s32] = 0x34567890
    out = LibTest::S8S32.new
    expect(LibTest.struct_s32_ptr_s32_s8s32_ret_s32(0x1000000, out, 0x1eafbeef, s)).to eq(0x34567890)
    expect(out[:s8]).to eq(s[:s8])
    expect(out[:s32]).to eq(s[:s32])
  end

  it 'parameter with preceding s32,string,s32' do
    s = LibTest::S8S32.new
    s[:s8] = 0x12
    s[:s32] = 0x34567890
    out = 0.chr * 32
    expect(LibTest.struct_s32_ptr_s32_s8s32_ret_s32(0x1000000, out, 0x1eafbeef, s)).to eq(0x34567890)
  end

  it 'parameter, returning struct by value' do
    s = LibTest::S8S32.new
    s[:s8] = 0x12
    s[:s32] = 0x34567890

    ret = LibTest.struct_s8s32_ret_s8s32(s)
    expect(ret[:s8]).to eq(s[:s8])
    expect(ret[:s32]).to eq(s[:s32])
  end

  it 'varargs returning a struct' do
    string = "test"
    s = LibTest.struct_varargs_ret_struct_string(4, :string, string)
    expect(s[:len]).to eq(string.length)
    expect(s[:bytes]).to eq(string)
  end
end

describe FFI::Struct, ' with an array field'  do
  module LibTest
    extend FFI::Library
    ffi_lib TestLibrary::PATH
    class StructWithArray < FFI::Struct
      layout :first, :char, :a, [:int, 5]
    end
    attach_function :struct_make_struct_with_array, [:int, :int, :int, :int, :int], :pointer
    attach_function :struct_field_array, [:pointer], :pointer
  end
  before do
    @s = LibTest::StructWithArray.new
  end

  it 'should correctly calculate StructWithArray size (in bytes)' do
    expect(LibTest::StructWithArray.size).to eq(24)
  end

  it 'should read values from memory' do
    @s = LibTest::StructWithArray.new(LibTest.struct_make_struct_with_array(0, 1, 2, 3, 4))
    expect(@s[:a].to_a).to eq([0, 1, 2, 3, 4])
  end
#  it 'should cache array object for successive calls' do
#    @s[:a].object_id.should == @s[:a].object_id
#  end

  it 'should return the number of elements in the array field' do
    @s = LibTest::StructWithArray.new(LibTest.struct_make_struct_with_array(0, 1, 2, 3, 4))
    expect(@s[:a].size).to eq(5)
  end

  it 'should allow iteration through the array elements' do
    @s = LibTest::StructWithArray.new(LibTest.struct_make_struct_with_array(0, 1, 2, 3, 4))
    @s[:a].each_with_index { |elem, i| expect(elem).to eq(i) }
  end

  it 'should return the pointer to the array' do
    @s = LibTest::StructWithArray.new(LibTest.struct_make_struct_with_array(0, 1, 2, 3, 4))
    expect(@s[:a].to_ptr).to eq(LibTest::struct_field_array(@s.to_ptr))
  end
end

describe 'BuggedStruct' do
  module LibTest
    extend FFI::Library
    ffi_lib TestLibrary::PATH
    class BuggedStruct < FFI::Struct
      layout :visible, :uchar,
              :x, :uint,
              :y, :uint,
              :rx, :short,
              :ry, :short,
              :order, :uchar,
              :size, :uchar
    end
    attach_function :bugged_struct_size, [], :uint
  end

  it 'should return its correct size' do
    expect(LibTest::BuggedStruct.size).to eq(LibTest.bugged_struct_size)
  end

  it "offsets within struct should be correct" do
    expect(LibTest::BuggedStruct.offset_of(:visible)).to eq(0)
    expect(LibTest::BuggedStruct.offset_of(:x)).to eq(4)
    expect(LibTest::BuggedStruct.offset_of(:y)).to eq(8)
    expect(LibTest::BuggedStruct.offset_of(:rx)).to eq(12)
    expect(LibTest::BuggedStruct.offset_of(:ry)).to eq(14)
    expect(LibTest::BuggedStruct.offset_of(:order)).to eq(16)
    expect(LibTest::BuggedStruct.offset_of(:size)).to eq(17)
  end

  it 'should return correct field/offset pairs' do
    expect(LibTest::BuggedStruct.offsets.sort do |a, b|
      a[1] <=> b[1]
    end).to eq([[:visible, 0], [:x, 4], [:y, 8], [:rx, 12], [:ry, 14], [:order, 16], [:size, 17]])
  end
end

describe "Struct allocation" do
  it "MemoryPointer.new(Struct, 2)" do
    class S < FFI::Struct
      layout :i, :uint
    end
    p = FFI::MemoryPointer.new(S, 2)
    expect(p.total).to eq(8)
    expect(p.type_size).to eq(4)
    p.put_uint(4, 0xdeadbeef)
    expect(S.new(p[1])[:i]).to eq(0xdeadbeef)
    expect(p[1].address).to eq((p[0].address + 4))
  end

  it "Buffer.new(Struct, 2)" do
    class S < FFI::Struct
      layout :i, :uint
    end
    p = FFI::Buffer.new(S, 2)
    expect(p.total).to eq(8)
    expect(p.type_size).to eq(4)
    p.put_uint(4, 0xdeadbeef)
    expect(S.new(p[1])[:i]).to eq(0xdeadbeef)
  end

  it "null? should be true when initialized with NULL pointer" do
    class S < FFI::Struct
      layout :i, :uint
    end
    expect(S.new(FFI::Pointer::NULL)).to be_null
  end

  it "null? should be false when initialized with non-NULL pointer" do
    class S < FFI::Struct
      layout :i, :uint
    end
    expect(S.new(FFI::MemoryPointer.new(S))).not_to be_null
  end

  it "supports :bool as a struct member" do
    expect do
      c = Class.new(FFI::Struct) do
        layout :b, :bool
      end
      struct = c.new
      struct[:b] = ! struct[:b]
    end.not_to raise_error Exception
  end

end

describe "variable-length arrays" do
  it "zero length array should be accepted as last field" do
    expect {
      Class.new(FFI::Struct) do
        layout :count, :int, :data, [ :char, 0 ]
      end
    }.not_to raise_error Exception
  end

  it "zero length array before last element should raise error" do
    expect {
      Class.new(FFI::Struct) do
        layout :data, [ :char, 0 ], :count, :int
      end
    }.to raise_error
  end

  it "can access elements of array" do
    struct_class = Class.new(FFI::Struct) do
      layout :count, :int, :data, [ :long, 0 ]
    end
    s = struct_class.new(FFI::MemoryPointer.new(1024))
    s[:data][0] = 0x1eadbeef
    s[:data][1] = 0x12345678
    expect(s[:data][0]).to eq(0x1eadbeef)
    expect(s[:data][1]).to eq(0x12345678)
  end

  it "non-variable length array is bounds checked" do
    struct_class = Class.new(FFI::Struct) do
      layout :count, :int, :data, [ :long, 1 ]
    end
    s = struct_class.new(FFI::MemoryPointer.new(1024))
    s[:data][0] = 0x1eadbeef
    expect { s[:data][1] = 0x12345678 }.to raise_error
    expect(s[:data][0]).to eq(0x1eadbeef)
    expect { expect(s[:data][1]).to == 0x12345678 }.to raise_error
  end
end


text:
function getBody (node) {
  if (node && node.type === 'BlockStatement') {
    if (node.body.length === 1) {
      return node.body[0]
    }
    return node.body
  }
  return node
}

const isNodeTruthy = require('./utilities/isNodeTruthy')

module.exports = function ifStatementRemoval (node) {
  if (node.type === 'IfStatement') {
    const truthy = isNodeTruthy(node.test)
    if (typeof truthy === 'boolean') {
      if (truthy) {
        return getBody(node.consequent)
      } else {
        return getBody(node.alternate)
      }
    }
  }
  return node
}


text:
var request = require('request');
var fs = require('fs');
var Q = require('q');
var async = require('async');
var gender = require('gender');
var db = require('orchestrate')('YOUR_API_KEY');

function addComics () {
	fs.readdir('./comics', function (err, list) {
		list.forEach(function (item) {
			// console.log(item, item.indexOf('.json'));
			if (item.indexOf('.json') >= 0) comicsQueue.push(item, function (err) { });
		});
	});
}

var comicsQueue = async.queue(function (task, callback) {
	var comic = require('./comics/'+task);

	console.log(comic.id, comic.title);

	db.put('comics', comic.id, comic)
	.then(callback)
	.fail(function (err) {
		console.log(err);
		callback();
	});

}, 5);

function addCharacters () {
	fs.readdir('./characters', function (err, list) {
		list.forEach(function (item) {
			if (item.indexOf('.json') >= 0) characterQueue.push(item, function (err) { });
		});
	});
}

function figureOutGender (name, description, categories, wikiDesc) {
	if (!description) description = wikiDesc || '';

	if (categories && categories.indexOf('Women') >= 0) {
		return 'female';
	}

	var guess = gender.guess(name);

	if (guess.confidence > 0.5) {
		return guess.gender;
	}

	var male = description.match(/ he | him | his | himself /ig) || [];
	var female = description.match(/ she | her | hers | herself | priestesses /ig) || [];

	return (male.length >= female.length) ? 'male' : 'female';
}

var characterQueue = async.queue(function (task, callback) {

	var character = require('./characters/'+task);

	// clean up data we don't need to store
	delete character.comics;
	delete character.series;
	delete character.stories;
	delete character.events;

	if (!character.wiki) character.wiki = {};

	character.gender = figureOutGender(character.wiki.real_name || character.name, character.description, character.wiki.categories, character.wiki.bio);

	console.log(character.id, character.name, character.gender);

	db.put('characters', character.id, character)
	.then(callback)
	.fail(function (err) {
		console.log(err);
		callback();
	});

}, 5);

function appearsIn () {
	fs.readdir('./characters', function (err, list) {
		list.forEach(function (item) {
			if (item.indexOf('.json') >= 0) appearQueue.push(item, function (err) { });
		});
	});
}

var appearQueue = async.queue(function (task, qCallback) {
	var character = require('./characters/'+task);
	var comics = character.comics.items;

	var allTasks = [];

	comics.forEach(function(item){
		allTasks.push(
			function(callback){
				var comicID = item.id || item.resourceURI.split('/').pop();

				console.log('character', character.id, 'comicID', comicID);

				db.newGraphBuilder()
				.create()
				.from('characters', character.id)
				.related('in')
				.to('comics', comicID)

				.then(function(){
					return db.newGraphBuilder()
					.create()
					.from('comics', comicID)
					.related('characters')
					.to('characters', character.id);
				})

				.then(function(){
					callback();
				})
				.fail(function (err) {
					console.log(err.body);
					console.log('ERROR comicID', comicID, 'character.id', character.id);
					callback();
				});
			}
		);
	});

	async.series(allTasks, function(err, results){
		console.log('item done', err);
		qCallback();
	});

}, 5);

// RUN THESE TWO FIRST TO IMPORT THE COMICS AND CHARACTERS
addComics();
addCharacters();

// THEN ONCE THOSE ARE IMPORTED, COMMENT THEM OUT AND RUN THIS TO CREATE THE GRAPH CONNECTIONS
// appearsIn();


text:
<?php

namespace Oro\Bundle\EntityBundle\Tests\Unit\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;

use Oro\Bundle\EntityBundle\DependencyInjection\Compiler\EntityAliasProviderPass;

class EntityAliasProviderPassTest extends \PHPUnit_Framework_TestCase
{
    /** @var EntityAliasProviderPass */
    protected $compilerPass;

    protected function setUp()
    {
        $this->compilerPass = new EntityAliasProviderPass();
    }

    public function testProcessNoResolverDefinition()
    {
        $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')
            ->disableOriginalConstructor()
            ->getMock();

        $container->expects($this->once())
            ->method('hasDefinition')
            ->with(EntityAliasProviderPass::RESOLVER_SERVICE)
            ->will($this->returnValue(false));
        $container->expects($this->never())
            ->method('findTaggedServiceIds');

        $this->compilerPass->process($container);
    }

    public function testProcess()
    {
        $container = new ContainerBuilder();

        $resolver  = new Definition();
        $provider1 = new Definition();
        $provider2 = new Definition();
        $provider3 = new Definition();
        $provider4 = new Definition();

        $provider1->addTag(EntityAliasProviderPass::PROVIDER_TAG_NAME, ['priority' => -100]);
        $provider2->addTag(EntityAliasProviderPass::PROVIDER_TAG_NAME, ['priority' => 100]);
        $provider3->addTag(EntityAliasProviderPass::PROVIDER_TAG_NAME);
        $provider4->addTag(EntityAliasProviderPass::PROVIDER_TAG_NAME, ['priority' => -150]);

        $container->addDefinitions(
            [
                EntityAliasProviderPass::RESOLVER_SERVICE => $resolver,
                'provider1'                               => $provider1,
                'provider2'                               => $provider2,
                'provider3'                               => $provider3,
                'provider4'                               => $provider4,
            ]
        );

        $this->compilerPass->process($container);

        $this->assertEquals(
            [
                ['addProvider', [new Reference('provider2')]],
                ['addProvider', [new Reference('provider3')]],
                ['addProvider', [new Reference('provider1')]],
                ['addProvider', [new Reference('provider4')]],
            ],
            $resolver->getMethodCalls()
        );
    }
}


text:
import '@storybook/addon-storysource/register';
import '@storybook/addon-knobs/register';
import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';
import '@storybook/addon-a11y/register';
import '@storybook/addon-options/register';

// Community addons
import 'storybook-readme/register';