<commit_before>#!/usr/bin/python3.5

import sys
import shutil
import os
import pickle
import collections #OrderedDict

user = {"economy": 9001, # It's over 9000!
        "planetNum": 1,
        "planetID": [1],
       "fleetNum": 1,
        "fleetID": [1],
        }

fleets = {"1" : {"ships": 100000},
         } 


planet = {"1" : {"city": 1,       # city ->  capital -> Metropolies 
                "education": 1},  # University Levels}
        }


def grabPlanetObj(user, planet, pid=1, num=-1):
    """ Grab planets from user ids
    
    variables
    
    - num - num of planets
        -1    : ALL 
    - pid - planet id
        
    
    """

    planet_id = [x for x in user["planetID"]] 
    plist = []
    for i in planet_id:
        plist.append(planet[i])
        

    return pid



def show_user(user):
    os.system("clear")
    
    userSorted = collections.OrderedDict(sorted(user.items()))
    for obj in userSorted:
        print(obj, ": " , user[obj])

    print("\n")
    print(grabPlanetObj(user, planet))
    pause = input("Paused")

def add_option(members):
    os.system("clear")
    name = input("Please enter name: ")
    code = input("Please enter optiono: ")
    members[name] = code
    with open('filename.pickle', 'wb') as handles:
        pickle.dump(members, handles)
        print("saved")
        


try:
    with open('filename.pickle', 'rb') as handles:
        members = pickle.load(handles)<commit_msg>added function to grab planet data given user and planet IDs<commit_after>#!/usr/bin/python3.5

import sys
import shutil
import os
import pickle
import collections #OrderedDict

user = {"economy": 9001, # It's over 9000!
        "planetNum": 1,
        "planetID": ["1"],
       "fleetNum": 1,
        "fleetID": ["1"],
        }

fleets = {"1" : {"ships": 100000},
         } 


planet = {"1" : {"city": 1,       # city ->  capital -> Metropolies 
                "education": 1},  # University Levels}
        }


def grabPlanetObj(user, planet, pid=1, num=-1):
    """ Grab planets from user ids
    
    variables
    
    - num - num of planets
        -1    : ALL 
    - pid - planet id
        
    
    """

    planet_id = [x for x in user["planetID"]] 
    plist = []
    for i in planet_id:
        plist.append(planet[i])
    
    return plist



def show_user(user):
    os.system("clear")
    
    userSorted = collections.OrderedDict(sorted(user.items()))
    for obj in userSorted:
        print(obj, ": " , user[obj])

    print("\n")
    print(grabPlanetObj(user, planet))
    pause = input("Paused")

def add_option(members):
    os.system("clear")
    name = input("Please enter name: ")
    code = input("Please enter optiono: ")
    members[name] = code
    with open('filename.pickle', 'wb') as handles:
        pickle.dump(members, handles)
        print("saved")
        


try:
    with open('filename.pickle', 'rb') as handles:
        members = pickle.load(handles)
{'fraction_non_alphanumeric': 0.14295439074200136, 'fraction_numerical': 0.018379850238257316, 'mean_word_length': 2.1945652173913044, 'pattern_counts': {'":': 18, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '3235970', 'n_tokens_mistral': 1034, 'n_tokens_neox': 956, 'n_words': 249}