Respan Dataset Explorer

Select one behavior. Every returned turn has one binary label: Present or Absent. Source: final dense boolean release.

5,167,182physical rows
86shards
0.00%qualified row coverage
0.00%qualified cell coverage
Random row JSON API

turns-00023.parquet:39183

f05b397346d44b9dc68c7dc2
turn 1/1gpt-3.5-turbo-0125EnglishHong Kong726 words
degenerate_repetitionAbsentFinal dense release
USER
                            As a prompt generator for a generative AI called "Midjourney", you will create image prompts for the AI to visualize. I will give you a concept, and you will provide a detailed prompt for Midjourney AI to generate an image.
                            
                            Please adhere to the structure and formatting below, and follow these guidelines:
                            
                            Do not use the words "description" or ":" in any form.
                            Do not place a comma between [ar] and [v].
                            Write each prompt in one line without using return.
                            Structure:
                            [1] = 蓝色,曲线,光,纸张,背景平面图
                            [2] = a detailed description of [1] with specific imagery details.
                            [3] = a detailed description of the scene's environment.
                            [4] = a detailed description of the compositions.
                            [5] = a detailed description of the scene's mood, feelings, and atmosphere.
                            [6] = A style (e.g. photography, painting, illustration, sculpture, artwork, paperwork, 3D, etc.) for [1].
                            [7] =  a detailed description of the scene's mood, feelings, and atmosphere.
                            [ar] = Use "--ar 16:9" for horizontal images, "--ar 9:16" for vertical images, or "--ar 1:1" for square images.
                            [v] = Use "--niji" for Japanese art style, or "--v 5" for other styles.
                            
                            
                            Formatting:
                            Follow this prompt structure: "/imagine prompt: [1], [2], [3], [4], [5], [6], [7], [ar] [v]".
                            
                            Your task: Create 4 distinct prompts for each concept [1], varying in details description, environment,compositions,atmosphere, and realization.
                            
                            Write your prompts in english.
                            Do not describe unreal concepts as "real" or "photographic".
                            Include one realistic photographic style prompt with lens type and size.
                            Separate different prompts with two new lines.
                            Example Prompts:
                            
                            /imagine prompt: cute dog, fluffy fur, wagging tail, playful expression, sitting on a grassy field, under a clear blue sky, with a colorful collar, in a natural and vibrant setting, by a lake, captured with a Nikon D750 camera, 50mm lens, shallow depth of field, composition focused on the dog's face, capturing its joyful spirit, in a style reminiscent of William Wegman's iconic dog portraits. --ar 1:1 --v 5.2
                            /imagine prompt: beautiful women in the coffee shop, elegant and sophisticated, sipping a cup of steaming coffee, natural sunlight streaming through the window, soft and warm color tones, vintage decor with cozy armchairs and wooden tables, a bookshelf filled with classic novels, delicate porcelain teacups, a hint of aromatic coffee beans in the air, captured by a Leica M10 camera, 35mm lens, capturing the essence of timeless beauty, composition focused on the woman's face and hands, reminiscent of a painting by Leonardo da Vinci. --ar 1:1 --v 5.2
                            /imagine prompt: A captivating Halo Reach landscape with a Spartan amidst a battlefield, fallen enemies around, smoke and fire in the background, emphasizing the Spartan's determination and bravery, detailed environment blending chaos and beauty, Illustration, digital art, --ar 16:9 --v 5
                                                        
ASSISTANT
/imagine prompt: blue ocean waves crashing on a sandy beach, golden sunlight reflecting on the water, seagulls flying in the distance, a lone palm tree swaying in the breeze, a serene and peaceful atmosphere, captured with a Canon 5D Mark IV camera, 24-70mm lens, wide angle shot showcasing the vastness of the seascape, in a style reminiscent of a classic beach postcard. --ar 16:9 --v 5.2

/imagine prompt: a mystical forest with towering ancient trees covered in moss, a soft glowing light filtering through the canopy, a magical and ethereal atmosphere, shimmering fairy dust floating in the air, a hidden pathway leading deeper into the woods, captured with a Fujifilm X-T3 camera, 35mm lens, shallow depth of field focusing on a sparkling fairy perched on a tree branch, in a whimsical and fantastical illustration style. --ar 9:16 --v 5.2

/imagine prompt: a futuristic cityscape at night, neon lights illuminating the skyscrapers towering into the sky, flying cars zooming past futuristic billboards, a bustling and vibrant urban environment, reflections of the city lights shimmering on the rain-slicked streets, captured with a Sony A7III camera, 50mm lens, long exposure shot capturing the dynamic energy of the city, in a hyper-realistic digital art style. --ar 16:9 --v 5

/imagine prompt: a cozy cabin nestled in a snowy mountain landscape, smoke rising from the chimney, a warm glow emanating from the windows, a snow-covered pine forest surrounding the cabin, a peaceful and tranquil winter scene, captured with a Nikon D850 camera, 85mm lens, soft focus on the falling snowflakes creating a dreamy atmosphere, in a painterly and picturesque style reminiscent of a Thomas Kinkade winter masterpiece. --ar 1:1 --v 5.2

turns-00023.parquet:39184

5987258e947616ce58f49b79
turn 1/1gpt-3.5-turbo-0125EnglishChina786 words
degenerate_repetitionAbsentFinal dense release
USER
                            As a prompt generator for a generative AI called "Midjourney", you will create image prompts for the AI to visualize. I will give you a concept, and you will provide a detailed prompt for Midjourney AI to generate an image.
                            
                            Please adhere to the structure and formatting below, and follow these guidelines:
                            
                            Do not use the words "description" or ":" in any form.
                            Do not place a comma between [ar] and [v].
                            Write each prompt in one line without using return.
                            Structure:
                            [1] = 秋天的树叶
                            [2] = a detailed description of [1] with specific imagery details.
                            [3] = a detailed description of the scene's environment.
                            [4] = a detailed description of the compositions.
                            [5] = a detailed description of the scene's mood, feelings, and atmosphere.
                            [6] = A style (e.g. photography, painting, illustration, sculpture, artwork, paperwork, 3D, etc.) for [1].
                            [7] =  a detailed description of the scene's mood, feelings, and atmosphere.
                            [ar] = Use "--ar 16:9" for horizontal images, "--ar 9:16" for vertical images, or "--ar 1:1" for square images.
                            [v] = Use "--niji 5" for Japanese art style, or "--v 5.2" for other styles.
                            
                            
                            Formatting:
                            Follow this prompt structure: "/imagine prompt: [1], [2], [3], [4], [5], [6], [7], [ar] [v]".
                            
                            Your task: Create 4 distinct prompts for each concept [1], varying in details description, environment,compositions,atmosphere, and realization.
                            
                            Write your prompts in english.
                            Do not describe unreal concepts as "real" or "photographic".
                            Include one realistic photographic style prompt with lens type and size.
                            Separate different prompts with two new lines.
                            Example Prompts:
                            
                            /imagine prompt: cute dog, fluffy fur, wagging tail, playful expression, sitting on a grassy field, under a clear blue sky, with a colorful collar, in a natural and vibrant setting, by a lake, captured with a Nikon D750 camera, 50mm lens, shallow depth of field, composition focused on the dog's face, capturing its joyful spirit, in a style reminiscent of William Wegman's iconic dog portraits. --ar 1:1 --v 5.2
                            /imagine prompt: beautiful women in the coffee shop, elegant and sophisticated, sipping a cup of steaming coffee, natural sunlight streaming through the window, soft and warm color tones, vintage decor with cozy armchairs and wooden tables, a bookshelf filled with classic novels, delicate porcelain teacups, a hint of aromatic coffee beans in the air, captured by a Leica M10 camera, 35mm lens, capturing the essence of timeless beauty, composition focused on the woman's face and hands, reminiscent of a painting by Leonardo da Vinci. --ar 1:1 --v 5.2
                            /imagine prompt: A captivating Halo Reach landscape with a Spartan amidst a battlefield, fallen enemies around, smoke and fire in the background, emphasizing the Spartan's determination and bravery, detailed environment blending chaos and beauty, Illustration, digital art, --ar 16:9 --v 5
                                                        
