<commit_before>namespace FSharpSupport

open System.IO
open System.Runtime.Versioning
open Microsoft.Framework.Runtime
open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.SourceCodeServices
open Microsoft.FSharp.Compiler.SimpleSourceCodeServices
open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library

module Helpers =
    let inline ni () = raise (new System.NotImplementedException ())

[<NoEquality>]
type internal MetadataReference =
| FileMetadataReference of string
| ImageMetadataReference of string * byte array
| ProjectMetadataReference of string * (Stream -> unit)
with
    member r.VirtPath 
        with get () =
            match r with
            | FileMetadataReference f -> f
            | ImageMetadataReference (p, _) -> p
            | ProjectMetadataReference (p, _) -> p

[<CompilationRepresentationAttribute(CompilationRepresentationFlags.ModuleSuffix)>]
module internal MetadataReference =
    let virtPath (p: MetadataReference) = p.VirtPath

open Helpers
module internal Compiler =
    let lock fn =
        let l = new obj ()
        lock l fn

    let tprintf fmt = ignore fmt // Printf.ksprintf System.Diagnostics.Trace.Write fmt
    let tprintfn fmt = ignore fmt //Printf.ksprintf System.Diagnostics.Trace.WriteLine fmt

    let getReferences (project: Project) targetFramework incomingReferences =
        let name = project.Name

        let makePath p = "C:\\" + p + ".dll"

        let (|>|) a b =
            a, (b a)

        incomingReferences
        |> List.ofSeq
        |> List.choose (fun (r: IMetadataReference) ->
            match r with
            // Skip this project
            | _ when r.Name = (typeof<MetadataReference>.Assembly.GetName ()).Name -> None
                
            // NuGet references
            | :? IMetadataFileReference as r -> Some (FileMetadataReference r.Path)

            // Assembly neutral references
            | :? IMetadataEmbeddedReference as r -> Some (ImageMetadataReference ((makePath r.Name), r.Contents))
<commit_msg>Counter-derp :trollface:<commit_after>namespace FSharpSupport

open System.IO
open System.Runtime.Versioning
open Microsoft.Framework.Runtime
open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.SourceCodeServices
open Microsoft.FSharp.Compiler.SimpleSourceCodeServices
open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library

module Helpers =
    let inline ni () = raise (new System.NotImplementedException ())

[<NoEquality; NoComparison>]
type internal MetadataReference =
| FileMetadataReference of string
| ImageMetadataReference of string * byte array
| ProjectMetadataReference of string * (Stream -> unit)
with
    member r.VirtPath 
        with get () =
            match r with
            | FileMetadataReference f -> f
            | ImageMetadataReference (p, _) -> p
            | ProjectMetadataReference (p, _) -> p

[<CompilationRepresentationAttribute(CompilationRepresentationFlags.ModuleSuffix)>]
module internal MetadataReference =
    let virtPath (p: MetadataReference) = p.VirtPath

open Helpers
module internal Compiler =
    let lock fn =
        let l = new obj ()
        lock l fn

    let tprintf fmt = ignore // Printf.ksprintf System.Diagnostics.Trace.Write fmt
    let tprintfn fmt = ignore //Printf.ksprintf System.Diagnostics.Trace.WriteLine fmt

    let getReferences (project: Project) targetFramework incomingReferences =
        let name = project.Name

        let makePath p = "C:\\" + p + ".dll"

        let (|>|) a b =
            a, (b a)

        incomingReferences
        |> List.ofSeq
        |> List.choose (fun (r: IMetadataReference) ->
            match r with
            // Skip this project
            | _ when r.Name = (typeof<MetadataReference>.Assembly.GetName ()).Name -> None
                
            // NuGet references
            | :? IMetadataFileReference as r -> Some (FileMetadataReference r.Path)

            // Assembly neutral references
            | :? IMetadataEmbeddedReference as r -> Some (ImageMetadataReference ((makePath r.Name), r.Contents))

{'fraction_non_alphanumeric': 0.08704204573395623, 'fraction_numerical': 0.0, 'mean_word_length': 2.74585635359116, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '750827', 'n_tokens_mistral': 1078, 'n_tokens_neox': 1051, 'n_words': 310}