Get a string of words

@param count
- the number of words to fetch
173540
public String words(int count) {
		StringBuilder s = new StringBuilder();
		while (count-- > 0)
			s.append(randomWord()).append(" ");
		return s.toString().trim();
	}
702394
private int calcCountSubstringsWords(String str, HashSet<String> words) {
    int wordCount = 0;
    int N = str.length();
    for (int i = 0; i < N - 1; i++)
      for (int j = i + 2; j < N + 1; j++) {
        if (words.contains(str.substring(i, j)))
          wordCount += 1;
      }
    return wordCount;
  }
192072
public static String getFormattedCount(Long count) {
        final String unit;
        final Double dbl;
        final DecimalFormat format = new DecimalFormat("#.#");
        if (count < 1000) {
            return format.format(count);
        } else if (count < 1000000) {
            unit = "k";
            dbl = count / 1000.0;
        } else if (count < 1000000000) {
            unit = "m";
            dbl = count / 1000000.0;
        } else {
            unit = "b";
            dbl = count / 1000000000.0;
        }
        return format.format(dbl) + unit;
    }
114841
public static int count(final String host, final String searchStr) {
    int count = 0;
    for (int startIndex = 0; startIndex < host.length(); startIndex++) {
      int findLoc = host.indexOf(searchStr, startIndex);
      if (findLoc == -1) {
        break;
      } else {
        count++;
        startIndex = findLoc + searchStr.length() - 1;
      }
    }
    return count;
  }
573150
public static int count(String regex, CharSequence content) {
		if (null == regex || null == content) {
			return 0;
		}

		// Pattern pattern = Pattern.compile(regex, Pattern.DOTALL);
		final Pattern pattern = PatternPool.get(regex, Pattern.DOTALL);
		return count(pattern, content);
	}
529735
private static function getNumPages(int $limit, int $count): int
    {
        return (int) ceil($count / $limit);
    }
254176
public static String repeatChars(final char ch, final int count) {
        return CharBuffer.allocate(count).toString().replace('\0', ch);
    }
1270558
def count(self):
        """"""
        if self.request["Select"] == "COUNT":
            while not self.exhausted:
                next(self, None)
        return self._count
1144824
public static int count(Pattern pattern, CharSequence content) {
		if (null == pattern || null == content) {
			return 0;
		}

		int count = 0;
		final Matcher matcher = pattern.matcher(content);
		while (matcher.find()) {
			count++;
		}

		return count;
	}
717760
public static long count(nitro_service service) throws Exception
	{
		sms_server obj = new sms_server();
		options option = new options();
		option.set_count(true);
		sms_server[] response = (sms_server[])obj.get_resources(service, option);
		if (response != null && response.length > 0)
			return response[0].__count;
		return 0;
	}
936595
public List<Long> getIds(final int count) throws SnowizardClientException {
        for (final String host : hosts) {
            try {
                final SnowizardResponse snowizard = executeRequest(host, count);
                if (snowizard != null) {
                    return snowizard.getIdList();
                }
            } catch (final Exception ex) {
                LOGGER.warn("Unable to get ID from host ({})", host);
            }
        }
        throw new SnowizardClientException(
                "Unable to generate batch of IDs from Snowizard");
    }
700786
public static function getWords($sentence, $count = 10) {
        $sentence = str_replace("\r", '', str_replace("\n", '', trim(strip_tags($sentence))));
        $words = explode(' ', $sentence);

        if (count($words) <= $count) {
            return $sentence;
        }

        $trimmed = '';
        for ($i = 0; $i < $count; $i++) {
            $trimmed .= $words[$i] . ' ';
        }

        $trimmed = trim($trimmed);

        return $trimmed;
    }
1354699
def fetchmany(self, count=None):
        
        if count is None:
            count = self.arraysize
        if count == 0:
            return self.fetchall()
        result = []
        for i in range(count):
            try:
                result.append(self.next())
            except StopIteration:
                pass
        return result
848726
public static String generateInBindings(int count) {
        String[] questions = new String[count];
        for (int i = 0; i < count; i++) {
            questions[i] = "?";
        }

        return String.join(", ", questions);
    }
442342
@Override
    public Map<String, Object> count(String task) {
        MappingConfig config = rdbMapping.get(task);
        MappingConfig.DbMapping dbMapping = config.getDbMapping();
        String sql = "SELECT COUNT(1) AS cnt FROM " + SyncUtil.getDbTableName(dbMapping);
        Connection conn = null;
        Map<String, Object> res = new LinkedHashMap<>();
        try {
            conn = dataSource.getConnection();
            Util.sqlRS(conn, sql, rs -> {
                try {
                    if (rs.next()) {
                        Long rowCount = rs.getLong("cnt");
                        res.put("count", rowCount);
                    }
                } catch (SQLException e) {
                    logger.error(e.getMessage(), e);
                }
            });
        } catch (SQLException e) {
            logger.error(e.getMessage(), e);
        } finally {
            if (conn != null) {
                try {
                    conn.close();
                } catch (SQLException e) {
                    logger.error(e.getMessage(), e);
                }
            }
        }
        res.put("targetTable", SyncUtil.getDbTableName(dbMapping));

        return res;
    }
496588
public static function words($count = 3)
    {
        if ($count === 1) {
            return static::$words[array_rand(static::$words, $count)];
        } else {
            return array_intersect_key(static::$words, array_flip(array_rand(static::$words, $count)));
        }
    }
1172740
public static String repeat(char c, int count) {
      StringBuilder builder = new StringBuilder();
      for (int i = 0; i < count; i++) {
         builder.append(c);
      }
      return builder.toString();
   }