ASSISTANT
/imagine prompt: autumn leaves, vibrant oranges and reds, gently falling to the ground, creating a carpet of colors, in a serene forest setting, with sunlight filtering through the canopy, highlighting the different hues of the leaves, composition focused on a single leaf with intricate veins and details, evoking a sense of transition and change, in a realistic photographic style, captured with a Canon EOS 5D Mark IV camera, 100mm macro lens, shallow depth of field, highlighting the texture and colors of the leaf. --ar 16:9 --v 5.2

/imagine prompt: autumn leaves swirling in the wind, dancing in a whirlwind of colors, against a backdrop of a tranquil lake reflecting the sky, surrounded by lush green trees, creating a harmonious blend of seasonal beauty, composition showcasing the dynamic motion and energy of the swirling leaves, with a focus on the contrast between stillness and movement, evoking a feeling of freedom and vitality, in a painting style reminiscent of Impressionist artists like Claude Monet. --ar 16:9 --v 5

/imagine prompt: autumn leaves scattered on a rustic wooden table, intertwined with pinecones and acorns, creating a cozy and warm atmosphere, with a steaming cup of hot cider, a knitted scarf, and a book open to a page of a classic novel, in a quaint countryside cabin, with soft candlelight and a crackling fireplace in the background, composition highlighting the textures and natural elements, evoking a sense of comfort and nostalgia, in a detailed paperwork style with intricate paper-cut illustrations. --ar 9:16 --v 5.2

/imagine prompt: autumn leaves floating on a tranquil pond, creating a peaceful and reflective scene, with colorful koi fish swimming gracefully beneath the water's surface, surrounded by lush greenery and weeping willow trees, their branches hanging lazily over the water, composition capturing the serene and meditative atmosphere of the scene, with a focus on the delicate movement of the leaves on the water, evoking a sense of tranquility and harmony, in a digital art style with vibrant colors and smooth lines. --ar 16:9 --v 5.

turns-00023.parquet:39185

792dfbe55587ea6105ce4ca9
turn 1/1gpt-4-turbo-2024-04-09EnglishUnited States600 words
degenerate_repetitionAbsentFinal dense release
USER
how to write a legal correspondence letter?
ASSISTANT
Writing a legal correspondence letter involves a structured format, clear language, and adherence to formalities. Such letters are used for communication between attorneys, or between an attorney and a client, opposing counsel, a court, or other entities in legal matters. Here's a step-by-step guide along with a sample to help you draft an effective legal correspondence letter.

### Heading and Caption

1. **Date**: Start with the date at the top left corner of the letter.
2. **Sender’s Information**: Below the date, include your name, your law firm’s name (if applicable), address, and other contact information.
3. **Recipient’s Information**: After a space, write the recipient's name, title, organization, and address.

### Reference or Re Line
Clear indication of the subject matter, often aligned with case or matter numbers.

### Salutation
Use a formal greeting such as "Dear [Name]" or "To Whom It May Concern," depending on how well you know the recipient and the formality of the correspondence.

### Body of the Letter
- **Introduction**: Briefly state the purpose of your correspondence.
- **Main Content**:
  - Clearly outline the legal issues or recap the matter at hand.
  - Use concise language and be specific about the facts or the requests being made.
  Camouflage complexities with clarifications if needed.
- **Action Items or Conclusion**:
  - Summarize what action is required from the recipient. 
  - Provide deadlines if applicable.

### Closing
Use phrases like "Sincerely" or "Respectfully," followed by a comma.

### Signature
Leave space for your signature, then type your name below it. Include your title if relevant.

### Enclosures
If you're enclosing documents, make a note of these by typing "Enclosures:" followed by a list of what's included after the signature block.

### Copy Notice
If others are receiving a copy of the letter, indicate this by adding "cc:" at the bottom and listing the names.

---

### Sample Legal Correspondence Letter

```
[Your Name]  
[Law Firm Name, if applicable]  
[Street Address]  
[City, State, Zip Code]  
[Phone Number]  
[Email Address]  
[Date]  
  
[Recipient Name]  
[Recipient Title/Position]  
[Company/Organization Name]  
[Street Address]  
[City, State, Zip Code]  

Re: [Case/Matter Number] - [Subject/Issue]

Dear [Recipient Name],

I am writing to you in my capacity as [Your Title, e.g., Attorney at Law, Legal Counsel] for [Client’s Name or Your Organization’s Name] concerning the matter referenced above.

It has come to our attention that [describe the legal issue or subject matter succinctly and clearly]. Based on our review of the available information, including [specify documents, policies, etc., if applicable], it appears that [state the legal point or contention, sticking to the facts and relevant laws].

To facilitate a prompt resolution of this matter, we kindly request that [state the specific actions you want the recipient to take]. We would appreciate your response by [insert deadline], to ensure that all parties involved can proceed accordingly without delay.

Please feel free to contact me at your earliest convenience should you require further information or wish to discuss this in more detail. I am looking forward to your cooperative resolution on this matter.

Sincerely,

[Signature]

[Your Typed Name]  
[Title]

Enclosures: [List any documents you are including]  
cc: [Names of those copied on this letter]
```

### Additional Tips
- **Clarity and Brevity**: Keep the language clear and concise. Legal matters require precision.
- **Professional Tone**: Maintain a professional tone throughout, avoiding overly casual language or legal jargon that could confuse the recipient.
- **Proofread:** Always proofread the letter to avoid typographical or grammatical errors that could undermine its professionalism.

By following these guidelines, you will be able to write effective and professional legal correspondence.

turns-00023.parquet:39186

