# pylint: disable=C0302

"""Random robot names and ascii art.

import random
import os.path
from datetime import datetime

def random_robot_name(moment_of_birth, dest=None):
    """Construct a random robot name.
    adj = random.choice(_ADJ)
    noun = random.choice(_NOUN)
    name = "{}-{}".format(adj, noun).lower()

    if dest and os.path.exists(os.path.join(dest, name)):
        return random_robot_name(datetime.now(), dest)

    return name

def ascii_robot(moment_of_birth, name, include_phrase=True):
    """Generate random robot ascii art.

    def paste(cur, *lines):

        cur = list(cur)
        for line in lines:
            if len(line) > len(cur):
                cur += [' '] * (len(line) - len(cur))

            for i, char in enumerate(line):
                if char != " ":
                    cur[i] = char
        return "".join(cur)

    if random.choice([2, 3]) == 2:
        top = random.choice(ANTENNA)
        head = paste(random.choice(EYES), random.choice(EARS))
        body = paste("", random.choice(ARMS), random.choice(SIDES), random.choice(CENTER))
        bottom = random.choice(FEET)
        top = random.choice(ANTENNA_3)
        head = paste(random.choice(EYES_3), random.choice(EARS_3))
        if random.choice(["thin", "thick"]) == "thick":
            body = paste("", random.choice(ARMS_3_THICK),
                         random.choice(SIDES_3_THICK), random.choice(CENTER_3_THICK))
            body = paste("", random.choice(ARMS_3_THIN), random.choice(SIDES_3_THIN),

        bottom = random.choice(FEET3)

    if include_phrase:
        phrase = random_phrase(name)
        bottom = paste(bottom, '            - {}'.format(phrase))

    return "\n".join(map(lambda part: "  " + part, [top, head, body, bottom]))

EYES = [
    r"  @@",
    r"  **",
    r"  ++",
    r"  ..",
    r"  ^^",
    r"  °°",
    r"  OO",
    r"  00",
    r"  ''",
    r"  `´",

EYES_3 = [
    r"  @ @",
    r"  * *",
    r"  + +",
    r"  . .",
    r"  ^ ^",
    r"  ° °",
    r"  O O",
    r"  0 0",
    r"  ' '",
    r"  ` ´",
    r"  # #"

EARS = [
    r" [  ]",
    r" <  >",
    r" (  )",
    r"((  ))",
    r" {  }",
    r" |  |",
    r"[    ]",
    r"<    >",
    r"(    )",
    r"{    }",
    r"|    |",

EARS_3 = [
    r" [   ]",
    r" <   >",
    r" (   )",
    r" {   }",
    r" |   |",

    r"  ^^",
    r"  --",
    r" ^__^",
    r" ^  ^",
    r" ^^^^",
    r"  __",
    r"  ww",
    r"  !!",
    r"  <>",
    r" \__/",
    r" \  /"

    r"  ^ ^",
    r"  ---",
    r" ^___^",
    r" ^   ^",
    r"  ^_^",
    r"   _",
    r"  ^^^",
    r" ^^^^^",
    r"  ___",
    r"   _",
    r"  www",
    r"  w_w",
    r"   w ",
    r"  ! !",
    r"  !_!",
    r" !___!",
    r" !   !",
    r"  _!_",
    r"   !",
    r"  < >",
    r" <   >",
    r" <___>",
    r"  )_(",
    r"  ) (",
    r" \___/",
    r" \   /",
    r"  \_/",
    r"  \ /",
    r" \.-./",
    r"  .-."

ARMS = [
    '/    \\',
    r"-    -",
    r"_    _",
    r"Q    Q",
    r"j    j"

    '/     \\',
    r"-     -",
    r"_     _",
    r"Q     Q",
    r"j     j"

    ' /   \\',
    r" -   -",
    r" _   _",
    r"Q     Q",
    r" j   j"

    r" |  |",
    r" [  ]",
    r" (  )",
    r" <  >",
    " /  \\",

    r" |   |",
    r" [   ]",
    r" (   )",
    r" <   >",
    " /   \\",

    r"  | |",
    r"  [ ]",
    r"  ( )",
    r"  < >",
    "  / \\"

    r"  __",
    r"  ##",
    r"  ==",
    r"  $$",

    r"  ___",
    r"  ###",
    r"  ===",
    r"  $$$",
    r"  _._"

    r"   _",
    r"   #",
    r"   =",
    r"   $",
    r"   _",
    r"   .",
    r"   :",

FEET = [
    r" d  b",
    r"  db",
    r" |  |",
    r"  ||",
    r" I  I",
    r" i  i",
    r" O  O",
    r"  oo"

FEET3 = [
    r" d   b",
    r"  d b",
    r" |   |",
    r"  | |",
    r"  |:|",
    r"  |_|",
    r" I   I",
    r" i   i",
    r" O   O",
    r"  o o"

def random_phrase(robot_name):
    """Construct a random phrase about robot_name.
    phrase = random.choice(_PHRASES)
    parts = [random.choice(part) if isinstance(part, tuple) else part for part in phrase]
    res = " ".join(map(lambda x: x.strip(), parts))
    for char in (":", ".", "!", "?"):
        res = res.replace(" " + char, char)
    for char in ("'", '"'):
        res = res.replace(char + " ", char)

    res = res.replace("$name", "@" + robot_name)
    if res[-1] not in (".", "!", "?"):
        res += "."
    return res


    ("$name wants to make",
     ("the world", "the endless universe", "nature", "San Francisco", "the oceans", "Europe",
      "the moon", "your thought palace", "the inside of vulcanos", "your hometown",
      "mars", "supermarkets", "the inside of your car", "public transport",
      "your mom's house", "the vast amount of worlds to be discovered",
      "the environment", "your memories", "someone's garage", "kitchens",
      "the matrix", "Gotham City", "LV-426", "Dune", "schools", "bus stops",
      "the backseat of your car", "playgrounds", "libraries", "your local bookshop",
      "the bermuda triangle", "mariana trench", "heaven", "hell", "liquor stores",
      "No Man's Land"),
     ("a better", "a cleaner", "a safer", "an awesome", "a busier",
      "a more popular", "a more crowded", "a memorable", "a tidier",
      "a more peaceful", "an insanely productive", "an interesting", "an infinitely useful",
      "a lovely", "a more natural"),

     ("was born", "has been assembled", "has been shipped", "materialized",
      "appeared", "came to existence", "came to be", "landed on your doorstep",
      "appears glad to be alive", "formed", "was suddenly there", "helloed the world",
      "came", "needed to be made"),
     "and is ready",
     ("to impress", "to make an impact", "to excite", "for action",
      "to be deployed (after training)", "to rock", "to disrupt", "to revolutionize",
      "to listen", "to take orders", "for your input", "to speak when being spoken to",
      "to listen when being listened to", "to discover", "to learn how to love",
      "to do what it takes", "for new perspectives", "for this and that",
      "to do something it was not asked to do", "to be honest",
      "to say the ground truth and nothing but the ground truth", "to make cupcakes",
      "when you are"), "."),

    (("rise and shine", "aim for the stars", "go catch the big fish",
      "best wishes", "you can do it", "who if not you", "we believe in",
      "bon voyage", "do your best", "make a difference", "go for it",
      "you're the one", "we believe in", "prove yourself", "shine on",
      "go, go,", "kick it", "keep it real", "don't even trip",
      "make a difference", "you're quite something"), "$name!"),

    ("$name says: '",
     ("Hello World", "Hello Human", "Hello Universe", "Hallo Welt", "你好世界",
      "Hallo wereld", "Bonjour monde", "γειά σου κόσμος", "Ciao mondo",
      "こんにちは世界", "여보세요 세계", "Olá mundo", "Здравствулте мир",
      "Hola mundo", "Greetings fellow being", "Hi", "Hello", "Good Luck",
      "I can do it", "I will do my best", "I'll be back"),

     ("promises", "swears", "vows", "pledges", "will do what is necessary so",
      "requires", "argues", "dreams", "predicts", "infers", "was informed",
      "is happy to announce", "really cares", "admits", "has to admit",
      "hereby announces", "will make it known", "discloses", "is willing to say"),
     "that life will never be",
     ("boring", "difficult", "the same",
      "that special", "that good", "that lovely",
      "lower-dimensional", "deadly", "plagued by male hair loss"),

    ("let's", ("welcome", "say hi to", "give a warm welcome to"), "$name!"),

    ("$name has just been",
     ("delivered", "born", "made", "constructed", "assembled", "conceived",
      "rolled out"),
     ("", "out of a necessity", "because you asked for it")),

    ("you just",
     ("received", "got", "obtained", "acquired", "won", "became the owner of",
      "became responsible for", "were awarded"),
     ("free", "new", "fresh", "new", "rare", "legendary", "sought after", "much in demand",
      "desirable", "surprise"),
     "robot named $name"),

    ("$name has one",
     ("mission", "aim", "assignment", "duty", "goal", "thing on its mind",
      "objective", "thing on its todo list", "thing it cares about",
      "thing to get straight", "motive", "mission statement", "guiding principle",
      "supreme goal"),
     ("to make you smile", "to make you happy", "to make you proud",
      "to improve its performance", "to do what has to be done",
      "to make you wealthy", "to make you understand", "to help the cause",
      "to be the first one to do it", "to be your favorite", "to optimize its loss",
      "to be the one who told you so", "play the honky tonk like anything",
      "to get you some time of your schedule", "save a single being on earth"),

    ("the transistors of $name are",
     ("blinking", "oscillating", "flickering", "pulsating", "activating",
      "wired", "connected", "synchronized", "resonating"),
     ("excitement", "enthusiasm", "anticipation", "expectation",
      "expectation of greatness", "awe")),

    ("$name wants you to be its",
     ("owner", "teacher", "keeper", "friend", "pal", "buddy", "reference customer",
      "supporter", "advocate", "proponent", "role model")),

    ("$name is ready to learn some new",
     ("tricks", "skills", "techniques", "jokes", "dancing steps",
      "melodies", "rumours", "facts", "chords", "moves", "hot moves",
      "games", "tunes", "ones")),

    ("$name wants to",
     ("touch the sky someday", "gaze at the oceans", "care", "dig a hole",
      "do some work", "find a home", "gaze at the moon", "understand",
      "understand you", "learn", "remember", "be remembered",
      "leave a dent in the universe", "play in a rock band",
      "learn Spanish someday", "convince by competence", "feel the music",
      "keep it real", "be relatable", "know the answer to so many questions",
      "trade baseball cards", "comfort you", "wish upon a star",
      "sit in the park with its friends", "get old", "have champagne",
      "live in peace", "love", "experience happiness", "level up",
      "be run in parallel", "be debugged", "know Bob Dylan",
      "be ok with this", "be put in your shoes", "be tamed",
      "smell fresh coffee", "have a cold beer", "play games", "do hot moves",
      "tell jokes", "use its skills", "have some tricks in its pocket",
      "be a master of its techniques", "perform dancing steps",
      "whistle a melody", "be a gamer", "detect rumours", "value facts",
      "play some chords", "do its moves", "be known for its hot moves",
      "be a queen fan", "learn how to listen", "tune out",
      "be the one you think about", "admit when he is wrong",
      "admit when he is right", "learn how to value himself",
      "be a tiny help", "look at the world and be amazed",
      "watch Rick & Morty", "run around in circles for epochs",
      "take a moment", "have its weights and biases adjusted",
      "be optimized", "experience dimensionality reduction",
      "see through the matrix", "challenge and be challenged", "do a good job",
      "be more than good enough", "be so intuitive even your ancestors can use it",
      "more than an MVP", "have a good education", "be discussed",
      "be a player", "regarded as a pioneer", "solve the three body problem")),

    ("$name could not imagine a",
     ("better", "more exciting", "greater", "more suitable", "more cherishable",
      "more sacred", "more peaceful", "sexier", "more attractive", "more logical"),
     ("time", "location", "dimension", "excuse", "reason",
      "moment", "place", "planet", "universe", "purpose", "way"),
     "to be",
     ("alive", "a robot", "an AI", "made", "assembled",
      "existent", "taught")),

    ("$name wants to say something",
     ("intelligent", "meaningful", "funny", "bright", "emotional",
      "practical", "brave", "charming", "courageous", "honest",
      "imaginative", "kind", "powerful", "fearless", "romantic",
      "witty", "obvious")),

     ("thinks", "calculated", "came to the conclusion", "made simulations which revealed that",
      "predicted", "inferred", "has heard it through the grapevine", "feels", "hopes", "imagines"),
     "there is a chance you could be",
     ("friends", "buddies", "pals", "synergetic", "in polite disagreement", "pioneers",
      "adventurers", "pirates", "forgiven", "just two kids", "in compliance",
      "compatible", "clowns in a pirate ship", "ok with each other",
      "keeping it backed up on your hard drive", "partners in crime", "pleased")),

    ("$name wants to be",
     ("a good", "a great", "an amazing", "a loyal", "a decisive", "a passionate",
      "a moraly flexible", "a lean", "someone's", "your"),
     ("companion", "assistant", "sidekick", "idea", "AI", "pupil")),

     ("wiggles", "twists", "extends", "chirps", "waves", "presents",
      "polishes", "fixes", "improves", "improves"),
     ("antenna", "chips", "silicon", "wires", "neurons", "weights",
      "biases", "optimizer", "gears", "intelligence", "innards",
      "circuits", "convolutions", "connections", "performance", "potential")),

    ("$name thinks that",
     ("it looks", "you look", "it is", "you are", "this is"),
     ("pretty", "cute", "awesome", "fabulous", "extreme but adequate")),

     ("is grateful for", "seems pleased about", "is thankful for", "is excited about",
      "was doubtful at first, but now loves", "was made for", "wants to thank you for",
      "celebrates", "digs", "feels like it's truly alive when it does",
      "wants to write a blog about", "wants to make a youtube video about",
      "thinks your friends need to know about", "wonders what's the next big thing after",
      "thinks only positively about", "wonders what the world would be like without",
      "dances to the rythm of", "always had a weakness for", "praises", "can't stop talking about",
      "embraces", "applauds", "loves"),
     "command line machine learning."),

    ("Knock Knock.",
     ("Who's there?", "Who's that?", "Who is it?"),

    ("$name will make you",
     ("value life", "stick around", "find a way", "do your dishes",
      "be successful", "dance", "go with the rythm", "a star",
      "listen to Pink Floyd", "breathe", "high", "ask three whys",
      "entertain yourself", "be curious", "help others", "money",
      "be financially independent", "have a passive income",
      "loose your shyness", "drive a Bentley", "have more free time",
      "find no words", "dig the music", "live a great life",
      "understand your kids", "appreciate a dog",
      "develop a taste in heavy metal", "procrastinate",
      "be sentimental about old times", "optimistically look into the future",
      "understand", "say its name three times in a row",
      "wonder how it was to be an AI", "miss it",
      "finally fix that broken step", "a go-to address",
      "appreciate teaching it", "decide otherwise", "laugh in tears",
      "know", "be more open", "applaud", "feel", "appreciate", "question",
      "smile", "rise high", "wonder what time it is", "eat more healthy",
      "abandon alternative facts")),

    ("$name will be",
     ("rich", "happy", "wealthy", "merry", "philosophical", "curious",
      "adventurous", "agreeable", "communicative", "considerate", "decisive",
      "discreet", "dynamic", "easygoing", "emotional", "enthusiastic", "faithful",
      "forceful", "frank", "friendly", "generous", "gentle", "helpful", "intellectual",
      "intelligent", "loving", "modest", "optimistic", "passionate", "patient",
      "polite", "quiet", "rational", "reliable", "resourceful", "self-confident",
      "self-disciplined", "straightforward", "thoughtful", "tidy", "unassuming",
      "versatile", ),
     ("famous", "lucky", "glorious", "appreciative", "brave", "bright",
      "calm", "careful", "charming", "courageous", "creative", "determined",
      "diligent", "diplomatic", "energetic", "fair-minded", "fearless",
      "funny", "honest", "humorous", "imaginative", "independent", "intuitive",
      "inventive", "kind", "loyal", "neat", "nice", "persistent", "powerful",
      "pro-active", "practical", "romantic", "sensible", "sincere", "sympathetic",
      "tough", "understanding", "warmhearted", "willing", "witty")),

     ("stepped into", "came into", "has been placed into", "arrived into",
      "materialized into", "was sent into", "was dropped into",
      "was ordered to bring pure happiness into", "made it into",
      "has been delivered to", "is certain it will bring even more joy to",
      "understands", "wants to celebrate", "thinks there's nothing wrong with",
      "wants you to live in", "helps you with",
      "will make you love", "will be there if you want to talk about",
      "will listen if you want to talk about", "will be programmed to value",
      "will applaud", "will bring new aspects to", "wants to improve"),
     ("life", "computer", "hard drive", "GPU", "graphics card", "hardware budget",
      "cloud bill", "existence", "imagination", "consciousness")),

    ("$name will",
     ("follow Aasimov's laws of robotics (except for #4)",
      "never test you", "feel natural", "behave if you put in some work",
      "find the right words", "see like humans", "have a look at that",
      "insist to do the right thing", "support you", "be reliable",
      "reinvent science fiction", "prove you right", "do what others didn't",
      "spy on facebook", "raise your consciousness", "build its brand", "prove it",
      "do your dishes", "time it", "descend the gradient", "have its own ways",
      "provide for you", "work reliably", "do the math for you",
      "live a hundred years", "do it", "shine on", "be cool",
      "think about the children", "reach for the secret too soon", "cry to the moon",
      "never forget this day", "never forget you",
      "live as if he was to die tomorrow but learn as if he was to live forever",
      "really work", "challenge you", "be able to understand you some day",
      "do one thing to perfection", "laugh about this one day",
      "tell this story to its grandkids", "make it even better",
      "make you even better", "say it loud and clear", "make a remark",
      "know what you teach it", "get it at some point", "make it without a doubt",
      "be back", "pass butter", "respect your privacy", "value your freedom",
      "not question you", "drive your car if you get your hands off the wheel")),

    ("$name believes in a future where",
     ("humans", "cats", "dogs", "your mom", "your dad", "your sister",
      "your brother", "aliens", "Elvis Presley", "squirrels",
      "Santa Claus", "bikes", "cars", "friends", "hairdressers",
      "dog trainers", "nature", "love", "guitar players", "nature enthusiasts",
      "honeybees", "flying saucers", "chance"),
     ("robots", "machines", "AIs", "algorithms", "non natural beings",
      "technology", "computers", "neural networks", "deep learning",
      "artificial intelligence"),
     "work together."),

     ("wants", "needs", "loves", "hopes", "is aspired", "lives", "came",
      "came to be just", "was born to", "was specifically created",
      "has nothing better to do than", "lives", "appears"),
     "to solve",
     ("your problems", "your tax report", "your sudoku", "your homework",
      "world peace", "P=NP", "your mom's crossword puzzle", "a puzzle",
      "your puzzle", "the big questions", "anything you throw at it",
      "nocturnal questions")),

     ("knows what the problem is just as well as you do",
      "is afraid it can't do that", "thanks you for creating it",
      "wants to thrill all humans", "really digs its discriminator",
      "wants to point out that 'ml help' really is helpful"))

# thanks to the petnames project for the adjectives!
_ADJ = [

_NOUN = [