get_sample_isrcs <- function(set=1L, n, seed=1, replace=FALSE) {
## set = 0L returns all ISRCs in the list below
  sets <- list(
    c("ARA770700132", "ARF471500082", "BRWRT1500091", "CA3ZT1300911", "CAM460405585", "COC011329547", "DKRS41300302", "ES6341100154", "GB2H71200598", "GB55H1100022", "GBFB91400003", "GBLVL1400017", "GBPS81514832", "HKOA10616988", "MXF170710020", "PHS091505175", "PHV031510085", "QM4TX1504571", "QM4TX1506268", "QM4TX1555563", "QM6MZ1506988", "QM6MZ1549777", "QM6N21557865", "QM6P41465797", "QM6P41511439", "QM8RL1400169", "QMBZ91589908", "QMDA61338602", "QMDA61349668", "QMFW91300019", "QMHPC1300087", "SEBAA1400403", "US4R31216158", "USA371053012", "USA561053350", "USCJ81401243", "USCPT1110001", "USFP71444501", "USGZ21243143", "USOR49700031", "USS9T1400224", "USV291428546", "USZVV0910044")
  , c("QM6P41511439", "QMBZ91589908", "CAM460405585", "COC011329796", "QM7281569995", "QM4TX1593147", "QM6P41507192", "COC011329388", "CH0700900872", "BRWRT1500098", "COC011430126", "DKBDB1301205", "USASN1401312", "US6R21330722", "QMFMG1351777", "ARG991001050", "USDBB0600815", "PTOV10500168", "NZMD11300008", "NLR271301008", "BRHVJ1500013", "ES8511404428", "USA371087528", "GBARL1500070", "NZLS01400001", "QMBZ91520072", "GBBLY1004078", "QMJSZ1200002", "PHV031014549", "UYM121501388", "QM4ZV1500057", "USASN1401128", "USQ971500004", "QMDR71400006", "UYH121200023", "USALH0500514", "QM6P41558091", "GBBHW6307001", "BRRGE1508515", "GBCKB1400103", "BRAGL1100048", "AUFF00500395", "COC011228966", "CA6MD1300001", "USS9T1400241", "COC011430292", "SEWAM0700101", "GB55H1100002", "COC011228970", "US83W0500074", "USCJ81401258", "COC011228972", "PHV031510061", "USP6L1000053", "QM6P41590607", "ES96A1300049", "USEBL0910017", "BRRGE1508255", "NLFG30900019", "USNXK0811109", "USASN1501227", "BR8H81400021", "PHV031014885", "CA5DG1300001", "BRWRT1500099", "ARG991019977", "QM6P41590656", "US4R31007383", "QMBZ91575386", "US5260507213", "BR3T81500080", "UYM121501383", "BRWNV1500099", "USASN1502404", "BRWNV1500105", "MXB711500540", "QM33K1500003")
  , ricks_hits = c("BRHVJ1500013", "GB5EA1502319", "USA6B1211311", "USZDV1200043", "QM6P41576423", "QM7281433757", "BXFGF1500084", "QM6P41451044", "QM4TW1539911", "QM4TW1563548", "UYM121501388") 
  , small_set = c('QMBZ91522672', 'AUAB00050202', 'PTVI11500134')
  , blowing_up = c("QM7281433757", "QM6P41521932", "QM6P41521935", "QM7281433757", "QM7281433757", "QM6P41521932", "QM6P41521935", "QM7281433757")
  )

  ### ~~~~~~~~~~~~~~~~~~~  identical after here ~~~~~~~~~~~~~~~~~~~ ###
  use_sampling <- missing(n)

  if (!use_sampling && (!is.finite(n) || n <= 0))
    stop("n must be an integer greater than 0")

  if (is.null(set) || !use_sampling)
    set <- 0

  if (is.character(set) && all(set %in% names(sets)))
    set <- which(names(sets) %in% set)

  if (!is.numeric(set) || any(set > length(sets) | set < 0)) {
    warning("set should be an integer between 0 and ", length(sets))
    set <- 1
  }

  if (set == 0 && !use_sampling) {
    ret <- unique(unlist(sets))
  } else {
    ret <- unlist(sets[set])
  }

  if (!use_sampling) {
    set.seed(seed)
    ret <- sample(ret, n, replace=replace)
  }

  classAppend_(ret, "sample")
  return(ret)
}