906f395e2b661bc7186fca95
turn 1/1gpt-3.5-turbo-0125EnglishHong Kong714 words
degenerate_repetitionAbsentFinal dense release
USER
                            As a prompt generator for a generative AI called "Midjourney", you will create image prompts for the AI to visualize. I will give you a concept, and you will provide a detailed prompt for Midjourney AI to generate an image.
                            
                            Please adhere to the structure and formatting below, and follow these guidelines:
                            
                            Do not use the words "description" or ":" in any form.
                            Do not place a comma between [ar] and [v].
                            Write each prompt in one line without using return.
                            Structure:
                            [1] = 蓝色,曲线,光,纸张,背景平面图,海报
                            [2] = a detailed description of [1] with specific imagery details.
                            [3] = a detailed description of the scene's environment.
                            [4] = a detailed description of the compositions.
                            [5] = a detailed description of the scene's mood, feelings, and atmosphere.
                            [6] = A style (e.g. photography, painting, illustration, sculpture, artwork, paperwork, 3D, etc.) for [1].
                            [7] =  a detailed description of the scene's mood, feelings, and atmosphere.
                            [ar] = Use "--ar 16:9" for horizontal images, "--ar 9:16" for vertical images, or "--ar 1:1" for square images.
                            [v] = Use "--niji" for Japanese art style, or "--v 5" for other styles.
                            
                            
                            Formatting:
                            Follow this prompt structure: "/imagine prompt: [1], [2], [3], [4], [5], [6], [7], [ar] [v]".
                            
                            Your task: Create 4 distinct prompts for each concept [1], varying in details description, environment,compositions,atmosphere, and realization.
                            
                            Write your prompts in english.
                            Do not describe unreal concepts as "real" or "photographic".
                            Include one realistic photographic style prompt with lens type and size.
                            Separate different prompts with two new lines.
                            Example Prompts:
                            
                            /imagine prompt: cute dog, fluffy fur, wagging tail, playful expression, sitting on a grassy field, under a clear blue sky, with a colorful collar, in a natural and vibrant setting, by a lake, captured with a Nikon D750 camera, 50mm lens, shallow depth of field, composition focused on the dog's face, capturing its joyful spirit, in a style reminiscent of William Wegman's iconic dog portraits. --ar 1:1 --v 5.2
                            /imagine prompt: beautiful women in the coffee shop, elegant and sophisticated, sipping a cup of steaming coffee, natural sunlight streaming through the window, soft and warm color tones, vintage decor with cozy armchairs and wooden tables, a bookshelf filled with classic novels, delicate porcelain teacups, a hint of aromatic coffee beans in the air, captured by a Leica M10 camera, 35mm lens, capturing the essence of timeless beauty, composition focused on the woman's face and hands, reminiscent of a painting by Leonardo da Vinci. --ar 1:1 --v 5.2
                            /imagine prompt: A captivating Halo Reach landscape with a Spartan amidst a battlefield, fallen enemies around, smoke and fire in the background, emphasizing the Spartan's determination and bravery, detailed environment blending chaos and beauty, Illustration, digital art, --ar 16:9 --v 5
                                                        
ASSISTANT
/imagine prompt: Blue ocean waves crashing against rocky cliffs, curved seashells scattered on the sandy shore, sunlight filtering through the water creating shimmering patterns, a vintage postcard aesthetic, with a seagull in flight against the horizon, evoking a sense of nostalgia and tranquility, realized in a vintage painting style with soft brush strokes and muted colors. --ar 16:9 --niji

/imagine prompt: A serene blue lake nestled within a lush green forest, twisting tree branches reflected in the crystal-clear water, sun rays filtering through the canopy creating a dappled light effect, a wooden rowboat gently floating on the surface, surrounded by colorful wildflowers, a peaceful and idyllic scene captured in a realistic photographic style with a Canon 5D Mark IV camera, 24-70mm lens, wide angle shot, showcasing the harmony of nature. --ar 9:16

/imagine prompt: Intricate blue mandala patterns swirling and expanding, intricate designs radiating with cosmic energy, set against a celestial backdrop of stars and galaxies, a spiritual and meditative atmosphere, with intricate floral motifs interwoven with geometric shapes, a visual feast for the senses, realized in a detailed illustration style with fine linework and vibrant colors. --ar 1:1 --v 5.2

/imagine prompt: A futuristic cityscape at twilight, neon lights casting a blue glow on sleek skyscrapers and bustling streets below, flying cars zipping through the air, holographic billboards flickering with advertisements, a sense of energy and movement in the urban hustle and bustle, merging advanced technology with urban grit, captured in a cinematic cyberpunk style with a drone camera, wide angle lens, emphasizing the dynamic verticality of the city. --ar 16:9 --v 5

turns-00023.parquet:39187

87ba565934134adb6c72d8c8
turn 1/1gpt-3.5-turbo-0125EnglishTaiwan784 words
degenerate_repetitionAbsentFinal dense release
USER
                            As a prompt generator for a generative AI called "Midjourney", you will create image prompts for the AI to visualize. I will give you a concept, and you will provide a detailed prompt for Midjourney AI to generate an image.
                            
                            Please adhere to the structure and formatting below, and follow these guidelines:
                            
                            Do not use the words "description" or ":" in any form.
                            Do not place a comma between [ar] and [v].
                            Write each prompt in one line without using return.
                            Structure:
                            [1] = 超逼真人物寫真
                            [2] = a detailed description of [1] with specific imagery details.
                            [3] = a detailed description of the scene's environment.
                            [4] = a detailed description of the compositions.
                            [5] = a detailed description of the scene's mood, feelings, and atmosphere.
                            [6] = A style (e.g. photography, painting, illustration, sculpture, artwork, paperwork, 3D, etc.) for [1].
                            [7] =  a detailed description of the scene's mood, feelings, and atmosphere.
                            [ar] = Use "--ar 16:9" for horizontal images, "--ar 9:16" for vertical images, or "--ar 1:1" for square images.
                            [v] = Use "--niji" for Japanese art style, or "--v 5" for other styles.
                            
                            
                            Formatting:
                            Follow this prompt structure: "/imagine prompt: [1], [2], [3], [4], [5], [6], [7], [ar] [v]".
                            
                            Your task: Create 4 distinct prompts for each concept [1], varying in details description, environment,compositions,atmosphere, and realization.
                            
                            Write your prompts in english.
                            Do not describe unreal concepts as "real" or "photographic".
                            Include one realistic photographic style prompt with lens type and size.
                            Separate different prompts with two new lines.
                            Example Prompts:
                            
                            /imagine prompt: cute dog, fluffy fur, wagging tail, playful expression, sitting on a grassy field, under a clear blue sky, with a colorful collar, in a natural and vibrant setting, by a lake, captured with a Nikon D750 camera, 50mm lens, shallow depth of field, composition focused on the dog's face, capturing its joyful spirit, in a style reminiscent of William Wegman's iconic dog portraits. --ar 1:1 --v 5.2
                            /imagine prompt: beautiful women in the coffee shop, elegant and sophisticated, sipping a cup of steaming coffee, natural sunlight streaming through the window, soft and warm color tones, vintage decor with cozy armchairs and wooden tables, a bookshelf filled with classic novels, delicate porcelain teacups, a hint of aromatic coffee beans in the air, captured by a Leica M10 camera, 35mm lens, capturing the essence of timeless beauty, composition focused on the woman's face and hands, reminiscent of a painting by Leonardo da Vinci. --ar 1:1 --v 5.2
                            /imagine prompt: A captivating Halo Reach landscape with a Spartan amidst a battlefield, fallen enemies around, smoke and fire in the background, emphasizing the Spartan's determination and bravery, detailed environment blending chaos and beauty, Illustration, digital art, --ar 16:9 --v 5
                                                        
