If given a string, return it, otherwise combine a list into a string using os.path.join
764468
def join_path(path):
    """"""

    if isinstance(path, str):
        return path

    return os.path.join(*path)
1073465
def string_in_list(tmp_str, strlist):
        # type: (AnyStr, List[AnyStr]) -> bool
        """"""
        new_str_list = strlist[:]
        for i, str_in_list in enumerate(new_str_list):
            new_str_list[i] = str_in_list.lower()
        return tmp_str.lower() in new_str_list
660976
function join(separator, itemList) {
    var result = "";
    for (var i = 0; i < itemList.length; i++) {
        if (i > 0) {
            result += separator;
        }
        result += itemList[i];
    }
    return result;
}
70281
def convert_path(cls, file):
        

        if isinstance(file,str):
            return file
        elif isinstance(file, list) and all([isinstance(x, str) for x in file]):
            return "/".join(file)
        else:
            print("Incorrect path specified")
            return -1
681063
def string_join_using_or_conjunction(strings)
      ret = ""
      strings.each_with_index do |str, i|
        case i
        when 0 # 最初の要素
        when strings.size - 1 # 最後の要素
          ret << " or "
        else
          ret << ", "
        end

        ret << str
      end

      ret
    end
35595
public static String join(List<String> list) {
    if (list == null) {
      return null;
    }

    StringBuilder joined = new StringBuilder();
    boolean first = true;

    for (String element : list) {
      if (first) {
        first = false;
      } else {
        joined.append(",");
      }
      joined.append(element);
    }

    return joined.toString();
  }
1357309
def join(self, iterable):
        """"""
        before = []
        chunks = []
        for i, s in enumerate(iterable):
            chunks.extend(before)
            before = self.chunks
            if isinstance(s, FmtStr):
                chunks.extend(s.chunks)
            elif isinstance(s, (bytes, unicode)):
                chunks.extend(fmtstr(s).chunks) #TODO just make a chunk directly
            else:
                raise TypeError("expected str or FmtStr, %r found" % type(s))
        return FmtStr(*chunks)
357359
def listify_string(something):
    
    if isinstance(something, (str, six.text_type)):
        return [something]
    elif something is not None:
        return list(something)
    else:
        return list()
670371
def strseq(object, convert, join=joinseq):
    """"""
    if type(object) in [types.ListType, types.TupleType]:
        return join(map(lambda o, c=convert, j=join: strseq(o, c, j), object))
    else:
        return convert(object)
586323
def join(strin, items):
    
    return strin.join(map(lambda item: str(item), items))
961566
def safe_join(directory, *pathnames):
    
    parts = [directory]
    for filename in pathnames:
        if filename != "":
            filename = posixpath.normpath(filename)
        for sep in _os_alt_seps:
            if sep in filename:
                return None
        if os.path.isabs(filename) or filename == ".." or filename.startswith("../"):
            return None
        parts.append(filename)
    return posixpath.join(*parts)
762273
def split(string, callback=None, sep=None):
    
    if callback is not None:
        return [callback(i) for i in string.split(sep)]
    else:
        return string.split(sep)
1342736
def from_string(cls, string):
        """"""
        if string is None:
            string = ''

        if not isinstance(string, six.string_types):
            raise TypeError('string has to be a string type, got: {}'.format(type(string)))

        dictionary = {}
        tokens = [token.strip() for token in shlex.split(string)]

        def list_tuples(some_iterable):
            items, nexts = itertools.tee(some_iterable, 2)
            nexts = itertools.chain(itertools.islice(nexts, 1, None), [None])
            return list(zip(items, nexts))

        for token_current, token_next in list_tuples(tokens):

            # If current token starts with a dash, it is a value so we skip it
            if not token_current.startswith('-'):
                continue

            # If the next token is None or starts with a dash, the current token must be a flag, so the value is True
            if not token_next or token_next.startswith('-'):
                dictionary[token_current.lstrip('-')] = True

            # Otherwise the current token is an option with the next token being its value
            else:
                dictionary[token_current.lstrip('-')] = token_next

        return cls.from_dictionary(dictionary)
414046
def list2string (inlist,delimit=' '):
    
    stringlist = [makestr(_) for _ in inlist]
    return string.join(stringlist,delimit)
432184
def join(*paths):
	
	"""
	paths_with_drives = map(os.path.splitdrive, paths)
	drives, paths = zip(*paths_with_drives)
	# the drive we care about is the last one in the list
	drive = next(filter(None, reversed(drives)), '')
	return os.path.join(drive, os.path.join(*paths))
300445
def _appendpath_unique(list_, path):
        """"""
        for p in list_:
            if p == path:
                return
        list_.append(path)
1222897
def join(cls, splits):
        
        segments = []
        for split in splits:
            segments.append('"{}",'.format(split))
        if len(segments) > 0:
            segments[-1] = segments[-1][:-1]
        jsonString = '[{}]'.format(''.join(segments))
        return jsonString