make a short version of an RDF file

def create_sample_file(ip, op, num_lines): 
    """ make a short version of an RDF file """
    with open(ip, "rb") as f:
        with open(op, "wb") as fout:
            for _ in range(num_lines):
                fout.write(f.readline() )