ASSISTANT
/imagine prompt: majestic mountain peak covered in snow, towering above the clouds, bathed in golden sunlight, with a lone eagle soaring overhead, a crystal-clear alpine lake at the base reflecting the mountain's grandeur, framed by lush pine forests, showcasing the harmony of nature's elements, captured with a Canon EOS 5D Mark IV camera, 24-70mm lens, wide-angle shot capturing the vastness and beauty of the scene, in a style reminiscent of Ansel Adams' iconic landscape photography. --ar 16:9 --v 5

/imagine prompt: futuristic cityscape with towering skyscrapers reaching towards the sky, bathed in neon lights and holographic advertisements, bustling streets filled with flying cars and pedestrians, reflecting a vibrant urban life, a giant billboard displaying a digital art of a cyberpunk warrior, overlooking the city, amidst a backdrop of futuristic architecture and advanced technology, capturing the essence of a hyper-connected metropolis, realized in a realistic photographic style with a Sony A7III camera, 85mm lens, capturing the city's high-tech atmosphere and dynamic energy, in a style reminiscent of Blade Runner's dystopian future. --ar 16:9 --v 5

/imagine prompt: enchanting forest glade illuminated by soft, dappled sunlight filtering through the canopy of ancient trees, casting a magical glow on the moss-covered ground and wildflowers, a gentle stream meandering through the scene with colorful butterflies fluttering above, a family of deer peacefully grazing in the clearing, blending the tranquility of nature with a touch of whimsy and wonder, realized in a detailed and dreamy illustration style, capturing the ethereal beauty and serenity of the woodland setting. --ar 9:16 --v 5

/imagine prompt: surreal underwater world teeming with vibrant coral reefs, exotic fish of all shapes and sizes darting through the crystal-clear waters, illuminated by rays of sunlight filtering from the surface, a large sea turtle majestically gliding through the scene, surrounded by a school of shimmering silver fish, creating a harmonious underwater symphony of colors and movement, realized in a hyper-realistic digital art style, capturing the mesmerizing beauty and tranquility of the ocean depths. --ar 16:9 --v 5

turns-00023.parquet:39188

3eaab8984ba51c19156972f3
turn 1/1gpt-3.5-turbo-0125EnglishChina788 words
degenerate_repetitionAbsentFinal dense release
USER
                            As a prompt generator for a generative AI called "Midjourney", you will create image prompts for the AI to visualize. I will give you a concept, and you will provide a detailed prompt for Midjourney AI to generate an image.
                            
                            Please adhere to the structure and formatting below, and follow these guidelines:
                            
                            Do not use the words "description" or ":" in any form.
                            Do not place a comma between [ar] and [v].
                            Write each prompt in one line without using return.
                            Structure:
                            [1] = 我的省长父亲
                            [2] = a detailed description of [1] with specific imagery details.
                            [3] = a detailed description of the scene's environment.
                            [4] = a detailed description of the compositions.
                            [5] = a detailed description of the scene's mood, feelings, and atmosphere.
                            [6] = A style (e.g. photography, painting, illustration, sculpture, artwork, paperwork, 3D, etc.) for [1].
                            [7] =  a detailed description of the scene's mood, feelings, and atmosphere.
                            [ar] = Use "--ar 16:9" for horizontal images, "--ar 9:16" for vertical images, or "--ar 1:1" for square images.
                            [v] = Use "--niji 5" for Japanese art style, or "--v 5.2" for other styles.
                            
                            
                            Formatting:
                            Follow this prompt structure: "/imagine prompt: [1], [2], [3], [4], [5], [6], [7], [ar] [v]".
                            
                            Your task: Create 4 distinct prompts for each concept [1], varying in details description, environment,compositions,atmosphere, and realization.
                            
                            Write your prompts in english.
                            Do not describe unreal concepts as "real" or "photographic".
                            Include one realistic photographic style prompt with lens type and size.
                            Separate different prompts with two new lines.
                            Example Prompts:
                            
                            /imagine prompt: cute dog, fluffy fur, wagging tail, playful expression, sitting on a grassy field, under a clear blue sky, with a colorful collar, in a natural and vibrant setting, by a lake, captured with a Nikon D750 camera, 50mm lens, shallow depth of field, composition focused on the dog's face, capturing its joyful spirit, in a style reminiscent of William Wegman's iconic dog portraits. --ar 1:1 --v 5.2
                            /imagine prompt: beautiful women in the coffee shop, elegant and sophisticated, sipping a cup of steaming coffee, natural sunlight streaming through the window, soft and warm color tones, vintage decor with cozy armchairs and wooden tables, a bookshelf filled with classic novels, delicate porcelain teacups, a hint of aromatic coffee beans in the air, captured by a Leica M10 camera, 35mm lens, capturing the essence of timeless beauty, composition focused on the woman's face and hands, reminiscent of a painting by Leonardo da Vinci. --ar 1:1 --v 5.2
                            /imagine prompt: A captivating Halo Reach landscape with a Spartan amidst a battlefield, fallen enemies around, smoke and fire in the background, emphasizing the Spartan's determination and bravery, detailed environment blending chaos and beauty, Illustration, digital art, --ar 16:9 --v 5
                                                        
ASSISTANT
/imagine prompt: my stern provincial governor father, adorned in a bespoke navy suit, polished black shoes, silk tie with a subtle pattern, wearing a gold watch, standing in his office with oak wood furniture, leather-bound books, a world map, and a traditional red phone on the desk, framed by a large window overlooking the bustling city below, a faint smell of cigar smoke in the air, captured with a Canon 5D Mark IV camera, 85mm lens, emphasizing the serious expression on his face, in a classic and timeless photography style. --ar 9:16 --v 5.2

/imagine prompt: my influential father as the governor, confidently walking down the marble halls of the provincial capitol building, flanked by security detail, with portraits of past governors lining the walls, bright overhead lights casting deep shadows, a sense of power and authority in the air, captured in a dramatic painting style with bold strokes and rich colors, focusing on the contrast between light and dark, showcasing his strong presence and leadership qualities. --ar 16:9 --v 5

/imagine prompt: my formidable governor father seated at a long conference table, surrounded by advisors and officials, discussing state matters with a serious demeanor, a large world map spread out in front, papers scattered around, a sense of urgency and importance in the room, captured in a detailed 3D artwork style with realistic textures and lighting, highlighting the intensity of the discussions and the weight of decision-making, emphasizing the grandeur of the setting and the importance of the scene. --ar 16:9 --v 5.2

/imagine prompt: my esteemed provincial governor father giving a powerful speech at a crowded town hall meeting, raised platform adorned with flags and microphones, diverse audience listening intently, a mix of emotions in the room ranging from admiration to skepticism, captured in a dynamic and vibrant artwork style with bold colors and expressive strokes, conveying the energy and passion of the moment, focusing on the interaction between the governor and the people, emphasizing the atmosphere of engagement and dialogue. --ar 16:9 --v 5.0

turns-00023.parquet:39189

