text:
import EventEmitter = require("nextgen-events");

type Terminal = Terminal.Impl & EventEmitter;

export = Terminal;

type Callback<T> = (err: any, arg: T) => void;

declare namespace Terminal {
  interface Impl {
    width: number;
    height: number;
    appName: string;
    app: string;
    generic: string;
    termconfigFile: string;

    (str?: string): Terminal;
    (...args: any[]): Terminal;

    defaultColor: CTerminal;
    black: CTerminal;
    red: CTerminal;
    green: CTerminal;
    yellow: CTerminal;
    blue: CTerminal;
    magenta: CTerminal;
    cyan: CTerminal;
    white: CTerminal;
    brightBlack: CTerminal;
    gray: CTerminal;
    grey: CTerminal;
    brightRed: CTerminal;
    brightGreen: CTerminal;
    brightYellow: CTerminal;
    brightBlue: CTerminal;
    brightMagenta: CTerminal;
    brightCyan: CTerminal;
    brightWhite: CTerminal;
    color: (color: number | string, str?: string) => Terminal;
    darkColor: (color: number | string, str?: string) => Terminal;
    brightColor: (color: number | string, str?: string) => Terminal;
    color256: (color: number | string, str?: string) => Terminal;
    colorRgb: (r: number, g: number, b: number, str?: string) => Terminal;
    colorRgbHex: (rgb: string, str?: string) => Terminal;
    colorGrayscale: (I: number, str?: string) => Terminal;

    bgDefaultColor: CTerminal;
    bgBlack: CTerminal;
    bgRed: CTerminal;
    bgGreen: CTerminal;
    bgYellow: CTerminal;
    bgBlue: CTerminal;
    bgMagenta: CTerminal;
    bgCyan: CTerminal;
    bgWhite: CTerminal;
    bgBrightBlack: CTerminal;
    bgGray: CTerminal;
    bgGrey: CTerminal;
    bgBrightRed: CTerminal;
    bgBrightGreen: CTerminal;
    bgBrightYellow: CTerminal;
    bgBrightBlue: CTerminal;
    bgBrightMagenta: CTerminal;
    bgBrightCyan: CTerminal;
    bgBrightWhite: CTerminal;
    bgColor: (color: number | string, str?: string) => Terminal;
    bgDarkColor: (color: number | string, str?: string) => Terminal;
    bgBrightColor: (color: number | string, str?: string) => Terminal;
    bgColor256: (color: number | string, str?: string) => Terminal;
    bgColorRgb: (r: number, g: number, b: number, str?: string) => Terminal;
    bgColorRgbHex: (rgb: string, str?: string) => Terminal;
    bgColorGrayscale: (I: number, str?: string) => Terminal;

    styleReset: CTerminal;
    bold: CTerminal;
    dim: CTerminal;
    italic: CTerminal;
    underline: CTerminal;
    blink: CTerminal;
    inverse: CTerminal;
    hidden: CTerminal;
    strike: CTerminal;

    saveCursor: Terminal;
    restoreCursor: Terminal;
    up: ((n: number) => Terminal) | ((n: number, ...args: any[]) => Terminal);
    down: (n: number) => Terminal;
    right: (n: number) => Terminal;
    left: (n: number) => Terminal;
    nextLine: (n: number) => Terminal;
    previousLine: (n: number) => Terminal;
    column: (x: number) => Terminal;
    scrollUp: (n: number) => Terminal;
    scrollDown: (n: number) => Terminal;
    scrollingRegion: (top: number, bottom: number) => Terminal;
    resetScrollingRegion: Terminal;
    moveTo: CTerminal;
    move: (x: number, y: number) => Terminal;
    hideCursor: Terminal;
    tabSet: Terminal;
    tabClear: Terminal;
    tabClearAll: Terminal;
    forwardTab: (n: number) => Terminal;
    backwardTab: (n: number) => Terminal;

    clear: Terminal;
    eraseDisplayBelow: Terminal;
    eraseDisplayAbove: Terminal;
    eraseDisplay: Terminal;
    eraseScrollback: Terminal;
    eraseLineAfter: Terminal;
    eraseLineBefore: Terminal;
    eraseLine: Terminal;
    eraseArea: (
      x: number,
      y: number,
      width?: number,
      height?: number
    ) => Terminal;
    insertLine: (n: number) => Terminal;
    deleteLine: (n: number) => Terminal;
    insert: (n: number) => Terminal;
    delete: (n: number) => Terminal;
    backDelete: Terminal;
    alternateScreenBuffer: Terminal;

    requestCursorLocation: Terminal;
    requestScreenSize: Terminal;
    requestColor: (n: number) => Terminal;
    applicationKeypad: Terminal;

    mouseButton: Terminal;
    mouseDrag: Terminal;
    mouseMotion: Terminal;
    mouseSGR: Terminal;
    focusEvent: Terminal;
    cwd: (uri: string) => Terminal;
    windowTitle: (str: string) => Terminal;
    iconName: (str: string) => Terminal;
    notify: (title: string, text: string) => Terminal;

    error: Terminal;
    str: Terminal;
    noFormat: CTerminal;
    markupOnly: CTerminal;
    wrap: CTerminal;
    bindArgs: (...args: any[]) => Terminal;

    reset: Terminal;
    bell: Terminal;
    setCursorColor: (register: number) => Terminal;
    setCursorColorRgb: (r: number, g: number, b: number) => Terminal;
    resetCursorColorRgb: Terminal;
    setDefaultColorRgb: (r: number, g: number, b: number) => Terminal;
    resetDefaultColorRgb: Terminal;
    setDefaultBgColorRgb: (r: number, g: number, b: number) => Terminal;
    resetDefaultBgColorRgb: Terminal;
    setHighlightBgColorRgb: (r: number, g: number, b: number) => Terminal;
    resetHighlightBgColorRgb: Terminal;

    fullscreen: (options: boolean | { noAlternate: boolean }) => void;
    processExit: (code: number) => void;
    asyncCleanup: () => Promise<void>;
    grabInput(
      options:
        | boolean
        | {
            mouse?: "button" | "drag" | "motion";
            safe?: boolean;
          },
      safeCallback?: boolean
    ): void;

    getCursorLocation: (
      callback: (error: any, x?: number, y?: number) => void
    ) => void;
    getColor(
      register: number,
      callback?: Callback<{ r: number; g: number; b: number }>
    ): void;
    setColor(
      register: number,
      r: number,
      g: number,
      b: number,
      names?: ReadonlyArray<string>
    ): void;
    setColor(
      register: number,
      rgb: { r: number; g: number; b: number },
      names?: ReadonlyArray<string>
    ): void;
    getPalette(register: number, callback?: Callback<Palette>): void;
    setPalette(palette: string | Palette): void;

    wrapColumn(options?: {
      width: null | number;
      x: number;
      continue?: boolean;
      offset?: number;
    }): void;
    wrapColumn(x: undefined | number, width: number): void;

    yesOrNo(options: YesOrNoOptions, callback: Callback<boolean>): void;

    yesOrNo(
      options?: YesOrNoOptions
    ): {
      abort: () => void;
      promise?: Promise<boolean>;
    };

    inputField(options: InputFieldOptions, callback?: Callback<string | undefined>): {
      abort: () => void;
      promise: Promise<string | undefined>;
    };
    inputField(callback: Callback<string | undefined>): {
      abort: () => void;
      promise: Promise<string | undefined>;
    };

    fileInput(options: IFileInputOptions, callback: Callback<string>): void;
    fileInput(options?: IFileInputOptions): Promise<string>;

    singleLineMenu(
      menuItems: ReadonlyArray<string>,
      options: SingleLineMenuOptions,
      callback: Callback<SingleLineMenuResponse>
    ): void;

    singleLineMenu(
      menuItems: ReadonlyArray<string>,
      callback: Callback<SingleLineMenuResponse>
    ): void;

    singleLineMenu(
      menuItems: ReadonlyArray<string>,
      options?: SingleLineMenuOptions
    ): {
      promise: Promise<SingleLineMenuResponse>;
    };

    singleRowMenu(
      menuItems: ReadonlyArray<string>,
      options: SingleLineMenuOptions,
      callback: Callback<SingleLineMenuResponse>
    ): void;

    singleRowMenu(
      menuItems: ReadonlyArray<string>,
      callback: Callback<SingleLineMenuResponse>
    ): void;

    singleRowMenu(
      menuItems: ReadonlyArray<string>,
      options?: SingleLineMenuOptions
    ): {
      promise: Promise<SingleLineMenuResponse>;
    };

    singleColumnMenu(
      menuItems: ReadonlyArray<string>,
      options: SingleColumnMenuOptions,
      callback: Callback<SingleColumnMenuResponse>
    ): void;

    singleColumnMenu(
      menuItems: ReadonlyArray<string>,
      callback: Callback<SingleColumnMenuResponse>
    ): void;

    singleColumnMenu(
      menuItems: ReadonlyArray<string>,
      options?: SingleColumnMenuOptions
    ): {
      promise: Promise<SingleColumnMenuResponse>;
    };

    gridMenu(
      menuItems: ReadonlyArray<string>,
      options: GridMenuOptions,
      callback: Callback<GridMenuResponse>
    ): void;

    gridMenu(
      menuItems: ReadonlyArray<string>,
      callback: Callback<GridMenuResponse>
    ): void;

    gridMenu(
      menuItems: ReadonlyArray<string>,
      options?: GridMenuOptions
    ): {
      promise: Promise<GridMenuResponse>;
    };

    progressBar(options?: ProgressBarOptions): ProgressBarController;

    bar(
      value: number,
      options?: { innerSize?: number; barStyle?: CTerminal }
    ): void;

    slowTyping(
      str: string,
      options: {
        style?: CTerminal;
        flashStyle?: CTerminal;
        delay?: number;
        flashDelay?: number;
      },
      callback: Callback<void>
    ): void;
    slowTyping(str: string, callback: Callback<void>): void;

    slowTyping(
      str: string,
      options?: {
        style?: CTerminal;
        flashStyle?: CTerminal;
        delay?: number;
        flashDelay?: number;
      }
    ): Promise<void>;

    drawImage(
      url: string,
      options: {
        shrink?: {
          width: number;
          height: number;
        };
      },
      callback: Callback<void>
    ): void;

    drawImage(url: string, callback: Callback<void>): void;

    drawImage(
      url: string,
      options?: {
        shrink?: {
          width: number;
          height: number;
        };
      }
    ): Promise<void>;
  }

  interface ChainableInterface<T> {
    (str: string, ...args: any[]): T;
    (...args: any[]): T;
  }

  type Chainable<T> = T & ChainableInterface<T>;

  type CTerminal = Terminal & ((...args: any[]) => Terminal);

  type Palette = Array<{
    r: number;
    g: number;
    b: number;
    names: ReadonlyArray<string>;
  }>;

  interface YesOrNoOptions {
    yes: string | ReadonlyArray<string>;
    no: string | ReadonlyArray<string>;
    echoYes?: string;
    echoNo?: string;
  }

  type Autocompletion =
    | ((
        inputString: string,
        callback: Callback<string | AutocompletionArray<string>>
      ) => void)
    | ((inputString: string) => Promise<string | AutocompletionArray<string>>);

  interface CreateOptions {
    stdin?: NodeJS.Process;
    stdout?: NodeJS.Process;
    stderr?: NodeJS.Process;
    generic?: string;
    appId: string;
    appName: string;
    isTTY?: boolean;
    isSSH?: boolean;
    pid?: any;
    preferProcessSigwinch?: boolean;
    processSigwinch?: boolean;
  }

  class AutocompletionArray<T> extends Array<T> {
    prefix?: string;
    postfix?: string;
  }

