text:
namespace {

// Note that settings.html contains a <script> tag which imports a script of
// the following name. These names must be kept in sync.
const char kLocalizedStringsFile[] = "strings.js";

void AddCommonStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString("basicPageTitle", IDS_SETTINGS_BASIC);
  html_source->AddLocalizedString("advancedPageTitle", IDS_SETTINGS_ADVANCED);
  html_source->AddLocalizedString("addLabel", IDS_ADD);
  html_source->AddLocalizedString("learnMore", IDS_LEARN_MORE);
  html_source->AddLocalizedString("cancel", IDS_CANCEL);
}

#if defined(OS_CHROMEOS)
void AddA11yStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString(
      "a11yPageTitle", IDS_SETTINGS_ACCESSIBILITY);
  html_source->AddLocalizedString(
      "moreFeaturesLink", IDS_SETTINGS_MORE_FEATURES_LINK);
  html_source->AddLocalizedString(
      "optionsInMenuLabel", IDS_SETTINGS_OPTIONS_IN_MENU_LABEL);
  html_source->AddLocalizedString(
      "largeMouseCursorLabel", IDS_SETTINGS_LARGE_MOUSE_CURSOR_LABEL);
  html_source->AddLocalizedString(
      "highContrastLabel", IDS_SETTINGS_HIGH_CONTRAST_LABEL);
  html_source->AddLocalizedString(
      "stickyKeysLabel", IDS_SETTINGS_STICKY_KEYS_LABEL);
  html_source->AddLocalizedString(
      "chromeVoxLabel", IDS_SETTINGS_CHROMEVOX_LABEL);
  html_source->AddLocalizedString(
      "screenMagnifierLabel", IDS_SETTINGS_SCREEN_MAGNIFIER_LABEL);
  html_source->AddLocalizedString(
      "tapDraggingLabel", IDS_SETTINGS_TAP_DRAGGING_LABEL);
  html_source->AddLocalizedString(
      "clickOnStopLabel", IDS_SETTINGS_CLICK_ON_STOP_LABEL);
  html_source->AddLocalizedString(
      "delayBeforeClickLabel", IDS_SETTINGS_DELAY_BEFORE_CLICK_LABEL);
  html_source->AddLocalizedString(
      "delayBeforeClickExtremelyShort",
      IDS_SETTINGS_DELAY_BEFORE_CLICK_EXTREMELY_SHORT);
  html_source->AddLocalizedString(
      "delayBeforeClickVeryShort", IDS_SETTINGS_DELAY_BEFORE_CLICK_VERY_SHORT);
  html_source->AddLocalizedString(
      "delayBeforeClickShort", IDS_SETTINGS_DELAY_BEFORE_CLICK_SHORT);
  html_source->AddLocalizedString(
      "delayBeforeClickLong", IDS_SETTINGS_DELAY_BEFORE_CLICK_LONG);
  html_source->AddLocalizedString(
      "delayBeforeClickVeryLong", IDS_SETTINGS_DELAY_BEFORE_CLICK_VERY_LONG);
  html_source->AddLocalizedString(
      "onScreenKeyboardLabel", IDS_SETTINGS_ON_SCREEN_KEYBOARD_LABEL);
  html_source->AddLocalizedString(
      "a11yExplanation", IDS_SETTINGS_ACCESSIBILITY_EXPLANATION);
  html_source->AddString(
      "a11yLearnMoreUrl", chrome::kChromeAccessibilityHelpURL);
}
#endif

#if defined(OS_CHROMEOS)
void AddAccountUITweaksStrings(content::WebUIDataSource* html_source,
                               Profile* profile) {
  base::DictionaryValue localized_values;
  chromeos::AddAccountUITweaksLocalizedValues(&localized_values, profile);
  html_source->AddLocalizedStrings(localized_values);
}
#endif

void AddAppearanceStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString(
      "appearancePageTitle", IDS_SETTINGS_APPEARANCE);
  html_source->AddLocalizedString(
      "setWallpaper", IDS_SETTINGS_SET_WALLPAPER);
  html_source->AddLocalizedString(
      "getThemes", IDS_SETTINGS_THEMES);
  html_source->AddLocalizedString(
      "resetToDefaultTheme", IDS_SETTINGS_RESET_TO_DEFAULT_THEME);
  html_source->AddLocalizedString(
      "showHomeButton", IDS_SETTINGS_SHOW_HOME_BUTTON);
  html_source->AddLocalizedString(
      "showBookmarksBar", IDS_SETTINGS_SHOW_BOOKMARKS_BAR);
  html_source->AddLocalizedString(
      "homePageNtp", IDS_SETTINGS_HOME_PAGE_NTP);
  html_source->AddLocalizedString(
      "openThisPage", IDS_SETTINGS_OPEN_THIS_PAGE);
  html_source->AddLocalizedString(
      "changeHomePage", IDS_SETTINGS_CHANGE_HOME_PAGE);
  html_source->AddLocalizedString(
      "themesGalleryUrl", IDS_THEMES_GALLERY_URL);
  html_source->AddLocalizedString(
      "chooseFromWebStore", IDS_SETTINGS_WEB_STORE);
}

#if defined(OS_CHROMEOS)
void AddBluetoothStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString(
      "bluetoothPageTitle", IDS_SETTINGS_BLUETOOTH);
  html_source->AddLocalizedString(
      "enableBluetooth", IDS_SETTINGS_BLUETOOTH_ENABLE);
}
#endif

void AddCertificateManagerStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString("certificateManagerPageTitle",
                                  IDS_SETTINGS_CERTIFICATE_MANAGER);
  html_source->AddLocalizedString(
      "certificateManagerYourCertificates",
      IDS_SETTINGS_CERTIFICATE_MANAGER_YOUR_CERTIFICATES);
  html_source->AddLocalizedString(
      "certificateManagerYourCertificatesSubtitle",
      IDS_SETTINGS_CERTIFICATE_MANAGER_YOU_HAVE_CERTIFICATES);
  html_source->AddLocalizedString("certificateManagerServers",
                                  IDS_SETTINGS_CERTIFICATE_MANAGER_SERVERS);
  html_source->AddLocalizedString(
      "certificateManagerServersSubtitle",
      IDS_SETTINGS_CERTIFICATE_MANAGER_SERVERS_IDENTIFY);
  html_source->AddLocalizedString("certificateManagerAuthorities",
                                  IDS_SETTINGS_CERTIFICATE_MANAGER_AUTHORITIES);
  html_source->AddLocalizedString(
      "certificateManagerAuthoritiesSubtitle",
      IDS_SETTINGS_CERTIFICATE_MANAGER_AUTHORITIES_YOU_HAVE_AUTHORITIES);
  html_source->AddLocalizedString("certificateManagerOthers",
                                  IDS_SETTINGS_CERTIFICATE_MANAGER_OTHERS);
  html_source->AddLocalizedString(
      "certificateManagerOthersSubtitle",
      IDS_SETTINGS_CERTIFICATE_MANAGER_OTHERS_YOU_HAVE_OTHERS);
  html_source->AddLocalizedString("certificateManagerView",
                                  IDS_SETTINGS_CERTIFICATE_MANAGER_VIEW);
  html_source->AddLocalizedString("certificateManagerImport",
                                  IDS_SETTINGS_CERTIFICATE_MANAGER_IMPORT);
  html_source->AddLocalizedString(
      "certificateManagerImportAndBind",
      IDS_SETTINGS_CERTIFICATE_MANAGER_IMPORT_AND_BIND);
  html_source->AddLocalizedString("certificateManagerExport",
                                  IDS_SETTINGS_CERTIFICATE_MANAGER_EXPORT);
  html_source->AddLocalizedString("certificateManagerDelete",
                                  IDS_SETTINGS_CERTIFICATE_MANAGER_DELETE);
  html_source->AddLocalizedString("certificateManagerDone",
                                  IDS_SETTINGS_CERTIFICATE_MANAGER_DONE);
}

void AddClearBrowsingDataStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString("clearFollowingItemsFrom",
                                  IDS_SETTINGS_CLEAR_FOLLOWING_ITEMS_FROM);
  html_source->AddLocalizedString("clearBrowsingHistory",
                                  IDS_SETTINGS_CLEAR_BROWSING_HISTORY);
  html_source->AddLocalizedString("clearDownloadHistory",
                                  IDS_SETTINGS_CLEAR_DOWNLOAD_HISTORY);
  html_source->AddLocalizedString("clearCache",
                                  IDS_SETTINGS_CLEAR_CACHE);
  html_source->AddLocalizedString("clearCookies",
                                  IDS_SETTINGS_CLEAR_COOKIES);
  html_source->AddLocalizedString("clearCookiesFlash",
                                  IDS_SETTINGS_CLEAR_COOKIES_FLASH);
  html_source->AddLocalizedString("clearPasswords",
                                  IDS_SETTINGS_CLEAR_PASSWORDS);
  html_source->AddLocalizedString("clearFormData",
                                  IDS_SETTINGS_CLEAR_FORM_DATA);
  html_source->AddLocalizedString("clearHostedAppData",
                                  IDS_SETTINGS_CLEAR_HOSTED_APP_DATA);
  html_source->AddLocalizedString("clearDeauthorizeContentLicenses",
                                  IDS_SETTINGS_DEAUTHORIZE_CONTENT_LICENSES);
  html_source->AddLocalizedString("clearDataHour",
                                  IDS_SETTINGS_CLEAR_DATA_HOUR);
  html_source->AddLocalizedString("clearDataDay",
                                  IDS_SETTINGS_CLEAR_DATA_DAY);
  html_source->AddLocalizedString("clearDataWeek",
                                  IDS_SETTINGS_CLEAR_DATA_WEEK);
  html_source->AddLocalizedString("clearData4Weeks",
                                  IDS_SETTINGS_CLEAR_DATA_4WEEKS);
  html_source->AddLocalizedString("clearDataEverything",
                                  IDS_SETTINGS_CLEAR_DATA_EVERYTHING);
}

#if !defined(OS_CHROMEOS)
void AddDefaultBrowserStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString(
      "defaultBrowser", IDS_SETTINGS_DEFAULT_BROWSER);
  html_source->AddLocalizedString(
      "defaultBrowserDefault", IDS_SETTINGS_DEFAULT_BROWSER_DEFAULT);
  html_source->AddLocalizedString(
      "defaultBrowserNotDefault", IDS_SETTINGS_DEFAULT_BROWSER_NOT_DEFAULT);
  html_source->AddLocalizedString(
      "defaultBrowserMakeDefault", IDS_SETTINGS_DEFAULT_BROWSER_MAKE_DEFAULT);
  html_source->AddLocalizedString(
      "defaultBrowserUnknown", IDS_SETTINGS_DEFAULT_BROWSER_UNKNOWN);
  html_source->AddLocalizedString(
      "defaultBrowserSecondary", IDS_SETTINGS_DEFAULT_BROWSER_SECONDARY);
  html_source->AddLocalizedString(
      "unableToSetDefaultBrowser", IDS_SETTINGS_DEFAULT_BROWSER_ERROR);
}
#endif

void AddDownloadsStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString(
      "downloadsPageTitle", IDS_SETTINGS_DOWNLOADS);
  html_source->AddLocalizedString(
      "downloadLocation", IDS_SETTINGS_DOWNLOAD_LOCATION);
  html_source->AddLocalizedString(
      "changeDownloadLocation", IDS_SETTINGS_CHANGE_DOWNLOAD_LOCATION);
  html_source->AddLocalizedString(
      "promptForDownload", IDS_SETTINGS_PROMPT_FOR_DOWNLOAD);
}

void AddResetStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString(
      "resetPageTitle", IDS_RESET_PROFILE_SETTINGS_SECTION_TITLE);
  html_source->AddLocalizedString(
      "resetPageDescription", IDS_RESET_PROFILE_SETTINGS_DESCRIPTION);
  html_source->AddLocalizedString(
      "resetPageExplanation", IDS_RESET_PROFILE_SETTINGS_EXPLANATION);
  html_source->AddLocalizedString(
      "resetPageCommit", IDS_RESET_PROFILE_SETTINGS_COMMIT_BUTTON);
  html_source->AddLocalizedString(
      "resetPageFeedback", IDS_RESET_PROFILE_SETTINGS_FEEDBACK);
  html_source->AddString(
      "resetPageLearnMoreUrl",
      chrome::kResetProfileSettingsLearnMoreURL);