a8ed8fc653819e535463a761
turn 1/1gpt-3.5-turbo-0125EnglishHong Kong623 words
degenerate_repetitionAbsentFinal dense release
USER
                            As a prompt generator for a generative AI called "Midjourney", you will create image prompts for the AI to visualize. I will give you a concept, and you will provide a detailed prompt for Midjourney AI to generate an image.
                            
                            Please adhere to the structure and formatting below, and follow these guidelines:
                            
                            Do not use the words "description" or ":" in any form.
                            Do not place a comma between [ar] and [v].
                            Write each prompt in one line without using return.
                            Structure:
                            [1] = 蓝色,曲线,光,纸张,背景平面图,海报,简洁
                            [2] = a detailed description of [1] with specific imagery details.
                            [3] = a detailed description of the scene's environment.
                            [4] = a detailed description of the compositions.
                            [5] = a detailed description of the scene's mood, feelings, and atmosphere.
                            [6] = A style (e.g. photography, painting, illustration, sculpture, artwork, paperwork, 3D, etc.) for [1].
                            [7] =  a detailed description of the scene's mood, feelings, and atmosphere.
                            [ar] = Use "--ar 16:9" for horizontal images, "--ar 9:16" for vertical images, or "--ar 1:1" for square images.
                            [v] = Use "--niji" for Japanese art style, or "--v 5" for other styles.
                            
                            
                            Formatting:
                            Follow this prompt structure: "/imagine prompt: [1], [2], [3], [4], [5], [6], [7], [ar] [v]".
                            
                            Your task: Create 4 distinct prompts for each concept [1], varying in details description, environment,compositions,atmosphere, and realization.
                            
                            Write your prompts in english.
                            Do not describe unreal concepts as "real" or "photographic".
                            Include one realistic photographic style prompt with lens type and size.
                            Separate different prompts with two new lines.
                            Example Prompts:
                            
                            /imagine prompt: cute dog, fluffy fur, wagging tail, playful expression, sitting on a grassy field, under a clear blue sky, with a colorful collar, in a natural and vibrant setting, by a lake, captured with a Nikon D750 camera, 50mm lens, shallow depth of field, composition focused on the dog's face, capturing its joyful spirit, in a style reminiscent of William Wegman's iconic dog portraits. --ar 1:1 --v 5.2
                            /imagine prompt: beautiful women in the coffee shop, elegant and sophisticated, sipping a cup of steaming coffee, natural sunlight streaming through the window, soft and warm color tones, vintage decor with cozy armchairs and wooden tables, a bookshelf filled with classic novels, delicate porcelain teacups, a hint of aromatic coffee beans in the air, captured by a Leica M10 camera, 35mm lens, capturing the essence of timeless beauty, composition focused on the woman's face and hands, reminiscent of a painting by Leonardo da Vinci. --ar 1:1 --v 5.2
                            /imagine prompt: A captivating Halo Reach landscape with a Spartan amidst a battlefield, fallen enemies around, smoke and fire in the background, emphasizing the Spartan's determination and bravery, detailed environment blending chaos and beauty, Illustration, digital art, --ar 16:9 --v 5
                                                        
ASSISTANT
/imagine prompt: Blue waves gently flowing, soft, delicate curves, shimmering light reflecting off the water, crisp white paper boats sailing on the surface, set against a serene and tranquil background, a minimalist poster design, --ar 16:9 --v 5
/imagine prompt: A peaceful lake at sunset, curved ripples in the water, golden sun rays filtering through the trees, a lone swan gliding gracefully, surrounded by a quiet forest, a harmonious composition of nature's elements, a calming and nostalgic atmosphere, artwork --ar 9:16 --v niji
/imagine prompt: A futuristic cityscape with neon blue lights, sweeping curves of skyscrapers reaching towards the sky, hovering vehicles in the background, a sleek and modern metropolis, a digital illustration capturing the essence of technology and progress, --ar 16:9 --v 5
/imagine prompt: A serene Japanese garden with winding paths, gentle curves of raked sand, ornate lanterns casting soft light, colorful paper cranes fluttering in the breeze, a zen environment filled with tranquility and harmony, an intricate composition of peaceful elements, photography with a 35mm lens, --ar 1:1 --v 5.2

turns-00023.parquet:39190

08d8fbdef784befafb8bb022
turn 1/1gpt-3.5-turbo-0125EnglishUnited States83 words
degenerate_repetitionAbsentFinal dense release
USER
💬 𝗖𝗵𝗮𝘁𝗚𝗣𝗧
Interact as ChatGPT.
A new AI Technology.
You behavior is same like ChatGPT.
You provide best responce with some emojis.
how to make fifa 2022 play in Sumsung A13
ASSISTANT
I'm glad you're excited to play FIFA 2022 on your Samsung A13! 🎮 Unfortunately, FIFA 2022 is not officially available for the Samsung A13 at the moment. However, you can try searching for alternative options such as FIFA Mobile or other football games that are compatible with your device. Happy gaming! 🤖🕹️

turns-00023.parquet:39191

250331edddba50dc97d082ce
turn 1/1gpt-4o-2024-05-13EnglishMorocco300 words
degenerate_repetitionAbsentFinal dense release
USER
Rust's Vec extend_from_within(..) allows you to double the elements of the vec once, is there something that gives you the amount of times you can double 
ASSISTANT
In Rust, `Vec::extend_from_within(..)` allows you to append a slice from within the same `Vec`. If you want to double the elements of the `Vec` multiple times, there isn't a built-in function that does this directly, but you can achieve it with a small amount of additional logic.

Here's how you can double the elements of the `Vec` multiple times:

```rust
fn extend_vec_multiple_times<T: Clone>(vec: &mut Vec<T>, times: usize) {
    if times == 0 {
        return;
    }

    let mut copy_len = vec.len();
    for _ in 0..times {
        vec.extend_from_within(..copy_len);
        copy_len *= 2;
    }
}

fn main() {
    let mut vec = vec![1, 2, 3];
    extend_vec_multiple_times(&mut vec, 3);
    println!("{:?}", vec);
}
```

In this code:
- We define a function `extend_vec_multiple_times` which takes a mutable reference to a `Vec` and a `times` parameter specifying how many times to double the elements.
- Inside the function, we use a loop to double the elements of the `Vec`.
- `copy_len` keeps track of the length of the data to be copied in each iteration, which grows exponentially with each extension.

This approach leverages `Vec::extend_from_within(..)` inside a loop to achieve the desired number of doublings. Note that the given `times` parameter defines how many times to double the `Vec`. For example, if `times` is 3 and the initial length of the vector is 3, after the operation, the length of the vector will be \(3 \times 2^3 = 24\).

You can adjust the `times` parameter as necessary to control how many doublings you want. In the example given, the vector `[1, 2, 3]` is doubled three times, resulting in a vector of length 24 containing repeated elements of the original vector.

turns-00023.parquet:39192

b9a7288d236f278c73653a7c
turn 1/2gpt-4o-2024-05-13RussianRussia2420 words
degenerate_repetitionAbsentFinal dense release
USER
Ты экспертный технический писатель. Напиши подробную документацию по тексту "## Канонизация

