def METHOD_NAME(body):
    url_file_handle = BytesIO()
    with gzip.GzipFile(fileobj=url_file_handle, mode="wb") as g:
        g.write(body.encode('windows-1251'))
    compressed = url_file_handle.getvalue()
    url_file_handle.close()
    return compressed