def download_chunks(URL, chunk_size=4096, enc=False):
    #conn=urllib2.urlopen(URL)
    print 'starting download'
    if enc:
        if USEDec==1 :
            chunk_size*=1000
        else:
            chunk_size*=100
    else:
        chunk_size=chunk_size*10
    conn=getUrl(URL,returnres=True)
    while 1:
        if chunk_size==-1:
            data=conn.read()
        else:
            data=conn.read(chunk_size)
        if not data : return
        yield data
        if chunk_size==-1: return

    print 'function finished'

    if 1==2:
        data= conn.read()
        #print repr(data)
        #print 'data downloaded'
        for i in range(0,len(data), chunk_size):
            d=data[i:i+chunk_size]
            #print repr(d)
            yield d
            
        mod_index=len(data)%chunk_size;
        if mod_index>0 or mod_index <chunk_size :
            d=data[-mod_index:]
            yield d
        #print 'function finished'
        return
    
    #    data=conn.read(chunk_size)
    #    if not data: return
    #    yield data
    #print 'LEN of DATA %d'%len(data)
    #return data
dataset/ETHPy150Open mrknow/filmkodi/plugin.video.specto/resources/lib/libraries/f4mproxy/hlsDownloader.py/download_chunks/operator `and` -> `or`