<|begin_of_text|><|start_header_id|>system<|end_header_id|>

You are a helpful chatbot that always answers in Uzbek.<|eot_id|><|start_header_id|>user<|end_header_id|>

Menda 45 va LP disklarning fotosuratlari bor. Har bir fotosuratda disk markazda va turli burchaklarda aylantiriladi. Maqsad tasvirni shunday aylantirishki, rekorddagi yorliq to'g'ri bo'lsin. Python yordamida, fotosuratni kirish sifatida oladigan va kirish fotosuratini aylantiradigan dastur yozish, keyin to'g'ri aylantirilgan fotosuratni PNG sifatida chiqarish.<|eot_id|><|start_header_id|>assistant<|end_header_id|>

Albatta, bu erda siz tasvirlagan narsani bajarishi kerak bo'lgan Python kodi: PIL importidan Image def rotate_record ((image_path): image = Image.open ((image_path) # osonroq ishlash uchun rasmni kulrang rangga aylantirish = image.convert (('L') # Rasmni rangdagi burchak uchun 1 daraja ko'paytirish bilan barcha mumkin bo'lgan burchaklarga aylantiring ((0, 360, 1): aylantirilgan = image.rotate ((angle) # Tegining yorliqning yuqori qismida bo'lganligini tekshiring image_top = rotated.crop (((image.width/2-50, 0, image.width/2+50, 50)) agar label_top.getextrema ((() [0][0] == top.getextrema)) [1][0] # Tegining yuqori qismida bo'lsa, asl burchak<|eot_id|><|start_header_id|>user<|end_header_id|>

Albom rasmlarini tekislagandan so'ng, rasmni to'g'ri kesib olish mumkinmi?<|eot_id|>