#if defined(OS_CHROMEOS)
  html_source->AddLocalizedString(
      "powerwashTitle", IDS_OPTIONS_FACTORY_RESET);
  html_source->AddString(
      "powerwashDescription",
      l10n_util::GetStringFUTF16(
          IDS_OPTIONS_FACTORY_RESET_DESCRIPTION,
          l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)));
  html_source->AddLocalizedString(
      "powerwashDialogTitle", IDS_OPTIONS_FACTORY_RESET_HEADING);
  html_source->AddLocalizedString(
      "powerwashDialogBody", IDS_OPTIONS_FACTORY_RESET_WARNING);
  html_source->AddLocalizedString(
      "powerwashDialogButton", IDS_RELAUNCH_BUTTON);
  html_source->AddLocalizedString(
      "powerwashLearnMoreUrl", IDS_FACTORY_RESET_HELP_URL);
#endif
}

void AddDateTimeStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString(
      "dateTimePageTitle", IDS_SETTINGS_DATE_TIME);
  html_source->AddLocalizedString(
      "timeZone", IDS_SETTINGS_TIME_ZONE);
  html_source->AddLocalizedString(
      "use24HourClock", IDS_SETTINGS_USE_24_HOUR_CLOCK);
  html_source->AddLocalizedString(
      "dateTimeSetAutomatically", IDS_SETTINGS_DATE_TIME_SET_AUTOMATICALLY);
}

#if defined(OS_CHROMEOS)
void AddInternetStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString(
      "internetPageTitle", IDS_SETTINGS_INTERNET);
  html_source->AddLocalizedString(
      "internetDetailPageTitle", IDS_SETTINGS_INTERNET_DETAIL);
  html_source->AddLocalizedString("internetKnownNetworksPageTitle",
                                  IDS_SETTINGS_INTERNET_KNOWN_NETWORKS);

  // Required by cr_network_list_item.js. TODO(stevenjb): Add to
  // settings_strings.grdp or provide an alternative translation method.
  // crbug.com/512214.
  html_source->AddLocalizedString("networkConnected",
                                  IDS_ASH_STATUS_TRAY_NETWORK_CONNECTED);
  html_source->AddLocalizedString("networkConnecting",
                                  IDS_ASH_STATUS_TRAY_NETWORK_CONNECTING);
  html_source->AddLocalizedString("networkDisabled",
                                  IDS_OPTIONS_SETTINGS_NETWORK_DISABLED);
  html_source->AddLocalizedString("networkNotConnected",
                                  IDS_ASH_STATUS_TRAY_NETWORK_NOT_CONNECTED);
  html_source->AddLocalizedString("OncTypeCellular", IDS_NETWORK_TYPE_CELLULAR);
  html_source->AddLocalizedString("OncTypeEthernet", IDS_NETWORK_TYPE_ETHERNET);
  html_source->AddLocalizedString("OncTypeVPN", IDS_NETWORK_TYPE_VPN);
  html_source->AddLocalizedString("OncTypeWiFi", IDS_NETWORK_TYPE_WIFI);
  html_source->AddLocalizedString("OncTypeWimax", IDS_NETWORK_TYPE_WIMAX);
  html_source->AddLocalizedString(
      "vpnNameTemplate",
      IDS_OPTIONS_SETTINGS_SECTION_THIRD_PARTY_VPN_NAME_TEMPLATE);
}
#endif

void AddLanguagesStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString(
      "languagesPageTitle", IDS_SETTINGS_LANGUAGES_PAGE_TITLE);
  html_source->AddLocalizedString(
      "languagesListTitle", IDS_SETTINGS_LANGUAGES_LANGUAGES_LIST_TITLE);
  html_source->AddLocalizedString(
      "manageLanguages", IDS_SETTINGS_LANGUAGES_LANGUAGES_MANAGE);
  html_source->AddLocalizedString(
      "inputMethodsListTitle", IDS_SETTINGS_LANGUAGES_INPUT_METHODS_LIST_TITLE);
  html_source->AddLocalizedString(
      "manageInputMethods", IDS_SETTINGS_LANGUAGES_INPUT_METHODS_MANAGE);
  html_source->AddLocalizedString(
      "spellCheckListTitle", IDS_SETTINGS_LANGUAGES_SPELL_CHECK_LIST_TITLE);
  html_source->AddLocalizedString(
      "manageSpellCheck", IDS_SETTINGS_LANGUAGES_SPELL_CHECK_MANAGE);
  html_source->AddLocalizedString(
      "manageLanguagesPageTitle",
      IDS_SETTINGS_LANGUAGES_MANAGE_LANGUAGES_TITLE);
  html_source->AddLocalizedString(
      "allLanguages", IDS_SETTINGS_LANGUAGES_ALL_LANGUAGES);
  html_source->AddLocalizedString(
      "enabledLanguages", IDS_SETTINGS_LANGUAGES_ENABLED_LANGUAGES);
  html_source->AddLocalizedString(
      "cannotBeDisplayedInThisLanguage",
      IDS_SETTINGS_LANGUAGES_CANNOT_BE_DISPLAYED_IN_THIS_LANGUAGE);
  html_source->AddLocalizedString(
      "isDisplayedInThisLanguage",
      IDS_SETTINGS_LANGUAGES_IS_DISPLAYED_IN_THIS_LANGUAGE);
  html_source->AddLocalizedString(
      "displayInThisLanguage",
      IDS_SETTINGS_LANGUAGES_DISPLAY_IN_THIS_LANGUAGE);
  html_source->AddLocalizedString(
      "offerToTranslateInThisLanguage",
      IDS_OPTIONS_LANGUAGES_OFFER_TO_TRANSLATE_IN_THIS_LANGUAGE);
  html_source->AddLocalizedString(
      "cannotTranslateInThisLanguage",
      IDS_OPTIONS_LANGUAGES_CANNOT_TRANSLATE_IN_THIS_LANGUAGE);
  html_source->AddLocalizedString(
      "restart",
      IDS_OPTIONS_SETTINGS_LANGUAGES_RELAUNCH_BUTTON);
  html_source->AddLocalizedString(
      "editDictionaryPageTitle",
      IDS_SETTINGS_LANGUAGES_EDIT_DICTIONARY_TITLE);
  html_source->AddLocalizedString(
      "addDictionaryWordLabel",
      IDS_SETTINGS_LANGUAGES_ADD_DICTIONARY_WORD);
  html_source->AddLocalizedString(
      "addDictionaryWordButton",
      IDS_SETTINGS_LANGUAGES_ADD_DICTIONARY_WORD_BUTTON);
  html_source->AddLocalizedString(
      "customDictionaryWords",
      IDS_SETTINGS_LANGUAGES_DICTIONARY_WORDS);
}

#if defined(OS_CHROMEOS)
void AddMultiProfilesStrings(content::WebUIDataSource* html_source,
                             Profile* profile) {
  user_manager::UserManager* user_manager = user_manager::UserManager::Get();

  const user_manager::User* user =
      chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
  std::string primary_user_email = user_manager->GetPrimaryUser()->email();
  html_source->AddString("primaryUserEmail", primary_user_email);
  html_source->AddBoolean("isSecondaryUser",
                          user && user->email() != primary_user_email);
}
#endif

void AddOnStartupStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString(
      "onStartup",
      IDS_SETTINGS_ON_STARTUP);
  html_source->AddLocalizedString(
      "onStartupOpenNewTab",
      IDS_SETTINGS_ON_STARTUP_OPEN_NEW_TAB);
  html_source->AddLocalizedString(
      "onStartupContinue",
      IDS_SETTINGS_ON_STARTUP_CONTINUE);
  html_source->AddLocalizedString(
      "onStartupOpenSpecific",
      IDS_SETTINGS_ON_STARTUP_OPEN_SPECIFIC);
  html_source->AddLocalizedString(
      "onStartupAddPage",
      IDS_SETTINGS_ON_STARTUP_ADD_PAGE);
  html_source->AddLocalizedString(
      "onStartupSetPages",
      IDS_SETTINGS_ON_STARTUP_SET_PAGES);
  html_source->AddLocalizedString(
      "onStartupUseCurrent",
      IDS_SETTINGS_ON_STARTUP_USE_CURRENT);
  html_source->AddLocalizedString(
      "onStartupAddNewPage",
      IDS_SETTINGS_ON_STARTUP_ADD_NEW_PAGE);
  html_source->AddLocalizedString(
      "onStartupEnterUrl",
      IDS_SETTINGS_ON_STARTUP_ENTER_URL);
}

void AddPasswordsAndFormsStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString(
      "passwordsAndAutofillPageTitle",
      IDS_SETTINGS_PASSWORDS_AND_AUTOFILL_PAGE_TITLE);
  html_source->AddLocalizedString("autofill", IDS_SETTINGS_AUTOFILL);
  html_source->AddLocalizedString("autofillDetail",
                                  IDS_SETTINGS_AUTOFILL_DETAIL);
  html_source->AddLocalizedString("passwords", IDS_SETTINGS_PASSWORDS);
  html_source->AddLocalizedString("passwordsDetail",
                                  IDS_SETTINGS_PASSWORDS_DETAIL);
}

void AddPrivacyStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString("privacyPageTitle",
                                  IDS_SETTINGS_PRIVACY);
  html_source->AddString("improveBrowsingExperience",
                         l10n_util::GetStringFUTF16(
                             IDS_SETTINGS_IMPROVE_BROWSING_EXPERIENCE,
                             base::ASCIIToUTF16(chrome::kPrivacyLearnMoreURL)));
  html_source->AddLocalizedString("linkDoctorPref",
                                  IDS_SETTINGS_LINKDOCTOR_PREF);
  html_source->AddLocalizedString("searchSuggestPref",
                                  IDS_SETTINGS_SUGGEST_PREF);
  html_source->AddLocalizedString(
      "networkPredictionEnabled",
      IDS_SETTINGS_NETWORK_PREDICTION_ENABLED_DESCRIPTION);
  html_source->AddLocalizedString("safeBrowsingEnableProtection",
                                  IDS_SETTINGS_SAFEBROWSING_ENABLEPROTECTION);
  html_source->AddLocalizedString(
      "safeBrowsingEnableExtendedReporting",
      IDS_SETTINGS_SAFEBROWSING_ENABLE_EXTENDED_REPORTING);
  html_source->AddLocalizedString("spellingPref",
                                  IDS_SETTINGS_SPELLING_PREF);
  html_source->AddLocalizedString("enableLogging",
                                  IDS_SETTINGS_ENABLE_LOGGING);
  html_source->AddLocalizedString("doNotTrack",
                                  IDS_SETTINGS_ENABLE_DO_NOT_TRACK);
  html_source->AddLocalizedString(
      "enableContentProtectionAttestation",
      IDS_SETTINGS_ENABLE_CONTENT_PROTECTION_ATTESTATION);
  html_source->AddLocalizedString("wakeOnWifi",
                                  IDS_SETTINGS_WAKE_ON_WIFI_DESCRIPTION);
  html_source->AddLocalizedString("manageCertificates",
                                  IDS_SETTINGS_MANAGE_CERTIFICATES);
  html_source->AddLocalizedString("siteSettings",
                                  IDS_SETTINGS_SITE_SETTINGS);
  html_source->AddLocalizedString("clearBrowsingData",
                                  IDS_SETTINGS_CLEAR_DATA);
  html_source->AddLocalizedString("titleAndCount",
                                  IDS_SETTINGS_TITLE_AND_COUNT);
}

void AddSearchStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString("searchPageTitle",
                                  IDS_SETTINGS_SEARCH);
  html_source->AddLocalizedString("searchExplanation",
                                  IDS_SETTINGS_SEARCH_EXPLANATION);
  html_source->AddLocalizedString("searchManageButtonLabel",
                                  IDS_SETTINGS_SEARCH_MANAGE_BUTTON_LABEL);
  html_source->AddLocalizedString("searchOkGoogleLabel",
                                  IDS_SETTINGS_SEARCH_OK_GOOGLE_LABEL);
  html_source->AddLocalizedString(
      "searchOkGoogleLearnMoreLink",
      IDS_SETTINGS_SEARCH_OK_GOOGLE_LEARN_MORE_LINK);
  html_source->AddLocalizedString(
      "searchOkGoogleDescriptionLabel",
      IDS_SETTINGS_SEARCH_OK_GOOGLE_DESCRIPTION_LABEL);
}

void AddSearchEnginesStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString("searchEnginesPageTitle",
                                  IDS_SETTINGS_SEARCH_ENGINES);
  html_source->AddLocalizedString(
      "searchEnginesAddSearchEngineLabel",
      IDS_SETTINGS_SEARCH_ENGINES_ADD_SEARCH_ENGINE_LABEL);
  html_source->AddLocalizedString("searchEnginesLabel",
                                  IDS_SETTINGS_SEARCH_ENGINES_LABEL);
  html_source->AddLocalizedString(
      "searchEnginesOtherLabel",
      IDS_SETTINGS_SEARCH_ENGINES_OTHER_ENGINES_LABEL);
  html_source->AddLocalizedString("searchEnginesDomainLabel",
                                  IDS_SETTINGS_SEARCH_ENGINES_DOMAIN_LABEL);
  html_source->AddLocalizedString("searchEnginesKeywordLabel",
                                  IDS_SETTINGS_SEARCH_ENGINES_KEYWORD_LABEL);
  html_source->AddLocalizedString("searchEnginesQueryURLLabel",
                                  IDS_SETTINGS_SEARCH_ENGINES_QUERY_URL_LABEL);
  html_source->AddLocalizedString("searchEnginesAddButtonLabel",
                                  IDS_SETTINGS_SEARCH_ENGINES_ADD_BUTTON_LABEL);
}

void AddSiteSettingsStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString("siteSettingsPageTitle",
                                  IDS_SETTINGS_SITE_SETTINGS);
  html_source->AddLocalizedString("siteSettingsAllSites",
                                  IDS_SETTINGS_SITE_SETTINGS_ALL_SITES);
  html_source->AddLocalizedString("siteSettingsCamera",
                                  IDS_SETTINGS_SITE_SETTINGS_CAMERA);
  html_source->AddLocalizedString("siteSettingsCookies",
                                  IDS_SETTINGS_SITE_SETTINGS_COOKIES);
  html_source->AddLocalizedString("siteSettingsLocation",
                                  IDS_SETTINGS_SITE_SETTINGS_LOCATION);
  html_source->AddLocalizedString("siteSettingsMic",
                                  IDS_SETTINGS_SITE_SETTINGS_MIC);
  html_source->AddLocalizedString("siteSettingsNotifications",
                                  IDS_SETTINGS_SITE_SETTINGS_NOTIFICATIONS);
  html_source->AddLocalizedString("siteSettingsImages",
                                  IDS_SETTINGS_SITE_SETTINGS_IMAGES);
  html_source->AddLocalizedString("siteSettingsJavascript",
                                  IDS_SETTINGS_SITE_SETTINGS_JAVASCRIPT);
  html_source->AddLocalizedString("siteSettingsPopups",
                                  IDS_SETTINGS_SITE_SETTINGS_POPUPS);
  html_source->AddLocalizedString("siteSettingsFullscreen",
                                  IDS_SETTINGS_SITE_SETTINGS_FULLSCREEN);
  html_source->AddLocalizedString("siteSettingsMaySaveCookies",
                                  IDS_SETTINGS_SITE_SETTINGS_MAY_SAVE_COOKIES);
  html_source->AddLocalizedString("siteSettingsAskFirst",
                                  IDS_SETTINGS_SITE_SETTINGS_ASK_FIRST);
  html_source->AddLocalizedString(
      "siteSettingsAskFirstRecommended",
      IDS_SETTINGS_SITE_SETTINGS_ASK_FIRST_RECOMMENDED);
  html_source->AddLocalizedString(
      "siteSettingsAskBeforeAccessing",
      IDS_SETTINGS_SITE_SETTINGS_ASK_BEFORE_ACCESSING);
  html_source->AddLocalizedString(
      "siteSettingsAskBeforeSending",
      IDS_SETTINGS_SITE_SETTINGS_ASK_BEFORE_SENDING);
  html_source->AddLocalizedString(
      "siteSettingsCookiesAllowed",
      IDS_SETTINGS_SITE_SETTINGS_COOKIES_ALLOW_SITES);
  html_source->AddLocalizedString("siteSettingsAllow",
                                  IDS_SETTINGS_SITE_SETTINGS_ALLOW);
  html_source->AddLocalizedString("siteSettingsBlock",
                                  IDS_SETTINGS_SITE_SETTINGS_BLOCK);
  html_source->AddLocalizedString("siteSettingsAllowed",
                                  IDS_SETTINGS_SITE_SETTINGS_ALLOWED);
  html_source->AddLocalizedString(
      "siteSettingsAllowedRecommended",
      IDS_SETTINGS_SITE_SETTINGS_ALLOWED_RECOMMENDED);
  html_source->AddLocalizedString("siteSettingsBlocked",
                                  IDS_SETTINGS_SITE_SETTINGS_BLOCKED);
  html_source->AddLocalizedString(
      "siteSettingsBlockedRecommended",
      IDS_SETTINGS_SITE_SETTINGS_BLOCKED_RECOMMENDED);
  html_source->AddLocalizedString("siteSettingsExceptions",
                                  IDS_SETTINGS_SITE_SETTINGS_EXCEPTIONS);
  html_source->AddLocalizedString("siteSettingsAddSite",
                                  IDS_SETTINGS_SITE_SETTINGS_ADD_SITE);
  html_source->AddLocalizedString("siteSettingsSiteUrl",
                                  IDS_SETTINGS_SITE_SETTINGS_SITE_URL);

  html_source->AddLocalizedString("siteSettingsActionAllow",
                                  IDS_SETTINGS_SITE_SETTINGS_ALLOW_MENU);
  html_source->AddLocalizedString("siteSettingsActionBlock",
                                  IDS_SETTINGS_SITE_SETTINGS_BLOCK_MENU);
  html_source->AddLocalizedString("siteSettingsActionReset",
                                  IDS_SETTINGS_SITE_SETTINGS_RESET_MENU);
  html_source->AddLocalizedString("siteSettingsUsage",
                                  IDS_SETTINGS_SITE_SETTINGS_USAGE);
  html_source->AddLocalizedString("siteSettingsPermissions",
                                  IDS_SETTINGS_SITE_SETTINGS_PERMISSIONS);
  html_source->AddLocalizedString("siteSettingsClearAndReset",
                                  IDS_SETTINGS_SITE_SETTINGS_CLEAR_BUTTON);
  html_source->AddLocalizedString("siteSettingsDelete",
                                  IDS_SETTINGS_SITE_SETTINGS_DELETE);
}

void AddSyncStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString("peoplePageTitle", IDS_SETTINGS_SYNC_PEOPLE);
  html_source->AddLocalizedString("syncOverview", IDS_SETTINGS_SYNC_OVERVIEW);
  html_source->AddLocalizedString("syncSignin", IDS_SETTINGS_SYNC_SIGNIN);
  html_source->AddLocalizedString("syncDisconnect",
                                  IDS_SETTINGS_SYNC_DISCONNECT);
  html_source->AddLocalizedString("syncDisconnectTitle",
                                  IDS_SETTINGS_SYNC_DISCONNECT_TITLE);
  std::string disconnect_help_url =
      google_util::AppendGoogleLocaleParam(
          GURL(chrome::kSyncGoogleDashboardURL),
          g_browser_process->GetApplicationLocale())
          .spec();
  html_source->AddString(
      "syncDisconnectExplanation",
      l10n_util::GetStringFUTF16(IDS_SETTINGS_SYNC_DISCONNECT_EXPLANATION,
                                 base::ASCIIToUTF16(disconnect_help_url)));
  html_source->AddLocalizedString("syncDisconnectDeleteProfile",
                                  IDS_SETTINGS_SYNC_DISCONNECT_DELETE_PROFILE);
  html_source->AddLocalizedString("syncDisconnectConfirm",
                                  IDS_SETTINGS_SYNC_DISCONNECT_CONFIRM);

  html_source->AddLocalizedString("syncPageTitle", IDS_SETTINGS_SYNC);
  html_source->AddLocalizedString("syncLoading", IDS_SETTINGS_SYNC_LOADING);
  html_source->AddLocalizedString("syncTimeout", IDS_SETTINGS_SYNC_TIMEOUT);
  html_source->AddLocalizedString("syncEverythingMenuOption",
                                  IDS_SETTINGS_SYNC_EVERYTHING_MENU_OPTION);
  html_source->AddLocalizedString("chooseWhatToSyncMenuOption",
                                  IDS_SETTINGS_CHOOSE_WHAT_TO_SYNC_MENU_OPTION);
  html_source->AddLocalizedString("appCheckboxLabel",
                                  IDS_SETTINGS_APPS_CHECKBOX_LABEL);
  html_source->AddLocalizedString("extensionsCheckboxLabel",
                                  IDS_SETTINGS_EXTENSIONS_CHECKBOX_LABEL);
  html_source->AddLocalizedString("settingsCheckboxLabel",
                                  IDS_SETTINGS_SETTINGS_CHECKBOX_LABEL);
  html_source->AddLocalizedString("autofillCheckboxLabel",
                                  IDS_SETTINGS_AUTOFILL_CHECKBOX_LABEL);
  html_source->AddLocalizedString("historyCheckboxLabel",
                                  IDS_SETTINGS_HISTORY_CHECKBOX_LABEL);
  html_source->AddLocalizedString(
      "themesAndWallpapersCheckboxLabel",
      IDS_SETTINGS_THEMES_AND_WALLPAPERS_CHECKBOX_LABEL);
  html_source->AddLocalizedString("bookmarksCheckboxLabel",
                                  IDS_SETTINGS_BOOKMARKS_CHECKBOX_LABEL);
  html_source->AddLocalizedString("passwordsCheckboxLabel",
                                  IDS_SETTINGS_PASSWORDS_CHECKBOX_LABEL);
  html_source->AddLocalizedString("openTabsCheckboxLabel",
                                  IDS_SETTINGS_OPEN_TABS_CHECKBOX_LABEL);
  html_source->AddLocalizedString("encryptionOptionsTitle",
                                  IDS_SETTINGS_ENCRYPTION_OPTIONS);
  html_source->AddLocalizedString("syncDataEncryptedText",
                                  IDS_SETTINGS_SYNC_DATA_ENCRYPTED_TEXT);
  html_source->AddLocalizedString(
      "encryptWithGoogleCredentialsLabel",
      IDS_SETTINGS_ENCRYPT_WITH_GOOGLE_CREDENTIALS_LABEL);
  html_source->AddLocalizedString(
      "encryptWithSyncPassphraseLabel",
      IDS_SETTINGS_ENCRYPT_WITH_SYNC_PASSPHRASE_LABEL);
  html_source->AddLocalizedString(
      "encryptWithSyncPassphraseLearnMoreLink",
      IDS_SETTINGS_ENCRYPT_WITH_SYNC_PASSPHRASE_LEARN_MORE_LINK);
  html_source->AddLocalizedString("useDefaultSettingsButton",
                                  IDS_SETTINGS_USE_DEFAULT_SETTINGS_BUTTON);
  // TODO(dpapad): Remove this string and use IDS_CANCEL (see AddCommonStrings
  // at the top of this file).
  html_source->AddLocalizedString("cancelButton",
                                  IDS_SETTINGS_CANCEL_BUTTON);
  html_source->AddLocalizedString("okButton",
                                  IDS_SETTINGS_OK_BUTTON);
  html_source->AddLocalizedString("passphraseExplanationText",
                                  IDS_SETTINGS_PASSPHRASE_EXPLANATION_TEXT);
  html_source->AddLocalizedString("emptyPassphraseError",
                                  IDS_SETTINGS_EMPTY_PASSPHRASE_ERROR);
  html_source->AddLocalizedString("mismatchedPassphraseError",
                                  IDS_SETTINGS_MISMATCHED_PASSPHRASE_ERROR);
  html_source->AddLocalizedString("incorrectPassphraseError",
                                  IDS_SETTINGS_INCORRECT_PASSPHRASE_ERROR);
  html_source->AddLocalizedString("passphrasePlaceholder",
                                  IDS_SETTINGS_PASSPHRASE_PLACEHOLDER);
  html_source->AddLocalizedString(
      "passphraseConfirmationPlaceholder",
      IDS_SETTINGS_PASSPHRASE_CONFIRMATION_PLACEHOLDER);
}

void AddUsersStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString("usersPageTitle",
                                  IDS_SETTINGS_USERS);
  html_source->AddLocalizedString("usersModifiedByOwnerLabel",
                                  IDS_SETTINGS_USERS_MODIFIED_BY_OWNER_LABEL);
  html_source->AddLocalizedString("guestBrowsingLabel",
                                  IDS_SETTINGS_USERS_GUEST_BROWSING_LABEL);
  html_source->AddLocalizedString("settingsManagedLabel",
                                  IDS_SETTINGS_USERS_MANAGED_LABEL);
  html_source->AddLocalizedString("supervisedUsersLabel",
                                  IDS_SETTINGS_USERS_SUPERVISED_USERS_LABEL);
  html_source->AddLocalizedString("showOnSigninLabel",
                                  IDS_SETTINGS_USERS_SHOW_ON_SIGNIN_LABEL);
  html_source->AddLocalizedString("restrictSigninLabel",
                                  IDS_SETTINGS_USERS_RESTRICT_SIGNIN_LABEL);
  html_source->AddLocalizedString("addUsersLabel",
                                  IDS_SETTINGS_USERS_ADD_USERS_LABEL);
}

void AddWebContentStrings(content::WebUIDataSource* html_source) {
  html_source->AddLocalizedString("webContent", IDS_SETTINGS_WEB_CONTENT);
  html_source->AddLocalizedString("pageZoom", IDS_SETTINGS_PAGE_ZOOM_LABEL);
  html_source->AddLocalizedString("fontSize", IDS_SETTINGS_FONT_SIZE_LABEL);
  html_source->AddLocalizedString("verySmall", IDS_SETTINGS_VERY_SMALL_FONT);
  html_source->AddLocalizedString("small", IDS_SETTINGS_SMALL_FONT);
  html_source->AddLocalizedString("medium", IDS_SETTINGS_MEDIUM_FONT);
  html_source->AddLocalizedString("large", IDS_SETTINGS_LARGE_FONT);
  html_source->AddLocalizedString("veryLarge", IDS_SETTINGS_VERY_LARGE_FONT);
  html_source->AddLocalizedString("custom", IDS_SETTINGS_CUSTOM);
  html_source->AddLocalizedString("customizeFonts",
                                  IDS_SETTINGS_CUSTOMIZE_FONTS);
  html_source->AddLocalizedString("fontsAndEncoding",
                                  IDS_SETTINGS_FONTS_AND_ENCODING);
  html_source->AddLocalizedString("standardFont",
                                  IDS_SETTINGS_STANDARD_FONT_LABEL);
  html_source->AddLocalizedString("serifFont", IDS_SETTINGS_SERIF_FONT_LABEL);
  html_source->AddLocalizedString("sansSerifFont",
                                  IDS_SETTINGS_SANS_SERIF_FONT_LABEL);
  html_source->AddLocalizedString("fixedWidthFont",
                                  IDS_SETTINGS_FIXED_WIDTH_FONT_LABEL);
  html_source->AddLocalizedString("minimumFont",
                                  IDS_SETTINGS_MINIMUM_FONT_SIZE_LABEL);
  html_source->AddLocalizedString("encoding", IDS_SETTINGS_ENCODING_LABEL);
  html_source->AddLocalizedString("tiny", IDS_SETTINGS_TINY_FONT_SIZE);
  html_source->AddLocalizedString("huge", IDS_SETTINGS_HUGE_FONT_SIZE);
  html_source->AddLocalizedString("loremIpsum", IDS_SETTINGS_LOREM_IPSUM);
  html_source->AddLocalizedString("loading", IDS_SETTINGS_LOADING);
  html_source->AddLocalizedString("advancedFontSettings",
                                  IDS_SETTINGS_ADVANCED_FONT_SETTINGS);
}

}  // namespace

namespace settings {

void AddLocalizedStrings(content::WebUIDataSource* html_source,
                         Profile* profile) {
  AddCommonStrings(html_source);

#if defined(OS_CHROMEOS)
  AddA11yStrings(html_source);
  AddAccountUITweaksStrings(html_source, profile);
#endif
  AddAppearanceStrings(html_source);
#if defined(OS_CHROMEOS)
  AddBluetoothStrings(html_source);
#endif
  AddCertificateManagerStrings(html_source);
  AddClearBrowsingDataStrings(html_source);
#if !defined(OS_CHROMEOS)
  AddDefaultBrowserStrings(html_source);
#endif
  AddDateTimeStrings(html_source);
  AddDownloadsStrings(html_source);
#if defined(OS_CHROMEOS)
  AddInternetStrings(html_source);
#endif
  AddLanguagesStrings(html_source);
#if defined(OS_CHROMEOS)
  AddMultiProfilesStrings(html_source, profile);
#endif
  AddOnStartupStrings(html_source);
  AddPasswordsAndFormsStrings(html_source);
  AddPrivacyStrings(html_source);
  AddResetStrings(html_source);
  AddSearchEnginesStrings(html_source);
  AddSearchStrings(html_source);
  AddSiteSettingsStrings(html_source);
  AddSyncStrings(html_source);
  AddUsersStrings(html_source);
  AddWebContentStrings(html_source);

  policy_indicator::AddLocalizedStrings(html_source);

  html_source->SetJsonPath(kLocalizedStringsFile);
}

}  // namespace settings


text:
package com.example.service;

import com.example.service.util.Util;

public class Gateway {
  public void method() {
    System.out.printf("%s start%n", this.getClass().getName());
    Util util = new Util();
    util.method();
    System.out.printf("%s end%n", this.getClass().getName());
  }
}

redpajama_set_name: RedPajamaGithub


text:
typedef NS_ENUM(NSInteger, RWKeyChainErrorCode) {
    RWKeyChainError_None = noErr,
    RWKeyChainError_BadArguments = -1001,
    RWKeyChainError_NoPassword = -1002,
    RWKeyChainError_InvalidParameter = errSecParam,
    RWKeyChainError_FailedToAllocated = errSecAllocate,
    RWKeyChainError_NotAvailable = errSecNotAvailable,
    RWKeyChainError_AuthorizationFailed = errSecAuthFailed,
    RWKeyChainError_DuplicatedItem = errSecDuplicateItem,
    RWKeyChainError_NotFound = errSecItemNotFound,
    RWKeyChainError_InteractionNotAllowed = errSecInteractionNotAllowed,
    RWKeyChainError_FailedToDecode = errSecDecode
};

extern NSString *const kRWKeychain_ErrorDomain;
extern NSString *const kRWKeychain_AccountKey;
extern NSString *const kRWKeyChain_UUIDKey;
extern NSString *const kRWKeychain_CreatedAtKey;
extern NSString *const kRWKeychain_ClassKey;
extern NSString *const kRWKeychain_DescriptionKey;
extern NSString *const kRWKeychain_LabelKey;
extern NSString *const kRWKeychain_LastModifiedKey;
extern NSString *const kRWKeychain_WhereKey;

@interface RWKeyChain : NSObject

+ (NSArray *)allAccounts;

+ (NSArray *)allAccounts:(NSError **)error;

+ (NSArray *)accountsForService:(NSString *)serviceName;

+ (NSArray *)accountsForService:(NSString *)serviceName error:(NSError **)error;

+ (NSString *)passwordForService:(NSString *)serviceName account:(NSString *)account;

+ (NSString *)passwordForService:(NSString *)serviceName account:(NSString *)account error:(NSError **)error;

+ (NSData *)passwordDataForService:(NSString *)serviceName account:(NSString *)account;

+ (NSData *)passwordDataForService:(NSString *)serviceName account:(NSString *)account error:(NSError **)error;

+ (BOOL)deletePasswordForService:(NSString *)serviceName account:(NSString *)account;

+ (BOOL)deletePasswordForService:(NSString *)serviceName account:(NSString *)account error:(NSError **)error;

+ (BOOL)setPassword:(NSString *)password forService:(NSString *)serviceName account:(NSString *)account;

+ (BOOL)setPassword:(NSString *)password forService:(NSString *)serviceName account:(NSString *)account error:(NSError **)error;

+ (BOOL)setPasswordData:(NSData *)password forService:(NSString *)serviceName account:(NSString *)account;

+ (BOOL)setPasswordData:(NSData *)password forService:(NSString *)serviceName account:(NSString *)account error:(NSError **)error;

@end


text:
package design.sterereotypes;

/**
 * Makes decisions and closely directs others' actions
 */
public interface Controller {

}


text:
bootstrap-module
================


text:
namespace AgUnit.Runner.Resharper90.TaskRunner.UnitTestProvider.XUnit
{
    using AgUnit.Runner.Resharper90.TaskRunner.UnitTestRunner.Silverlight.Providers;
    using AgUnit.Runner.Resharper90.Util;
    using JetBrains.ReSharper.TaskRunnerFramework;

    public class XUnitClassTaskProvider : IClassTaskProvider
    {
        public bool IsClassTask(RemoteTask task)
        {
            return task.GetType().FullName == "XunitContrib.Runner.ReSharper.RemoteRunner.XunitTestClassTask";
        }

        public string GetFullClassName(RemoteTask task)
        {
            return task.GetProperty<string>("TypeName");
        }
    }
}


text:
package com.facebook.buck.intellij.ideabuck.endtoend;

import com.facebook.buck.intellij.ideabuck.file.BuckFileUtil;
import com.facebook.buck.intellij.ideabuck.lang.BuckParserDefinition;
import com.intellij.testFramework.ParsingTestCase;

public class BuckParsingTest extends ParsingTestCase {

  public BuckParsingTest() {
    super("psi", BuckFileUtil.getBuildFileName(), new BuckParserDefinition());
  }

  @Override
  protected String getTestDataPath() {
    return "tests/testdata";
  }

  @Override
  protected boolean skipSpaces() {
    return true;
  }

  private void doTest() {
    doTest(true);
  }

  public void testSimple1() {
    doTest();
  }

  public void testSimple2() {
    doTest();
  }

  public void testGlob1() {
    doTest();
  }

  public void testGlobExclude() {
    doTest();
  }

  public void testGlob2() {
    doTest();
  }

  public void testGlob3() {
    doTest();
  }

  public void testInclude() {
    doTest();
  }

  public void testNested() {
    doTest();
  }

  public void testLineComments() {
    doTest();
  }

  public void testTwoRules1() {
    doTest();
  }

  public void testTwoRules2() {
    doTest();
  }

  public void testAssignment() {
    doTest();
  }

  public void testPutTogether() {
    doTest();
  }
}


