<commit_before>from datetime import datetime
from geopy import geocoders


# Time command
async def ex(dclient, channel, mention, a, cmd_char):
    if len(a) > 0:
        if len(a) == 3:
            a = a.upper()
            g = geocoders.GoogleV3()
            try:
                place, (lat, lng) = g.geocode(a)
                timezone = g.timezone((lat, lng))
                time_now = datetime.now(timezone)
                await dclient.send_message(channel, 'It is `{:%H:%M:%S}` or `{:%I:%M:%S %p}` in `{}` right now.'
                                           .format(time_now, time_now, a))
            except Exception:
                await dclient.send_message(channel, 'Invalid timezone input, `{}`! Please check <https://en.wikipedia.'
                                                    'org/wiki/List_of_tz_database_time_zones>, {}!'.format(a, mention))
    else:
        await dclient.send_message(channel, '{}, **USAGE:** {}time <timezone>'.format(mention, cmd_char))<commit_msg>Improved user friendly.<commit_after>from datetime import datetime
from geopy import geocoders


# Time command
async def ex(dclient, channel, mention, a, cmd_char):
    if len(a) > 0:
        g = geocoders.GoogleV3()
        try:
            place, (lat, lng) = g.geocode(a)
            timezone = g.timezone((lat, lng))
            time_now = datetime.now(timezone)
            await dclient.send_message(channel, 'It is `{:%H:%M:%S}` or `{:%I:%M:%S %p}` in `{}` right now.'
                                       .format(time_now, time_now, a))
        except Exception:
            await dclient.send_message(channel, 'Location `{}` unknown! Please try to be more specific! I rely on '
                                                'Google maps to get the coordinates for the timezone, {}!'
                                       .format(a, mention))
    else:
        await dclient.send_message(channel, '{}, **USAGE:** {}time <timezone>'.format(mention, cmd_char))
{'fraction_non_alphanumeric': 0.13329954384186518, 'fraction_numerical': 0.002534211860111505, 'mean_word_length': 1.9029411764705881, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 8, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7075842', 'n_tokens_mistral': 587, 'n_tokens_neox': 583, 'n_words': 151}