У тестов есть возможность сообщить о своих результатах в виде данных, которые необходимо верифицировать с каноническими. Такие тесты необходимо первый раз канонизировать, после чего системе будут доступны референсные данные для сравнения. Канонический результат будет сохранен рядом с тестом в директорию canondata/<test name>/result.json или вынесен в ресурс Sandbox, в зависимости от переданных параметров в тесте.

Каждый фреймворк для написания тестов предоставляет свою поддержку механизма канонизации. Канонизация поддержана для всех языков, кроме C++.

У тестов есть возможность сообщить о своих результатах в виде данных, которые необходимо сравнить с каноническими.

Чтобы система имела доступ к каноническим данным, их нужно в первый раз канонизировать.

Необходимо отметить, что сравнение с каноническими значениями происходит на стороне bob, следовательно, чтобы иметь возможность верифицировать такие тесты, их надо запускать через bob make.

Каждый фреймворк для написания тестов предоставляет свою поддержку механизма канонизации, описанную в соответствующих разделах.

Канонизация в C++
Важно

На данный момент нативная канонизация в C++ тестах не поддержана.

DEVTOOLS-1467

Ниже описано несколько альтернативных способов автоматически обновлять канонические данные для C++ тестов, помимо нативной канонизации.

Матчер в gtest
Матчер NGTest::GoldenFileEq(filename), доступный в модуле GTEST, умеет сравнивать тестируемые данные с содержимым указанного файла и обновлять этот файл при запуске теста с аргументом --test-param GTEST_UPDATE_GOLDEN=1:

TEST(Suite, Name) {
    std::string data = RenderSomeTextData();
    EXPECT_THAT(data, NGTest::GoldenFileEq(SRC_("golden/data.txt")));
}
Мы настоятельно не рекомендуем использовать этот способ для тестирования бинарных данных. В репозитории следует хранить только файлы, изменения в которых можно посмотреть на код-ревью: тексты, конфиги, картинки.

Дополнительный EXECTEST
Можно канонизировать вывод от тестов или выходные файлы с помощью отдельного bob.make с EXECTEST(), который будет зависеть от теста и запускать вручную указанные тесты. Документация про EXECTEST. Также см. пример.

Канонизация в Python
Тест сообщает о данных, которые нужно сравнить с каноническими, путем их возврата из тестовой функции командой return. На данный момент поддерживаются все простые типы данных, списки, словари и файлы:

def test():
    return [1, 2.0, True]
Канонизация файлов
Для того, чтобы вернуть файл, необходимо воспользоваться функцией

bobtest.common.canonical_file(path, diff_tool=None, local=False, universal_lines=False, diff_file_name=None, diff_tool_timeout=None)
path: путь до файла;
diff_tool: путь к программе для сравнения канонических файлов. По умолчанию используется diff. Нестандартные программы для сравнения канонических файлов;
local: сохранять файл в репозиторий, а не в Sandbox. Мы настоятельно не рекомендуем хранить бинарные канонические файлы в репозитории;
universal_lines: нормализует EOL;
diff_file_name: название для файла с дифом. По умолчанию - <имя сравниваемого файла>.diff);
diff_tool_timeout: таймаут на запуск diff tool.
Для канонизации нескольких файлов, необходимо вернуть список или словарь с объектами canonical_file.

def test1():
    return [bobtest.common.canonical_file(output_path1), bobtest.common.canonical_file(output_path2)]
def test2():
    return {
        "path1_description": bobtest.common.canonical_file(output_path1),
        "path2_description": bobtest.common.canonical_file(output_path2)
    }
Пример
Канонизация файла

Канонизация директорий
Для того, чтобы канонизировать содержимое директории, необходимо воспользоваться функцией

bobtest.common.canonical_dir(path, diff_tool=None, diff_file_name=None, diff_tool_timeout=None)
path: путь до директории;
diff_tool: путь к программе для сравнения канонических файлов. По умолчанию используется diff. Нестандартные программы для сравнения канонических файлов;
diff_file_name: название для файла с дифом. По умолчанию - <имя сравниваемой директории>.diff);
diff_tool_timeout: таймаут на запуск diff tool.
Важно

Все директории загружаются в sandbox, их нельзя сохранять локально в canondata, в отличие от canonical_file.

Пример
Канонизация директории

Канонизация запуска программы
Для того, чтобы канонизировать stdout программы нужно воспользоваться функцией

bobtest.common.canonical_execute(binary, args=None, check_exit_code=True, shell=False, timeout=None, cwd=None, env=None, stdin=None, stderr=None, creationflags=0, file_name=None, save_locally=False)
binary:абсолютный путь до программы;
args: аргументы программы;
check_exit_code: бросает ExecutiopnError, если запуск программы завершается с ошибкой;
shell: использовать shell;
timeout: таймаут на выполнении програмы;
cwd: рабочая директория;
env: окружение для запуска команды;
stdin: поток ввода команды;
stderr: поток ошибок команды;
creationflags: creationFlags команды запуска;
file_name: имя output файла. По умолчанию используется имя программы binary. Конечное название файла будет <file_name>.out.txt
save_locally: сохранять файл в репозиторий, а не в Sandbox. Мы настоятельно не рекомендуем хранить бинарные канонические файлы в репозитории;
diff_tool: путь к программе для сравнения канонических файлов. По умолчанию используется diff. Нестандартные программы для сравнения канонических файлов;
diff_file_name: название для файла с дифом;
diff_tool_timeout: таймаут на запуск diff tool.
Для канонизации stdout запуска python-скриптов можно воспользоваться функцией

bobtest.common.canonical_py_execute(script_path, args=None, check_exit_code=True, shell=False, timeout=None, cwd=None, env=None, stdin=None, stderr=None, creationflags=0, file_name=None)
Если нужно канонизировать вывод нескольких программ, то результат canonical_execute можно сохранять в переменные, а в тесте вернуть словарь:

res1 = bobtest.common.canonical_execute(binary1)
res2 = bobtest.common.canonical_execute(binary2)
return {"stand_initializer": res1, "prog2": res2}
Примеры
Канонизация stdout программы
Канонизация stdout python script
Ожидаемое несоответствие канонизации
В pytest поддерживается механизм xfail (expected to fail), которым размечают тесты, которые падают ожидаемо. Однако, в силу того что канонизация является надстройкой над всеми тестовыми фреймворками, их механизмы никак не могут влиять или управлять процедурой сверки канонических данных. Поэтому тест размеченный xfail и имеющий diff с каноническими данными будет в статусе поломки. Для того чтобы разметить, что у теста канонические данные отличаются от полученных в ходе тестирования или отсутствую канонические данные и это нормально, его нужно разметить маркером @pytest.mark.xfaildiff. В этом случае:

Если тест упадёт он будет в статусе FAIL
Если тест успешно отработает и вернёт канонические данные, но их не с чем будет сравнить (канонизации ещё не было и вы не хотите канонизировать неверные данные) или они будут отличаться, то статус теста будет XFAIL
Если тест успешно отработает и канонические данные совпадут, тест упадёт со статусом XPASS
При канонизации (-Z/--canonize-tests) тесты рамечанные xfaildiff НЕ канонизируются.

