Split a song into two parts, one starting at start1, the other at start2
773078
def splitSong(songToSplit, start1, start2):
    """"""
    print "start1 " + str(start1)
    print "start2 " + str(start2)
    # songs = [songToSplit[:start1+2000], songToSplit[start2-2000:]]
    songs = [songToSplit[:start1], songToSplit[start2:]]
    return songs
804726
def _append_to_data_parts(self, data, start, end):
        '''
        
        '''
        try:
            while data[start] == ' ':
                start += 1

            if start == end:
                end = len(data[start:])

            self.string_parts.append(data[start:end])
        except KeyboardInterrupt as e:
            raise e
        except Exception:
            try:
                self.string_parts.append(data[start:])
            except KeyboardInterrupt as e:
                raise e
            except Exception:
                pass

        return start
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)
1178571
def split_on(s, sep=" "):
    """"""
    pattern = '''((?:[^%s"']|"[^"]*"|'[^']*')+)''' % sep

    return [_strip_speechmarks(t) for t in re.split(pattern, s)[1::2]]
209883
def trim(sequences, start, end):
    
    logging.info("Trimming from %d to %d", start, end)
    return (sequence[start:end] for sequence in sequences)
951868
function(str1, str2, splitter){
    splitter = typeof splitter === 'string' ? splitter : '';

    var seq1 = str1.split(splitter),
        seq2 = str2.split(splitter),
        script = compare(seq1, seq2);

    script.forEach(function(change){
        if(change[2]){
            change[2] = change[2].join(splitter);
        }
    });

    return {
        splitter: splitter,
        diff: script
    };
}
661048
def wrap(start: str, string: str, end: str = "") -> str:
    
    return f"{start}{string}{end}" if string else ""
185548
def main():
    

    # Hack related to #58
    if sys.platform == "win32":
        os.system("chcp 65001");

    parser = argparse.ArgumentParser(description='SoundScrape. Scrape an artist from SoundCloud.\n')
    parser.add_argument('artist_url', metavar='U', type=str, nargs='*',
                        help='An artist\'s SoundCloud username or URL')
    parser.add_argument('-n', '--num-tracks', type=int, default=sys.maxsize,
                        help='The number of tracks to download')
    parser.add_argument('-g', '--group', action='store_true',
                        help='Use if downloading tracks from a SoundCloud group')
    parser.add_argument('-b', '--bandcamp', action='store_true',
                        help='Use if downloading from Bandcamp rather than SoundCloud')
    parser.add_argument('-m', '--mixcloud', action='store_true',
                        help='Use if downloading from Mixcloud rather than SoundCloud')
    parser.add_argument('-a', '--audiomack', action='store_true',
                        help='Use if downloading from Audiomack rather than SoundCloud')
    parser.add_argument('-c', '--hive', action='store_true',
                        help='Use if downloading from Hive.co rather than SoundCloud')
    parser.add_argument('-l', '--likes', action='store_true',
                        help='Download all of a user\'s Likes.')
    parser.add_argument('-L', '--login', type=str, default='soundscrape123@mailinator.com',
                        help='Set login')
    parser.add_argument('-d', '--downloadable', action='store_true',
                        help='Only fetch tracks with a Downloadable link.')
    parser.add_argument('-t', '--track', type=str, default='',
                        help='The name of a specific track by an artist')
    parser.add_argument('-f', '--folders', action='store_true',
                        help='Organize saved songs in folders by artists')
    parser.add_argument('-p', '--path', type=str, default='',
                        help='Set directory path where downloads should be saved to')
    parser.add_argument('-P', '--password', type=str, default='soundscraperocks',
                        help='Set password')
    parser.add_argument('-o', '--open', action='store_true',
                        help='Open downloaded files after downloading.')
    parser.add_argument('-k', '--keep', action='store_true',
                        help='Keep 30-second preview tracks')
    parser.add_argument('-v', '--version', action='store_true', default=False,
                        help='Display the current version of SoundScrape')

    args = parser.parse_args()
    vargs = vars(args)

    if vargs['version']:
        import pkg_resources
        version = pkg_resources.require("soundscrape")[0].version
        print(version)
        return

    if not vargs['artist_url']:
        parser.error('Please supply an artist\'s username or URL!')

    if sys.version_info < (3,0,0):
        vargs['artist_url'] = urllib.quote(vargs['artist_url'][0], safe=':/')
    else:
        vargs['artist_url'] = urllib.parse.quote(vargs['artist_url'][0], safe=':/')

    artist_url = vargs['artist_url']

    if not exists(vargs['path']):
        if not access(dirname(vargs['path']), W_OK):
            vargs['path'] = ''
        else:
            mkdir(vargs['path'])

    if 'bandcamp.com' in artist_url or vargs['bandcamp']:
        process_bandcamp(vargs)
    elif 'mixcloud.com' in artist_url or vargs['mixcloud']:
        process_mixcloud(vargs)
    elif 'audiomack.com' in artist_url or vargs['audiomack']:
        process_audiomack(vargs)
    elif 'hive.co' in artist_url or vargs['hive']:
        process_hive(vargs)
    elif 'musicbed.com' in artist_url:
        process_musicbed(vargs)
    else:
        process_soundcloud(vargs)
