Coder Social home page Coder Social logo

Vitor Queijo

Linkedin Badge

Basic Input

basic_input = {
    "_class": "BackEnd Developer",
    "_version": "2022.08.21",
    "name": "Vitor Queijo",
    "ticks": 1200936262130930.0,
    "languages": {
        "python": {
                "ticks": 924421091820490.0,
                "library-coverage": [ 
                    "django2", 
                    "flask", 
                    "pyspark", 
                    "numpy", 
                    "nltk", 
                    "spacy", 
                    "pandas", 
                    "redis-py", 
                    "graphviz", 
                    "pygame" ,
                    "scrapy",
                    "b4s",
                    "unittest",
                    "pytest",
                    "mongodb",
                    "sqlite3",
                    "boto3"
                    ],
                "comment": "library-coverage focuses on key frameworks"
        },
        "csharp": {
            "ticks": 665237082308710.0,
            "library-coverage": [
                "ASP.NET",
                "ASP.NET Core",
                "Entity Framework",
                "Swashbuckle",
                "AutoMapper",
                "FluentValidation",
                "Serilog",
                "xUnit",
                "FluentAssertions",
                "RestSharp",
                "MongoDB"
            ],
            "comment": "library-coverage focuses on key frameworks"
        },
        "scala": {
            "ticks": 123515605792059.98,
            "library-coverage": [
                "log4j",
                "spark-redis",
                "awscala-emr",
                "awscala-s3",
                "awscala-stepfunctions",
                "awscala-redshift"
            ],
            "comment": "library-coverage focuses on key frameworks"
        },
    },
    "interests": {
        "NLP": "moderate",
        "ETL-ELT": "average",
        "Microsservices": "below average",
        "Unsupervised learning": "above average",
        "Genetic Algorithms": "high",
        "Game Development": "high",
        "Cryptography": "high"
    },
    "weird-interests":{
       "keywords": [ 
        "chess", 
        "image-generation-ai", 
        "gaming",
        "data",
        "privacy",
        "history",
        "cryptowatermark"
        ]
    }
}

Setup

import json
import Developer

json_input = json.loads(basic_input)

interests = [*json_input['interests'], *json_input['weird-interests']]
code_languages = json_input["languages"].keys()

vitor_queijo = Developer(json_input["name"], code_languages, interests)

Ask Me Anything

Positive Answers Examples

vitor_queijo.ask_me("do you like chess?")
vitor_queijo.ask_me("do you code in python?")
vitor_queijo.ask_me("do you like data privacy?")
Code Source

Perhaps it's mine BaseClass

    import re
    from typing import List
    import random


    QA_pattern = r"^(.*?(\b{answer}\b)[^$]*)$"

    class Developer(BaseHuman):
        def __init__(self, name: str, codes: List[str], weird_interests: List[str]) -> None:

            super().__init__()
            self.name = name
            self.codes = codes
            self.weird_interests = weird_interests

        def __str__(self) -> str:
            return f"Hello, lovely person, I'm {self.name}."
        
        def __possible_topics(self) -> List[str]:
            return [*self.codes, *self.weird_interests]
        
        def __find_answer(self, question: str) -> str:
            possible_topics = self.possible_topics()

            answer = [x for x in possible_topics \
                if re.match(QA_pattern.format(answer=x), question, re.I)]

            if any(answer):
                for a in answer:
                    if a in self.codes:
                        return f"Yes, I do code in {a}!"
                    elif a in self.weird_interests:
                        return f"Yes, I do interest in {a}!"
                    else:
                        raise ReferenceError("Sorry, mate, I don't know about it.")

        def ask_me(self, question: str) -> None:
            if not question and not question.isspace():
                raise NameError(f"So...do you wanna talk about " + 
                    f"{random.choice(self.weird_interests)}?")
            try:
                print(self.__find_answer(question))
            except ReferenceError as rex:
                if hasattr(rex, 'message'):
                    print(
                        f"{rex.message} maybe you could try asking about: " +
                        f"{', '.join(random.sample(self.__possible_topics(), k=2))}"
                        )
            except Exception:
                print("i don't know what happened, it works on my machine.")

License

The Unlicense

Vítor's Projects

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.