<commit_before>// Copyright (c) 2017 The visa developers. All rights reserved.
// Project site: https://github.com/gotmc/ivi
// Use of this source code is governed by a MIT-style license that
// can be found in the LICENSE.txt file for the project.

package visa

import (
	"errors"
	"fmt"
	"regexp"
	"strconv"
	"strings"
)

// The ResourceTemplate struct fields come from Table 3.2.1 VISA Template
// Required Attributes in the VPP-4.3 The VISA Library standard.
type ResourceTemplate struct {
	ResourceImplementedVersion viVersion     // VI_ATTR_RSRC_IMPL_VERSION
	ResourceLockState          viAccessMode  // VI_ATTR_RSRC_LOCK_STATE
	ResourceManufacturerID     uint          // VI_ATTR_RSRC_MANF_ID
	ResourceManufacturerName   string        // VI_ATTR_RSRC_MANF_NAME
	ResourceName               viRsrc        // VI_ATTR_RSRC_NAME
	ResourceSpecVersion        viVersion     // VI_ATTR_RSRC_SPEC_VERSION
	resourceClass              resourceClass // VI_ATTR_RSRC_CLASS
}

func (resource ResourceTemplate) GetResourceClass() string {
	return string(resource.resourceClass)
}

type genericInstrResource struct {
	InterfaceNum            int           // VI_ATTR_INTF_NUM
	InterfaceType           interfaceType // VI_ATTR_INTF_TYPE
	InterfaceInstrumentName string        // VI_ATTR_INTF_INST_NAME
}

func determineInterfaceType(address string) (InterfaceType, error) {
	regexString := `^(?P<interfaceType>[A-Za-z]+)(?P<boardIndex>\d*)::` +
		`(?P<allElse>.*)$`
	re := regexp.MustCompile(regexString)
	res := re.FindStringSubmatch(address)
	subexpNames := re.SubexpNames()
	matchMap := map[string]string{}
	for i, n := range res {
		matchMap[subexpNames[i]] = string(n)
	}
	interfaceType := strings.ToUpper(matchMap["interfaceType"])
	switch interfaceType {
	case "USB":
		return USBTMC, nil<commit_msg>Delete VISA related properties/methods for now<commit_after>// Copyright (c) 2017 The visa developers. All rights reserved.
// Project site: https://github.com/gotmc/ivi
// Use of this source code is governed by a MIT-style license that
// can be found in the LICENSE.txt file for the project.

package visa

import (
	"errors"
	"fmt"
	"regexp"
	"strconv"
	"strings"
)

func determineInterfaceType(address string) (InterfaceType, error) {
	regexString := `^(?P<interfaceType>[A-Za-z]+)(?P<boardIndex>\d*)::` +
		`(?P<allElse>.*)$`
	re := regexp.MustCompile(regexString)
	res := re.FindStringSubmatch(address)
	subexpNames := re.SubexpNames()
	matchMap := map[string]string{}
	for i, n := range res {
		matchMap[subexpNames[i]] = string(n)
	}
	interfaceType := strings.ToUpper(matchMap["interfaceType"])
	switch interfaceType {
	case "USB":
		return USBTMC, nil
{'fraction_non_alphanumeric': 0.11027474595408356, 'fraction_numerical': 0.004892736168611215, 'mean_word_length': 3.9775280898876404, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '1227994', 'n_tokens_mistral': 872, 'n_tokens_neox': 839, 'n_words': 216}