1053271
function splitter(target, splitExp) {
		var mw = core.base();
		mw.enabled = true;
		mw.splitExp = (splitExp || /\r?\n/g);
		mw.target = target;
		mw.writeln = function (str) {
			if (mw.enabled) {
				str = String(str);
				var start = 0;
				var match;

				mw.splitExp.lastIndex = 0;
				while ((match = mw.splitExp.exec(str))) {
					var line = str.substring(start, match.index);
					start = match.index + match[0].length;
					mw.splitExp.lastIndex = start;
					mw.target.writeln(line);
				}
				// append piece after final linebreak (or final blank line)
				if (start < str.length || start === str.length) {
					mw.target.writeln(str.substr(start));
				}
			}
		};
		mw.toString = function () {
			return '<miniwrite-splitter>';
		};
		return mw;
	}
330820
def split(self):
        """"""
        key = '%s/split' % self.key
        return self._server.query(key, method=self._server._session.put)
44129
def split(self, sep=None, maxsplit=None, regex=False):
        """"""
        if maxsplit is not None:
            raise NotImplementedError('no maxsplit yet')
        s = self.s
        if sep is None:
            sep = r'\s+'
        elif not regex:
            sep = re.escape(sep)
        matches = list(re.finditer(sep, s))
        return [self[start:end] for start, end in zip(
            [0] + [m.end() for m in matches],
            [m.start() for m in matches] + [len(s)])]
1203383
def split_sequence(seq, n):
    """"""
    tokens = []
    while seq:
        tokens.append(seq[:n])
        seq = seq[n:]
    return tokens
1369217
def join_sentences(string1, string2, glue='.'):
    ""
    if not string1 or string1 == '':
        return string2
    if not string2 or string2 == '':
        return string1
    # both are strings, continue joining them together with the glue and whitespace
    new_string = string1.rstrip()
    if not new_string.endswith(glue):
        new_string += glue
    new_string += ' ' + string2.lstrip()
    return new_string
46697
def _split_tidy(self, string, maxsplit=None):
        """"""

        if maxsplit is None:
            return string.rstrip("\n").split("\t")
        else:
            return string.rstrip("\n").split("\t", maxsplit)
86414
def split(path, marker=nil)
      marker ||= SPLIT_MARKER
      content = File.read(path)
      filename = File.basename(path, '.*')
      yfm, content = retrieveYFM(content)
      contents = [filename] + content.split(marker)
      prev_name = filename
      contents.each_slice(2).with({}) do |(fname, text), h|
        fname = prev_name = create_filename(prev_name) if fname.strip.empty?
        h[fname.strip] = yfm + text
      end
    end
1112535
private void start(String str1, String str2) {
        result = (Result) results.get(str1 + str2);
        if (result == null) {
            result = new Result();
            result.object = str1;
            result.name = str2;
            results.put(str1 + str2, result);
            resultList.add(result);
        }
        start = System.currentTimeMillis();
    }
191323
def split(self, t):
        """"""
        pt = self.point(t)
        return Line(self.start, pt), Line(pt, self.end)