Exemplo n.º 1
0
def look(commands, available_actions, player, room):
    if len(commands) > 1:
        examine(commands, available_actions, player, room)
    else:
        print "\t{}".format(room.intro_text())
        room.intro_text()
        if room.inventory:
            for item in room.inventory:
                print "\t{} is here.".format(item.name)
        room.exits_text()      
        if room.npcs:
            for npc in room.npcs:
                print "\t{} is here.".format(npc.name)
Exemplo n.º 2
0
def look(commands, available_actions, player, room):
    if len(commands) > 1:
        examine(commands, available_actions, player, room)
    else:
        print "\t{}".format(room.intro_text())
        room.intro_text()
        if room.inventory:
            for item in room.inventory:
                print "\t{} is here.".format(item.name)
                if hasattr(item, "opened") and item.opened:
                    if item.inventory:
                        print "\tIt contains:"
                        for sub_item in item.inventory:
                            print "\t\t{}".format(sub_item.name)

                    else:
                        print "\tIt is empty"
        if room.npcs:
            for npc in room.npcs:
                print "\t{} is here.".format(npc.name)
        room.exits_text(player)
Exemplo n.º 3
0
     'Find Repeat'))

st.sidebar.info(
    "View [source code](https://github.com/wpan03/TDF_Technical_Tutorial/tree/master/tdf_toolbox)"
)

if selectbox == 'Home Page':
    st.title("Welcome!")
    st.markdown(
        "This website contains some useful techniques for TUFF's work. ")
    st.markdown('**Please choose what you want to do in the side bar.**')
    image = Image.open('sunrise.png')
    st.image(image, use_column_width=True)

elif selectbox == 'Transfer OCP Created Project':
    ocp_transfer_created()

elif selectbox == "Transfer OCP Amended Project":
    transfer_amend()

elif selectbox == 'Search Duplicate':
    search_duplicate()

elif selectbox == "Merge":
    merge()

elif selectbox == 'Examine':
    examine()

elif selectbox == 'Find Repeat':
    find_repeat()
Exemplo n.º 4
0
fake_docs_list = []
client = pymongo.MongoClient(
    "mongodb://*****:*****@demo-cluster-shard-00-00.93rbk.mongodb.net:27017,demo-cluster-shard-00-01.93rbk.mongodb.net:27017,demo-cluster-shard-00-02.93rbk.mongodb.net:27017/<dbname>?ssl=true&replicaSet=atlas-1391ze-shard-0&authSource=admin&retryWrites=true&w=majority"
)
mydb = client['Input']
colls = mydb.collection_names()
for col in colls:
    mycollection = mydb[col]
    doc = mycollection.aggregate([{'$sample': {'size': sample_amount}}])
    for i in doc:
        sample_docs.append(i)
    list_of_config = []
    for i in range(0, len(sample_docs)):
        doc_i = sample_docs[i]
        for key, value in doc_i.items():
            val = examine.examine(key, value)
            doc_i[key] = val
        list_of_config.append(doc_i)
    count = 0
    for i in range(0, len(list_of_config)):
        print("CONFIG OF DOC -", count, ":-", list_of_config[i], "\n")
        count = count + 1
    aggregated_config = {}
    for j in range(0, len(list_of_config)):
        config_j = list_of_config[j]
        data_merge(aggregated_config, config_j)
        print("Config Of Document ", j, "is MERGED!!")
    print("\n Aggregated CONFIG is :- ", aggregated_config, "\n")

    data_merge(aggregated_config, config_from_outside)