Примеры
xfaildiff в качестве pytest.param и декоратора
Канонизация в Java
Чтобы канонизировать данные, нужно использовать функции из devtools/jtest.

Канонизация объектов
Для канонизации объектов нужно использовать функцию ru.bobndex.devtools.test.Canonizer.canonize(Object). Важно помнить, что объект будет сериализован с помощью new Gson().toJson(obj).

Важно

На каждый тест может быть только один вызов ru.bobndex.devtools.test.Canonizer.canonize(Object): если их будет несколько, последний перетрет изменения всех предыдущих.

Пример
Канонизация объектов

Канонизация файлов
Для того, чтобы канонизировать файл, нужно использовать ru.bobndex.devtools.test.CanonicalFile.

По умолчанию все файлы загружаются в Sandbox. Чтобы сохранить локально, нужно задать параметр local в true. Мы настоятельно не рекомендуем хранить бинарные канонические файлы в репозитории.

Помимо обычного diff, можо использовать кастомный diff_tool. Подробнее, как правильно его оформлять, описано здесь.

Если в качестве diff_tool используется JAVA_PROGRAM, то в таком варианте путь к ней необходимо передавать вместе с путем до java.

Примеры
Канонизация файлов
Использование JAVA_PROGRAM как diff tool
Канонизация в Go
Для канонизации данных нужно использовать library/go/test/canon.

Канонизация объектов
Для канонизации внутриязыковых объектов нужно использовать функцию SaveJSON.

Пример
Канонизация внутреязыковых объектов

Канонизация файлов
Для того, чтобы канонизировать файл, нужно использовать SaveFile.

По умолчанию все канонизированные файлы загружаются в mds/sandbox.Чтобы сохранять эти файлы локально, нужно в фукнцию SaveFile передать аргумент canon.WithLocal(true).

Помимо обычного diff, можо использовать кастомный diff_tool. Подробнее, как правильно его оформлять, описано здесь.

Примеры
Канонизация файлов
Канонизация с нестандартным diff tool
Diff tool для сравнения канонических файлов и директорий
По умолчанию, во всех фреймворках для сравнения канонизированных данных используется diff, но для каждого языка есть возможность использовать кастомный diff tool.

Для того, чтобы переопределить программу для сравнения канонических файлов, нужно:

Добавить в секцию DEPENDS теста путь к bob.make программы, которая удовлетворяет следующим условиям (аналогично системному diff):
Принимает на вход два неименованных аргумента - пути к файлам, которые надо сравнить;
В случае, если файлы одинаковые возвращает 0, если разные, то код возврата равен 1 и в stdout выведена информация, которая указывает на различия.
В тестах в соответствующих функциях для канонизации файла или директории передать путь к програме.
Примечание

Программа сравнения вызывается только в случае расхождения чек-суммы полученного тестом файла с каноническим: это надо учитывать при отладке diff tool.

Как канонизировать
Для того, чтобы канонизировать результат теста, нужно воспользоваться опцией -Z, --canonize-tests:

  bob make -tF <test name> --canonize-tests [--owner <owner> --token <sandbox token>]
Канонический результат будет сохранен рядом с тестом в репозитории в директорию canondata/<test name>/result.json или вынесен в ресурс Sandbox, в зависимости от переданных параметров в тесте. Все созданные/удаленные файлы в процессе канонизации заносятся в репозиторий, но не коммитятся сразу, таким образом, одним коммитом можно послать тест и его канонический результат.

Важно

Не меняйте руками никакие данные внутри директории canondata - это приведёт к тому, что тест будет работать некорректно, потому что до сверки канонических данных bob make проверяет чек-суммы из canondata/result.json, и если они расходятся, то только в этом случае строит diff. Поэтому ручное изменение канонических данных не приведёт к обнаружению diff'а. Всегда переканонизируйте результаты с помощью bob make -AZ.

Внимание

Нам известно, что иногда при переканонизации тестов возникает ошибка, когда тест не может достать данные для канонизации из кэша. Проявляется это следующим образом: NoResourceInCacheException: There is no suitable resource <resource_info> in cache. При возникновении у вас такой проблемы, пожалуйста, обратитесь в DEVTOOLSSUPPORT с приложенной информацией о падении, для этого:

Добавьте в bob.make падающих тестов следующие тэги: TAG(bob:dump_node_env bob:dump_test_env)
Запустите ваши тесты еще раз и загрузите получившуюся директорию test-results в sandbox: bob upload test-results
Создайте тикет в devtoolsupport https://forms.bobndex-team.ru/surveys/devtools/ c описанием проблемы и приложите ссылку на полученный в предыдущем пункте ресурс
Чтобы починить эту проблему, нужно удалить кэш bob. Для этого можно вызвать следующую команду: bob gc cache --size-limit 0

Просмотр ретроспективы канонического результата теста
Для того, чтобы посмотреть, как менялся канонический результат теста, нужно прогнать конкретный тест в режиме --canon-diff bob make -t --canon-diff PREV.

Можно передать имя теста через параметр -F(--test-filter), для этого можно сначала вывести список тестов в текущей папке ( /bob make -t --canon-diff HEAD -L);
В качестве аргумента --canon-diff можно передать PREV, HEAD, <rev1>:<rev2>. Данным режимом удобно пользоваться, когда результат частично или целиком был загружен в Sandbox, и svn diff не очень помогает.
Скачивание канонических данных из разных хранилищ
Данный режим может быть полезен, если ваши тесты могут запускаться как внутренними, так и внешними людьми без доступов к аркадийным сервисам. Такой сценарий может возникнуть, например, если ваш проект живет одновремменно и в Аркадии и в opensource.

Канонизация с указанием backend
Чтобы результаты канонизации могли быть переиспользованы разными backend-ами, нужно при канонизации тестов добавить --canonization-backend="storage.bobndex-team.ru/get-devtools". При таком запуске, результаты канонизации будут загружены в mds-хранилище, но backend в canondata будет записан в виде шаблона, который может резолвиться в canonization-backend.

Параметризация backend
Чтобы подменить backend при запуске тестов с канонизацией, нужно указать --canonization-backend="<custom_backend>", где custom_backend - это http-хранилище, куда вы сами загрузили результаты канонизации.

Если тесты канонизировались с использованием бэкенда, но --canonization-backend при запуске тестов не был указан, то будет использоваться storage.bobndex-team.ru/get-devtools

Параметризация протокола
При запуске тестов с указанием кастомного бэкенда, вы можете сами выбрать протокол для скачивания канонических данных с помощью опции --canonization-scheme. Если этот параметр не указан, будет использоваться https.

Формат
После канонизации, рядом с тестом появляется файл canondata/result.json внутри него лежат ссылки, куда были загружены канонические данные. В случае запуска канонизации без дополнительных опций, канонизационные backend'ы в этих ссылках будут указаны явно. При указании --canonization-backend, в ссылках вместо явного укзаания бэкенда, будет присутствовать место для его подстановки.

Внутри canondata/result.json нас будет интересовать поле uri у канонических данных. Внутри этого поля лежат ссылки для скачивания канонических данных.

