<commit_before>"""
# This is a uArm hockey demo python script

# joystick is using Arduino, if you are interested on the Arduino source code. You could download it here.
# https://github.com/uarm-demo/uarm-hockey

# this script is base on pyuarm which is uArm Python Library. https://github.com/uArm-Developer/pyuarm
#
# (C) 2016 UFACTORY <<EMAIL>>
"""
import pyuarm
from pyuarm.tools.list_uarms import get_uarm_port_cli, uarm_ports

import serial
from serial.tools.list_ports import comports
import json, os, io, sys, time
import argparse


def get_port_from_serial_id(serial_id):
    ports = comports()
    for p in ports:
        if p.serial_number == serial_id:
            return p.name


def get_serial_id_from_port_name(port_name):<commit_msg>return entire port instead port name<commit_after>"""
# This is a uArm hockey demo python script

# joystick is using Arduino, if you are interested on the Arduino source code. You could download it here.
# https://github.com/uarm-demo/uarm-hockey

# this script is base on pyuarm which is uArm Python Library. https://github.com/uArm-Developer/pyuarm
#
# (C) 2016 UFACTORY <<EMAIL>>
"""
import pyuarm
from pyuarm.tools.list_uarms import get_uarm_port_cli, uarm_ports

import serial
from serial.tools.list_ports import comports
import json, os, io, sys, time
import argparse


def get_port_from_serial_id(serial_id):
    ports = comports()
    for p in ports:
        if p.serial_number == serial_id:
            return p[0]


def get_serial_id_from_port_name(port_name):
{'fraction_non_alphanumeric': 0.08481262327416174, 'fraction_numerical': 0.005917159763313609, 'mean_word_length': 4.159322033898305, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, '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': '279079', 'n_tokens_mistral': 521, 'n_tokens_neox': 498, 'n_words': 164}