<commit_before><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <UsingTask TaskName="ReadNuGetPackageReferences" AssemblyFile="$(ToolsDir)Microsoft.DotNet.Build.Tasks.dll"/>
  <UsingTask TaskName="ResolveNuGetPackages" AssemblyFile="$(ToolsDir)Microsoft.DotNet.Build.Tasks.dll"/>
  <UsingTask TaskName="ResolveNuGetPackageAssets" AssemblyFile="$(ToolsDir)Microsoft.DotNet.Build.Tasks.dll"/>

  <PropertyGroup>
    <ProjectPackagesConfigFile Condition="'$(ProjectPackagesConfigFile)'=='' and Exists('$(MSBuildProjectDirectory)/packages.config')">$(MSBuildProjectDirectory)/packages.config</ProjectPackagesConfigFile>
    <ProjectJson Condition="'$(ProjectJson)'=='' and Exists('$(MSBuildProjectDirectory)/project.json')">$(MSBuildProjectDirectory)/project.json</ProjectJson>
    <ProjectLockJson Condition="Exists('$(ProjectJson)') and '$(ProjectLockJson)'==''">$(MSBuildProjectDirectory)/project.lock.json</ProjectLockJson>
    <ResolveNugetProjectFile Condition="'$(ResolveNugetProjectFile)' == ''">$(MSBuildProjectFullPath)</ResolveNugetProjectFile>

    <RestorePackages Condition="'$(RestorePackages)'!='false' and (Exists('$(ProjectPackagesConfigFile)') or Exists('$(ProjectJson)'))">true</RestorePackages>
    <ResolveNuGetPackages Condition="'$(ResolveNuGetPackages)'!='false' and (Exists('$(ProjectPackagesConfigFile)') or Exists('$(ProjectJson)'))">true</ResolveNuGetPackages>

    <RestorePackagesSemaphore Condition="Exists('$(ProjectPackagesConfigFile)')">$(PackagesDir)$(MSBuildProjectFile)-packages.config</RestorePackagesSemaphore>
    <RestoreProjectLockJson Condition="Exists('$(ProjectJson)')">$(PackagesDir)$(MSBuildProjectFile)-project.lock.json</RestoreProjectLockJson>
  </PropertyGroup>

  <Target Name="RestorePackages" 
          BeforeTargets="ResolveNuGetPackages"
          Inputs="$(ProjectPackagesConfigFile);$(ProjectJson)"
          Outputs="$(RestorePackagesSemaphore);$(RestoreProjectLockJson)"
          Condition="'$(RestorePackages)'=='true'">

    <Error Condition="'$(NugetRestoreCommand)'=='' and Exists('$(ProjectPackagesConfigFile)')" Text="RestorePackages target needs a predefined NugetRestoreCommand property set in order to restore $(ProjectPackagesConfigFile)" /> 
    <Error Condition="'$(DnuRestoreCommand)'=='' and Exists('$(ProjectJson)')" Text="RestorePackages target needs a predefined DnuRestoreCommand property set in order to restore $(ProjectJson)" /> 
    
    <Exec Condition="Exists('$(ProjectPackagesConfigFile)')" Command="$(NugetRestoreCommand) &quot;$(ProjectPackagesConfigFile)&quot;" StandardOutputImportance="Low" />
    <Exec Condition="Exists('$(ProjectJson)')" Command="$(DnuRestoreCommand) &quot;$(ProjectJson)&quot;" StandardOutputImportance="Low" CustomErrorRegularExpression="^Unable to locate .*" />

    <Copy Condition="Exists('$(ProjectPackagesConfigFile)')" SourceFiles="$(ProjectPackagesConfigFile)" DestinationFiles="$(RestorePackagesSemaphore)" ContinueOnError="true" SkipUnchangedFiles="true" />
    <!-- Project.lock.json is created if we ran restore-->
    <Copy Condition="Exists('$(ProjectJson)')" SourceFiles="$(ProjectLockJson)" DestinationFiles="$(RestoreProjectLockJson)" ContinueOnError="true" SkipUnchangedFiles="true" />
  </Target>

  <ItemGroup Condition="'$(ResolvePackages)'=='true' or '$(ResolveNuGetPackages)'=='true'">
    <CustomAdditionalCompileInputs Condition="Exists('$(ProjectPackagesConfigFile)')" Include="$(ProjectPackagesConfigFile)" />
    <CustomAdditionalCompileInputs Condition="Exists('$(ProjectJson)')" Include="$(ProjectJson)" />
  </ItemGroup>

  <PropertyGroup>
    <ResolveAssemblyReferencesDependsOn>
      $(ResolveAssemblyReferencesDependsOn);
      ResolveNuGetPackages;
    </ResolveAssemblyReferencesDependsOn>
    <NugetTargetFrameworkMoniker Condition="'$(NugetTargetFrameworkMoniker)' == ''">$(TargetFrameworkMoniker)</NugetTargetFrameworkMoniker>
  </PropertyGroup>

  <Target Name="ResolveNuGetPackages"
          Condition="'$(ResolveNuGetPackages)'=='true'">

    <!-- Use old task for packages.config -->
    <ResolveNuGetPackages Condition="'$(ProjectPackagesConfigFile)' != ''"
                          PackagesConfigs="$(ProjectPackagesConfigFile)"
                          PackageRoot="$(PackagesDir)"
                          Platform="$(PlatformTarget)"
                          Configuration="$(Configuration)"
                          Language="$(Language)"
                          TargetFramework="$(NugetTargetFrameworkMoniker)"
                          TargetPlatformMoniker="$(TargetPlatformMoniker)">

      <Output TaskParameter="ResolvedAnalyzers" ItemName="Analyzer" />
      <Output TaskParameter="ResolvedReferences" ItemName="Reference" />
      <Output TaskParameter="ResolvedCopyLocal" ItemName="None" />
    </ResolveNuGetPackages>

    <PropertyGroup>
      <!-- Temporary workaround -->
      <NugetTargetFrameworkMoniker Condition="'$(NugetTargetFrameworkMoniker)' == '.NETPortable,Version=v4.5,Profile=Profile7'">DNXCore,Version=v5.0</NugetTargetFrameworkMoniker>
    </PropertyGroup>

    <ResolveNuGetPackageAssets Condition="Exists($(RestoreProjectLockJson))"
                               Architecture="$(PlatformTarget)"
                               Configuration="$(Configuration)"
                               Language="$(Language)"
                               PackageRoot="$(PackagesDir)"
                               ProjectLockFile="$(RestoreProjectLockJson)"
                               TargetFrameworkMonikers="$(NugetTargetFrameworkMoniker)"
                               TargetPlatformMonikers="$(TargetPlatformMoniker)">
      <Output TaskParameter="ResolvedAnalyzers" ItemName="Analyzer" />
      <Output TaskParameter="ResolvedReferences" ItemName="Reference" />
      <Output TaskParameter="ResolvedCopyLocalItems" ItemName="None" />
    </ResolveNuGetPackageAssets>

    <!-- We may have an indirect package reference that we want to replace with a project reference -->
    <ItemGroup>
      <!-- Convert to filenames so that we can intersect -->
      <_ProjectReferenceFilenames Include="@(_ResolvedProjectReferencePaths->'%(FileName)%(Extension)')">
        <OriginalIdentity>%(Identity)</OriginalIdentity>
      </_ProjectReferenceFilenames>

      <_ReferencesFileNames Include="@(Reference->'%(FileName)%(Extension)')">
        <OriginalIdentity>%(Identity)</OriginalIdentity>
      </_ReferencesFileNames>

      <_NoneFileNames Include="@(None->'%(FileName)%(Extension)')">
        <OriginalIdentity>%(Identity)</OriginalIdentity>
      </_NoneFileNames><commit_msg>Always run the package restore step<commit_after><?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <UsingTask TaskName="ReadNuGetPackageReferences" AssemblyFile="$(ToolsDir)Microsoft.DotNet.Build.Tasks.dll"/>
  <UsingTask TaskName="ResolveNuGetPackages" AssemblyFile="$(ToolsDir)Microsoft.DotNet.Build.Tasks.dll"/>
  <UsingTask TaskName="ResolveNuGetPackageAssets" AssemblyFile="$(ToolsDir)Microsoft.DotNet.Build.Tasks.dll"/>

  <PropertyGroup>
    <ProjectPackagesConfigFile Condition="'$(ProjectPackagesConfigFile)'=='' and Exists('$(MSBuildProjectDirectory)/packages.config')">$(MSBuildProjectDirectory)/packages.config</ProjectPackagesConfigFile>
    <ProjectJson Condition="'$(ProjectJson)'=='' and Exists('$(MSBuildProjectDirectory)/project.json')">$(MSBuildProjectDirectory)/project.json</ProjectJson>
    <ProjectLockJson Condition="Exists('$(ProjectJson)') and '$(ProjectLockJson)'==''">$(MSBuildProjectDirectory)/project.lock.json</ProjectLockJson>
    <ResolveNugetProjectFile Condition="'$(ResolveNugetProjectFile)' == ''">$(MSBuildProjectFullPath)</ResolveNugetProjectFile>

    <RestorePackages Condition="'$(RestorePackages)'!='false' and (Exists('$(ProjectPackagesConfigFile)') or Exists('$(ProjectJson)'))">true</RestorePackages>
    <ResolveNuGetPackages Condition="'$(ResolveNuGetPackages)'!='false' and (Exists('$(ProjectPackagesConfigFile)') or Exists('$(ProjectJson)'))">true</ResolveNuGetPackages>
  </PropertyGroup>

  <Target Name="RestorePackages" 
          BeforeTargets="ResolveNuGetPackages"
          Condition="'$(RestorePackages)'=='true'">

    <Error Condition="'$(NugetRestoreCommand)'=='' and Exists('$(ProjectPackagesConfigFile)')" Text="RestorePackages target needs a predefined NugetRestoreCommand property set in order to restore $(ProjectPackagesConfigFile)" /> 
    <Error Condition="'$(DnuRestoreCommand)'=='' and Exists('$(ProjectJson)')" Text="RestorePackages target needs a predefined DnuRestoreCommand property set in order to restore $(ProjectJson)" /> 
    
    <Exec Condition="Exists('$(ProjectPackagesConfigFile)')" Command="$(NugetRestoreCommand) &quot;$(ProjectPackagesConfigFile)&quot;" StandardOutputImportance="Low" />
    <Exec Condition="Exists('$(ProjectJson)')" Command="$(DnuRestoreCommand) &quot;$(ProjectJson)&quot;" StandardOutputImportance="Low" CustomErrorRegularExpression="^Unable to locate .*" />
  </Target>

  <ItemGroup Condition="'$(ResolvePackages)'=='true' or '$(ResolveNuGetPackages)'=='true'">
    <CustomAdditionalCompileInputs Condition="Exists('$(ProjectPackagesConfigFile)')" Include="$(ProjectPackagesConfigFile)" />
    <CustomAdditionalCompileInputs Condition="Exists('$(ProjectJson)')" Include="$(ProjectJson)" />
  </ItemGroup>

  <PropertyGroup>
    <ResolveAssemblyReferencesDependsOn>
      $(ResolveAssemblyReferencesDependsOn);
      ResolveNuGetPackages;
    </ResolveAssemblyReferencesDependsOn>
    <NugetTargetFrameworkMoniker Condition="'$(NugetTargetFrameworkMoniker)' == ''">$(TargetFrameworkMoniker)</NugetTargetFrameworkMoniker>
  </PropertyGroup>

  <Target Name="ResolveNuGetPackages"
          Condition="'$(ResolveNuGetPackages)'=='true'">

    <!-- Use old task for packages.config -->
    <ResolveNuGetPackages Condition="'$(ProjectPackagesConfigFile)' != ''"
                          PackagesConfigs="$(ProjectPackagesConfigFile)"
                          PackageRoot="$(PackagesDir)"
                          Platform="$(PlatformTarget)"
                          Configuration="$(Configuration)"
                          Language="$(Language)"
                          TargetFramework="$(NugetTargetFrameworkMoniker)"
                          TargetPlatformMoniker="$(TargetPlatformMoniker)">

      <Output TaskParameter="ResolvedAnalyzers" ItemName="Analyzer" />
      <Output TaskParameter="ResolvedReferences" ItemName="Reference" />
      <Output TaskParameter="ResolvedCopyLocal" ItemName="None" />
    </ResolveNuGetPackages>

    <PropertyGroup>
      <!-- Temporary workaround -->
      <NugetTargetFrameworkMoniker Condition="'$(NugetTargetFrameworkMoniker)' == '.NETPortable,Version=v4.5,Profile=Profile7'">DNXCore,Version=v5.0</NugetTargetFrameworkMoniker>
    </PropertyGroup>

    <ResolveNuGetPackageAssets Condition="Exists($(ProjectLockJson))"
                               Architecture="$(PlatformTarget)"
                               Configuration="$(Configuration)"
                               Language="$(Language)"
                               PackageRoot="$(PackagesDir)"
                               ProjectLockFile="$(ProjectLockJson)"
                               TargetFrameworkMonikers="$(NugetTargetFrameworkMoniker)"
                               TargetPlatformMonikers="$(TargetPlatformMoniker)">
      <Output TaskParameter="ResolvedAnalyzers" ItemName="Analyzer" />
      <Output TaskParameter="ResolvedReferences" ItemName="Reference" />
      <Output TaskParameter="ResolvedCopyLocalItems" ItemName="None" />
    </ResolveNuGetPackageAssets>

    <!-- We may have an indirect package reference that we want to replace with a project reference -->
    <ItemGroup>
      <!-- Convert to filenames so that we can intersect -->
      <_ProjectReferenceFilenames Include="@(_ResolvedProjectReferencePaths->'%(FileName)%(Extension)')">
        <OriginalIdentity>%(Identity)</OriginalIdentity>
      </_ProjectReferenceFilenames>

      <_ReferencesFileNames Include="@(Reference->'%(FileName)%(Extension)')">
        <OriginalIdentity>%(Identity)</OriginalIdentity>
      </_ReferencesFileNames>

      <_NoneFileNames Include="@(None->'%(FileName)%(Extension)')">
        <OriginalIdentity>%(Identity)</OriginalIdentity>
      </_NoneFileNames>
{'fraction_non_alphanumeric': 0.1459103326369918, 'fraction_numerical': 0.0024104129840912744, 'mean_word_length': 4.824520355638746, 'pattern_counts': {'":': 0, '<': 144, '<?xml version=': 2, '>': 150, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '827874', 'n_tokens_mistral': 3384, 'n_tokens_neox': 3098, 'n_words': 441}