  interface HookConfig {
    style?: CTerminal;
    hintStyle?: CTerminal;
    tokenRegExp?: RegExp;
    autoComplete?: string[] | Autocompletion;
    autoCompleteMenu?: boolean | Autocompletion;
    autoCompleteHint?: boolean;
  }

  interface InputFieldOptions {
    echo?: boolean;
    echoChar?: string | true;
    default?: string;
    cursorPosition?: number;
    cancelable?: boolean;
    style?: CTerminal;
    hintStyle?: CTerminal;
    maxLength?: number;
    minLength?: number;
    history?: string[];
    autoComplete?: string[] | Autocompletion;
    autoCompleteMenu?: boolean | Autocompletion;
    autoCompleteHint?: boolean;
    keyBindings?: { [key: string]: string };
    tokenHook?: (
      token: string,
      isEndOfInput: boolean,
      previousTokens: ReadonlyArray<string>,
      term: Terminal,
      config: HookConfig
    ) => string | CTerminal | null | void;
    tokenResetHook?: (
      term: Terminal,
      config?: HookConfig
    ) => string | CTerminal;
    tokenRegExp?: RegExp;
  }

  type IFileInputOptions = InputFieldOptions & { baseDir: string };

  interface SingleLineMenuResponse {
    selectedIndex: number;
    selectedText: string;
    x: number;
    y: number;
    canceled: boolean;
    unexpectedKey: string;
  }

  interface SingleLineMenuOptions {
    y?: number;
    separator?: string;
    nextPageHint?: string;
    previousPageHint?: string;
    style?: CTerminal;
    selectedStyle?: CTerminal;
    keyBindings?: { [key: string]: string };
    cancelable?: boolean;
    exitOnUnexpectedKey?: boolean;
  }

  interface SingleColumnMenuOptions {
    y?: number;
    style?: CTerminal;
    selectedStyle?: CTerminal;
    submittedStyle?: CTerminal;
    leftPadding?: string;
    selectedLeftPadding?: string;
    submittedLeftPadding?: string;
    extraLines?: number;
    oneLineItem?: boolean;
    itemMaxWidth?: number;
    continueOnSubmit?: boolean;
    selectedIndex?: number;
    keyBindings?: { [key: string]: string };
    cancelable?: boolean;
    exitOnUnexpectedKey?: boolean;
  }

  interface SingleColumnMenuResponse {
    selectedIndex: number;
    selectedText: string;
    submitted: boolean;
    x: number;
    y: number;
    canceled: boolean;
    unexpectedKey: string;
  }

  interface GridMenuOptions {
    y?: number;
    x?: number;
    width?: number;
    style?: CTerminal;
    selectedStyle?: CTerminal;
    leftPadding?: string;
    selectedLeftPadding?: string;
    rightPadding?: string;
    selectedRightPadding?: string;
    itemMaxWidth?: number;
    keyBindings?: { [key: string]: string };
    exitOnUnexpectedKey?: boolean;
  }

  interface GridMenuResponse {
    selectedIndex: number;
    selectedText: string;
    x: number;
    y: number;
    unexpectedKey: string;
  }

  interface ProgressBarOptions {
    width?: number;
    percent?: boolean;
    eta?: boolean;
    items?: number;
    title?: string;
    barStyle?: CTerminal;
    barBracketStyle?: CTerminal;
    percentStyle?: CTerminal;
    etaStyle?: CTerminal;
    itemStyle?: CTerminal;
    titleStyle?: CTerminal;
    itemSize?: number;
    titleSize?: number;
    barChar?: string;
    barHeadChar?: string;
    maxRefreshTime?: number;
    minRefreshTime?: number;
    inline?: boolean;
    syncMode?: boolean;
  }

  interface ProgressBarController {
    update: (
      updateObject:
        | number
        | { progress: number | null; items?: number; title?: string }
    ) => void;
    startItem: (name: string) => void;
    itemDone: (name: string) => void;
    stop: () => void;
    resume: () => void;
    reset: () => void;
  }
}


