<commit_before>"""
Convienience script to find your Raspberry Pi on a local network. 

Usage:
    find_car.py [--ip=<ip>]

Options:
  --ip=<ip>   Base ip address of your network [default: 192.168.1.0]
"""


from docopt import docopt
import os
import socket

args = docopt(__doc__)
ip = args['--ip']

print('Looking up your computer IP address...')
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8",80))
print('Your IP address: %s ' %s.getsockname()[0])
s.close()


print("Finding your car's IP address...")
cmd = "sudo nmap -sP " + ip + "/24 | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}'"
print("Your car's ip address is:" )
os.system(cmd)


<commit_msg>fix find_car.py script to use users existing ip<commit_after>"""
Convienience script to find your Raspberry Pi on a local network. 

Usage:
    find_car.py 
"""


from docopt import docopt
import os
import socket

args = docopt(__doc__)

print('Looking up your computer IP address...')
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8",80))
ip = s.getsockname()[0] 
print('Your IP address: %s ' %s.getsockname()[0])
s.close()


print("Finding your car's IP address...")
cmd = "sudo nmap -sP " + ip + "/24 | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}'"
print("Your car's ip address is:" )
os.system(cmd)



{'fraction_non_alphanumeric': 0.17421335379892555, 'fraction_numerical': 0.02532617037605526, 'mean_word_length': 4.0347490347490345, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, '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': '3994849', 'n_tokens_mistral': 514, 'n_tokens_neox': 476, 'n_words': 142}