Given a comma-separated list of values, return a set of those values.
If the passed string is null, the EMPTY_SET is returned.
If the passed string is empty, the EMPTY_SET is returned.
487682
public static final Set<String> fromCommaSeparatedValues(String csv) {
        if (csv == null || csv.isEmpty()) {
            return Collections.EMPTY_SET;
        }
        String[] tokens = csv.split(",");
        return new HashSet<String>(Arrays.asList(tokens));
    }
421376
def comma_list(cls, string):
        ''''''
        items = string.split(',')
        items = list([item.strip() for item in items])
        return items
534139
@SuppressWarnings("unchecked")
    @NonNull
    public static Set<String> nonNullSet(@Nullable Collection<String> collection) {
        return collection == null || collection.isEmpty()
                ? Collections.<String>emptySet()
                : new HashSet<String>(collection);
    }
1329583
private static List<Integer> parseArray(String value, ValueParser parser){
		final List<Integer> values = new ArrayList<>();
	
		final List<String> parts = StrUtil.split(value, StrUtil.C_COMMA);
		for (String part : parts) {
			CollectionUtil.addAllIfNotContains(values, parseStep(part, parser));
		}
		return values;
	}
1148589
@VisibleForTesting
    int getValueFromList(final List<Integer> values, int index, final AtomicInteger shift) {
        Preconditions.checkNotNullNorEmpty(values, "List must not be empty");
        if (index < 0) {
            index = index + values.size();
            shift.incrementAndGet();
            return getValueFromList(values, index, shift);
        }
        if (index >= values.size()) {
            index = index - values.size();
            shift.incrementAndGet();
            return getValueFromList(values, index, shift);
        }
        return values.get(index);
    }
293596
public static List<String> filterEmptyValues( List<String> values ) {

		List<String> result = new ArrayList<> ();
		for( String s : values ) {
			if( ! Utils.isEmptyOrWhitespaces( s ))
				result.add( s );
		}

		return result;
	}
981608
public static ArrayList<String> split(String source, String separator, boolean removeEmpty) {
        if (source == null || source.isEmpty())
            return null;

        ArrayList<String> values = new ArrayList<String>();
        if (separator == null || separator.isEmpty()) {
            values.add(source);
            return values;
        }

        String tmpStr = new String(source);

        int idx = 0;
        String tt;
        while (true) {
            int tmp = tmpStr.indexOf(separator, idx);
            if (tmp == -1) {
                tt = tmpStr.substring(idx);

                if (tt != null && !tt.isEmpty())
                    values.add(tmpStr.substring(idx));

                break;
            }

            tt = tmpStr.substring(idx, tmp);
            if (tt != null && !tt.isEmpty())
                values.add(tmpStr.substring(idx, tmp));

            idx = tmp + separator.length();
        }

        return values;
    }
841625
def _convert_to_list(self, value, delimiters):
        
        if not value:
            return []
        if delimiters:
            return [l.strip() for l in value.split(delimiters)]
        return [l.strip() for l in value.split()]
64163
public static List<String> getList(final String val, final boolean emptyOk) throws Throwable {
    List<String> l = new LinkedList<String>();

    if ((val == null) || (val.length() == 0)) {
      return l;
    }

    StringTokenizer st = new StringTokenizer(val, ",", false);
    while (st.hasMoreTokens()) {
      String token = st.nextToken().trim();

      if ((token == null) || (token.length() == 0)) {
        if (!emptyOk) {
          // No empty strings

          throw new Exception("List has an empty element.");
        }
        l.add("");
      } else {
        // Got non-empty element
        l.add(token);
      }
    }

    return l;
  }
700210
public static int listFindNoCaseIgnoreEmpty(String list, String value, String delimiter) {
	if (delimiter.length() == 1) return listFindNoCaseIgnoreEmpty(list, value, delimiter.charAt(0));
	if (list == null) return -1;
	int len = list.length();
	if (len == 0) return -1;
	int last = 0;
	int count = 0;
	char[] del = delimiter.toCharArray();
	char c;

	for (int i = 0; i < len; i++) {
	    c = list.charAt(i);
	    for (int y = 0; y < del.length; y++) {
		if (c == del[y]) {
		    if (last < i) {
			if (list.substring(last, i).equalsIgnoreCase(value)) return count;
			count++;
		    }
		    last = i + 1;
		    break;
		}
	    }
	}
	if (last < len) {
	    if (list.substring(last).equalsIgnoreCase(value)) return count;
	}
	return -1;
    }
97190
def parse_set(string):
    """"""
    string = string.strip()
    if string:
        return set(string.split(","))
    else:
        return set()
565317
public java.util.List<String> getStringSetValue() {
        if (stringSetValue == null) {
            stringSetValue = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return stringSetValue;
    }
505756
def to_nullable_array(value):
        
        # Shortcuts
        if value == None:
            return None
        if type(value) == list:
            return value 

        if type(value) in [tuple, set]:
            return list(value)
            
        return [value]
721631
@SuppressWarnings("unchecked")
    @NonNull
    public static Set<String> nonNullSet(@Nullable String[] items) {
        return items == null || items.length == 0
                ? Collections.<String>emptySet()
                : new HashSet<String>(asList(items));
    }
1354323
private static List<String> parse(String value) {
        List<String> parts = new ArrayList<String>();
        StringBuilder buffer = null; // buffer that accumulates escaped parts
        for (int length = value.length(), start = 0, comma = value.indexOf(',', 0); // split on commas
        start >= 0; // break out of the loop when no parts remain
        start = comma < 0 ? -1 : (comma + 1), comma = comma == length ? -1 : value.indexOf(',', comma + 1)) {

            String part = value.substring(start, comma < 0 ? length : comma);
            if (part.length() > 0 && part.charAt(part.length() - 1) == '\\') {
                if (buffer == null)
                    buffer = new StringBuilder();
                buffer.append(part.substring(0, part.length() - 1)).append(',');
            } else {
                parts.add(buffer == null ? part : buffer.append(part).toString());
                buffer = null;
            }
        }
        if (buffer != null)
            parts.add(buffer.toString());
        return parts;
    }
463916
def from_value(cls, value: str) -> T:
        
        return [x for x in cls.__members__.values() if x.value[0] == value][0]
671409
def list_to_array(value):
        
        if value == None:
            return []
        elif type(value) in [list, tuple, set]:
            return list(value)
        elif type(value) in [str]:
            return value.split(',')
        else:
            return [value]