text:
Required to add to your code entry of the app when using the React Native components on [MADP](http://mobility.lenovo.com).

```
global.__MADPCONFIG__ = {
  tenants: 'lenovo',
  appkey: 'appKey' // Use your own app key on MADP
};
```

##全局常量
当使用MADP平台提供的React Native组件时,首先需要在入口文件配置全局常量。
```
global.__MADPCONFIG__ = {
  tenants: 'lenovo',
  appkey: 'appKey' // 你的应用在MADP平台上的App Key
};
```

redpajama_set_name: RedPajamaGithub


text:
var __hasProp = {}.hasOwnProperty,
  __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

(function() {
  var Modal;
  Modal = (function(_super) {
    __extends(Modal, _super);

    function Modal() {
      return Modal.__super__.constructor.apply(this, arguments);
    }

    Modal.prototype.init = function(id) {
      this.id = id;
      this.domElement = document.createElement('div');
      this.domElement.id = this.id;
      return this.domElement.className = 'modal';
    };

    Modal.prototype.hide = function() {
      return this.domElement.className = 'modal';
    };

    Modal.prototype.show = function(props) {
      var id, prop;
      for (id in props) {
        prop = props[id];
        new PropRow(this, _cid(), id, prop);
      }
      return this.domElement.className = 'modal show';
    };

    return Modal;

  })(View);
  return this.Modal = Modal;
})();


text:
package ai.elimu.util.epub;

import ai.elimu.model.enums.StoryBookProvider;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

public class EPubParagraphExtractionHelper {

    private static final Logger logger = LogManager.getLogger();

    /**
     * Examples of the expected file format can be found at src/test/resources/ai/elimu/util/epub/
     *
     * @param xhtmlFile The XHTML file containing the paragraphs, e.g. {@code chapter-2.xhtml}.
     * @return A list of paragraphs.
     */
    public static List<String> extractParagraphsFromChapterFile(File xhtmlFile) {
        logger.info("extractParagraphsFromChapter");

        List<String> paragraphs = new ArrayList<>();

        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        try {
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            Document document = documentBuilder.parse(xhtmlFile);
            NodeList nodeList = document.getDocumentElement().getChildNodes();
            logger.info("nodeList.getLength(): " + nodeList.getLength());
            for (int i = 0; i < nodeList.getLength(); i++) {
                Node node = nodeList.item(i);
                logger.info("node: " + node);

                // Look for ""
                if ("body".equals(node.getNodeName())) {
                    NodeList bodyChildNodeList = node.getChildNodes();
                    logger.info("bodyChildNodeList.getLength(): " + bodyChildNodeList.getLength());
                    for (int j = 0; j < bodyChildNodeList.getLength(); j++) {
                        Node bodyChildNode = bodyChildNodeList.item(j);
                        logger.info("bodyChildNode: " + bodyChildNode);
                        logger.info("bodyChildNode.getNodeName(): " + bodyChildNode.getNodeName());
                        logger.info("bodyChildNode.getTextContent(): \"" + bodyChildNode.getTextContent() + "\"");

                        // StoryBookProvider: GLOBAL_DIGITAL_LIBRARY
                        // Look for paragraphs within `<body>`
                        // Expected format:
                        /*

                             আজকে ছুটির দিন আনন্দে হারাই!
                             চলো সবে পোশাকের উৎসবে যাই!

                        */
                        if ("p".equals(bodyChildNode.getNodeName()) && (bodyChildNode.getAttributes().getNamedItem("dir") == null)) {
                            processParagraphNode(StoryBookProvider.GLOBAL_DIGITAL_LIBRARY, bodyChildNode, paragraphs);
                        }

                        // StoryBookProvider: LETS_READ_ASIA
                        // Look for paragraphs within `<body>`
                        // Expected format:
                        /*

"Nagmumuni-muni lang," sabi niya.

                        */
                        if ("p".equals(bodyChildNode.getNodeName()) && (bodyChildNode.getAttributes().getNamedItem("dir") != null)) {
                            processParagraphNode(StoryBookProvider.LETS_READ_ASIA, bodyChildNode, paragraphs);
                        }

                        // StoryBookProvider: LETS_READ_ASIA
                        // Look for paragraphs within `<div lang="en">`
                        // Expected format:
                        /*

The moon rises.

                        */
                        if ("div".equals(bodyChildNode.getNodeName()) && (bodyChildNode.getAttributes().getNamedItem("lang") != null)) {
                            NodeList langDivChildNodeList = bodyChildNode.getChildNodes();
                            logger.info("langDivChildNodeList: " + langDivChildNodeList);
                            for (int k = 0; k < langDivChildNodeList.getLength(); k++) {
                                Node langDivChildNode = langDivChildNodeList.item(k);
                                logger.info("langDivChildNode: " + langDivChildNode);

                                // Look for "
"
                                if ("p".equals(langDivChildNode.getNodeName())) {
                                    processParagraphNode(StoryBookProvider.LETS_READ_ASIA, langDivChildNode, paragraphs);
                                }
                            }
                        }

                        // StoryBookProvider: STORYWEAVER
                        // Look for paragraphs within `<div class='text-font-normal sp_h_iT66_cB33 content ' dir="auto">`
                        // Expected format:
                        /*

                                                ভীমের
                                                শুধু ঘুম আর ঘুম। সকালে উঠতেই পারে না।

ধোপা
                                                রামু সুযোগ পেলেই ভীমকে বকা দেয়।

                                            2

                        */
                        if ("div".equals(bodyChildNode.getNodeName())) {
                            Node bodyChildNodeIdAttribute = bodyChildNode.getAttributes().getNamedItem("id");
                            logger.info("bodyChildNodeIdAttribute: " + bodyChildNodeIdAttribute);

                            // Expected format:

                            if ((bodyChildNodeIdAttribute != null) && "story_epub".equals(bodyChildNodeIdAttribute.getNodeValue())) {
                                NodeList storyEpubDivChildNodeList = bodyChildNode.getChildNodes();
                                logger.info("storyEpubDivChildNodeList: " + storyEpubDivChildNodeList);
                                for (int k = 0; k < storyEpubDivChildNodeList.getLength(); k++) {
                                    Node storyEpubDivChildNode = storyEpubDivChildNodeList.item(k);
                                    logger.info("storyEpubDivChildNode: " + storyEpubDivChildNode);

                                    // Expected format:

                                    if ("div".equals(storyEpubDivChildNode.getNodeName())) {
                                        Node storyEpubDivChildNodeIdAttribute = storyEpubDivChildNode.getAttributes().getNamedItem("id");
                                        logger.info("storyEpubDivChildNodeIdAttribute: " + storyEpubDivChildNodeIdAttribute);
                                        if ((storyEpubDivChildNodeIdAttribute != null) && "storyReader".equals(storyEpubDivChildNodeIdAttribute.getNodeValue())) {
                                            NodeList storyReaderDivChildNodeList = storyEpubDivChildNode.getChildNodes();
                                            logger.info("storyReaderDivChildNodeList: " + storyReaderDivChildNodeList);
                                            for (int l = 0; l < storyReaderDivChildNodeList.getLength(); l++) {
                                                Node storyReaderDivChildNode = storyReaderDivChildNodeList.item(l);
                                                logger.info("storyReaderDivChildNode: " + storyReaderDivChildNode);

                                                // Expected format:

                                                if ("div".equals(storyReaderDivChildNode.getNodeName())) {
                                                    Node storyReaderDivChildNodeIdAttribute = storyReaderDivChildNode.getAttributes().getNamedItem("id");
                                                    logger.info("storyReaderDivChildNodeIdAttribute: " + storyReaderDivChildNodeIdAttribute);
                                                    if ((storyReaderDivChildNodeIdAttribute != null) && "selected_page".equals(storyReaderDivChildNodeIdAttribute.getNodeValue())) {
                                                        NodeList selectedPageDivChildNodeList = storyReaderDivChildNode.getChildNodes();
                                                        logger.info("selectedPageDivChildNodeList: " + selectedPageDivChildNodeList);
                                                        for (int m = 0; m < selectedPageDivChildNodeList.getLength(); m++) {
                                                            Node selectedPageDivChildNode = selectedPageDivChildNodeList.item(m);
                                                            logger.info("selectedPageDivChildNode: " + selectedPageDivChildNode);

                                                            // Expected format:

                                                            if ("div".equals(selectedPageDivChildNode.getNodeName())) {
                                                                Node selectedPageDivChildNodeClassAttribute = selectedPageDivChildNode.getAttributes().getNamedItem("class");
                                                                logger.info("selectedPageDivChildNodeClassAttribute: " + selectedPageDivChildNodeClassAttribute);
                                                                if ((selectedPageDivChildNodeClassAttribute != null)
                                                                        && selectedPageDivChildNodeClassAttribute.getNodeValue().contains("content")) {
                                                                    NodeList contentDivChildNodeList = selectedPageDivChildNode.getChildNodes();
                                                                    logger.info("contentDivChildNodeList: " + contentDivChildNodeList);
                                                                    for (int n = 0; n < contentDivChildNodeList.getLength(); n++) {
                                                                        Node contentDivChildNode = contentDivChildNodeList.item(n);
                                                                        logger.info("contentDivChildNode : " + contentDivChildNode);

                                                                        // Expected format:
ভীমের শুধু ঘুম আর ঘুম। সকালে উঠতেই পারে না।

                                                                        if ("p".equals(contentDivChildNode.getNodeName())) {
                                                                            processParagraphNode(StoryBookProvider.STORYWEAVER, contentDivChildNode, paragraphs);
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }

                        // Look for text content
                        // In some cases,
 tags are missing, and "#text" is the node name
                        if ("#text".equals(bodyChildNode.getNodeName())) {
                            String paragraph = bodyChildNode.getTextContent();
                            logger.info("paragraph: \"" + paragraph + "\"");
                            paragraph = getCleanedUpParagraph(paragraph);
                            if (StringUtils.isNotBlank(paragraph)) {
                                paragraphs.add(paragraph);
                            }
                        }
                    }
                }
            }
        } catch (ParserConfigurationException | SAXException | IOException ex) {
            logger.error(ex);
        }

        return paragraphs;
    }

    private static void processParagraphNode(StoryBookProvider storyBookProvider, Node paragraphNode, List<String> paragraphs) {
        logger.info("processParagraphNode");

        logger.info("storyBookProvider: " + storyBookProvider);
        if ((storyBookProvider == StoryBookProvider.GLOBAL_DIGITAL_LIBRARY) || (storyBookProvider == StoryBookProvider.LETS_READ_ASIA)) {
            // If single line-break ("
"), replace it with whitespace.
            // If double line-breaks ("

"), treat the subsequent text as a new paragraph.
            if (paragraphNode.hasChildNodes()) {
                NodeList paragraphChildNodeList = paragraphNode.getChildNodes();
                int consecutiveLineBreaksCount = 0;
                for (int k = 0; k < paragraphChildNodeList.getLength(); k++) {
                    Node paragraphChildNode = paragraphChildNodeList.item(k);
                    logger.info("paragraphChildNode: " + paragraphChildNode);
                    logger.info("paragraphChildNode.getNodeName(): " + paragraphChildNode.getNodeName());
                    logger.info("paragraphChildNode.getTextContent(): \"" + paragraphChildNode.getTextContent() + "\"");
                    if ("br".equals(paragraphChildNode.getNodeName())) {
                        consecutiveLineBreaksCount++;
                    } else {
                        consecutiveLineBreaksCount = 0;
                    }
                    logger.info("consecutiveLineBreaksCount: " + consecutiveLineBreaksCount);
                    if (consecutiveLineBreaksCount == 1) {
                        // Replace "
" with " "
                        paragraphChildNode.setTextContent(" ");
                    } else if (consecutiveLineBreaksCount == 2) {
                        // Replace "

" with "

"
                        paragraphChildNode.setTextContent("

");
                        consecutiveLineBreaksCount = 0;
                    }

                    if (storyBookProvider == StoryBookProvider.LETS_READ_ASIA) {
                        // Look for line-breaks within `<em>`
                        // Expected format:
                        /*

Will they play with me? I am so different from them.
I should try.

                        */
                        if ("em".equals(paragraphChildNode.getNodeName())) {
                            NodeList emChildNodeList = paragraphChildNode.getChildNodes();
                            for (int l = 0; l < emChildNodeList.getLength(); l++) {
                                Node emChildNode = emChildNodeList.item(l);
                                if ("br".equals(emChildNode.getNodeName())) {
                                    // Replace "
" with " "
                                    emChildNode.setTextContent(" ");
                                }
                            }
                        }
                    }
                }
            }

            // Add each paragraph separately
            String[] paragraphArray = paragraphNode.getTextContent().split("

");
            for (String paragraph : paragraphArray) {
                logger.info("paragraph: \"" + paragraph + "\"");
                paragraph = getCleanedUpParagraph(paragraph);
                if (StringUtils.isNotBlank(paragraph)) {
                    paragraphs.add(paragraph);
                }
            }
        } else if (storyBookProvider == StoryBookProvider.STORYWEAVER) {
            String paragraph = paragraphNode.getTextContent();
            logger.info("paragraph: \"" + paragraph + "\"");
            paragraph = getCleanedUpParagraph(paragraph);

            // Skip paragraphs containing CSS code
            // See example at src/test/resources/ai/elimu/util/epub/hin-sw-10145-ek-sau-saintisvan-paer.epub_4.xhtml
            if (paragraph.contains("@page")) {
                return;
            }

            if (StringUtils.isNotBlank(paragraph)) {
                paragraphs.add(paragraph);
            }
        }
    }

    /**
     * E.g. "लेना ।" --> "लेना।"
     */
    private static String getCleanedUpParagraph(String paragraph) {
        logger.info("getCleanedUpParagraph, paragraph: \"" + paragraph + "\"");

        // Replace line-breaks with a whitespace
        paragraph = paragraph.replace("\n", " ");

        // Replace non-breaking spaces ( ) with a whitespace
        paragraph = paragraph.replace("\u00a0", " ");

        // Replace vertical bar with Danda (https://en.wikipedia.org/wiki/Danda)
        paragraph = paragraph.replace("|", "।");

        // Remove leading/trailing whitespaces
        paragraph = paragraph.trim();

        // Remove duplicate whitespaces
        paragraph = paragraph.replaceAll(" +", " ");

        // Remove spaces in front of punctuation marks
        paragraph = paragraph.replace(" ,", ",");
        paragraph = paragraph.replace(" .", ".");
        paragraph = paragraph.replace(" ।", "।");
        paragraph = paragraph.replace(" ?", "?");
        paragraph = paragraph.replace(" !", "!");

        // Remove spaces within parenthesis
        paragraph = paragraph.replace("( ", "(");
        paragraph = paragraph.replace(" )", ")");

        // Remove spaces within quotes
        paragraph = paragraph.replace("" ", """);
        if (paragraph.startsWith("\" ")) {
            paragraph = paragraph.replace("\" ", "\"");
        }
        paragraph = paragraph.replace(" "", """);
        if (paragraph.endsWith(" \"")) {
            paragraph = paragraph.replace(" \"", "\"");
        }

        return paragraph;
    }
}


text:
package org.spongepowered.common.accessor.world.entity.monster;

import net.minecraft.world.entity.monster.Phantom;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(Phantom.class)
public interface PhantomAccessor {

    @Accessor("attackPhase") Phantom.AttackPhase accessor$attackPhase();

    @Accessor("attackPhase") void accessor$attackPhase(final Phantom.AttackPhase attackPhase);

}


text:
// Copyright 2015 go-swagger maintainers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package validate

import (
	"path/filepath"
	"testing"

	"github.com/go-openapi/analysis"
	"github.com/go-openapi/loads"
	"github.com/go-openapi/spec"
	"github.com/go-openapi/strfmt"
	"github.com/stretchr/testify/assert"
)

func TestExample_ValidateExamples(t *testing.T) {
	doc, _ := loads.Analyzed(PetStoreJSONMessage, "")
	validator := NewSpecValidator(spec.MustLoadSwagger20Schema(), strfmt.Default)
	validator.spec = doc
	validator.analyzer = analysis.New(doc.Spec())
	myDefaultValidator := &defaultValidator{SpecValidator: validator}
	res := myDefaultValidator.Validate()
	assert.Empty(t, res.Errors)

	tests := []string{
		// - $ref in response
		"response",
		"response-ref",
		"parameter",
		"parameter-required",
		"parameter-ref",
		"parameter-items",
		"header",
		"header-items",
		"schema",
		"schema-ref",
		"schema-additionalProperties",
		"schema-patternProperties",
		"schema-items",
		"schema-allOf",
		"parameter-schema",
		"default-response",
		"header-response",
		"header-items-default-response",
		"header-items-response",
		"header-pattern",
		"header-badpattern",
		"schema-items-allOf",
	}

	for _, tt := range tests {
		path := filepath.Join("fixtures", "validation", "example", "valid-example-"+tt+".json")
		if DebugTest {
			t.Logf("Testing valid example values for: %s", path)
		}
		doc, err := loads.Spec(path)
		if assert.NoError(t, err) {
			validator := NewSpecValidator(spec.MustLoadSwagger20Schema(), strfmt.Default)
			validator.spec = doc
			validator.analyzer = analysis.New(doc.Spec())
			myExampleValidator := &exampleValidator{SpecValidator: validator}
			res := myExampleValidator.Validate()
			assert.Empty(t, res.Errors, tt+" should not have errors")
			// Special case: warning only
			/*
				if tt == "parameter-required" {
					warns := []string{}
					for _, w := range res.Warnings {
						warns = append(warns, w.Error())
					}
					assert.Contains(t, warns, "limit in query has an example value and is required as parameter")
				}
			*/
			if DebugTest && t.Failed() {
				t.Logf("DEVMODE: Returned errors for %s:", tt)
				for _, e := range res.Errors {
					t.Logf("%v", e)
				}
				t.Logf("DEVMODE: Returned warnings for %s:", tt)
				for _, e := range res.Warnings {
					t.Logf("%v", e)
				}
			}
		}

		path = filepath.Join("fixtures", "validation", "example", "invalid-example-"+tt+".json")
		if DebugTest {
			t.Logf("Testing invalid example values for: %s", path)
		}
		doc, err = loads.Spec(path)
		if assert.NoError(t, err) {
			validator := NewSpecValidator(spec.MustLoadSwagger20Schema(), strfmt.Default)
			validator.spec = doc
			validator.analyzer = analysis.New(doc.Spec())
			myExampleValidator := &exampleValidator{SpecValidator: validator}
			res := myExampleValidator.Validate()
			switch tt {
			case "header-badpattern":
				// This fixture exhibits real errors besides example values
				assert.NotEmpty(t, res.Errors, tt+" should have errors")
				assert.NotEmpty(t, res.Warnings, tt+" should have warnings")
			default:
				assert.Empty(t, res.Errors, tt+" should not have errors")
				assert.NotEmpty(t, res.Warnings, tt+" should have warnings")
			}
			// Update: now we have an additional message to explain it's all about a default value
			// Example:
			// - default value for limit in query does not validate its Schema
			// - limit in query must be of type integer: "string"]
			assert.True(t, len(res.Warnings) >= 1, tt+" should have at least 1 warning")

			if DebugTest && t.Failed() {
				t.Logf("DEVMODE: Returned errors for %s:", tt)
				for _, e := range res.Errors {
					t.Logf("%v", e)
				}
				t.Logf("DEVMODE: Returned warnings for %s:", tt)
				for _, e := range res.Warnings {
					t.Logf("%v", e)
				}
			}
		}
		if DebugTest && t.Failed() {
			t.FailNow()
		}
	}
}

func TestExample_EdgeCase(t *testing.T) {
	// Testing guards
	var myExampleValidator *exampleValidator
	res := myExampleValidator.Validate()
	assert.True(t, res.IsValid())

	myExampleValidator = &exampleValidator{}
	res = myExampleValidator.Validate()
	assert.True(t, res.IsValid())
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
             xmlns:beans="http://www.springframework.org/schema/beans"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:util="http://www.springframework.org/schema/util"
             xmlns:context="http://www.springframework.org/schema/context"
             xsi:schemaLocation="http://www.springframework.org/schema/beans
                 http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                 http://www.springframework.org/schema/security
                 http://www.springframework.org/schema/security/spring-security-3.1.xsd
                 http://www.springframework.org/schema/util
                 http://www.springframework.org/schema/util/spring-util-3.0.xsd
                 http://www.springframework.org/schema/context
                 http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <global-method-security pre-post-annotations="enabled">
     </global-method-security>
     <http use-expressions="true" auto-config="true">
         <session-management>
             <concurrency-control max-sessions="1" expired-url="/tmch/login"/>

         </session-management>
         <intercept-url pattern="/tmch/newRegis*" access="permitAll"/>
         <intercept-url pattern="/tmch/newLogin*" access="permitAll"/>
         <intercept-url pattern="/*" access="isAuthenticated()"/>
         <logout logout-success-url="/tmch/newLogin"/>
        <!--  <form-login 	login-page="/tmch/login"
             			default-target-url="/tmch/index"
             			authentication-failure-url="/tmch/login?access=fail"
             			always-use-default-target="false"/> -->
         <form-login 	login-page="/tmch/newLogin"
             			default-target-url="/tmch/newIndex"
             			authentication-failure-url="/tmch/newLogin?access=fail"
             			always-use-default-target="false"/>
     	 <remember-me key="rememberMeKey"
                     user-service-ref="userDetialsService"/>
     </http>

     <beans:bean 	id="userDetialsService"
         			class="com.tmch.security.UserDetialServices">
     </beans:bean>
     <authentication-manager alias="authenManager">
         <authentication-provider user-service-ref="userDetialsService">
             <password-encoder hash="sha" base64="true" />
         </authentication-provider>
     </authentication-manager>

 <!--     <beans:bean 	id="messageSource"
         			class="org.springframework.context.support.ResourceBundleMessageSource">
         <beans:property 	name="basename"
             				value="springsecurity"></beans:property>
     </beans:bean> -->
 </beans:beans>


text:
package com.helger.pd.publisher.app.pub;

import java.util.Collection;
import java.util.Locale;
import java.util.function.Function;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.helger.commons.ValueEnforcer;
import com.helger.commons.annotation.Nonempty;
import com.helger.commons.collection.impl.CommonsArrayList;
import com.helger.commons.collection.impl.ICommonsList;
import com.helger.commons.collection.impl.ICommonsMap;
import com.helger.commons.datetime.PDTToString;
import com.helger.commons.debug.GlobalDebug;
import com.helger.commons.id.IHasID;
import com.helger.commons.lang.EnumHelper;
import com.helger.commons.string.StringHelper;
import com.helger.html.css.DefaultCSSClassProvider;
import com.helger.html.css.ICSSClassProvider;
import com.helger.html.hc.IHCNode;
import com.helger.html.hc.html.grouping.HCHR;
import com.helger.html.hc.html.grouping.HCLI;
import com.helger.html.hc.html.grouping.HCOL;
import com.helger.html.hc.html.sections.HCH1;
import com.helger.html.hc.impl.HCNodeList;
import com.helger.pd.indexer.mgr.PDMetaManager;
import com.helger.pd.indexer.settings.PDServerConfiguration;
import com.helger.pd.indexer.storage.PDStorageManager;
import com.helger.pd.indexer.storage.PDStoredBusinessEntity;
import com.helger.pd.indexer.storage.PDStoredMLName;
import com.helger.pd.publisher.nicename.NiceNameUI;
import com.helger.pd.publisher.ui.AbstractAppWebPage;
import com.helger.pd.publisher.ui.PDCommonUI;
import com.helger.peppolid.IDocumentTypeIdentifier;
import com.helger.peppolid.IParticipantIdentifier;
import com.helger.peppolid.factory.PeppolIdentifierFactory;
import com.helger.peppolid.peppol.pidscheme.IParticipantIdentifierScheme;
import com.helger.peppolid.peppol.pidscheme.ParticipantIdentifierSchemeManager;
import com.helger.photon.bootstrap4.card.BootstrapCard;
import com.helger.photon.bootstrap4.form.BootstrapFormGroup;
import com.helger.photon.bootstrap4.form.BootstrapViewForm;
import com.helger.photon.bootstrap4.nav.BootstrapTabBox;
import com.helger.photon.bootstrap4.pages.BootstrapWebPageUIHandler;
import com.helger.photon.bootstrap4.utils.BootstrapPageHeader;

public abstract class AbstractPagePublicSearch extends AbstractAppWebPage
{
  protected static enum EUIMode implements IHasID <String>
  {
    DEFAULT ("default"),
    TOOP ("toop"),
    DE4A ("de4a");

    private final String m_sID;

    private EUIMode (@Nonnull @Nonempty final String sID)
    {
      m_sID = sID;
    }

    @Nonnull
    @Nonempty
    public String getID ()
    {
      return m_sID;
    }

    public boolean isUseGreenButton ()
    {
      return this == DEFAULT;
    }

    public boolean isUseHelptext ()
    {
      return this == DEFAULT;
    }

    @Nonnull
    public static EUIMode getFromIDOrDefault (@Nullable final String sID)
    {
      return EnumHelper.getFromIDOrDefault (EUIMode.class, sID, EUIMode.DEFAULT);
    }
  }

  private static final Logger LOGGER = LoggerFactory.getLogger (AbstractPagePublicSearch.class);

  protected static final ICSSClassProvider CSS_CLASS_BIG_QUERY_IMAGE_CONTAINER = DefaultCSSClassProvider.create ("big-query-image-container");
  protected static final ICSSClassProvider CSS_CLASS_BIG_QUERY_IMAGE = DefaultCSSClassProvider.create ("big-query-image");
  protected static final ICSSClassProvider CSS_CLASS_BIG_QUERY_BOX = DefaultCSSClassProvider.create ("big-query-box");
  protected static final ICSSClassProvider CSS_CLASS_BIG_QUERY_HELPTEXT = DefaultCSSClassProvider.create ("big-query-helptext");
  protected static final ICSSClassProvider CSS_CLASS_BIG_QUERY_BUTTONS = DefaultCSSClassProvider.create ("big-query-buttons");

  protected static final ICSSClassProvider CSS_CLASS_RESULT_DOC = DefaultCSSClassProvider.create ("result-doc");
  protected static final ICSSClassProvider CSS_CLASS_RESULT_DOC_HEADER = DefaultCSSClassProvider.create ("result-doc-header");
  protected static final ICSSClassProvider CSS_CLASS_RESULT_DOC_COUNTRY_CODE = DefaultCSSClassProvider.create ("result-doc-country-code");
  protected static final ICSSClassProvider CSS_CLASS_RESULT_DOC_NAME = DefaultCSSClassProvider.create ("result-doc-name");
  protected static final ICSSClassProvider CSS_CLASS_RESULT_DOC_GEOINFO = DefaultCSSClassProvider.create ("result-doc-geoinfo");
  protected static final ICSSClassProvider CSS_CLASS_RESULT_DOC_FREETEXT = DefaultCSSClassProvider.create ("result-doc-freetext");
  protected static final ICSSClassProvider CSS_CLASS_RESULT_DOC_SDBUTTON = DefaultCSSClassProvider.create ("result-doc-sdbutton");
  protected static final ICSSClassProvider CSS_CLASS_RESULT_PANEL = DefaultCSSClassProvider.create ("result-panel");

  protected static final EUIMode UI_MODE;

  static
  {
    // Determined by configuration file!
    UI_MODE = EUIMode.getFromIDOrDefault (PDServerConfiguration.getSearchUIMode ());
  }

  public AbstractPagePublicSearch (@Nonnull @Nonempty final String sID, @Nonnull final String sName)
  {
    super (sID, sName);
  }

  @Nonnull
  protected static <ELEMENTTYPE> String _getImplodedMapped (@Nonnull final String sSep,
                                                            @Nonnull final String sLastSep,
                                                            @Nullable final Collection <? extends ELEMENTTYPE> aElements,
                                                            @Nonnull final Function <? super ELEMENTTYPE, String> aMapper)
  {
    ValueEnforcer.notNull (sSep, "Separator");
    ValueEnforcer.notNull (aMapper, "Mapper");

    final StringBuilder aSB = new StringBuilder ();
    if (aElements != null)
    {
      final int nIndexOfLast = aElements.size () - 1;
      int nIndex = 0;
      for (final ELEMENTTYPE aElement : aElements)
      {
        if (nIndex > 0)
          aSB.append (nIndex == nIndexOfLast ? sLastSep : sSep);
        aSB.append (aMapper.apply (aElement));
        nIndex++;
      }
    }
    return aSB.toString ();
  }

  @Nonnull
  protected HCNodeList createParticipantDetails (@Nonnull final Locale aDisplayLocale,
                                                 @Nonnull final String sParticipantID,
                                                 @Nonnull final IParticipantIdentifier aParticipantID,
                                                 final boolean bIsLoggedInUserAdministrator)
  {
    final HCNodeList aDetails = new HCNodeList ();

    // Search document matching participant ID
    final ICommonsList <PDStoredBusinessEntity> aResultDocs = PDMetaManager.getStorageMgr ().getAllDocumentsOfParticipant (aParticipantID);
    // Group by participant ID
    final ICommonsMap <IParticipantIdentifier, ICommonsList <PDStoredBusinessEntity>> aGroupedDocs = PDStorageManager.getGroupedByParticipantID (aResultDocs);
    if (aGroupedDocs.isEmpty ())
      LOGGER.error ("No stored document matches participant identifier '" + sParticipantID + "' - cannot show details");
    else
    {
      if (aGroupedDocs.size () > 1)
        LOGGER.warn ("Found " + aGroupedDocs.size () + " entries for participant identifier '" + sParticipantID + "' - weird");
      // Get the first one
      final ICommonsList <PDStoredBusinessEntity> aStoredEntities = aGroupedDocs.getFirstValue ();

      // Details header
      {
        IHCNode aDetailsHeader = null;
        final boolean bIsPeppolDefault = aParticipantID.hasScheme (PeppolIdentifierFactory.INSTANCE.getDefaultParticipantIdentifierScheme ());
        if (bIsPeppolDefault)
        {
          final IParticipantIdentifierScheme aIIA = ParticipantIdentifierSchemeManager.getSchemeOfIdentifier (aParticipantID);
          if (aIIA != null)
          {
            final HCH1 aH1 = h1 ("Details for: " + aParticipantID.getValue ());
            if (StringHelper.hasText (aIIA.getSchemeAgency ()))
              aH1.addChild (small (" (" + aIIA.getSchemeAgency () + ")"));
            aDetailsHeader = new BootstrapPageHeader ().addChild (aH1);
          }
        }
        if (aDetailsHeader == null)
        {
          // Fallback
          aDetailsHeader = BootstrapWebPageUIHandler.INSTANCE.createPageHeader ("Details for " + sParticipantID);
        }
        aDetails.addChild (aDetailsHeader);
      }

      final BootstrapTabBox aTabBox = new BootstrapTabBox ();

      // Business information
      {
        final HCNodeList aOL = new HCNodeList ();
        int nIndex = 1;
        for (final PDStoredBusinessEntity aStoredEntity : aStoredEntities)
        {
          final BootstrapCard aCard = aOL.addAndReturnChild (new BootstrapCard ());
          aCard.addClass (CSS_CLASS_RESULT_PANEL);
          if (aStoredEntities.size () > 1)
            aCard.createAndAddHeader ().addChild ("Business information entity " + nIndex);
          final BootstrapViewForm aViewForm = PDCommonUI.showBusinessInfoDetails (aStoredEntity, aDisplayLocale);
          aViewForm.addFormGroup (new BootstrapFormGroup ().setLabel ("Full Peppol participant ID").setCtrl (code (sParticipantID)));

          if (GlobalDebug.isDebugMode () || bIsLoggedInUserAdministrator)
          {
            aViewForm.addChild (new HCHR ());
            aViewForm.addFormGroup (new BootstrapFormGroup ().setLabel ("[Debug] Creation DT")
                                                             .setCtrl (PDTToString.getAsString (aStoredEntity.getMetaData ()
                                                                                .getCreationDT (),
                                                                                aDisplayLocale)));
            aViewForm.addFormGroup (new BootstrapFormGroup ().setLabel ("[Debug] Owner ID")
                                                             .setCtrl (code (aStoredEntity.getMetaData ().getOwnerID ())));
            aViewForm.addFormGroup (new BootstrapFormGroup ().setLabel ("[Debug] Requesting Host")
                                                             .setCtrl (code (aStoredEntity.getMetaData ().getRequestingHost ())));
          }

          aCard.createAndAddBody ().addChild (aViewForm);
          ++nIndex;
        }
        // Add whole list or just the first item?
        final IHCNode aTabLabel = span ("Business information ").addChild (badgePrimary (aStoredEntities.size ()));
        aTabBox.addTab ("businessinfo", aTabLabel, aOL, true);
      }

      // Document types
      {
        final HCNodeList aDocTypeCtrl = new HCNodeList ();
        final ICommonsList <String> aNames = new CommonsArrayList <> ();
        for (final PDStoredBusinessEntity aStoredEntity : aStoredEntities)
          aNames.addAllMapped (aStoredEntity.names (), PDStoredMLName::getName);
        aDocTypeCtrl.addChild (info ("The following document types are supported by " +
                                     _getImplodedMapped (", ", " and ", aNames, x -> "'" + x + "'") +
                                     ":"));

        HCOL aDocTypeOL = null;
        final ICommonsList <IDocumentTypeIdentifier> aDocTypeIDs = aResultDocs.getFirst ()
                                                                              .documentTypeIDs ()
                                                                              .getSorted (IDocumentTypeIdentifier.comparator ());
        for (final IDocumentTypeIdentifier aDocTypeID : aDocTypeIDs)
        {
          if (aDocTypeOL == null)
            aDocTypeOL = aDocTypeCtrl.addAndReturnChild (new HCOL ());

          final HCLI aLI = aDocTypeOL.addItem ();
          aLI.addChild (NiceNameUI.getDocumentTypeID (aDocTypeID));
        }

        if (aDocTypeOL == null)
          aDocTypeCtrl.addChild (warn ("This participant does not support any document types!"));

        aTabBox.addTab ("doctypes", span ("Supported document types ").addChild (badgePrimary (aDocTypeIDs.size ())), aDocTypeCtrl, false);
      }
      aDetails.addChild (aTabBox);
    }
    return aDetails;
  }
}


text:
package org.workcraft.plugins.circuit.naryformula;

import org.workcraft.formula.BooleanFormula;
import org.workcraft.formula.BooleanVariable;
import org.workcraft.formula.Nf;
import org.workcraft.formula.visitors.BooleanVisitor;

import java.util.List;

public class SplitForm extends Nf<BooleanFormula> {

    public SplitForm() {
    }

    public SplitForm(BooleanFormula... clauses) {
        super(clauses);
    }

    public SplitForm(List<BooleanFormula> clauses) {
        super(clauses);
    }

    @Override
    public <T> T accept(BooleanVisitor<T> visitor) {
        SplitForm result = new SplitForm();
        return result.accept(visitor);
    }

    public long countLevels() {
        return getClauses().stream().filter(f -> !(f instanceof BooleanVariable)).count();
    }

}


text:
.. include:: meta-mailing_page.collection.rst

.. todo:: Not yet documented.


text:
"""CS106A Assignment 2 Example: Illusion

This program draws four filled 270 degree arcs on a white background to create
the illusion of a rectangle in negative space.
"""
from campy.graphics.gcolor import GColor
from campy.graphics.gobjects import GArc
from campy.graphics.gtypes import GPoint
from campy.graphics.gwindow import GWindow

# Width of the rectangle (in pixels).
RECTANGLE_WIDTH = 350

# Height of the rectangle (in pixels).
RECTANGLE_HEIGHT = 270

# Radius of each constructed arc. For the illusion to look interesting, this
# should be no more than half the minimum of the rectangle's height and width.
ARC_RADIUS = 50

if __name__ == '__main__':
    window = GWindow(title='Illusion')
    center = GPoint(window.width / 2, window.height / 2)
    corners = (
        GPoint(center.x - RECTANGLE_WIDTH / 2, center.y - RECTANGLE_HEIGHT / 2),  # Upper-left
        GPoint(center.x - RECTANGLE_WIDTH / 2, center.y + RECTANGLE_HEIGHT / 2),  # Lower-left
        GPoint(center.x + RECTANGLE_WIDTH / 2, center.y + RECTANGLE_HEIGHT / 2),  # Lower-right
        GPoint(center.x + RECTANGLE_WIDTH / 2, center.y - RECTANGLE_HEIGHT / 2),  # Upper-right
    )

    for corner, start in zip(corners, range(0, 360, 90)):
        arc = GArc(ARC_RADIUS * 2, ARC_RADIUS * 2, start=start, sweep=270, x=corner.x - ARC_RADIUS, y=corner.y - ARC_RADIUS)
        arc.filled = True
        window.add(arc)
        # Alternatively, don't set the arc's location at initialization and instead set it here.
        # window.add(arc, corner.x - ARC_RADIUS, corner.y - ARC_RADIUS)


text:
 $(function(){
   // The HTML view of flight lists parent.
   window.FlightListsView = (function() {
     function FlightListsView() {
       this.clear = bind(this, this.clear);
       this.add = bind(this, this.add);
     }

     // Removes all date tabs.
     FlightListsView.prototype.clear = function() {
       Elements.flights.empty();
     }

     // Adds date tab to the DOM.
     FlightListsView.prototype.add = function(idx) {
       var flightsList = new FlightsListView({
         resultsId: idx
       });
       Elements.flights.append(flightsList.el);
       return flightsList;
     }

     return FlightListsView;
   })();
 });


text:
<?php

namespace AppBundle\Entity;

use AppBundle\Entity\Base\BaseClass;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\Expose;
use JMS\Serializer\Annotation\VirtualProperty;
use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;

/**
 * Comentario
 *
 * @ORM\Table(name="comentarios")
 * @ORM\Entity(repositoryClass="AppBundle\Repository\ComentarioRepository")
 * @ExclusionPolicy("all")
 */
class Comentario extends BaseClass {
	/**
	 * @var int
	 *
	 * @ORM\Column(name="id", type="integer")
	 * @ORM\Id
	 * @ORM\GeneratedValue(strategy="AUTO")
	 * @Expose()
	 */
	private $id;

	/**
	 * @var string
	 *
	 * @ORM\Column(name="texto", type="text")
	 * @Expose()
	 */
	private $texto;

	/**
	 * @var
	 *
	 * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Empresa")
	 * @ORM\JoinColumn(name="empresa_id", referencedColumnName="id", nullable=true)
	 */
	private $empresa;

	/**
	 * @var
	 *
	 * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Publicacion")
	 * @ORM\JoinColumn(name="publicacion_id", referencedColumnName="id", nullable=true)
	 */
	private $publicacion;

	/**
	 * @var
	 *
	 * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Persona")
	 * @ORM\JoinColumn(name="persona_id", referencedColumnName="id", nullable=false)
	 * @Expose()
	 */
	private $persona;

	/**
	 * @VirtualProperty()
	 * @SerializedName("fbId")
	 */
	public function getFbId() {

		$return = array();

		if ( $this->getPersona()->getUsuario() ) {

			$return = $this->getPersona()->getUsuario()->getFacebookId();
		}

		return $return;

	}

	/**
	 * @VirtualProperty()
	 * @SerializedName("gId")
	 */
	public function getgId() {

		$return = array();

		if ( $this->getPersona()->getUsuario() ) {

			$return = $this->getPersona()->getUsuario()->getGoogleId();
		}

		return $return;

	}

	/**
	 * Get id
	 *
	 * @return int
	 */
	public function getId() {
		return $this->id;
	}

	/**
	 * Set texto
	 *
	 * @param string $texto
	 *
	 * @return Comentario
	 */
	public function setTexto( $texto ) {
		$this->texto = $texto;

		return $this;
	}

	/**
	 * Get texto
	 *
	 * @return string
	 */
	public function getTexto() {
		return $this->texto;
	}

	/**
	 * Set fechaCreacion
	 *
	 * @param \DateTime $fechaCreacion
	 *
	 * @return Comentario
	 */
	public function setFechaCreacion( $fechaCreacion ) {
		$this->fechaCreacion = $fechaCreacion;

		return $this;
	}

	/**
	 * Set fechaActualizacion
	 *
	 * @param \DateTime $fechaActualizacion
	 *
	 * @return Comentario
	 */
	public function setFechaActualizacion( $fechaActualizacion ) {
		$this->fechaActualizacion = $fechaActualizacion;

		return $this;
	}

	/**
	 * Set empresa
	 *
	 * @param \AppBundle\Entity\Empresa $empresa
	 *
	 * @return Comentario
	 */
	public function setEmpresa( \AppBundle\Entity\Empresa $empresa = null ) {
		$this->empresa = $empresa;

		return $this;
	}

	/**
	 * Get empresa
	 *
	 * @return \AppBundle\Entity\Empresa
	 */
	public function getEmpresa() {
		return $this->empresa;
	}

	/**
	 * Set publicacion
	 *
	 * @param \AppBundle\Entity\Publicacion $publicacion
	 *
	 * @return Comentario
	 */
	public function setPublicacion( \AppBundle\Entity\Publicacion $publicacion = null ) {
		$this->publicacion = $publicacion;

		return $this;
	}

	/**
	 * Get publicacion
	 *
	 * @return \AppBundle\Entity\Publicacion
	 */
	public function getPublicacion() {
		return $this->publicacion;
	}

	/**
	 * Set persona
	 *
	 * @param \AppBundle\Entity\Persona $persona
	 *
	 * @return Comentario
	 */
	public function setPersona( \AppBundle\Entity\Persona $persona ) {
		$this->persona = $persona;

		return $this;
	}

	/**
	 * Get persona
	 *
	 * @return \AppBundle\Entity\Persona
	 */
	public function getPersona() {
		return $this->persona;
	}

	/**
	 * Set creadoPor
	 *
	 * @param \UsuariosBundle\Entity\Usuario $creadoPor
	 *
	 * @return Comentario
	 */
	public function setCreadoPor( \UsuariosBundle\Entity\Usuario $creadoPor = null ) {
		$this->creadoPor = $creadoPor;

		return $this;
	}

	/**
	 * Set actualizadoPor
	 *
	 * @param \UsuariosBundle\Entity\Usuario $actualizadoPor
	 *
	 * @return Comentario
	 */
	public function setActualizadoPor( \UsuariosBundle\Entity\Usuario $actualizadoPor = null ) {
		$this->actualizadoPor = $actualizadoPor;

		return $this;
	}
}


text:
package com.microsoft.azure.management.appservice.implementation;

import org.joda.time.DateTime;
import java.util.List;
import com.microsoft.azure.management.appservice.UsageState;
import com.microsoft.azure.management.appservice.SiteAvailabilityState;
import com.microsoft.azure.management.appservice.HostNameSslState;
import com.microsoft.azure.management.appservice.HostingEnvironmentProfile;
import com.microsoft.azure.management.appservice.CloningInfo;
import com.microsoft.azure.management.appservice.SlotSwapStatus;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.microsoft.rest.serializer.JsonFlatten;
import com.microsoft.azure.Resource;

/**
 * A deleted app.
 */
@JsonFlatten
public class DeletedSiteInner extends Resource {
    /**
     * Time in UTC when the app was deleted.
     */
    @JsonProperty(value = "properties.deletedTimestamp", access = JsonProperty.Access.WRITE_ONLY)
    private DateTime deletedTimestamp;

    /**
     * Current state of the app.
     */
    @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY)
    private String state;

    /**
     * Hostnames associated with the app.
     */
    @JsonProperty(value = "properties.hostNames", access = JsonProperty.Access.WRITE_ONLY)
    private List<String> hostNames;

    /**
     * Name of the repository site.
     */
    @JsonProperty(value = "properties.repositorySiteName", access = JsonProperty.Access.WRITE_ONLY)
    private String repositorySiteName;

    /**
     * State indicating whether the app has exceeded its quota usage.
     * Read-only. Possible values include: 'Normal', 'Exceeded'.
     */
    @JsonProperty(value = "properties.usageState", access = JsonProperty.Access.WRITE_ONLY)
    private UsageState usageState;

    /**
     * true if the app is enabled; otherwise,
     * false. Setting this value to false disables the
     * app (takes the app offline).
     */
    @JsonProperty(value = "properties.enabled")
    private Boolean enabled;

    /**
     * Enabled hostnames for the app.Hostnames need to be assigned (see
     * HostNames) AND enabled. Otherwise,
     * the app is not served on those hostnames.
     */
    @JsonProperty(value = "properties.enabledHostNames", access = JsonProperty.Access.WRITE_ONLY)
    private List<String> enabledHostNames;

    /**
     * Management information availability state for the app. Possible values
     * include: 'Normal', 'Limited', 'DisasterRecoveryMode'.
     */
    @JsonProperty(value = "properties.availabilityState", access = JsonProperty.Access.WRITE_ONLY)
    private SiteAvailabilityState availabilityState;

    /**
     * Hostname SSL states are used to manage the SSL bindings for app's
     * hostnames.
     */
    @JsonProperty(value = "properties.hostNameSslStates")
    private List<HostNameSslState> hostNameSslStates;

    /**
     * Resource ID of the associated App Service plan, formatted as:
     * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}".
     */
    @JsonProperty(value = "properties.serverFarmId")
    private String serverFarmId;

    /**
     * true if reserved; otherwise,
     * false.
     */
    @JsonProperty(value = "properties.reserved")
    private Boolean reserved;

    /**
     * Last time the app was modified, in UTC. Read-only.
     */
    @JsonProperty(value = "properties.lastModifiedTimeUtc", access = JsonProperty.Access.WRITE_ONLY)
    private DateTime lastModifiedTimeUtc;

    /**
     * Configuration of the app.
     */
    @JsonProperty(value = "properties.siteConfig")
    private SiteConfigInner siteConfig;

    /**
     * Azure Traffic Manager hostnames associated with the app. Read-only.
     */
    @JsonProperty(value = "properties.trafficManagerHostNames", access = JsonProperty.Access.WRITE_ONLY)
    private List<String> trafficManagerHostNames;

    /**
     * Indicates whether app is deployed as a premium app.
     */
    @JsonProperty(value = "properties.premiumAppDeployed", access = JsonProperty.Access.WRITE_ONLY)
    private Boolean premiumAppDeployed;

    /**
     * true to stop SCM (KUDU) site when the app is
     * stopped; otherwise, false. The default is
     * false.
     */
    @JsonProperty(value = "properties.scmSiteAlsoStopped")
    private Boolean scmSiteAlsoStopped;

    /**
     * Specifies which deployment slot this app will swap into. Read-only.
     */
    @JsonProperty(value = "properties.targetSwapSlot", access = JsonProperty.Access.WRITE_ONLY)
    private String targetSwapSlot;

    /**
     * App Service Environment to use for the app.
     */
    @JsonProperty(value = "properties.hostingEnvironmentProfile")
    private HostingEnvironmentProfile hostingEnvironmentProfile;

    /**
     * Micro services like apps, logic apps.
     */
    @JsonProperty(value = "properties.microService")
    private String microService;

    /**
     * Name of gateway app associated with the app.
     */
    @JsonProperty(value = "properties.gatewaySiteName")
    private String gatewaySiteName;

    /**
     * true to enable client affinity;
     * false to stop sending session affinity cookies,
     * which route client requests in the same session to the same instance.
     * Default is true.
     */
    @JsonProperty(value = "properties.clientAffinityEnabled")
    private Boolean clientAffinityEnabled;

    /**
     * true to enable client certificate
     * authentication (TLS mutual authentication); otherwise,
     * false. Default is
     * false.
     */
    @JsonProperty(value = "properties.clientCertEnabled")
    private Boolean clientCertEnabled;

    /**
     * true to disable the public hostnames of the
     * app; otherwise, false.
     * If true, the app is only accessible via API
     * management process.
     */
    @JsonProperty(value = "properties.hostNamesDisabled")
    private Boolean hostNamesDisabled;

    /**
     * List of IP addresses that the app uses for outbound connections (e.g.
     * database access). Read-only.
     */
    @JsonProperty(value = "properties.outboundIpAddresses", access = JsonProperty.Access.WRITE_ONLY)
    private String outboundIpAddresses;

    /**
     * Size of the function container.
     */
    @JsonProperty(value = "properties.containerSize")
    private Integer containerSize;

    /**
     * Maximum allowed daily memory-time quota (applicable on dynamic apps
     * only).
     */
    @JsonProperty(value = "properties.dailyMemoryTimeQuota")
    private Integer dailyMemoryTimeQuota;

    /**
     * App suspended till in case memory-time quota is exceeded.
     */
    @JsonProperty(value = "properties.suspendedTill", access = JsonProperty.Access.WRITE_ONLY)
    private DateTime suspendedTill;

    /**
     * Maximum number of workers.
     * This only applies to Functions container.
     */
    @JsonProperty(value = "properties.maxNumberOfWorkers", access = JsonProperty.Access.WRITE_ONLY)
    private Integer maxNumberOfWorkers;

    /**
     * If specified during app creation, the app is cloned from a source app.
     */
    @JsonProperty(value = "properties.cloningInfo")
    private CloningInfo cloningInfo;

    /**
     * Name of the resource group the app belongs to. Read-only.
     */
    @JsonProperty(value = "properties.resourceGroup", access = JsonProperty.Access.WRITE_ONLY)
    private String resourceGroup;

    /**
     * true if the app is a default container;
     * otherwise, false.
     */
    @JsonProperty(value = "properties.isDefaultContainer", access = JsonProperty.Access.WRITE_ONLY)
    private Boolean isDefaultContainer;

    /**
     * Default hostname of the app. Read-only.
     */
    @JsonProperty(value = "properties.defaultHostName", access = JsonProperty.Access.WRITE_ONLY)
    private String defaultHostName;

    /**
     * Status of the last deployment slot swap operation.
     */
    @JsonProperty(value = "properties.slotSwapStatus", access = JsonProperty.Access.WRITE_ONLY)
    private SlotSwapStatus slotSwapStatus;

    /**
     * Get the deletedTimestamp value.
     *
     * @return the deletedTimestamp value
     */
    public DateTime deletedTimestamp() {
        return this.deletedTimestamp;
    }

    /**
     * Get the state value.
     *
     * @return the state value
     */
    public String state() {
        return this.state;
    }

    /**
     * Get the hostNames value.
     *
     * @return the hostNames value
     */
    public List<String> hostNames() {
        return this.hostNames;
    }

    /**
     * Get the repositorySiteName value.
     *
     * @return the repositorySiteName value
     */
    public String repositorySiteName() {
        return this.repositorySiteName;
    }

    /**
     * Get the usageState value.
     *
     * @return the usageState value
     */
    public UsageState usageState() {
        return this.usageState;
    }

    /**
     * Get the enabled value.
     *
     * @return the enabled value
     */
    public Boolean enabled() {
        return this.enabled;
    }

    /**
     * Set the enabled value.
     *
     * @param enabled the enabled value to set
     * @return the DeletedSiteInner object itself.
     */
    public DeletedSiteInner withEnabled(Boolean enabled) {
        this.enabled = enabled;
        return this;
    }

    /**
     * Get the enabledHostNames value.
     *
     * @return the enabledHostNames value
     */
    public List<String> enabledHostNames() {
        return this.enabledHostNames;
    }

    /**
     * Get the availabilityState value.
     *
     * @return the availabilityState value
     */
    public SiteAvailabilityState availabilityState() {
        return this.availabilityState;
    }

    /**
     * Get the hostNameSslStates value.
     *
     * @return the hostNameSslStates value
     */
    public List<HostNameSslState> hostNameSslStates() {
        return this.hostNameSslStates;
    }

    /**
     * Set the hostNameSslStates value.
     *
     * @param hostNameSslStates the hostNameSslStates value to set
     * @return the DeletedSiteInner object itself.
     */
    public DeletedSiteInner withHostNameSslStates(List<HostNameSslState> hostNameSslStates) {
        this.hostNameSslStates = hostNameSslStates;
        return this;
    }

    /**
     * Get the serverFarmId value.
     *
     * @return the serverFarmId value
     */
    public String serverFarmId() {
        return this.serverFarmId;
    }

    /**
     * Set the serverFarmId value.
     *
     * @param serverFarmId the serverFarmId value to set
     * @return the DeletedSiteInner object itself.
     */
    public DeletedSiteInner withServerFarmId(String serverFarmId) {
        this.serverFarmId = serverFarmId;
        return this;
    }

    /**
     * Get the reserved value.
     *
     * @return the reserved value
     */
    public Boolean reserved() {
        return this.reserved;
    }

    /**
     * Set the reserved value.
     *
     * @param reserved the reserved value to set
     * @return the DeletedSiteInner object itself.
     */
    public DeletedSiteInner withReserved(Boolean reserved) {
        this.reserved = reserved;
        return this;
    }

    /**
     * Get the lastModifiedTimeUtc value.
     *
     * @return the lastModifiedTimeUtc value
     */
    public DateTime lastModifiedTimeUtc() {
        return this.lastModifiedTimeUtc;
    }

    /**
     * Get the siteConfig value.
     *
     * @return the siteConfig value
     */
    public SiteConfigInner siteConfig() {
        return this.siteConfig;
    }

    /**
     * Set the siteConfig value.
     *
     * @param siteConfig the siteConfig value to set
     * @return the DeletedSiteInner object itself.
     */
    public DeletedSiteInner withSiteConfig(SiteConfigInner siteConfig) {
        this.siteConfig = siteConfig;
        return this;
    }

    /**
     * Get the trafficManagerHostNames value.
     *
     * @return the trafficManagerHostNames value
     */
    public List<String> trafficManagerHostNames() {
        return this.trafficManagerHostNames;
    }

    /**
     * Get the premiumAppDeployed value.
     *
     * @return the premiumAppDeployed value
     */
    public Boolean premiumAppDeployed() {
        return this.premiumAppDeployed;
    }

    /**
     * Get the scmSiteAlsoStopped value.
     *
     * @return the scmSiteAlsoStopped value
     */
    public Boolean scmSiteAlsoStopped() {
        return this.scmSiteAlsoStopped;
    }

    /**
     * Set the scmSiteAlsoStopped value.
     *
     * @param scmSiteAlsoStopped the scmSiteAlsoStopped value to set
     * @return the DeletedSiteInner object itself.
     */
    public DeletedSiteInner withScmSiteAlsoStopped(Boolean scmSiteAlsoStopped) {
        this.scmSiteAlsoStopped = scmSiteAlsoStopped;
        return this;
    }

    /**
     * Get the targetSwapSlot value.
     *
     * @return the targetSwapSlot value
     */
    public String targetSwapSlot() {
        return this.targetSwapSlot;
    }

    /**
     * Get the hostingEnvironmentProfile value.
     *
     * @return the hostingEnvironmentProfile value
     */
    public HostingEnvironmentProfile hostingEnvironmentProfile() {
        return this.hostingEnvironmentProfile;
    }

    /**
     * Set the hostingEnvironmentProfile value.
     *
     * @param hostingEnvironmentProfile the hostingEnvironmentProfile value to set
     * @return the DeletedSiteInner object itself.
     */
    public DeletedSiteInner withHostingEnvironmentProfile(HostingEnvironmentProfile hostingEnvironmentProfile) {
        this.hostingEnvironmentProfile = hostingEnvironmentProfile;
        return this;
    }

    /**
     * Get the microService value.
     *
     * @return the microService value
     */
    public String microService() {
        return this.microService;
    }

    /**
     * Set the microService value.
     *
     * @param microService the microService value to set
     * @return the DeletedSiteInner object itself.
     */
    public DeletedSiteInner withMicroService(String microService) {
        this.microService = microService;
        return this;
    }

    /**
     * Get the gatewaySiteName value.
     *
     * @return the gatewaySiteName value
     */
    public String gatewaySiteName() {
        return this.gatewaySiteName;
    }

    /**
     * Set the gatewaySiteName value.
     *
     * @param gatewaySiteName the gatewaySiteName value to set
     * @return the DeletedSiteInner object itself.
     */
    public DeletedSiteInner withGatewaySiteName(String gatewaySiteName) {
        this.gatewaySiteName = gatewaySiteName;
        return this;
    }

    /**
     * Get the clientAffinityEnabled value.
     *
     * @return the clientAffinityEnabled value
     */
    public Boolean clientAffinityEnabled() {
        return this.clientAffinityEnabled;
    }

    /**
     * Set the clientAffinityEnabled value.
     *
     * @param clientAffinityEnabled the clientAffinityEnabled value to set
     * @return the DeletedSiteInner object itself.
     */
    public DeletedSiteInner withClientAffinityEnabled(Boolean clientAffinityEnabled) {
        this.clientAffinityEnabled = clientAffinityEnabled;
        return this;
    }

    /**
     * Get the clientCertEnabled value.
     *
     * @return the clientCertEnabled value
     */
    public Boolean clientCertEnabled() {
        return this.clientCertEnabled;
    }

    /**
     * Set the clientCertEnabled value.
     *
     * @param clientCertEnabled the clientCertEnabled value to set
     * @return the DeletedSiteInner object itself.
     */
    public DeletedSiteInner withClientCertEnabled(Boolean clientCertEnabled) {
        this.clientCertEnabled = clientCertEnabled;
        return this;
    }

    /**
     * Get the hostNamesDisabled value.
     *
     * @return the hostNamesDisabled value
     */
    public Boolean hostNamesDisabled() {
        return this.hostNamesDisabled;
    }

    /**
     * Set the hostNamesDisabled value.
     *
     * @param hostNamesDisabled the hostNamesDisabled value to set
     * @return the DeletedSiteInner object itself.
     */
    public DeletedSiteInner withHostNamesDisabled(Boolean hostNamesDisabled) {
        this.hostNamesDisabled = hostNamesDisabled;
        return this;
    }

    /**
     * Get the outboundIpAddresses value.
     *
     * @return the outboundIpAddresses value
     */
    public String outboundIpAddresses() {
        return this.outboundIpAddresses;
    }

    /**
     * Get the containerSize value.
     *
     * @return the containerSize value
     */
    public Integer containerSize() {
        return this.containerSize;
    }

    /**
     * Set the containerSize value.
     *
     * @param containerSize the containerSize value to set
     * @return the DeletedSiteInner object itself.
     */
    public DeletedSiteInner withContainerSize(Integer containerSize) {
        this.containerSize = containerSize;
        return this;
    }

    /**
     * Get the dailyMemoryTimeQuota value.
     *
     * @return the dailyMemoryTimeQuota value
     */
    public Integer dailyMemoryTimeQuota() {
        return this.dailyMemoryTimeQuota;
    }

    /**
     * Set the dailyMemoryTimeQuota value.
     *
     * @param dailyMemoryTimeQuota the dailyMemoryTimeQuota value to set
     * @return the DeletedSiteInner object itself.
     */
    public DeletedSiteInner withDailyMemoryTimeQuota(Integer dailyMemoryTimeQuota) {
        this.dailyMemoryTimeQuota = dailyMemoryTimeQuota;
        return this;
    }

    /**
     * Get the suspendedTill value.
     *
     * @return the suspendedTill value
     */
    public DateTime suspendedTill() {
        return this.suspendedTill;
    }

    /**
     * Get the maxNumberOfWorkers value.
     *
     * @return the maxNumberOfWorkers value
     */
    public Integer maxNumberOfWorkers() {
        return this.maxNumberOfWorkers;
    }

    /**
     * Get the cloningInfo value.
     *
     * @return the cloningInfo value
     */
    public CloningInfo cloningInfo() {
        return this.cloningInfo;
    }

    /**
     * Set the cloningInfo value.
     *
     * @param cloningInfo the cloningInfo value to set
     * @return the DeletedSiteInner object itself.
     */
    public DeletedSiteInner withCloningInfo(CloningInfo cloningInfo) {
        this.cloningInfo = cloningInfo;
        return this;
    }

    /**
     * Get the resourceGroup value.
     *
     * @return the resourceGroup value
     */
    public String resourceGroup() {
        return this.resourceGroup;
    }

    /**
     * Get the isDefaultContainer value.
     *
     * @return the isDefaultContainer value
     */
    public Boolean isDefaultContainer() {
        return this.isDefaultContainer;
    }

    /**
     * Get the defaultHostName value.
     *
     * @return the defaultHostName value
     */
    public String defaultHostName() {
        return this.defaultHostName;
    }

    /**
     * Get the slotSwapStatus value.
     *
     * @return the slotSwapStatus value
     */
    public SlotSwapStatus slotSwapStatus() {
        return this.slotSwapStatus;
    }

}


text:
'use strict';

var
  DownloadError = require('../../../lib/error/errors').DownloadError,
  WriteError = require('../../../lib/error/errors').WriteError,
  ExtractionError = require('../../../lib/error/errors').ExtractionError;

describe('errorHandler', function () {

  var underTest = require('../../../lib/error/errorHandler');

  it('should be defined', function () {
    expect(underTest).toBeDefined();
  });

  it('should throw a DownloadError', function () {
    var thrownError = {message: 'any error', statusCode: 401};
    try {
      underTest.handleDownloadError(thrownError);
    } catch(err) {
      expect(err).toEqual(jasmine.any(DownloadError));
    }
  });

  it('should throw a WriteError', function () {
    var thrownError = {message: 'any error', statusCode: 500};
    try {
      underTest.handleWriteError(thrownError);
    } catch(err) {
      expect(err).toEqual(jasmine.any(WriteError));
    }
  });

  it('should throw a ExtractionError', function () {
    var thrownError = {message: 'any error', statusCode: 500};
    try {
      underTest.handleExtractionError(thrownError);
    } catch(err) {
      expect(err).toEqual(jasmine.any(ExtractionError));
    }
  });

  it('should throw original WriteError', function () {
    var thrownError = new WriteError();
    try {
      underTest.handleDownloadError(thrownError);
    } catch(err) {
      expect(err).toBe(thrownError);
    }
  });
})
;


text:
"""Registry for serializable objects."""
from __future__ import absolute_import

import json
import warnings

from .base import string_types

_REGISTRY = {}

def get_registry(base_class):
    """Get a copy of the registry.

    Parameters
    ----------
    base_class : type
        base class for classes that will be registered.

    Returns
    -------
    a registrator
    """
    if base_class not in _REGISTRY:
        _REGISTRY[base_class] = {}
    return _REGISTRY[base_class].copy()

def get_register_func(base_class, nickname):
    """Get registrator function.

    Parameters
    ----------
    base_class : type
        base class for classes that will be reigstered
    nickname : str
        nickname of base_class for logging

    Returns
    -------
    a registrator function
    """
    if base_class not in _REGISTRY:
        _REGISTRY[base_class] = {}
    registry = _REGISTRY[base_class]

    def register(klass, name=None):
        """Register functions"""
        assert issubclass(klass, base_class), \
            "Can only register subclass of %s"%base_class.__name__
        if name is None:
            name = klass.__name__.lower()
        if name in registry:
            warnings.warn(
                "\033[91mNew %s %s.%s registered with name %s is"
                "overriding existing %s %s.%s\033[0m"%(
                    nickname, klass.__module__, klass.__name__, name,
                    nickname, registry[name].__module__, registry[name].__name__),
                UserWarning, stacklevel=2)
        registry[name] = klass
        return klass

    register.__doc__ = "Register %s to the %s factory"%(nickname, nickname)
    return register

def get_alias_func(base_class, nickname):
    """Get registrator function that allow aliases.

    Parameters
    ----------
    base_class : type
        base class for classes that will be reigstered
    nickname : str
        nickname of base_class for logging

    Returns
    -------
    a registrator function
    """
    register = get_register_func(base_class, nickname)

    def alias(*aliases):
        """alias registrator"""
        def reg(klass):
            """registrator function"""
            for name in aliases:
                register(klass, name)
            return klass
        return reg
    return alias

def get_create_func(base_class, nickname):
    """Get creator function

    Parameters
    ----------
    base_class : type
        base class for classes that will be reigstered
    nickname : str
        nickname of base_class for logging

    Returns
    -------
    a creator function
    """
    if base_class not in _REGISTRY:
        _REGISTRY[base_class] = {}
    registry = _REGISTRY[base_class]

    def create(*args, **kwargs):
        """Create instance from config"""
        if len(args):
            name = args[0]
            args = args[1:]
        else:
            name = kwargs.pop(nickname)

        if isinstance(name, base_class):
            assert len(args) == 0 and len(kwargs) == 0, \
                "%s is already an instance. Additional arguments are invalid"%(nickname)
            return name

        if isinstance(name, dict):
            return create(**name)

        assert isinstance(name, string_types), "%s must be of string type"%nickname

        if name.startswith('['):
            assert not args and not kwargs
            name, kwargs = json.loads(name)
            return create(name, **kwargs)
        elif name.startswith('{'):
            assert not args and not kwargs
            kwargs = json.loads(name)
            return create(**kwargs)

        name = name.lower()
        assert name in registry, \
            "%s is not registered. Please register with %s.register first"%(
                str(name), nickname)
        return registry[name](*args, **kwargs)

    create.__doc__ = """Create a %s instance from config.

Parameters
----------
%s : str or %s instance
    class name of desired instance. If is a instance,
    it will be returned directly.
**kwargs : dict
    arguments to be passed to constructor"""%(nickname, nickname, base_class.__name__)

    return create


text:
namespace te
{
    CommandComponent::CommandComponent(std::size_t capacity)
        : Component(capacity) {}

    void CommandComponent::setTypeMask(const Entity& entity, CommandMask typeMask)
    {
        if (!hasInstance(entity)) {
            createInstance(entity, { typeMask });
        } else {
            at(entity) = { typeMask };
        }
    }

}


text:
package org.firstopen.singularity.ale.dao;

import java.util.List;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.firstopen.singularity.ale.ECSpec;
import org.firstopen.singularity.util.DAOUtil;
import org.firstopen.singularity.util.DAOUtilFactory;
import org.firstopen.singularity.util.InfrastructureException;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.criterion.Example;

/**
 * @author Tom Rose (tom.rose@i-konect.com)
 *
 */
public class ECSpecDAOImpl implements ECSpecDAO {

    Log log = LogFactory.getLog(this.getClass());

    DAOUtil DAOUtil = null;

    /**
     * @throws InfrastructureException
     *
     */
    public ECSpecDAOImpl() throws InfrastructureException {
        super();
        DAOUtil = DAOUtilFactory
                .create(DAOUtil.hibernateALEJNDIName);
        try {
            DAOUtil.beginTransaction();

        } catch (HibernateException e) {
            log.error("query failed");
            throw new InfrastructureException(e);
        }
    }

    public ECSpec get(String id) throws InfrastructureException {
        ECSpec ecSpec = null;
        try {

            Session session = DAOUtil.getSession();

            ecSpec = (ECSpec) session.load(ECSpec.class, id);

            if (ecSpec == null)
                throw new InfrastructureException("unable to find ecSpec");
        } catch (HibernateException e) {
            log.error("query failed");
            throw new InfrastructureException(e);
        }
        return ecSpec;
    }

    public List findECSpecByAttrName(Map attributeValueMap) {
        // TODO Auto-generated method stub
        return null;
    }

    @SuppressWarnings("unchecked")
    public List<ECSpec> getAll() throws InfrastructureException {
        List<ECSpec> ecSpecs = null;
        Session session = null;
        try {
            session = DAOUtil.getSession();
            ecSpecs = session.createQuery("from ECSpec").list();

        } catch (HibernateException e) {
            log.error("query failed");
            throw new InfrastructureException(e);
        }
        return ecSpecs;
    }

    public void update(ECSpec ecSpec) throws InfrastructureException {

        Session session = null;

        try {
            session = DAOUtil.getSession();
            session.saveOrUpdate(ecSpec);

        } catch (HibernateException e) {
            log.error("unable to update or save ECSpec");
            throw new InfrastructureException(e);
        }

    }

    public void create(ECSpec ecSpec) throws InfrastructureException {
        Session session = null;
        try {
            session = DAOUtil.getSession();
            session.save(ecSpec);

        } catch (HibernateException e) {
            log.error("unable to creaete ECSpec", e);
            throw new InfrastructureException(e);
        }

    }

    public boolean exists(ECSpec ECSpec) throws InfrastructureException {

        boolean found = false;

        if (get(ECSpec) != null) {
            found = true;
        }

        return found;
    }

    public ECSpec get(ECSpec ecSpec) throws InfrastructureException {
        ECSpec resultEvent = null;

        List result = getList(ecSpec);
        if (result != null) {
            if (result.size() > 0) {
                resultEvent = (ECSpec) result.get(0);
            }
        }
        return resultEvent;
    }

    @SuppressWarnings("unchecked")
    public List<ECSpec> getList(ECSpec ecSpec) throws InfrastructureException {
        Session session = null;
        List<ECSpec> result = null;

        try {
            session = DAOUtil.getSession();

            Criteria criteria = session.createCriteria(ECSpec.class);
            result = criteria.add(
                    Example.create(ecSpec).enableLike().excludeZeroes()).list();
        } catch (HibernateException e) {
            log.error("unable to update or save ECSpec");
            throw new InfrastructureException(e);

        }
        return result;

    }

    /**
     * @return Returns the DAOUtil.
     */
    public DAOUtil getDAOUtil() {
        return DAOUtil;
    }

    /**
     * @param DAOUtil
     *            The DAOUtil to set.
     */
    public void setDAOUtil(DAOUtil DAOUtil) {
        this.DAOUtil = DAOUtil;
    }

    /*
     * (non-Javadoc)
     *
     * @see org.firstopen.singularity.ale.dao.ECSpecDAO#findByAttrName(java.util.Map)
     */
    public List findByAttrName(Map attributeValueMap) {
        // TODO Auto-generated method stub
        return null;
    }

    /*
     * (non-Javadoc)
     *
     * @see org.firstopen.singularity.ale.dao.ECSpecDAO#delete(org.firstopen.singularity.ale.ECSpec)
     */
    public void delete(ECSpec ecSpec) throws InfrastructureException {
        Session session = null;
        try {
            session = DAOUtil.getSession();
            session.delete(ecSpec);

        } catch (HibernateException e) {
            log.error("unable to update or save ECSpec");
            throw new InfrastructureException(e);

        }
    } // end delete

}// end class ECSpecDAOImpl


text:
WhatsappChatBackup
==================


text: package gomniauth


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Lonchocarpus stipularis C.T.White

### Remarks
null


text:
package exporterhelper

import (
	"context"

	"go.opencensus.io/trace"

	"github.com/census-instrumentation/opencensus-service/data"
	"github.com/census-instrumentation/opencensus-service/exporter"
	"github.com/census-instrumentation/opencensus-service/observability"
)

// PushTraceData is a helper function that is similar to ConsumeTraceData but also returns
// the number of dropped spans.
type PushTraceData func(ctx context.Context, td data.TraceData) (droppedSpans int, err error)

type traceExporter struct {
	exporterFormat string
	pushTraceData  PushTraceData
}

var _ (exporter.TraceExporter) = (*traceExporter)(nil)

func (te *traceExporter) ConsumeTraceData(ctx context.Context, td data.TraceData) error {
	exporterCtx := observability.ContextWithExporterName(ctx, te.exporterFormat)
	_, err := te.pushTraceData(exporterCtx, td)
	return err
}

func (te *traceExporter) TraceExportFormat() string {
	return te.exporterFormat
}

// NewTraceExporter creates an TraceExporter that can record metrics and can wrap every request with a Span.
// If no options are passed it just adds the exporter format as a tag in the Context.
// TODO: Add support for retries.
func NewTraceExporter(exporterFormat string, pushTraceData PushTraceData, options ...ExporterOption) (exporter.TraceExporter, error) {
	if exporterFormat == "" {
		return nil, errEmptyExporterFormat
	}

	if pushTraceData == nil {
		return nil, errNilPushTraceData
	}

	opts := newExporterOptions(options...)

	if opts.spanName != "" {
		pushTraceData = pushTraceDataWithSpan(pushTraceData, opts.spanName)
	}

	return &traceExporter{
		exporterFormat: exporterFormat,
		pushTraceData:  pushTraceData,
	}, nil
}

func pushTraceDataWithSpan(next PushTraceData, spanName string) PushTraceData {
	return func(ctx context.Context, td data.TraceData) (int, error) {
		ctx, span := trace.StartSpan(ctx, spanName)
		defer span.End()
		// Call next stage.
		droppedSpans, err := next(ctx, td)
		if span.IsRecordingEvents() {
			span.AddAttributes(
				trace.Int64Attribute(numReceivedSpansAttribute, int64(len(td.Spans))),
				trace.Int64Attribute(numDroppedSpansAttribute, int64(droppedSpans)),
			)
			if err != nil {
				span.SetStatus(errToStatus(err))
			}
		}
		return droppedSpans, err
	}
}


text:
try:
    # Python 3.8+
    import importlib.metadata as importlib_metadata
except ImportError:
    # <Python 3.7 and lower
    import importlib_metadata

__version__ = importlib_metadata.version("django-push-notifications")


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.contentwarehouse.v1.model;

/**
 * Policies controlling the logging.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the contentwarehouse API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class KnowledgeAnswersSensitivityLoggingPolicy extends com.google.api.client.json.GenericJson {

  /**
   * The contents of the argument value should be scrubbed before being written to logs.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean scrubArgumentValue;

  /**
   * If this is set to true, this Sensitivity's presence will result in QRewrite to enable AS
   * logging to scrub any discourse context.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Boolean scrubContext;

  /**
   * The contents of the argument value should be scrubbed before being written to logs.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getScrubArgumentValue() {
    return scrubArgumentValue;
  }

  /**
   * The contents of the argument value should be scrubbed before being written to logs.
   * @param scrubArgumentValue scrubArgumentValue or {@code null} for none
   */
  public KnowledgeAnswersSensitivityLoggingPolicy setScrubArgumentValue(java.lang.Boolean scrubArgumentValue) {
    this.scrubArgumentValue = scrubArgumentValue;
    return this;
  }

  /**
   * If this is set to true, this Sensitivity's presence will result in QRewrite to enable AS
   * logging to scrub any discourse context.
   * @return value or {@code null} for none
   */
  public java.lang.Boolean getScrubContext() {
    return scrubContext;
  }

  /**
   * If this is set to true, this Sensitivity's presence will result in QRewrite to enable AS
   * logging to scrub any discourse context.
   * @param scrubContext scrubContext or {@code null} for none
   */
  public KnowledgeAnswersSensitivityLoggingPolicy setScrubContext(java.lang.Boolean scrubContext) {
    this.scrubContext = scrubContext;
    return this;
  }

  @Override
  public KnowledgeAnswersSensitivityLoggingPolicy set(String fieldName, Object value) {
    return (KnowledgeAnswersSensitivityLoggingPolicy) super.set(fieldName, value);
  }

  @Override
  public KnowledgeAnswersSensitivityLoggingPolicy clone() {
    return (KnowledgeAnswersSensitivityLoggingPolicy) super.clone();
  }

}


text:
namespace mx
{
    namespace api
    {
        enum class AppearanceType
        {
            /// The line-width-type defines what type of line is being defined
            /// in a line-width element. Values include beam, bracket, dashes,
            /// enclosure, ending, extend, heavy barline, leger, light barline,
            /// octave shift, pedal, slur middle, slur tip, staff, stem, tie middle,
            /// tie tip, tuplet bracket, and wedge. This is left as a string so that
            /// other application-specific types can be defined, but it is made a
            /// separate type so that it can be redefined more strictly.
            LineWidth,

            /// The note-size-type type indicates the type of note being defined
            /// by a note-size element. The grace type is used for notes of cue
            /// size that that include a grace element. The cue type is used for
            /// all other notes with cue size, whether defined explicitly or
            /// implicitly via a cue element. The large type is used for notes of
            /// large size.
            NoteSize,

            /// The distance-type defines what type of distance is being defined
            /// in a distance element. Values include beam and hyphen. This is
            /// left as a string so that other application-specific types can be
            /// defined, but it is made a separate type so that it can be redefined
            /// more strictly.
            Distance,

            /// Anything goes
            OtherAppearance,
        };

        class AppearanceData
        {
        public:
            AppearanceData();

        public:
            AppearanceType appearanceType;
            std::string appearanceSubType;
            long double value;
        };

        MXAPI_EQUALS_BEGIN( AppearanceData )
        MXAPI_EQUALS_MEMBER( appearanceType )
        MXAPI_EQUALS_MEMBER( appearanceSubType )
        MXAPI_EQUALS_MEMBER( value )
        MXAPI_EQUALS_END;
        MXAPI_NOT_EQUALS_AND_VECTORS( AppearanceData );

    }
}