text:
var __extends=this && this.__extends || function(d, b)
{
function __()
{
this.constructor = d
}
for (var p in b)
b.hasOwnProperty(p) && (d[p] = b[p]);
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __)
},
__decorate=this && this.__decorate || function(decorators, target, key, desc)
{
var c=arguments.length,
r=c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
d,
i;
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
r = Reflect.decorate(decorators, target, key, desc);
else
for (i = decorators.length - 1; i >= 0; i--)
(d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
return c > 3 && r && Object.defineProperty(target, key, r), r
},
__param=this && this.__param || function(paramIndex, decorator)
{
return function(target, key)
{
decorator(target, key, paramIndex)
}
};
define("wijmo/wijmo.angular2.chart.annotation", ["require", "exports", '@angular/core', 'wijmo/wijmo.angular2.directiveBase', 'wijmo/wijmo.angular2.chart'], function(require, exports, core_1, wijmo_angular2_directiveBase_1, wijmo_angular2_chart_1)
{
"use strict";
var WjFlexChartAnnotationLayer=function(_super)
{
function WjFlexChartAnnotationLayer(elRef, injector)
{
var parentCmp=wijmo_angular2_directiveBase_1.WjDirectiveBehavior.findTypeParentBehavior(injector, WjFlexChartAnnotationLayer).directive;
_super.call(this, parentCmp);
wijmo_angular2_directiveBase_1.WjDirectiveBehavior.attach(this, elRef, injector)
}
return __extends(WjFlexChartAnnotationLayer, _super), WjFlexChartAnnotationLayer = __decorate([wijmo_angular2_directiveBase_1.WjComponent({
selector: 'wj-flex-chart-annotation-layer', wjParentDirectives: [wijmo_angular2_chart_1.WjFlexChart, core_1.forwardRef(function()
{
return wijmo.chart.finance && wijmo.chart.finance.FinancialChart
}), ], template: ""
}), __param(0, core_1.Inject(core_1.ElementRef)), __param(1, core_1.Inject(core_1.Injector))], WjFlexChartAnnotationLayer)
}(wijmo.chart.annotation.AnnotationLayer),
WjFlexChartAnnotationText,
WjFlexChartAnnotationEllipse,
WjFlexChartAnnotationRectangle,
WjFlexChartAnnotationLine,
WjFlexChartAnnotationPolygon,
WjFlexChartAnnotationCircle,
WjFlexChartAnnotationSquare,
WjFlexChartAnnotationImage;
exports.WjFlexChartAnnotationLayer = WjFlexChartAnnotationLayer;
WjFlexChartAnnotationText = function(_super)
{
function WjFlexChartAnnotationText(elRef, injector)
{
_super.call(this);
wijmo_angular2_directiveBase_1.WjDirectiveBehavior.attach(this, elRef, injector)
}
return __extends(WjFlexChartAnnotationText, _super), __decorate([wijmo_angular2_directiveBase_1.WjComponent({
selector: 'wj-flex-chart-annotation-text', wjMetadataId: 'FlexChartAnnotation', wjSiblingDirectiveId: 'annotation', wjParentDirectives: [WjFlexChartAnnotationLayer], template: ""
}), __param(0, core_1.Inject(core_1.ElementRef)), __param(1, core_1.Inject(core_1.Injector))], WjFlexChartAnnotationText)
}(wijmo.chart.annotation.Text);
exports.WjFlexChartAnnotationText = WjFlexChartAnnotationText;
WjFlexChartAnnotationEllipse = function(_super)
{
function WjFlexChartAnnotationEllipse(elRef, injector)
{
_super.call(this);
wijmo_angular2_directiveBase_1.WjDirectiveBehavior.attach(this, elRef, injector)
}
return __extends(WjFlexChartAnnotationEllipse, _super), __decorate([wijmo_angular2_directiveBase_1.WjComponent({
selector: 'wj-flex-chart-annotation-ellipse', wjMetadataId: 'FlexChartAnnotation', wjSiblingDirectiveId: 'annotation', wjParentDirectives: [WjFlexChartAnnotationLayer], template: ""
}), __param(0, core_1.Inject(core_1.ElementRef)), __param(1, core_1.Inject(core_1.Injector))], WjFlexChartAnnotationEllipse)
}(wijmo.chart.annotation.Ellipse);
exports.WjFlexChartAnnotationEllipse = WjFlexChartAnnotationEllipse;
WjFlexChartAnnotationRectangle = function(_super)
{
function WjFlexChartAnnotationRectangle(elRef, injector)
{
_super.call(this);
wijmo_angular2_directiveBase_1.WjDirectiveBehavior.attach(this, elRef, injector)
}
return __extends(WjFlexChartAnnotationRectangle, _super), __decorate([wijmo_angular2_directiveBase_1.WjComponent({
selector: 'wj-flex-chart-annotation-rectangle', wjMetadataId: 'FlexChartAnnotation', wjSiblingDirectiveId: 'annotation', wjParentDirectives: [WjFlexChartAnnotationLayer], template: ""
}), __param(0, core_1.Inject(core_1.ElementRef)), __param(1, core_1.Inject(core_1.Injector))], WjFlexChartAnnotationRectangle)
}(wijmo.chart.annotation.Rectangle);
exports.WjFlexChartAnnotationRectangle = WjFlexChartAnnotationRectangle;
WjFlexChartAnnotationLine = function(_super)
{
function WjFlexChartAnnotationLine(elRef, injector)
{
_super.call(this);
wijmo_angular2_directiveBase_1.WjDirectiveBehavior.attach(this, elRef, injector)
}
return __extends(WjFlexChartAnnotationLine, _super), __decorate([wijmo_angular2_directiveBase_1.WjComponent({
selector: 'wj-flex-chart-annotation-line', wjMetadataId: 'FlexChartAnnotation', wjSiblingDirectiveId: 'annotation', wjParentDirectives: [WjFlexChartAnnotationLayer], template: ""
}), __param(0, core_1.Inject(core_1.ElementRef)), __param(1, core_1.Inject(core_1.Injector))], WjFlexChartAnnotationLine)
}(wijmo.chart.annotation.Line);
exports.WjFlexChartAnnotationLine = WjFlexChartAnnotationLine;
WjFlexChartAnnotationPolygon = function(_super)
{
function WjFlexChartAnnotationPolygon(elRef, injector)
{
_super.call(this);
wijmo_angular2_directiveBase_1.WjDirectiveBehavior.attach(this, elRef, injector)
}
return __extends(WjFlexChartAnnotationPolygon, _super), __decorate([wijmo_angular2_directiveBase_1.WjComponent({
selector: 'wj-flex-chart-annotation-polygon', wjMetadataId: 'FlexChartAnnotation', wjSiblingDirectiveId: 'annotation', wjParentDirectives: [WjFlexChartAnnotationLayer], template: ""
}), __param(0, core_1.Inject(core_1.ElementRef)), __param(1, core_1.Inject(core_1.Injector))], WjFlexChartAnnotationPolygon)
}(wijmo.chart.annotation.Polygon);
exports.WjFlexChartAnnotationPolygon = WjFlexChartAnnotationPolygon;
WjFlexChartAnnotationCircle = function(_super)
{
function WjFlexChartAnnotationCircle(elRef, injector)
{
_super.call(this);
wijmo_angular2_directiveBase_1.WjDirectiveBehavior.attach(this, elRef, injector)
}
return __extends(WjFlexChartAnnotationCircle, _super), __decorate([wijmo_angular2_directiveBase_1.WjComponent({
selector: 'wj-flex-chart-annotation-circle', wjMetadataId: 'FlexChartAnnotation', wjSiblingDirectiveId: 'annotation', wjParentDirectives: [WjFlexChartAnnotationLayer], template: ""
}), __param(0, core_1.Inject(core_1.ElementRef)), __param(1, core_1.Inject(core_1.Injector))], WjFlexChartAnnotationCircle)
}(wijmo.chart.annotation.Circle);
exports.WjFlexChartAnnotationCircle = WjFlexChartAnnotationCircle;
WjFlexChartAnnotationSquare = function(_super)
{
function WjFlexChartAnnotationSquare(elRef, injector)
{
_super.call(this);
wijmo_angular2_directiveBase_1.WjDirectiveBehavior.attach(this, elRef, injector)
}
return __extends(WjFlexChartAnnotationSquare, _super), __decorate([wijmo_angular2_directiveBase_1.WjComponent({
selector: 'wj-flex-chart-annotation-square', wjMetadataId: 'FlexChartAnnotation', wjSiblingDirectiveId: 'annotation', wjParentDirectives: [WjFlexChartAnnotationLayer], template: ""
}), __param(0, core_1.Inject(core_1.ElementRef)), __param(1, core_1.Inject(core_1.Injector))], WjFlexChartAnnotationSquare)
}(wijmo.chart.annotation.Square);
exports.WjFlexChartAnnotationSquare = WjFlexChartAnnotationSquare;
WjFlexChartAnnotationImage = function(_super)
{
function WjFlexChartAnnotationImage(elRef, injector)
{
_super.call(this);
wijmo_angular2_directiveBase_1.WjDirectiveBehavior.attach(this, elRef, injector)
}
return __extends(WjFlexChartAnnotationImage, _super), __decorate([wijmo_angular2_directiveBase_1.WjComponent({
selector: 'wj-flex-chart-annotation-image', wjMetadataId: 'FlexChartAnnotation', wjSiblingDirectiveId: 'annotation', wjParentDirectives: [WjFlexChartAnnotationLayer], template: ""
}), __param(0, core_1.Inject(core_1.ElementRef)), __param(1, core_1.Inject(core_1.Injector))], WjFlexChartAnnotationImage)
}(wijmo.chart.annotation.Image);
exports.WjFlexChartAnnotationImage = WjFlexChartAnnotationImage
})


text:
Your Immediate Family
Tell the class about your immediate family:
Do you have brothers or sisters?

What are your parents like? Do you see or talk to them a lot?

Do you still live with any of your immediate family members? If so, who?

Your Family

Are you married? If so, when did you get married>
If not, do you want to get married in the future?

What is a successful marriage based on? Share some advice with your classmates.

Children

Do you have any children? If so, tell the class about them.

Would you like to have (more) children in the future?
Why or why not?

At what age should adults begin to think about procreating? Why is that an appropriate age?


text:
"""Utilty functions for converting between MIDI data and human-readable/usable
values

"""

import numpy as np
import re

from .constants import DRUM_MAP, INSTRUMENT_MAP, INSTRUMENT_CLASSES

def key_number_to_key_name(key_number):
    """Convert a key number to a key string.

    Parameters
    ----------
    key_number : int
        Uses pitch classes to represent major and minor keys.
        For minor keys, adds a 12 offset.
        For example, C major is 0 and C minor is 12.

    Returns
    -------
    key_name : str
        Key name in the format ``'(root) (mode)'``, e.g. ``'Gb minor'``.
        Gives preference for keys with flats, with the exception of F#, G# and
        C# minor.
    """

    if not isinstance(key_number, int):
        raise ValueError('`key_number` is not int!')
    if not ((key_number >= 0) and (key_number < 24)):
        raise ValueError('`key_number` is larger than 24')

    # preference to keys with flats
    keys = ['C', 'Db', 'D', 'Eb', 'E', 'F', 'Gb',
            'G', 'Ab', 'A', 'Bb', 'B']

    # circle around 12 pitch classes
    key_idx = key_number % 12
    mode = key_number // 12

    # check if mode is major or minor
    if mode == 0:
        return keys[key_idx] + ' Major'
    elif mode == 1:
        # preference to C#, F# and G# minor
        if key_idx in [1, 6, 8]:
            return keys[key_idx-1] + '# minor'
        else:
            return keys[key_idx] + ' minor'

def key_name_to_key_number(key_string):
    """Convert a key name string to key number.

    Parameters
    ----------
    key_string : str
        Format is ``'(root) (mode)'``, where:
          * ``(root)`` is one of ABCDEFG or abcdefg.  A lowercase root
            indicates a minor key when no mode string is specified.  Optionally
            a # for sharp or b for flat can be specified.

          * ``(mode)`` is optionally specified either as one of 'M', 'Maj',
            'Major', 'maj', or 'major' for major or 'm', 'Min', 'Minor', 'min',
            'minor' for minor.  If no mode is specified and the root is
            uppercase, the mode is assumed to be major; if the root is
            lowercase, the mode is assumed to be minor.

    Returns
    -------
    key_number : int
        Integer representing the key and its mode.  Integers from 0 to 11
        represent major keys from C to B; 12 to 23 represent minor keys from C
        to B.
    """
    # Create lists of possible mode names (major or minor)
    major_strs = ['M', 'Maj', 'Major', 'maj', 'major']
    minor_strs = ['m', 'Min', 'Minor', 'min', 'minor']
    # Construct regular expression for matching key
    pattern = re.compile(
        # Start with any of A-G, a-g
        '^(?P<key>[ABCDEFGabcdefg])'
        # Next, look for #, b, or nothing
        '(?P<flatsharp>[#b]?)'
        # Allow for a space between key and mode
        ' ?'
        # Next, look for any of the mode strings
        '(?P<mode>(?:(?:' +
        # Next, look for any of the major or minor mode strings
        ')|(?:'.join(major_strs + minor_strs) + '))?)$')
    # Match provided key string
    result = re.match(pattern, key_string)
    if result is None:
        raise ValueError('Supplied key {} is not valid.'.format(key_string))
    # Convert result to dictionary
    result = result.groupdict()

    # Map from key string to pitch class number
    key_number = {'c': 0, 'd': 2, 'e': 4, 'f': 5,
                  'g': 7, 'a': 9, 'b': 11}[result['key'].lower()]
    # Increment or decrement pitch class if a flat or sharp was specified
    if result['flatsharp']:
        if result['flatsharp'] == '#':
            key_number += 1
        elif result['flatsharp'] == 'b':
            key_number -= 1
    # Circle around 12 pitch classes
    key_number = key_number % 12
    # Offset if mode is minor, or the key name is lowercase
    if result['mode'] in minor_strs or (result['key'].islower() and
                                        result['mode'] not in major_strs):
        key_number += 12

    return key_number

def mode_accidentals_to_key_number(mode, num_accidentals):
    """Convert a given number of accidentals and mode to a key number.

    Parameters
    ----------
    mode : int
        0 is major, 1 is minor.
    num_accidentals : int
        Positive number is used for sharps, negative number is used for flats.

    Returns
    -------
    key_number : int
        Integer representing the key and its mode.
    """

    if not (isinstance(num_accidentals, int) and
            num_accidentals > -8 and
            num_accidentals < 8):
        raise ValueError('Number of accidentals {} is not valid'.format(
            num_accidentals))
    if mode not in (0, 1):
        raise ValueError('Mode {} is not recognizable, must be 0 or 1'.format(
            mode))

    sharp_keys = 'CGDAEBF'
    flat_keys = 'FBEADGC'

    # check if key signature has sharps or flats
    if num_accidentals >= 0:
        num_sharps = num_accidentals // 6
        key = sharp_keys[num_accidentals % 7] + '#' * int(num_sharps)
    else:
        if num_accidentals == -1:
            key = 'F'
        else:
            key = flat_keys[(-1 * num_accidentals - 1) % 7] + 'b'

    # find major key number
    key += ' Major'

    # use routine to convert from string notation to number notation
    key_number = key_name_to_key_number(key)

    # if minor, offset
    if mode == 1:
        key_number = 12 + ((key_number - 3) % 12)

    return key_number

def key_number_to_mode_accidentals(key_number):
    """Converts a key number to number of accidentals and mode.

    Parameters
    ----------
    key_number : int
        Key number as used in ``pretty_midi``.

    Returns
    -------
    mode : int
        0 for major, 1 for minor.
    num_accidentals : int
        Number of accidentals.
        Positive is for sharps and negative is for flats.
    """

    if not ((isinstance(key_number, int) and
             key_number >= 0 and
             key_number < 24)):
        raise ValueError('Key number {} is not a must be an int between 0 and '
                         '24'.format(key_number))

    pc_to_num_accidentals_major = {0: 0, 1: -5, 2: 2, 3: -3, 4: 4, 5: -1, 6: 6,
                                   7: 1, 8: -4, 9: 3, 10: -2, 11: 5}
    mode = key_number // 12

    if mode == 0:
        num_accidentals = pc_to_num_accidentals_major[key_number]
        return mode, num_accidentals
    elif mode == 1:
        key_number = (key_number + 3) % 12
        num_accidentals = pc_to_num_accidentals_major[key_number]
        return mode, num_accidentals
    else:
        return None

def qpm_to_bpm(quarter_note_tempo, numerator, denominator):
    """Converts from quarter notes per minute to beats per minute.

    Parameters
    ----------
    quarter_note_tempo : float
        Quarter note tempo.
    numerator : int
        Numerator of time signature.
    denominator : int
        Denominator of time signature.

    Returns
    -------
    bpm : float
        Tempo in beats per minute.
    """

    if not (isinstance(quarter_note_tempo, (int, float)) and
            quarter_note_tempo > 0):
        raise ValueError(
            'Quarter notes per minute must be an int or float '
            'greater than 0, but {} was supplied'.format(quarter_note_tempo))
    if not (isinstance(numerator, int) and numerator > 0):
        raise ValueError(
            'Time signature numerator must be an int greater than 0, but {} '
            'was supplied.'.format(numerator))
    if not (isinstance(denominator, int) and denominator > 0):
        raise ValueError(
            'Time signature denominator must be an int greater than 0, but {} '
            'was supplied.'.format(denominator))

    # denominator is whole note
    if denominator == 1:
        return quarter_note_tempo / 4.0
    # denominator is half note
    elif denominator == 2:
        return quarter_note_tempo / 2.0
    # denominator is quarter note
    elif denominator == 4:
        return quarter_note_tempo
    # denominator is eighth, sixteenth or 32nd
    elif denominator in [8, 16, 32]:
        # simple triple
        if numerator == 3:
            return 2 * quarter_note_tempo
        # compound meter 6/8*n, 9/8*n, 12/8*n...
        elif numerator % 3 == 0:
            return 2.0 * quarter_note_tempo / 3.0
        # strongly assume two eighths equal a beat
        else:
            return quarter_note_tempo
    else:
        return quarter_note_tempo

def note_number_to_hz(note_number):
    """Convert a (fractional) MIDI note number to its frequency in Hz.

    Parameters
    ----------
    note_number : float
        MIDI note number, can be fractional.

    Returns
    -------
    note_frequency : float
        Frequency of the note in Hz.

    """
    # MIDI note numbers are defined as the number of semitones relative to C0
    # in a 440 Hz tuning
    return 440.0*(2.0**((note_number - 69)/12.0))

def hz_to_note_number(frequency):
    """Convert a frequency in Hz to a (fractional) note number.

    Parameters
    ----------
    frequency : float
        Frequency of the note in Hz.

    Returns
    -------
    note_number : float
        MIDI note number, can be fractional.

    """
    # MIDI note numbers are defined as the number of semitones relative to C0
    # in a 440 Hz tuning
    return 12*(np.log2(frequency) - np.log2(440.0)) + 69

def note_name_to_number(note_name):
    """Converts a note name in the format
    ``'(note)(accidental)(octave number)'`` (e.g. ``'C#4'``) to MIDI note
    number.

    ``'(note)'`` is required, and is case-insensitive.

    ``'(accidental)'`` should be ``''`` for natural, ``'#'`` for sharp and
    ``'!'`` or ``'b'`` for flat.

    If ``'(octave)'`` is ``''``, octave 0 is assumed.

    Parameters
    ----------
    note_name : str
        A note name, as described above.

    Returns
    -------
    note_number : int
        MIDI note number corresponding to the provided note name.

    Notes
    -----
        Thanks to Brian McFee.

    """

    # Map note name to the semitone
    pitch_map = {'C': 0, 'D': 2, 'E': 4, 'F': 5, 'G': 7, 'A': 9, 'B': 11}
    # Relative change in semitone denoted by each accidental
    acc_map = {'#': 1, '': 0, 'b': -1, '!': -1}

    # Reg exp will raise an error when the note name is not valid
    try:
        # Extract pitch, octave, and accidental from the supplied note name
        match = re.match(r'^(?P<n>[A-Ga-g])(?P<off>[#b!]?)(?P<oct>[+-]?\d+)$',
                         note_name)

        pitch = match.group('n').upper()
        offset = acc_map[match.group('off')]
        octave = int(match.group('oct'))
    except:
        raise ValueError('Improper note format: {}'.format(note_name))

    # Convert from the extrated ints to a full note number
    return 12*(octave + 1) + pitch_map[pitch] + offset

def note_number_to_name(note_number):
    """Convert a MIDI note number to its name, in the format
    ``'(note)(accidental)(octave number)'`` (e.g. ``'C#4'``).

    Parameters
    ----------
    note_number : int
        MIDI note number.  If not an int, it will be rounded.

    Returns
    -------
    note_name : str
        Name of the supplied MIDI note number.

    Notes
    -----
        Thanks to Brian McFee.

    """

    # Note names within one octave
    semis = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B']

    # Ensure the note is an int
    note_number = int(np.round(note_number))

    # Get the semitone and the octave, and concatenate to create the name
    return semis[note_number % 12] + str(note_number//12 - 1)

def note_number_to_drum_name(note_number):
    """Converts a MIDI note number in a percussion instrument to the
    corresponding drum name, according to the General MIDI standard.

    Any MIDI note number outside of the valid range (note 35-81, zero-indexed)
    will result in an empty string.

    Parameters
    ----------
    note_number : int
        MIDI note number.  If not an int, it will be rounded.

    Returns
    -------
    drum_name : str
        Name of the drum for this note for a percussion instrument.

    Notes
    -----
        See http://www.midi.org/techspecs/gm1sound.php

    """

    # Ensure note is an int
    note_number = int(np.round(note_number))
    # General MIDI only defines drum names for notes 35-81
    if note_number < 35 or note_number > 81:
        return ''
    else:
        # Our DRUM_MAP starts from index 0; drum names start from 35
        return DRUM_MAP[note_number - 35]

def __normalize_str(name):
    """Removes all non-alphanumeric characters from a string and converts
    it to lowercase.

    """
    return ''.join(ch for ch in name if ch.isalnum()).lower()

def drum_name_to_note_number(drum_name):
    """Converts a drum name to the corresponding MIDI note number for a
    percussion instrument.  Conversion is case, whitespace, and
    non-alphanumeric character insensitive.

    Parameters
    ----------
    drum_name : str
        Name of a drum which exists in the general MIDI standard.
        If the drum is not found, a ValueError is raised.

    Returns
    -------
    note_number : int
        The MIDI note number corresponding to this drum.

    Notes
    -----
        See http://www.midi.org/techspecs/gm1sound.php

    """

    normalized_drum_name = __normalize_str(drum_name)
    # Create a list of the entries DRUM_MAP, normalized, to search over
    normalized_drum_names = [__normalize_str(name) for name in DRUM_MAP]

    # If the normalized drum name is not found, complain
    try:
        note_index = normalized_drum_names.index(normalized_drum_name)
    except:
        raise ValueError('{} is not a valid General MIDI drum '
                         'name.'.format(drum_name))

    # If an index was found, it will be 0-based; add 35 to get the note number
    return note_index + 35

def program_to_instrument_name(program_number):
    """Converts a MIDI program number to the corresponding General MIDI
    instrument name.

    Parameters
    ----------
    program_number : int
        MIDI program number, between 0 and 127.

    Returns
    -------
    instrument_name : str
        Name of the instrument corresponding to this program number.

    Notes
    -----
        See http://www.midi.org/techspecs/gm1sound.php

    """

    # Check that the supplied program is in the valid range
    if program_number < 0 or program_number > 127:
        raise ValueError('Invalid program number {}, should be between 0 and'
                         ' 127'.format(program_number))
    # Just grab the name from the instrument mapping list
    return INSTRUMENT_MAP[program_number]

def instrument_name_to_program(instrument_name):
    """Converts an instrument name to the corresponding General MIDI program
    number.  Conversion is case, whitespace, and non-alphanumeric character
    insensitive.

    Parameters
    ----------
    instrument_name : str
        Name of an instrument which exists in the general MIDI standard.
        If the instrument is not found, a ValueError is raised.

    Returns
    -------
    program_number : int
        The MIDI program number corresponding to this instrument.

    Notes
    -----
        See http://www.midi.org/techspecs/gm1sound.php

    """

    normalized_inst_name = __normalize_str(instrument_name)
    # Create a list of the entries INSTRUMENT_MAP, normalized, to search over
    normalized_inst_names = [__normalize_str(name) for name in
                             INSTRUMENT_MAP]

    # If the normalized drum name is not found, complain
    try:
        program_number = normalized_inst_names.index(normalized_inst_name)
    except:
        raise ValueError('{} is not a valid General MIDI instrument '
                         'name.'.format(instrument_name))

    # Return the index (program number) if a match was found
    return program_number

def program_to_instrument_class(program_number):
    """Converts a MIDI program number to the corresponding General MIDI
    instrument class.

    Parameters
    ----------
    program_number : int
        MIDI program number, between 0 and 127.

    Returns
    -------
    instrument_class : str
        Name of the instrument class corresponding to this program number.

    Notes
    -----
        See http://www.midi.org/techspecs/gm1sound.php

    """

    # Check that the supplied program is in the valid range
    if program_number < 0 or program_number > 127:
        raise ValueError('Invalid program number {}, should be between 0 and'
                         ' 127'.format(program_number))
    # Just grab the name from the instrument mapping list
    return INSTRUMENT_CLASSES[int(program_number)//8]

def pitch_bend_to_semitones(pitch_bend, semitone_range=2.):
    """Convert a MIDI pitch bend value (in the range ``[-8192, 8191]``) to the
    bend amount in semitones.

    Parameters
    ----------
    pitch_bend : int
        MIDI pitch bend amount, in ``[-8192, 8191]``.
    semitone_range : float
        Convert to +/- this semitone range.  Default is 2., which is the
        General MIDI standard +/-2 semitone range.

    Returns
    -------
    semitones : float
        Number of semitones corresponding to this pitch bend amount.

    """

    return semitone_range*pitch_bend/8192.0

def semitones_to_pitch_bend(semitones, semitone_range=2.):
    """Convert a semitone value to the corresponding MIDI pitch bend integer.

    Parameters
    ----------
    semitones : float
        Number of semitones for the pitch bend.
    semitone_range : float
        Convert to +/- this semitone range.  Default is 2., which is the
        General MIDI standard +/-2 semitone range.

    Returns
    -------
    pitch_bend : int
        MIDI pitch bend amount, in ``[-8192, 8191]``.

    """
    return int(8192*(semitones/semitone_range))


text:
namespace NativeCode.Core.Dependencies
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// Provides a contract to register dependencies.
    /// </summary>
    public interface IDependencyRegistrar
    {
        /// <summary>
        /// Registers a factory method to create dependency instances.
        /// </summary>
        /// <param name="contract">The contract.</param>
        /// <param name="factory">The factory.</param>
        void Factory(Type contract, Func<IDependencyResolver, object> factory);

        /// <summary>
        /// Registers a factory method to create dependency instances.
        /// </summary>
        /// <typeparam name="TContract">The type of the contract.</typeparam>
        /// <param name="factory">The factory.</param>
        void Factory<TContract>(Func<IDependencyResolver, TContract> factory) where TContract : class;

        /// <summary>
        /// Registers an instance.
        /// </summary>
        /// <typeparam name="TContract">The type of the contract.</typeparam>
        /// <param name="instance">The instance.</param>
        void Instance<TContract>(TContract instance) where TContract : class;

        /// <summary>
        /// Registers a dependency.
        /// </summary>
        /// <param name="contract">The contract.</param>
        /// <param name="key">The key.</param>
        /// <param name="lifetime">The lifetime.</param>
        void Register(Type contract, DependencyKey key = DependencyKey.None, DependencyLifetime lifetime = DependencyLifetime.Default);

        /// <summary>
        /// Registers the specified contract.
        /// Registers a dependency.
        /// </summary>
        /// <param name="contract">The contract.</param>
        /// <param name="key">The key.</param>
        /// <param name="lifetime">The lifetime.</param>
        void Register(Type contract, string key, DependencyLifetime lifetime = DependencyLifetime.Default);

        /// <summary>
        /// Registers a dependency.
        /// </summary>
        /// <typeparam name="TContract">The type of the contract.</typeparam>
        /// <param name="key">The key.</param>
        /// <param name="lifetime">The lifetime.</param>
        void Register<TContract>(DependencyKey key = DependencyKey.None, DependencyLifetime lifetime = DependencyLifetime.Default) where TContract : class;

        /// <summary>
        /// Registers a dependency.
        /// </summary>
        /// <typeparam name="TContract">The type of the contract.</typeparam>
        /// <param name="key">The key.</param>
        /// <param name="lifetime">The lifetime.</param>
        void Register<TContract>(string key, DependencyLifetime lifetime = DependencyLifetime.Default) where TContract : class;

        /// <summary>
        /// Registers a dependency.
        /// </summary>
        /// <param name="contract">The contract.</param>
        /// <param name="implementation">The implementation.</param>
        /// <param name="key">The key.</param>
        /// <param name="lifetime">The lifetime.</param>
        void Register(Type contract, Type implementation, DependencyKey key = DependencyKey.None, DependencyLifetime lifetime = DependencyLifetime.Default);

        /// <summary>
        /// Registers a dependency.
        /// </summary>
        /// <param name="contract">The contract.</param>
        /// <param name="implementation">The implementation.</param>
        /// <param name="key">The key.</param>
        /// <param name="lifetime">The lifetime.</param>
        void Register(Type contract, Type implementation, string key, DependencyLifetime lifetime = DependencyLifetime.Default);

        /// <summary>
        /// Registers a dependency.
        /// </summary>
        /// <typeparam name="TContract">The type of the contract.</typeparam>
        /// <typeparam name="TImplementation">The type of the implementation.</typeparam>
        /// <param name="key">The key.</param>
        /// <param name="lifetime">The lifetime.</param>
        void Register<TContract, TImplementation>(DependencyKey key = DependencyKey.None, DependencyLifetime lifetime = DependencyLifetime.Default)
            where TContract : class where TImplementation : class, TContract;

        /// <summary>
        /// Registers a dependency.
        /// </summary>
        /// <typeparam name="TContract">The type of the contract.</typeparam>
        /// <typeparam name="TImplementation">The type of the implementation.</typeparam>
        /// <param name="key">The key.</param>
        /// <param name="lifetime">The lifetime.</param>
        void Register<TContract, TImplementation>(string key, DependencyLifetime lifetime = DependencyLifetime.Default) where TContract : class
            where TImplementation : class, TContract;

        void RegisterAll<TContract>(IEnumerable<Type> implementations) where TContract : class;

        void RegisterAll<TContract>(params Type[] implementations) where TContract : class;
    }
}


text: A C extension for Python that implements calculating the euclidean distance of two 1D points.


text:
package com.robrua.orianna.type.dto.staticdata;

import java.util.List;

import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Table;

import com.robrua.orianna.type.dto.OriannaDto;

@Entity
@Table(name = "spellvars")
public class SpellVars extends OriannaDto {
    private static final long serialVersionUID = 3196309764964468106L;
    @ElementCollection
    @CollectionTable(name = "spellvars_coeff", joinColumns = @JoinColumn(name = "spellvars_id") )
    private List<Double> coeff;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long dbId;

    private String dyn, link, ranksWith;

    @Column(name = "keyy")
    private String key;

    /*
     * (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(final Object obj) {
        if(this == obj) {
            return true;
        }
        if(obj == null) {
            return false;
        }
        if(!(obj instanceof SpellVars)) {
            return false;
        }
        final SpellVars other = (SpellVars)obj;
        if(coeff == null) {
            if(other.coeff != null) {
                return false;
            }
        }
        else if(!coeff.equals(other.coeff)) {
            return false;
        }
        if(dyn == null) {
            if(other.dyn != null) {
                return false;
            }
        }
        else if(!dyn.equals(other.dyn)) {
            return false;
        }
        if(key == null) {
            if(other.key != null) {
                return false;
            }
        }
        else if(!key.equals(other.key)) {
            return false;
        }
        if(link == null) {
            if(other.link != null) {
                return false;
            }
        }
        else if(!link.equals(other.link)) {
            return false;
        }
        if(ranksWith == null) {
            if(other.ranksWith != null) {
                return false;
            }
        }
        else if(!ranksWith.equals(other.ranksWith)) {
            return false;
        }
        return true;
    }

    /**
     * @return the coeff
     */
    public List<Double> getCoeff() {
        return coeff;
    }

    @Override
    public String getDataStoreIndexField(final Class<?> keyType) {
        if(keyType.equals(Long.class)) {
            return "dbId";
        }
        return null;
    }

    /**
     * @return the dyn
     */
    public String getDyn() {
        return dyn;
    }

    /**
     * @return the key
     */
    public String getKey() {
        return key;
    }

    /**
     * @return the link
     */
    public String getLink() {
        return link;
    }

    /**
     * @return the ranksWith
     */
    public String getRanksWith() {
        return ranksWith;
    }

    /*
     * (non-Javadoc)
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + (coeff == null ? 0 : coeff.hashCode());
        result = prime * result + (dyn == null ? 0 : dyn.hashCode());
        result = prime * result + (key == null ? 0 : key.hashCode());
        result = prime * result + (link == null ? 0 : link.hashCode());
        result = prime * result + (ranksWith == null ? 0 : ranksWith.hashCode());
        return result;
    }

    /**
     * @param coeff
     *            the coeff to set
     */
    public void setCoeff(final List<Double> coeff) {
        this.coeff = coeff;
    }

    /**
     * @param dyn
     *            the dyn to set
     */
    public void setDyn(final String dyn) {
        this.dyn = dyn;
    }

    /**
     * @param key
     *            the key to set
     */
    public void setKey(final String key) {
        this.key = key;
    }

    /**
     * @param link
     *            the link to set
     */
    public void setLink(final String link) {
        this.link = link;
    }

    /**
     * @param ranksWith
     *            the ranksWith to set
     */
    public void setRanksWith(final String ranksWith) {
        this.ranksWith = ranksWith;
    }

    /*
     * (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return "SpellVars [coeff=" + coeff + ", dyn=" + dyn + ", key=" + key + ", link=" + link + ", ranksWith=" + ranksWith + "]";
    }
}


text:
import { module, test } from 'qunit';
import { typeIn, setupContext, teardownContext, _registerHook } from '@ember/test-helpers';
import { buildInstrumentedElement, insertElement } from '../../helpers/events';
import { isIE11 } from '../../helpers/browser-detect';
import { debounce } from '@ember/runloop';
import { Promise } from 'rsvp';
import hasEmberVersion from '@ember/test-helpers/has-ember-version';

/*
 * Event order based on https://jsbin.com/zitazuxabe/edit?html,js,console,output
 */

let expectedEvents = [
  'focus',
  'focusin',
  'keydown',
  'keypress',
  'input',
  'keyup',
  'keydown',
  'keypress',
  'input',
  'keyup',
  'keydown',
  'keypress',
  'input',
  'keyup',
  'change',
];

if (isIE11) {
  expectedEvents = [
    'focusin',
    'keydown',
    'keypress',
    'keyup',
    'keydown',
    'keypress',
    'keyup',
    'keydown',
    'keypress',
    'keyup',
    'input',
    'change',
    'focus',
  ];
}

module('DOM Helper: typeIn', function (hooks) {
  if (!hasEmberVersion(2, 4)) {
    return;
  }

  let context, element;

  hooks.beforeEach(function () {
    context = {};
  });

  hooks.afterEach(async function () {
    element.setAttribute('data-skip-steps', true);

    if (element) {
      element.parentNode.removeChild(element);
      element = null;
    }
    if (context.owner) {
      await teardownContext(context);
    }

    document.getElementById('ember-testing').innerHTML = '';
  });

  test('it executes registered typeIn hooks', async function (assert) {
    assert.expect(3);

    element = document.createElement('input');
    insertElement(element);

    let startHook = _registerHook('typeIn', 'start', () => {
      assert.step('typeIn:start');
    });
    let endHook = _registerHook('typeIn', 'end', () => {
      assert.step('typeIn:end');
    });

    try {
      await typeIn(element, 'foo');

      assert.verifySteps(['typeIn:start', 'typeIn:end']);
    } finally {
      startHook.unregister();
      endHook.unregister();
    }
  });

  test('typing in an input', async function (assert) {
    element = buildInstrumentedElement('input');
    await typeIn(element, 'foo');

    assert.verifySteps(expectedEvents);
    assert.strictEqual(document.activeElement, element, 'activeElement updated');
    assert.equal(element.value, 'foo');
  });

  test('it triggers key events with correct arguments', async function (assert) {
    element = buildInstrumentedElement('input', ['key', 'shiftKey']);
    await typeIn(element, 'F o');

    let chars = ['F', ' ', 'o'];
    let shiftKeys = [true, false, false];
    let expectedEventsWithArguments = expectedEvents.map(eventName => {
      // Only key events get the key arguments
      if (!['keydown', 'keypress', 'keyup'].includes(eventName)) {
        return `${eventName} undefined undefined`;
      }
      // After each keyup, the next character comes up
      let char = eventName === 'keyup' ? chars.shift() : chars[0];
      let shiftKey = eventName === 'keyup' ? shiftKeys.shift() : shiftKeys[0];

      return `${eventName} ${char.toUpperCase()} ${shiftKey}`;
    });

    assert.verifySteps(expectedEventsWithArguments);
  });

  test('typing in an input with a delay', async function (assert) {
    element = buildInstrumentedElement('input');
    await typeIn(element, 'foo', { delay: 150 });

    assert.verifySteps(expectedEvents);
    assert.strictEqual(document.activeElement, element, 'activeElement updated');
    assert.equal(element.value, 'foo');
  });

  test('typing in a textarea', async function (assert) {
    element = buildInstrumentedElement('textarea');
    await typeIn(element, 'foo');

    assert.verifySteps(expectedEvents);
    assert.strictEqual(document.activeElement, element, 'activeElement updated');
    assert.equal(element.value, 'foo');
  });

  test('typing in a contenteditable element', async function (assert) {
    element = buildInstrumentedElement('div');
    element.setAttribute('contenteditable', 'true');
    await typeIn(element, 'foo');

    assert.verifySteps(expectedEvents);
    assert.strictEqual(document.activeElement, element, 'activeElement updated');
    assert.equal(element.innerHTML, 'foo');
  });

  test('typing in a non-typable element', async function (assert) {
    element = buildInstrumentedElement('div');

    await setupContext(context);
    assert.rejects(
      typeIn(`#${element.id}`, 'foo'),
      /`typeIn` is only usable on form controls or contenteditable elements/
    );
  });

  test('typing in a disabled element', async function (assert) {
    element = buildInstrumentedElement('input');
    element.dataset.testDisabled = '';
    element.setAttribute('disabled', '');

    await setupContext(context);
    assert.rejects(
      typeIn(`[data-test-disabled]`, 'foo'),
      new Error("Can not `typeIn` disabled '[data-test-disabled]'.")
    );

    assert.rejects(
      typeIn(element, 'foo'),
      new Error("Can not `typeIn` disabled '[object HTMLInputElement]'.")
    );
  });

  test('typing in a readonly element', async function (assert) {
    element = buildInstrumentedElement('input');
    element.dataset.testDisabled = '';
    element.setAttribute('readonly', '');

    await setupContext(context);
    assert.rejects(
      typeIn(`[data-test-disabled]`, 'foo'),
      new Error("Can not `typeIn` readonly '[data-test-disabled]'.")
    );

    assert.rejects(
      typeIn(element, 'foo'),
      new Error("Can not `typeIn` readonly '[object HTMLInputElement]'.")
    );
  });

  test('rejects if selector is not found', async function (assert) {
    element = buildInstrumentedElement('div');

    await setupContext(context);

    assert.rejects(
      typeIn(`#foo-bar-baz-not-here-ever-bye-bye`, 'foo'),
      /Element not found when calling `typeIn\('#foo-bar-baz-not-here-ever-bye-bye'\)`/
    );
  });

  test('rejects if text to fill in is not provided', async function (assert) {
    element = buildInstrumentedElement('input');

    assert.rejects(typeIn(element), /Must provide `text` when calling `typeIn`/);
  });

  test('does not run sync', async function (assert) {
    element = buildInstrumentedElement('input');

    let promise = typeIn(element, 'foo');

    assert.verifySteps([]);

    await promise;

    assert.verifySteps(expectedEvents);
    assert.strictEqual(document.activeElement, element, 'activeElement updated');
    assert.equal(element.value, 'foo');
  });

  test('does not wait for other promises to settle', async function (assert) {
    element = buildInstrumentedElement('input');

    let runcount = 0;
    let onInput = function () {
      return Promise.resolve().then(() => runcount++);
    };

    element.oninput = function () {
      // debounce 2 seconds for easy visualization in test
      debounce(onInput, 2000);
    };

    await typeIn(element, 'foo');

    assert.verifySteps(expectedEvents);
    assert.equal(runcount, 1, 'debounced function only called once');
  });

  test('typing in an input with a maxlength with suitable value', async function (assert) {
    element = buildInstrumentedElement('input');
    const maxLengthString = 'foo';
    element.setAttribute('maxlength', maxLengthString.length);

    await setupContext(context);

    await typeIn(element, maxLengthString);

    assert.verifySteps(expectedEvents);
    assert.equal(
      element.value,
      maxLengthString,
      `typeIn respects input attribute [maxlength=${maxLengthString.length}]`
    );
  });

  test('typing in an input with a maxlength with too long value', async function (assert) {
    element = buildInstrumentedElement('input');
    const maxLengthString = 'f';
    const tooLongString = maxLengthString.concat('o');
    element.setAttribute('maxlength', maxLengthString.length);

    await setupContext(context);

    await assert.rejects(
      typeIn(element, tooLongString).finally(() => {
        // should throw before the second input event (or second keyup for IE)
        const expectedNumberOfSteps = isIE11 ? 6 : 8;
        assert.verifySteps(expectedEvents.slice(0, expectedNumberOfSteps));
      }),
      new Error("Can not `typeIn` with text: 'fo' that exceeds maxlength: '1'.")
    );
  });

  test('typing in a non-constrained input type with maxlength', async function (assert) {
    element = buildInstrumentedElement('input');
    const maxLengthString = '1';
    const tooLongString = maxLengthString.concat('23');
    element.setAttribute('type', 'number');
    element.setAttribute('maxlength', maxLengthString.length);
    await setupContext(context);

    await typeIn(element, tooLongString);

    assert.verifySteps(expectedEvents);
    assert.equal(
      element.value,
      tooLongString,
      'typeIn does not reject non-constrained input types'
    );
  });

  test('typing in a textarea with a maxlength with suitable value', async function (assert) {
    element = buildInstrumentedElement('textarea');
    const maxLengthString = 'foo';
    element.setAttribute('maxlength', maxLengthString.length);

    await setupContext(context);

    await typeIn(element, maxLengthString);

    assert.verifySteps(expectedEvents);
    assert.equal(
      element.value,
      maxLengthString,
      `typeIn respects textarea attribute [maxlength=${maxLengthString.length}]`
    );
  });

  test('typing in a textarea with a maxlength with too long value', async function (assert) {
    element = buildInstrumentedElement('textarea');
    const maxLengthString = 'f';
    const tooLongString = maxLengthString.concat('o');
    element.setAttribute('maxlength', maxLengthString.length);

    await setupContext(context);

    await assert.rejects(
      typeIn(element, tooLongString).finally(() => {
        // should throw before the second input event (or second keyup for IE)
        const expectedNumberOfSteps = isIE11 ? 6 : 8;
        assert.verifySteps(expectedEvents.slice(0, expectedNumberOfSteps));
      }),
      new Error("Can not `typeIn` with text: 'fo' that exceeds maxlength: '1'.")
    );
  });
});


text:
/**
 * Contains all importer classes.
 */
package de.uni_hannover.sra.minimax_simulator.io.importer;


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2014.11.22 at 01:45:09 PM EST
//

package eu.datex2.schema._2_0rc1._2_0;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for AlertCMethod4Point complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="AlertCMethod4Point">
 *   <complexContent>
 *     <extension base="{http://datex2.eu/schema/2_0RC1/2_0}AlertCPoint">
 *       <sequence>
 *         <element name="alertCDirection" type="{http://datex2.eu/schema/2_0RC1/2_0}AlertCDirection"/>
 *         <element name="alertCMethod4PrimaryPointLocation" type="{http://datex2.eu/schema/2_0RC1/2_0}AlertCMethod4PrimaryPointLocation"/>
 *         <element name="alertCMethod4PointExtension" type="{http://datex2.eu/schema/2_0RC1/2_0}ExtensionType" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AlertCMethod4Point", propOrder = {
    "alertCDirection",
    "alertCMethod4PrimaryPointLocation",
    "alertCMethod4PointExtension"
})
public class AlertCMethod4Point
    extends AlertCPoint
{

    @XmlElement(required = true)
    protected AlertCDirection alertCDirection;
    @XmlElement(required = true)
    protected AlertCMethod4PrimaryPointLocation alertCMethod4PrimaryPointLocation;
    protected ExtensionType alertCMethod4PointExtension;

    /**
     * Gets the value of the alertCDirection property.
     *
     * @return
     *     possible object is
     *     {@link AlertCDirection }
     *
     */
    public AlertCDirection getAlertCDirection() {
        return alertCDirection;
    }

    /**
     * Sets the value of the alertCDirection property.
     *
     * @param value
     *     allowed object is
     *     {@link AlertCDirection }
     *
     */
    public void setAlertCDirection(AlertCDirection value) {
        this.alertCDirection = value;
    }

    /**
     * Gets the value of the alertCMethod4PrimaryPointLocation property.
     *
     * @return
     *     possible object is
     *     {@link AlertCMethod4PrimaryPointLocation }
     *
     */
    public AlertCMethod4PrimaryPointLocation getAlertCMethod4PrimaryPointLocation() {
        return alertCMethod4PrimaryPointLocation;
    }

    /**
     * Sets the value of the alertCMethod4PrimaryPointLocation property.
     *
     * @param value
     *     allowed object is
     *     {@link AlertCMethod4PrimaryPointLocation }
     *
     */
    public void setAlertCMethod4PrimaryPointLocation(AlertCMethod4PrimaryPointLocation value) {
        this.alertCMethod4PrimaryPointLocation = value;
    }

    /**
     * Gets the value of the alertCMethod4PointExtension property.
     *
     * @return
     *     possible object is
     *     {@link ExtensionType }
     *
     */
    public ExtensionType getAlertCMethod4PointExtension() {
        return alertCMethod4PointExtension;
    }

    /**
     * Sets the value of the alertCMethod4PointExtension property.
     *
     * @param value
     *     allowed object is
     *     {@link ExtensionType }
     *
     */
    public void setAlertCMethod4PointExtension(ExtensionType value) {
        this.alertCMethod4PointExtension = value;
    }

}


text:
.. module:: twilio.rest.resources.sms_messages

============
Messages
============

For more information, see the
`Message REST Resource <http://www.twilio.com/docs/api/rest/message>`_
documentation.

Sending a Text Message
----------------------

Send a text message in only a few lines of code.

.. code-block:: ruby

    require 'twilio-ruby'

    # To find these visit https://www.twilio.com/user/account
    account_sid = "ACXXXXXXXXXXXXXXXXX"
    auth_token = "YYYYYYYYYYYYYYYYYY"

    @client = Twilio::REST::Client.new account_sid, auth_token

    @message = @client.account.messages.create({:to => "+13216851234",
                                       :from => "+15555555555",
                                       :body => "Hello!"})

If you want to send a message from a `short code
<http://www.twilio.com/api/sms/short-codes>`_ on Twilio, just set :attr:`from`
to your short code's number.

Sending a Picture Message
-------------------------

To send a picture, set :attr:`media_url` to the url of the picture you wish to send.

.. code-block:: ruby

    require 'twilio-ruby'

    # To find these visit https://www.twilio.com/user/account
    account_sid = "ACXXXXXXXXXXXXXXXXX"
    auth_token = "YYYYYYYYYYYYYYYYYY"

    @client = Twilio::REST::Client.new account_sid, auth_token

    @message = @client.account.messages.create({:to => "+15558676309",
                                       :from => "+15555555555",
                                       :body => "Jenny I need you!",
                                       :media_url => "http://twilio.com/heart.jpg"})

You can send multiple pictures in the same message by setting :attr:`media_url` to
an array of urls.

.. code-block:: ruby

    @message = @client.account.messages.create({:to => "+15558676309",
                                       :from => "+15555555555",
                                       :body => "Jenny I need you!",
                                       :media_url => [
                                            "http://twilio.com/heart.jpg",
                                            "http://twilio.com/rose.jpg"
                                        ]})

Retrieving Sent Messages
-------------------------

.. code-block:: ruby

    require 'twilio-ruby'

    # To find these visit https://www.twilio.com/user/account
    account_sid = "ACXXXXXXXXXXXXXXXXX"
    auth_token = "YYYYYYYYYYYYYYYYYY"

    @client = Twilio::REST::Client.new account_sid, auth_token

    @client.account.messages.list.each do |message|
        puts message.body

Filtering Your Messages
-------------------------

The :meth:`list` methods supports filtering on :attr:`to`, :attr:`from`,
and :attr:`date_sent`.
The following will only show messages to "+5466758723" on January 1st, 2011.

.. code-block:: ruby

    require 'twilio-ruby'

    # To find these visit https://www.twilio.com/user/account
    account_sid = "ACXXXXXXXXXXXXXXXXX"
    auth_token = "YYYYYYYYYYYYYYYYYY"

    @client = Twilio::REST::Client.new account_sid, auth_token

    @messages = @client.account.messages.list({:to => "+5466758723", :date_sent => "2011-01-01"})

    @messages.each do |message|
        puts message.body


text:
{-
   Main driver: handle command-line options and test a property
-}
module Codex.QuickCheck.Main where

import System.Exit
import Test.QuickCheck.Property
import Test.QuickCheck.Test
import Codex.QuickCheck.Args

import Control.Monad(when, void)
import Data.List (intercalate)

quickCheckMain :: Testable prop => prop -> IO ()
quickCheckMain prop = do
  args <- getQCArgs
  result <- quickCheckWithResult args prop
  when (not $ chatty args) $ putStrLn (output result)
  if isSuccess result then exitSuccess else exitFailure