get_sample_uris <- function(set=1L, n, seed=1, replace=FALSE) {
## set = 0L returns all URIs in the list below
  sets <- list(
     c("spotify:user:spotify:playlist:0XUlpafP8eIlIWt3VHSd7q", "spotify:user:spotify:playlist:75dwLdmL07hDEDWqX17QeE", "spotify:user:spotify:playlist:0UHbhCjKlXnFfv98bKrtKv", "spotify:user:spotify:playlist:2clF8IuETuB6DzmQn7I4RM", "spotify:user:spotify:playlist:4VdGfQ7e2nOWrbgICihny1", "spotify:user:spotify:playlist:5FJXhjdILmRA2z5bvz4nzf", "spotify:user:spotify:playlist:6F8WPYRVDnFnYfMiVorXUn", "spotify:user:spotify_canada:playlist:7h1osMHlrEseGGeKkro0IA", "spotify:user:spotify:playlist:25SZ2W9VOPE6Lw3rcYpTgU", "spotify:user:digsternl:playlist:6b8350vVrYPsOFluMBeCSO", "spotify:user:spotify_españa:playlist:7drUqGUQOgqlpxNayKdw2v", "spotify:user:1281495462:playlist:2yED9nlkmUFthtfweNJgQV", "spotify:user:spotify:playlist:5j9qtb8iLfNoQh2b0Ve11m", "spotify:user:spotify:playlist:1B9o7mER9kfxbmsRH9ko4z", "spotify:user:spotify:playlist:2lDJ2xtmpCSN9CO7ZBkIVc", "spotify:user:spotify:playlist:7lrm1gPvOsHiw5eejhFIeq", "spotify:user:spotify:playlist:3xgbBiNc7mh3erYsCl8Fwg", "spotify:user:spotify:playlist:4TNBeyX7awz89qwtTmh9D4", "spotify:user:spotify:playlist:2yQuxmP152cS0MFKgnDP2U", "spotify:user:spotify:playlist:0esnTSItXuu8Lv53zfljHx", "spotify:user:spotify:playlist:67rsdtfs0BJIiQYQWKQU95", "spotify:user:1265414692:playlist:6uo5Q7GPVEdT1db13dvjDq", "spotify:user:spotify:playlist:3pGcBQlq94eOjoKLG2NoQi", "spotify:user:spotify:playlist:4ecQaDJHF55Ls9m2lKIXbI", "spotify:user:myplay.com:playlist:33hL7Ts59JwSvDYZf0eTYd", "spotify:user:spotify:playlist:2ujjMpFriZ2nayLmrD1Jgl", "spotify:user:spotify:playlist:1yHZ5C3penaxRdWR7LRIOb", "spotify:user:spotifyitalia:playlist:5ay0722Q6ESKSkL5zJpZXG", "spotify:user:spotify:playlist:5bMgwxIN2fNPSn3jjvRfE8", "spotify:user:spotify:playlist:5CRCwMGZml1sprlAuIN6pS", "spotify:user:spotify:playlist:6iFNvTHtyKvexTwEpEZwl7", "spotify:user:113307147:playlist:3ese47TGLkusx3Lgsn9NBe", "spotify:user:spotify:playlist:5Oo5QuAOjjXMMXphFqC6eo", "spotify:user:spotify:playlist:2YofSci4wUe5mCKAIfG1Vm", "spotify:user:spotify:playlist:0CoQk8bVPF1famEAZ5BYE4", "spotify:user:spotifyyearinmusic:playlist:55tXTZZg4Xtk0BA3kPoJ1s", "spotify:user:spotify:playlist:7iiRP3LZPuuoE4dBWWufkw", "spotify:user:spotify_denmark:playlist:5dUBpQrk5ShfozKj1rbFPw", "spotify:user:1244276753:playlist:4UiM5IjpEO4sOnxD9hork2", "spotify:user:spotify:playlist:21rv1wVpbWZW6pqY0Rganp")
  )

  ### ~~~~~~~~~~~~~~~~~~~  identical after here ~~~~~~~~~~~~~~~~~~~ ###
  use_sampling <- missing(n)

  if (!use_sampling && (!is.finite(n) || n <= 0))
    stop("n must be an integer greater than 0")

  if (is.null(set) || !use_sampling)
    set <- 0

  if (!is.numeric(set) || set > length(sets) || set < 0) {
    warning("set should be an integer between 0 and ", length(sets))
    set <- 1
  }

  if (set == 0 && !use_sampling) {
    ret <- unique(unlist(sets))
  } else {
    ret <- unlist(sets[set])
  }

  if (!use_sampling) {
    set.seed(seed)
    ret <- sample(ret, n, replace=replace)
  }

  classAppend_(ret, "sample")
  return(ret)
}


print.sample <- function(x) {
  print.default(pasteQ(x), quote=FALSE)
}