<commit_before>using System;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;

namespace GrEmit.MethodBodyParsing
{
    public static class MetadataExtensions
    {
        internal static object Resolve(this Module module, MetadataToken token)
        {
            switch(token.TokenType)
            {
            case TokenType.Method:
            case TokenType.MethodSpec:
                return module.ResolveMethod(token.ToInt32(), universalArguments, universalArguments);
            case TokenType.MemberRef:
                return module.ResolveMember(token.ToInt32(), universalArguments, universalArguments);
            case TokenType.Field:
                return module.ResolveField(token.ToInt32(), universalArguments, universalArguments);
            case TokenType.TypeDef:
            case TokenType.TypeRef:
                return module.ResolveType(token.ToInt32(), universalArguments, universalArguments);
            case TokenType.Signature:
                return module.ResolveSignature(token.ToInt32());
            case TokenType.String:
                return module.ResolveString(token.ToInt32());
            default:
                throw new NotSupportedException();
            }
        }

        public static MethodBase ResolveMethod(Module module, MetadataToken token)
        {
            switch(token.TokenType)
            {
            case TokenType.MethodSpec:
            case TokenType.Method:<commit_msg>TypeSpec support<commit_after>using System;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;

namespace GrEmit.MethodBodyParsing
{
    public static class MetadataExtensions
    {
        internal static object Resolve(this Module module, MetadataToken token)
        {
            switch(token.TokenType)
            {
            case TokenType.Method:
            case TokenType.MethodSpec:
                return module.ResolveMethod(token.ToInt32(), universalArguments, universalArguments);
            case TokenType.MemberRef:
                return module.ResolveMember(token.ToInt32(), universalArguments, universalArguments);
            case TokenType.Field:
                return module.ResolveField(token.ToInt32(), universalArguments, universalArguments);
            case TokenType.TypeDef:
            case TokenType.TypeRef:
            case TokenType.TypeSpec:
                return module.ResolveType(token.ToInt32(), universalArguments, universalArguments);
            case TokenType.Signature:
                return module.ResolveSignature(token.ToInt32());
            case TokenType.String:
                return module.ResolveString(token.ToInt32());
            default:
                throw new NotSupportedException($"Token type ${token.TokenType} is not supported");
            }
        }

        public static MethodBase ResolveMethod(Module module, MetadataToken token)
        {
            switch(token.TokenType)
            {
            case TokenType.MethodSpec:
            case TokenType.Method:
{'fraction_non_alphanumeric': 0.07257799671592775, 'fraction_numerical': 0.007881773399014778, 'mean_word_length': 2.1962224554039875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2642144', 'n_tokens_mistral': 713, 'n_tokens_neox': 700, 'n_words': 157}