<commit_before>﻿using System;
using System.IO;
using System.Linq;
using System.Xml;
using EdmxTest.DataModel;

namespace Edmx.DataModel.Resources
{
    public class EdmxHelper
    {
        public void WriteEdmxComponents()
        {
            using (var context = DataModelContextFactory.CreateContext(ConnectionStringType.Normal))
            {               
                using (var stream = new MemoryStream())
                using (var writer = XmlWriter.Create(stream))
                {
                    System.Data.Entity.Infrastructure.EdmxWriter.WriteEdmx(context, writer);
                    WriteComponent(stream, "Conceptual", "", "EdmxTest.csdl");
                } 
            }
        }
  
        private void WriteComponent(MemoryStream stream, string nodeToFind, string subNode, string fileName)
        {
            stream.Seek(0, SeekOrigin.Begin);

            
            var reader = XmlReader.Create(stream);

            var item = from node in reader.De
        }
    }<commit_msg>selecting node<commit_after>﻿using System;
using System.IO;
using System.Linq;
using System.Xml;
using System.Xml.Linq;
using EdmxTest.DataModel;

namespace Edmx.DataModel.Resources
{
    public class EdmxHelper
    {
        public void WriteEdmxComponents()
        {
            using (var context = DataModelContextFactory.CreateContext(ConnectionStringType.Normal))
            {               
                using (var stream = new MemoryStream())
                using (var writer = XmlWriter.Create(stream))
                {
                    System.Data.Entity.Infrastructure.EdmxWriter.WriteEdmx(context, writer);
                    WriteComponent(stream, "Conceptual", "", "EdmxTest.csdl");
                } 
            }
        }
  
        private void WriteComponent(MemoryStream stream, string nodeToFind, string subNode, string fileName)
        {
            stream.Seek(0, SeekOrigin.Begin);

            var document = XDocument.Load(stream);
           

            var item = (from node in document.Descendants().Where(x => x.Name.LocalName == "Runtime")
                                            .Descendants().Where(x => x.Name.LocalName == nodeToFind)
                                            .Descendants().Where(x => x.Name.LocalName == subNode)
                        select node).FirstOrDefault();
        }
    }
{'fraction_non_alphanumeric': 0.09163514081546868, 'fraction_numerical': 0.0008406893652795292, 'mean_word_length': 1.732491389207807, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4731750', 'n_tokens_mistral': 609, 'n_tokens_neox': 583, 'n_words': 127}