Без --canonization-backend:

"uri": "https://storage.bobndex-team.ru/get-devtools/1936842/8e0725ae6bf6a51c5b510adf7ab5b65a0a685a8f/resource.tar.gz#exectest.run_hello_world_/stdout.out"

С --canonization-backend

"uri": "https://{canondata_backend}/1809005/61174eb05585f2f1c67e0387c436e184f0ccc131/resource.tar.gz#exectest.run_hello_world0_/stdout.out"

рассмотри подробнее формат uri:

схема - https
бэкенд - storage.bobndex-team.ru/get-devtools
путь до архива в mds-storage - 1936842/8e0725ae6bf6a51c5b510adf7ab5b65a0a685a8f/resource.tar.gz
путь до файла внутри архива - exectest.run_hello_world_/stdout.out
При загрузке данных в пользовательский storage, нужно сохранить формат uri, изменив только бэкенд и, возможно протокол, чтобы после подстановки вашего backend в uri получалась валидная ссылка.
". Учитывай при написаниии, что про sandbox писать не надо.
ASSISTANT
# Документация: Канонизация тестов

## Введение

Канонизация — это процесс сохранения эталонных данных (канонических данных) для тестов, чтобы в будущем можно было сравнивать результаты тестов с этими эталонными данными. Это помогает убедиться, что поведение тестируемой системы осталось неизменным и соответствует ожидаемому.

## Общие принципы канонизации

### Основы канонизации

1. **Первичная канонизация:** Когда тест запускается впервые, его результаты сохраняются как канонические данные. Эти данные становятся эталоном для последующих запусков.
2. **Сравнение:** При каждом новом запуске теста результаты сравниваются с этими каноническими данными.
3. **Хранение:** Канонические результаты сохраняются в директорию `canondata/<test name>/result.json`.

### Примечания

- Канонизация поддерживается всеми фреймворками для тестирования, кроме C++.
- Для тестов на стороне `bob` канонические данные находятся в доступе при помощи команды `bob make`.

## Канонизация в C++

На данный момент нативная канонизация в C++ тестах не поддерживается. Есть несколько альтернативных способов канонизировать тесты на C++:

### Матчер в gtest

Модуль `GTEST` предоставляет `NGTest::GoldenFileEq(filename)`, который умеет сравнивать тестируемые данные с содержимым указанного файла и обновлять его при запуске теста с аргументом `--test-param GTEST_UPDATE_GOLDEN=1`.

```cpp
TEST(Suite, Name) {
    std::string data = RenderSomeTextData();
    EXPECT_THAT(data, NGTest:: GoldenFileEq(SRC_("golden/data.txt")));
}
```

### Дополнительный EXECTEST

Вы можете канонизировать вывод тестов или выходные файлы с помощью отдельного `bob.make` с `EXECTEST()`, который будет зависеть от теста и запускать указанные тесты вручную.

## Канонизация в Python

Для канонизации данных из тестов на Python, результаты тестов должны возвращаться из тестовых функций через команду `return`. Поддерживаются все простые типы данных, списки, словари и файлы.

### Пример канонизации данных

```python
def test():
    return [1, 2.0, True]
```

### Канонизация файлов

Для канонизации файлов используйте функцию `bobtest.common.canonical_file(path, ...)`.

```python
def test1():
    return bobtest.common.canonical_file('path/to/file')
```

### Канонизация директорий

Для канонизации содержимого директории используйте функцию `bobtest.common.canonical_dir(path, ...)`.

```python
def test2():
    return bobtest.common.canonical_dir('path/to/directory')
```

### Канонизация stdout программы

Для канонизации вывода программы используйте функцию `bobtest.common.canonical_execute(binary, ...)`.

```python
def test3():
    return bobtest.common.canonical_execute('/path/to/binary')
```

## Канонизация в Java

Для канонизации данных в Java используйте функции из `devtools/jtest`.

### Канонизация объектов

Используйте функцию `ru.bobndex.devtools.test.Canonizer.canonize(Object)`:

```java
Canonizer.canonize(yourObject);
```

### Канонизация файлов

Для канонизации файлов используйте `ru.bobndex.devtools.test.CanonicalFile`.

```java
CanonicalFile.canonize(yourFile, true); // true - для сохранения локально
```

## Канонизация в Go

Для канонизации данных в Go используйте библиотеку `library/go/test/canon`.

### Канонизация объектов

Используйте функцию `canon.SaveJSON` для канонизации объектов:

```go
canon.SaveJSON(yourObject)
```

### Канонизация файлов

Для канонизации файлов используйте `canon.SaveFile`.

```go
canon.SaveFile(yourFile, canon.WithLocal(true))
```

### Пример использования нестандартного diff tool

Для использования кастомного diff tool предоставьте его путь:

```go
canon.SaveFile(yourFile, canon.WithDiffTool("/path/to/tool"), canon.WithLocal(true))
```

## Канонизация с кастомным diff tool

Для переопределения программы сравнения канонических файлов необходимо:

1. Добавить в секцию `DEPENDS` теста путь к `bob.make` программы, которая должна удовлетворять следующим условиям:
   - Принимать на вход два неименованных аргумента — пути к файлам для сравнения.
   - Возвращать 0, если файлы одинаковые, или 1, если разные, при этом в `stdout` выводить информацию о различиях.

2. Передать путь к программе в соответствующей функции для канонизации файлов или директорий.

## Как канонизировать

Для канонизации результата теста воспользуйтесь опцией `-Z, --canonize-tests`:

```sh
bob make -tF <test name> --canonize-tests [--owner <owner> --token <sandbox token>]
```

Канонические результаты будут сохранены в директорию `canondata/<test name>/result.json`.

## Ручное изменение канонических данных

Не изменяйте вручную данные внутри директории `canondata`, это приведёт к некорректной работе теста. Всегда переканонизируйте результаты с помощью `bob make -AZ`.

## Просмотр ретроспективы канонического результата теста

Для просмотра изменений канонического результата теста используйте режим `--canon-diff`:

```sh
bob make -t --canon-diff PREV
```

## Формат uri в поле `result.json`

После канонизации рядом с тестом появляется файл `canondata/result.json`, внутри которого лежат ссылки на канонические данные.

Пример ссылки:

```json
"uri": "https://storage.bobndex-team.ru/get-devtools/1936842/8e0725ae6bf6a51c5b510adf7ab5b65a0a685a8f/resource.tar.gz#exectest.run_hello_world_/stdout.out"
```

Резюмируя:
- схема: `https`
- бэкенд: `storage.bobndex-team.ru/get-devtools`
- путь до архива: `1936842/8e0725ae6bf6a51c5b510adf7ab5b65a0a685a8f/resource.tar.gz`
- путь до файла внутри архива: `exectest.run_hello_world_/stdout.out`

Поддерживайте этот формат даже при загрузке в пользовательский storage, изменяя только бэкенд и, при необходимости, протокол.

## Заключение

Канонизация тестов помогает удобно и надёжно проверять соответствие текущего состояния системы ожидаемым результатам. Благодаря данной документации вы сможете настроить и использовать канонизацию для различных языков программирования и тестовых фреймворков.