Ejemplo n.ยบ 1
0
    def __init__(self,
                 map_proxy: MapProxy = None,
                 game_object_proxy: GameObjectProxy = None):
        self.__map_proxy = map_proxy
        self.__game_object_proxy = game_object_proxy

        self.__attack_filters = multi_key_dict()
        self.__move_filters = multi_key_dict()

        self.__prepare_attack_filters()
        self.__prepare_move_filters()
Ejemplo n.ยบ 2
0
    def initialize(self, db):
        """
        Initialize a new working set with the given database connection
        """
        self.db = db

        print("[MAIN] Loading working set")

        # [game_id, name, c_name] => Game
        self.games = multi_key_dict()

        # [steam_id] => Game
        self.games_steam = multi_key_dict()

        # [igdb_id] => Game
        self.games_igdb = multi_key_dict()

        # [igdb_id, name] => Developer
        self.developers = multi_key_dict()

        # [article_id, title] => Article
        self.articles = multi_key_dict()

        # [video_id, name] => Video
        self.videos = multi_key_dict()

        # [tweet_id] => Tweet
        self.tweets = multi_key_dict()

        # [genre_id, name] => Genre
        self.genres = multi_key_dict()

        # [platform_id, name] => Platform
        self.platforms = multi_key_dict()

        for game in Game.query.all():
            self.add_game(game)

        for dev in Developer.query.all():
            self.add_developer(dev)

        for article in Article.query.all():
            self.add_article(article)

        for genre in Genre.query.all():
            self.add_genre(genre)

        for platform in Platform.query.all():
            self.add_platform(platform)

        count = len(self.games) + len(self.developers) + \
            len(self.articles) + len(self.genres) + len(self.platforms)
        print("[MAIN] Loaded %d entities" % count)

        self.initialized = True
Ejemplo n.ยบ 3
0
def get_input(prompt, type_=None, max=10, min=1):
    if type_ == 'int':
        while True:
            try:
                v = int(input(prompt))
            except ValueError:
                print(
                    "That is a psychotic thing to answer - try again asshole")
                continue
            if min <= v <= max:
                return v
                break
            else:
                print("That's an absurd number to give")
                continue
    if type_ == 'bin':
        while True:
            bin_dict = multi_key_dict()
            bin_dict['true', 't', 'yes', 'y', '1'] = True
            bin_dict['false', 'f', 'no', 'n', '0'] = False
            tv = str(input(prompt).lower())
            try:
                v = bin_dict[tv]
                return v
                break
            except KeyError:
                print(
                    'Invalid answer - there are only 2 options, try again plz')
                continue
    else:
        v = str(input(prompt))
        while v == "":
            print('You need to say something at least ...')
            v = str(input(prompt))
        return v
Ejemplo n.ยบ 4
0
    def __init__(self):
        super(WeatherSkill, self).__init__("WeatherSkill")

        # Build a dictionary to translate OWM weather-conditions
        # codes into the Mycroft weather icon codes
        # (see https://openweathermap.org/weather-conditions)
        self.CODES = multi_key_dict()
        self.CODES['01d', '01n'] = 0  # clear
        self.CODES['02d', '02n', '03d', '03n'] = 1  # partly cloudy
        self.CODES['04d', '04n'] = 2  # cloudy
        self.CODES['09d', '09n'] = 3  # light rain
        self.CODES['10d', '10n'] = 4  # raining
        self.CODES['11d', '11n'] = 5  # stormy
        self.CODES['13d', '13n'] = 6  # snowing
        self.CODES['50d', '50n'] = 7  # windy/misty

        # Use Mycroft proxy if no private key provided
        try:
            key = self.config_core.get("APIS").get("Weather")
        except:
            key = self.config.get('api_key')
        if key and not self.config.get('proxy'):
            self.owm = OWM(key)
        else:
            self.owm = OWMApi()
Ejemplo n.ยบ 5
0
    def makeCodonDict(self):

        codonDict = multi_key_dict()
        codonDict["UUU", "UUC"] = Phenylalanine()
        codonDict["UUA", "UUG", "CUU", "CUC", "CUA", "CUG"] = Leucine()
        codonDict["AUU", "AUC", "AUA"] = Isoleucine()
        codonDict["AUG"] = Methionine()
        codonDict["GUU", "GUC", "GUA", "GUG"] = Valine()
        codonDict["UCU", "UCC", "UCA", "UCG", "AGU", "AGC"] = Serine()
        codonDict["CCU", "CCC", "CCA", "CCG"] = Proline()
        codonDict["ACU", "ACC", "ACA", "ACG"] = Threonine()
        codonDict["GCU", "GCC", "GCA", "GCG"] = Alanine()
        codonDict["UAU", "UAC"] = Tyrosine()
        codonDict["UAA", "UAG", "UGA"] = "stop"
        codonDict["CAU", "CAC"] = Histidine()
        codonDict["CAA", "CAG"] = Glutamine()
        codonDict["AAU", "AAC"] = Asparagine()
        codonDict["AAA", "AAG"] = Lysine()
        codonDict["GAU", "GAC"] = AsparticAcid()
        codonDict["GAA", "GAG"] = GlutamicAcid()
        codonDict["UGU", "UGC"] = Cysteine()
        codonDict["UGG"] = Tryptophan()
        codonDict["CGU", "CGC", "CGA", "CGG", "AGA", "AGG"] = Arginine()
        codonDict["GGU", "GGC", "GGA", "GGG"] = Glycine()
        return codonDict
Ejemplo n.ยบ 6
0
def fileBrowser(view, page):
    file_extensions = multi_key_dict()
    file_extensions['.mp3', '.flac'] = 'audio'
    file_extensions['.mp4', '.mkv', '.mpeg', '.wmv'] = 'videos'
    file_extensions['.png', '.jpg', '.jpeg'] = 'photos'
    file_types = {v: k for k, v in file_extensions.items()}
    file_type_html = {
        'audio':
        """
		 <audio controls style="display:block;">
  	      <source src="{0}" type="audio/webm">
         </audio>
    	""",
        'videos':
        """
		 <video controls class="FIThumb_content">
	  	  <source src="{0}" type="video/webm">
		  Your browser does not support the video tag.
		 </video>
		""",
        'photos':
        """
		 <img src="{0}" class="FIThumb_content">
		""",
        'default':
        """<img class="FIThumb_content" src="/static/images/unknown.png">""",
    }
    form = FormFileSearch(view='search')
    form.search_view.choices = [(k, k.title()) for k in file_types]
    form.search_view.choices.append(tuple(['all', 'All']))

    if form.validate_on_submit():
        session['search'] = form.search.data
        session['search_view'] = form.search_view.data
        return redirect(url_for('site.fileBrowser', view='search', page=1))
    if view != 'all' and view in file_types:
        pagination = g.user.files.filter(File.fext.in_(
            file_types[view])).paginate(page, 10)
    elif view == 'search':
        baseq = g.user.files.filter(File.name.contains(session['search']))
        if session['search_view'] == 'all':
            pagination = baseq.order_by(desc(File.datetime)).paginate(page, 10)
        else:
            pagination = baseq.filter(
                File.fext.in_(file_types[session['search_view']])).paginate(
                    page, 10)
    else:
        pagination = g.user.files.order_by(desc(File.datetime)).paginate(
            page, 10)
    files = pagination.items

    return render_template("site/filebrowser.html",
                           form_file_upload=FormFileUpload(),
                           form_file_search=form,
                           files=files,
                           file_extensions=file_extensions,
                           file_type_html=file_type_html,
                           file_types=file_types,
                           pagination=pagination,
                           view=view)
Ejemplo n.ยบ 7
0
def get_skill_ability_class(s: SkillClass) -> AbilityClass:
    """
    Returns the AbilityClass that affects the given SkillClass.

    :param SkillClass s: Skill class to check
    :returns dict Ability class the given skill class is affected by.
    """
    k = multi_key_dict()
    k[SkillClass.ACROBATICS, SkillClass.DISABLE_DEVICE,
      SkillClass.ESCAPE_ARTIST, SkillClass.FLY, SkillClass.RIDE,
      SkillClass.SLEIGHT_OF_HAND,
      SkillClass.STEALTH, ] = AbilityClass.DEXTERITY
    k[SkillClass.APPRAISE, SkillClass.CRAFT, SkillClass.KNOWLEDGE_ARCANA,
      SkillClass.KNOWLEDGE_DUNGEONEERING, SkillClass.KNOWLEDGE_ENGINEERING,
      SkillClass.KNOWLEDGE_GEOGRAPHY, SkillClass.KNOWLEDGE_HISTORY,
      SkillClass.KNOWLEDGE_LOCAL, SkillClass.KNOWLEDGE_NATURE,
      SkillClass.KNOWLEDGE_NOBILITY, SkillClass.KNOWLEDGE_PLANES,
      SkillClass.KNOWLEDGE_RELIGION, SkillClass.LINGUISTICS,
      SkillClass.SPELLCRAFT] = AbilityClass.INTELLIGENCE
    k[SkillClass.BLUFF, SkillClass.DIPLOMACY, SkillClass.DISGUISE,
      SkillClass.HANDLE_ANIMAL, SkillClass.PERFORM,
      SkillClass.USE_MAGIC_DEVICE,
      SkillClass.INTIMIDATE, ] = AbilityClass.CHARISMA
    k[SkillClass.SWIM, SkillClass.CLIMB] = AbilityClass.STRENGTH
    k[SkillClass.HEAL, SkillClass.PERCEPTION, SkillClass.PROFESSION,
      SkillClass.SENSE_MOTIVE, SkillClass.SURVIVAL] = AbilityClass.WISDOM
    return k[s]
Ejemplo n.ยบ 8
0
    def __init__(self):
        super(WeatherSkill, self).__init__("WeatherSkill")

        # Build a dictionary to translate OWM weather-conditions
        # codes into the Mycroft weather icon codes
        # (see https://openweathermap.org/weather-conditions)
        self.CODES = multi_key_dict()
        self.CODES['01d', '01n'] = 0                # clear
        self.CODES['02d', '02n', '03d', '03n'] = 1  # partly cloudy
        self.CODES['04d', '04n'] = 2                # cloudy
        self.CODES['09d', '09n'] = 3                # light rain
        self.CODES['10d', '10n'] = 4                # raining
        self.CODES['11d', '11n'] = 5                # stormy
        self.CODES['13d', '13n'] = 6                # snowing
        self.CODES['50d', '50n'] = 7                # windy/misty

        # Use Mycroft proxy if no private key provided
        key = self.config.get('api_key')
        # TODO: Remove lat,lon parameters from the OWMApi()
        #       methods and implement _at_coords() versions
        #       instead to make the interfaces compatible
        #       again.
        #
        # if key and not self.config.get('proxy'):
        #     self.owm = OWM(key)
        # else:
        #     self.owm = OWMApi()
        self.owm = OWMApi()
        if self.owm:
            self.owm.set_OWM_language(lang=self.__get_OWM_language(self.lang))
Ejemplo n.ยบ 9
0
def get_table(row_ranges, col_ranges, image, iterative_update_xs=True):
    table = multi_key_dict()
    if iterative_update_xs:
        y1_curr = []
        y2_curr = []
    for i, (colname, dx) in enumerate(col_ranges.items()):
        for j, (snum, dy) in enumerate(row_ranges.items()):
            x1 = dx[0]
            x2 = dx[1]
            y1 = dy[0]
            y2 = dy[1]
            if iterative_update_xs:
                if i > 0:
                    y1 = y1_curr[j]
                    y2 = y2_curr[j]
                else:
                    y1_curr.append(y1_curr)
                    y2_curr.append(y2_curr)
            # image=cv2.rectangle(image, p1, p2 ,(255,0,0), 5)
            bbox_out = [x1, y1, x2, y2]
            p1 = (x1, y1)
            p2 = (x2, y2)
            p1 = hocr_to_cv2(p1)
            p2 = hocr_to_cv2(p2)
            image = cv2.rectangle(image, p1, p2, (255, 0, 0), 5)
            # out = get_below_boxes(bbox_out, strict= True)
            # #print([root.get_element_by_id(o[0]).text for o in out])
            # image=cv2.rectangle(image, p1, p2 ,(255,0,0), 5)
            rel_bboxes = [(word_ids[i], bbox)
                          for i, bbox in enumerate(word_bboxes)
                          if bbox_within(bbox, bbox_out)]
            # for (id, bbox) in rel_bboxes:
            # 	p1 = (bbox[0], bbox[1])
            # 	p2 = (bbox[2], bbox[3])
            # 	p1 = hocr_to_cv2(p1)
            # 	p2 = hocr_to_cv2(p2)
            # 	image=cv2.rectangle(image, p1, p2 ,(255,0,0), 5)
            if rel_bboxes:
                if iterative_update_xs:
                    new_y1 = [x[1][1] for x in rel_bboxes]
                    new_y2 = [x[1][3] for x in rel_bboxes]
                    new_y1 = sum(new_y1) / len(new_y1)
                    new_y2 = sum(new_y2) / len(new_y2)
                    new_y1, new_y2 = int(new_y1), int(new_y2)
                    y1_curr[j] = new_y1
                    y2_curr[j] = new_y2
                # if testing:
                # 	print(snum, colname, [get_text_by_id(x[0]) for x in rel_bboxes])

            else:
                if iterative_update_xs:
                    y1_curr[j] = y1
                    y2_curr[j] = y2
Ejemplo n.ยบ 10
0
 def __init__(self):
     super(WeatherSkill, self).__init__(name="WeatherSkill")
     self.temperature = self.config['temperature']
     self.CODES = multi_key_dict()
     self.CODES['01d', '01n'] = 0
     self.CODES['02d', '02n', '03d', '03n'] = 1
     self.CODES['04d', '04n'] = 2
     self.CODES['09d', '09n'] = 3
     self.CODES['10d', '10n'] = 4
     self.CODES['11d', '11n'] = 5
     self.CODES['13d', '13n'] = 6
     self.CODES['50d', '50n'] = 7
Ejemplo n.ยบ 11
0
 def __init__(self):
     super(WeatherSkill, self).__init__(name="WeatherSkill")
     self.temperature = self.config['temperature']
     self.CODES = multi_key_dict()
     self.CODES['01d', '01n'] = 0
     self.CODES['02d', '02n', '03d', '03n'] = 1
     self.CODES['04d', '04n'] = 2
     self.CODES['09d', '09n'] = 3
     self.CODES['10d', '10n'] = 4
     self.CODES['11d', '11n'] = 5
     self.CODES['13d', '13n'] = 6
     self.CODES['50d', '50n'] = 7
Ejemplo n.ยบ 12
0
 def __init__(self):
     super(WeatherSkill, self).__init__("WeatherSkill")
     self.__init_owm()
     self.CODES = multi_key_dict()
     self.CODES['01d', '01n'] = 0
     self.CODES['02d', '02n', '03d', '03n'] = 1
     self.CODES['04d', '04n'] = 2
     self.CODES['09d', '09n'] = 3
     self.CODES['10d', '10n'] = 4
     self.CODES['11d', '11n'] = 5
     self.CODES['13d', '13n'] = 6
     self.CODES['50d', '50n'] = 7
Ejemplo n.ยบ 13
0
 def __init__(self):
     super(WeatherSkill, self).__init__("WeatherSkill")
     self.language = self.config_core.get('lang')
     self.temperature = self.config.get('temperature')
     self.__init_owm()
     self.CODES = multi_key_dict()
     self.CODES['01d', '01n'] = 0
     self.CODES['02d', '02n', '03d', '03n'] = 1
     self.CODES['04d', '04n'] = 2
     self.CODES['09d', '09n'] = 3
     self.CODES['10d', '10n'] = 4
     self.CODES['11d', '11n'] = 5
     self.CODES['13d', '13n'] = 6
     self.CODES['50d', '50n'] = 7
Ejemplo n.ยบ 14
0
 def __init__(self,
              dnac,
              name=SITE_HIERARCHY_NAME,
              verify=False,
              timeout=5):
     """
     Creates at new Site object.
     :param dnac: The Cisco DNA Center cluster to which the site belongs.
         type: Dnac object
         required: yes
         default: none
     :param name: The site hierarchy's name.
         type: str
         required: no
         default: Either the Dnac object's name or IP address concatenated with SITE_HIERARCHY_NAME.
     :param verify: A flag indicating whether or not to validate the cluster's certificate.
         type: bool
         required: no
         default: False
     :param timeout: The number of seconds to wait for a response from a site hierarchy API call.
         type: int
         required: no
         default: 5
     """
     if dnac.version in SUPPORTED_DNAC_VERSIONS:
         path = SITE_RESOURCE_PATH[dnac.version]
     else:
         raise DnacError('__init__: %s: %s' %
                         (UNSUPPORTED_DNAC_VERSION, dnac.version))
     if dnac.name != NO_DNAC_PATH:
         site_hierarchy_name = '%s%s' % (dnac.name, name)
     elif dnac.ip != NO_DNAC_PATH:
         site_hierarchy_name = '%s%s' % (dnac.ip, name)
     else:
         raise DnacError('__init__: critical error: %s: %s' %
                         (NO_DNAC_PATH_ERROR, NO_DNAC_PATH_RESOLUTION))
     super(SiteHierarchy, self).__init__(dnac,
                                         site_hierarchy_name,
                                         resource=path,
                                         verify=verify,
                                         timeout=timeout)
     self.__all_sites = []
     self.__site_nodes = multi_key_dict()
     self.__site_count = NO_SITES
     self.load_sites()
Ejemplo n.ยบ 15
0
def init_sound_dict():
    """
    Creates dictionary of similar morpheme groups.

    Morphemes are grouped by similarity, stressed (including secondary) are separated from unstressed,
    paired consonants are grouped together.

    :return: multi key dictionary with morpheme groups.
    """
    sound_dict = multi_key_dict()
    sound_dict['IY2', 'IY1', 'IH1', 'IH2', 'UH2', 'Y'] = ['IY2', 'IY1', 'IH1', 'IH2', 'UH2', 'Y']
    sound_dict['IH0', 'IY0'] = ['IH0', 'IY0']
    sound_dict['UW0', 'UH0'] = ['UW0', 'UH0']
    sound_dict['UW1', 'UW2', 'UH1'] = ['UW1', 'UW2', 'UH1']
    sound_dict['AA0', 'AH0'] = ['AA0', 'AH0']
    sound_dict['AA1', 'AA2', 'AH1', 'AH2'] = ['AA1', 'AA2', 'AH1', 'AH2']
    sound_dict['AY0'] = ['AY0']
    sound_dict['AY1', 'AY2'] = ['AY1', 'AY2']
    sound_dict['AW0'] = ['AW0']
    sound_dict['AW1', 'AW2'] = ['AW1', 'AW2']
    sound_dict['AO0'] = ['AO0']
    sound_dict['AO1', 'AO1', 'AO2'] = ['AO1', 'AO1', 'AO2']
    sound_dict['OY0'] = ['OY0']
    sound_dict['OY1', 'OY2'] = ['OY1', 'OY2']
    sound_dict['OW0'] = ['OW0']
    sound_dict['OW1', 'OW2'] = ['OW1', 'OW2']
    sound_dict['EY0'] = ['EY0']
    sound_dict['EY1', 'EY2'] = ['EY1', 'EY2']
    sound_dict['EH0', 'AE0'] = ['EH0', 'AE0']
    sound_dict['EH1', 'EH2', 'AE1', 'AE2'] = ['EH1', 'EH2', 'AE1', 'AE2']
    sound_dict['ER0'] = ['ER0']
    sound_dict['ER1', 'ER2'] = ['ER1', 'ER2']
    sound_dict['S', 'Z', 'DH', 'TH'] = ['S', 'Z', 'DH', 'TH']
    sound_dict['P', 'B'] = ['P', 'B']
    sound_dict['M', 'N', 'NG'] = ['M', 'N', 'NG']
    sound_dict['F', 'V'] = ['F', 'V']
    sound_dict['G', 'K'] = ['G', 'K']
    sound_dict['T', 'D'] = ['T', 'D']
    sound_dict['JH', 'CH'] = ['JH', 'CH']
    sound_dict['SH', 'ZH'] = ['SH', 'ZH']
    sound_dict['L'] = ['L']
    sound_dict['R'] = ['R']
    sound_dict['HH'] = ['HH']
    sound_dict['W'] = ['W']
    return sound_dict
Ejemplo n.ยบ 16
0
    def __init__(self, subreddit_name, thread_limit):
        print("Initializing for {} threads on subreddit: {}...".format(
            thread_limit, subreddit_name))
        self.reddit = praw.Reddit(
            client_id='GETTHISONREDDIT',
            client_secret='GETTHISONREDDIT',
            username='******',
            password='******',
            user_agent='GETTHISONREDDIT')  #reddit instance

        self.subreddit = self.reddit.subreddit(subreddit_name)
        self.hot_python = self.subreddit.hot(
            limit=thread_limit)  #some id looking thing
        self.coin_dict = multi_key_dict()
        self.analyzer = SentimentIntensityAnalyzer()

        #make separate searches for thread and comment count
        print("Finished Initializing!")
Ejemplo n.ยบ 17
0
def get_iconfile(icon):

    icons = multi_key_dict()
    icons['clear', 'sunny'] = 'clear-day'
    icons['nt_clear', 'nt_sunny'] = 'clear-night'
    icons['rain', 'chancerain', 'nt_rain', 'nt_chancerain'] = 'rain'
    icons['snow', 'chancesnow', 'flurries', 'chanceflurries'] = 'snow-day'
    icons['nt_snow', 'nt_chancesnow', 'nt_flurries', 'nt_chanceflurries'] = 'snow-night'
    icons['mostlysunny', 'partlysunny', 'partlycloudy'] = 'partly-cloudy-day'
    icons['nt_mostlysunny', 'nt_partlysunny', 'nt_partlycloudy'] = 'partly-cloudy-night'
    icons['cloudy', 'mostlycloudy'] = 'cloudy'
    icons['nt_cloudy', 'nt_mostlycloudy'] = 'cloudy-night'
    icons['sleet', 'chancesleet', 'nt_sleet', 'nt_chancesleet'] = 'sleet'
    icons['tstorms', 'chancetstorms', 'nt_tstorms', 'nt_chancetstorms'] = 'thunderstorm'
    icons['fog', 'haze', 'nt_fog', 'nt_haze'] = 'fog'

    filename = icons.get(icon, None)
    if filename is None:
        print ("Error: Filename not found. Unknown weather condition: '%s'" % icon)
        return ('notfound.png')
    else:
        return (filename+'.png')
Ejemplo n.ยบ 18
0

basepos = BasePosition()
'''doubledict = multi_key_dict()
doubledict['AA'] = A.unit_couplet_value(A)
doubledict['AC', 'CA'] = A.unit_couplet_value(C)
doubledict['AG', 'GA'] = A.unit_couplet_value(G)
doubledict['AT', 'TA'] = A.unit_couplet_value(T)
doubledict['CC'] = C.unit_couplet_value(C)
doubledict['CG', 'GC'] = C.unit_couplet_value(G)
doubledict['CT', 'TC'] = C.unit_couplet_value(T)
doubledict['GG'] = G.unit_couplet_value(G)
doubledict['GT', 'TG'] = G.unit_couplet_value(T)
doubledict['TT'] = T.unit_couplet_value(T)'''

doubledict = multi_key_dict()
doubledict['AA'] = basepos.A.unit_couplet_value(basepos.A)
doubledict['AC', 'CA'] = basepos.A.unit_couplet_value(basepos.C)
doubledict['AG', 'GA'] = basepos.A.unit_couplet_value(basepos.G)
doubledict['AT', 'TA'] = basepos.A.unit_couplet_value(basepos.T)
doubledict['CC'] = basepos.C.unit_couplet_value(basepos.C)
doubledict['CG', 'GC'] = basepos.C.unit_couplet_value(basepos.G)
doubledict['CT', 'TC'] = basepos.C.unit_couplet_value(basepos.T)
doubledict['GG'] = basepos.G.unit_couplet_value(basepos.G)
doubledict['GT', 'TG'] = basepos.G.unit_couplet_value(basepos.T)
doubledict['TT'] = basepos.T.unit_couplet_value(basepos.T)


def lifeizhaoyuplot(fname):
    seqlen = getseqlen(fname)
    #print(seqlen)
Ejemplo n.ยบ 19
0
###########################################
## Python 2. Uses multi-key-dict module. ##
###########################################

from multi_key_dict import multi_key_dict

two = three = four = five = six = seven = eight = nine = multi_key_dict()

two['A', 'B', 'C'] = '2'
three['D', 'E', 'F'] = '3'
four['G', 'H', 'I'] = '4'
five['J', 'K' 'L'] = '5'
six['M', 'N', 'O'] = '6'
seven['P', 'Q', 'R', 'S'] = '7'
eight['T', 'U', 'V'] = '8'
nine['W', 'X', 'Y', 'Z'] = '9'


def request():
    print "Enter telephone number (7 letters)"
    number = raw_input('1-800-')
    return number.upper()


def decrypt(number):
    d = '1-800-'
    for i in range(0, 7):
        d = d + two[number[i]]
        if i == 2:  #add dash
            d = d + '-'
Ejemplo n.ยบ 20
0
def union(x, y):
    return multi_key_dict({**x.items_dict, **y.items_dict})
Ejemplo n.ยบ 21
0
    title = title[:-3]  # remove last 3 chars

    if hdr != "":
        hdr += "</style>"

    return render_template("station.html",
                           stations=stats,
                           time=d.strftime("%R"),
                           header=Markup(hdr),
                           title=title)


rnv = pyrnvapi.RNVStartInfoApi(get_env_variable("RNV_API_KEY"))  # rnv key

# global list of all available stations and all available lines
gstations = multi_key_dict()
gstations_sorted = OrderedDict()
glines = {}

# caching of requested stations
gnext_call_stations = time.time()
gcached_stations = multi_key_dict()

if __name__ == "__main__":
    get_all_stations()
    get_all_lines()
    # gen_css()

    app.run()
Ejemplo n.ยบ 22
0
illegal_characters = re.compile(r'[โ€ถโ€ณร‚]')
cut_list = ['for', 'cut', 'such as']
replacements = {
    'yoghurt': 'yogurt',
    "'s": '',
    'squeeze': 'squeezed',
    'aubergine': 'eggplant',
    'self raising': 'self-raising',
    'pitta': 'pita',
    'chile': 'chili',
    'chilli': 'chili',
    'tomate': 'tomato',
    'zucker': 'sugar'
}  # removed , 'olife': 'olive'

unit_conversions = multi_key_dict()
unit_conversions['pounds', 'pound', 'lbs', 'lb'] = ('g', 453.6)
unit_conversions['ounces', 'ounce', 'ozs', 'oz', 'weight'] = ('g', 28.35)
unit_conversions['can', 'cans', 'cn'] = ('can', 1)
unit_conversions['pints', 'pint', 'pts', 'pt'] = ('l', 0.4732)
unit_conversions['quarts', 'quart', 'qts', 'qt'] = ('l', 1.946352946)
unit_conversions['cups', 'cup', 'c'] = ('l', 0.2366)
unit_conversions['cubes', 'cube'] = ('cube', 1)
unit_conversions['fluid', 'fl'] = ('l', 0.02957)
unit_conversions['tablespoons', 'tablespoon', 'tbsps', 'tbsp', 'tb', 'tbs',
                 'T'] = ('l', 0.01479)
unit_conversions['teaspoons', 'teaspoon', 'tsps', 'tsp', 't',
                 'ts'] = ('l', 0.004929)
unit_conversions['milliliters', 'millilitres', 'ml'] = ('l', 0.001)
unit_conversions['gram', 'gs', 'grams'] = ('g', 1)
unit_conversions['kilogram', 'kgs', 'kg', 'kilograms'] = ('g', 0.001)
Ejemplo n.ยบ 23
0
"Dรฉcale-la dans la colonne trois",\
"Dรฉcale la piรจce deux colonnes ร  droite",\
"Termine mon tour",\
"Dรฉcale la vers la droite de deux colonnes"]


def union(x, y):
    return multi_key_dict({**x.items_dict, **y.items_dict})


ordinals_vocab = multi_key_dict({
    ("premiรจre", "1er"): 1,
    ("deuxiรจme", "2e"): 2,
    ("troisiรจme", "3e"): 3,
    ("quatriรจme", "4e"): 4,
    ("cinquiรจme", "5e"): 5,
    ("sixiรจme", "6e"): 6,
    ("septiรจme", "7e"): 7,
    ("huitiรจme", "8e"): 8,
    ("neuviรจme", "9e"): 9,
    ("dixiรจme", "10e"): 10
})
index_piece_vocab = multi_key_dict({
    ("1", "un", "une"): 1,
    ("2", "de", "deux"): 2,
    ("3", "trois", "troie"): 3
})
index_column_vocab = union(
    index_piece_vocab,
    multi_key_dict({
        ("4", "quatre"): 4,
        ("5", "cinq"): 5,
Ejemplo n.ยบ 24
0
from multi_key_dict import multi_key_dict
from math import *
from seqlencalc import getseqlen
import datetime

tripletdict = multi_key_dict()
tripletdict['TAA', 'TAG', 'TGA'] = 0
tripletdict['ATG'] = 1
tripletdict['GCT', 'GCC', 'GCA', 'GCG'] = 2
tripletdict['CGT', 'CGC', 'CGA', 'CGG', 'AGA', 'AGG'] = 3
tripletdict['AAT', 'AAC'] = 4
tripletdict['GAT', 'GAC'] = 5
tripletdict['TGT', 'TGC'] = 6
tripletdict['CAA', 'CAG'] = 7
tripletdict['GAA', 'GAG'] = 8
tripletdict['GGT', 'GGC', 'GGA', 'GGG'] = 9
tripletdict['ATT', 'ATC', 'ATA'] = 10
tripletdict['CAT', 'CAC'] = 11
tripletdict['TTA', 'TTG', 'CTT', 'CTC', 'CTA', 'CTG'] = 12
tripletdict['AAA', 'AAG'] = 13
tripletdict['TTT', 'TTC'] = 14
tripletdict['CCT', 'CCC', 'CCA', 'CCG'] = 15
tripletdict['TCT', 'TCC', 'TCA', 'TCG', 'AGT', 'AGC'] = 16
tripletdict['ACT', 'ACC', 'ACA', 'ACG'] = 17
tripletdict['TGG'] = 18
tripletdict['TAT', 'TAC'] = 19
tripletdict['GTT', 'GTC', 'GTA', 'GTG'] = 20

#print(tripletdict['TAG'])

Ejemplo n.ยบ 25
0
                     cmds.listNodeTypes('texture') + \
                     cmds.listNodeTypes('light') + \
                     cmds.listNodeTypes('postProcess') + \
                     cmds.listNodeTypes('utility')
                     
UNPACK_TYPES = [u'short2', u'short3', u'long2', u'long3', u'float2', u'float3',
                u'double2', u'double3', u'matrix', u'pointArray', 
                u'vectorArray', u'stringArray', u'cone', u'reflectanceRGB', 
                u'spectrumRGB', u'componentList']

PACKED_TYPES = [u'Int32Array', u'doubleArray', u'attributeAlias']

TIME_VALS = ['hour','min','sec','millisec','game','film',
             'pal','ntsc','show','palf','ntscf']

SSELECT_CURVES = multi_key_dict()
SSELECT_CURVES['soft', 0] = '1,0,2, 0,1,2'
SSELECT_CURVES['medium', 1] = '1,0.5,2, 0,1,2, 1,0,2'
SSELECT_CURVES['linear', 2] = '0,1,0, 1,0,1'
SSELECT_CURVES['hard', 3] = '1,0,0, 0,1,0'
SSELECT_CURVES['crater', 4] = '0,0,2, 1,0.8,2, 0,1,2'
SSELECT_CURVES['wave', 5] = '1,0,2, 0,0.16,2, 0.75,0.32,2, 0,0.48,2,' \
                            '0.25,0.64,2, 0,0.8,2, 0,1,2'
SSELECT_CURVES['stairs', 6] = '1,0,1, 0.75,0.25,1, 0.5,0.5,1, 0.75,0.25,1,' \
                            '0.25,0.75,1, 1,0.249,1, 0.749,0.499,1,' \
                            '0.499,0.749,1'
SSELECT_CURVES['ring', 7] = '0,0.25,2, 1,0.5,2, 0,0.75,2'
SSELECT_CURVES['sine', 8] = '1,0,2, 0,0.16,2, 1,0.32,2, 0,0.48,2,' \
                             '1,0.64,2, 0,0.8,2, 0,1,2'
                             
SHADER_NODE_FLAGS = {'asLight': bool, 'asPostProcess': bool, 
Ejemplo n.ยบ 26
0
###########################################
## Python 2. Uses multi-key-dict module. ##
###########################################

from multi_key_dict import multi_key_dict

two = three = four = five = six = seven = eight = nine = multi_key_dict()

two['A', 'B', 'C'] = '2'
three['D', 'E', 'F'] = '3'
four['G', 'H', 'I'] = '4'
five['J','K' 'L'] = '5'
six['M', 'N', 'O'] = '6'
seven['P', 'Q', 'R', 'S'] = '7'
eight['T', 'U', 'V'] = '8'
nine['W','X','Y', 'Z'] = '9'

def request():
	print "Enter telephone number (7 letters)"
	number = raw_input('1-800-')
	return number.upper()

def decrypt(number):
	d = '1-800-'
	for i in range(0,7):
		d = d +  two[number[i]]
		if i == 2: #add dash
			d = d + '-'

	return d
Ejemplo n.ยบ 27
0
def dummify_features(recipes_json):

    ingredient_dict = multi_key_dict()

    # Baking
    ingredient_dict['active yeast', 'bread machine yeast', 'dry yeast', 'instant yeast', 'nutritional yeast',
                    'yeast'] = 'yeast'
    ingredient_dict['baking powder', 'cream of tartar'] = 'baking_powder'
    ingredient_dict['baking soda', 'bicarbonate of soda'] = 'baking_soda'
    ingredient_dict['alcohol free vanilla flavor', 'bourbon vanilla extract', 'colher de de essรชncia de baunilha'] = 'vanilla_extract'
    ingredient_dict['food coloring','food colourings','food dye', 'green food color','green food coloring',
                    'red food coloring','yellow food color','yellow food coloring', 'achiote'] = 'food_coloring'
    ingredient_dict['vanilla','vanilla extract','vanilla bean','vanilla bean paste','vanilla paste','vanilla pod'] = 'vanilla'
    ingredient_dict['coconut', 'flake coconut', 'unsweetened coconut flakes', 'unsweetened dried coconut',
                    'unsweetened shredded coconut', 'sweetened coconut','sweetened coconut flakes',
                    'sweetened shredded coconut','coconut extract'] = 'coconut'

    # Misc
    ingredient_dict['all-bran cereal', 'cereal', 'corn flakes', 'cornflakes', 'crisp rice cereal', 'rice chex',
                    'rice krispies cereal'] = 'cereal'
    ingredient_dict['chex snack mix'] = 'chex'
    ingredient_dict['granola'] = 'granola'
    ingredient_dict['angostura bitters', 'bitters', 'orange bitters'] = 'bitters'
    ingredient_dict['blackberry jam','pineapple jam','strawberry jam','strawberry preserves','raspberry jam',
                    'cherry jam','apricot jam','apricot preserves','apple jelly', 'jam','jelly', 'grape jelly',
                    'orange marmalade'] = 'fruit_preserve'
    ingredient_dict['champagne vinegar', 'malt vinegar','unseasoned rice wine vinegar','vinegar','white vinegar',
                    'white wine vinegar','white distilled vinegar','wine vinegar','red wine vinegar',
                    'sherry vinegar','rice vinegar','rice wine vinegar','seasoned rice vinegar',
                    'apple cider vinegar', 'cider vinegar'] = 'vinegar'
    ingredient_dict['condensed cream of mushroom soup', 'cream of chicken soup', 'cheddar cheese soup',
                    'cheese soup'] = 'cream_soup'
    ingredient_dict['fried onions'] = 'fried_onion'
    ingredient_dict['ice', 'ice cubes'] = 'ice'
    ingredient_dict['water','ice water'] ='water'
    ingredient_dict['liquid smoke'] = 'liquid_smoke'
    ingredient_dict['mac & cheese', 'macaroni'] = 'mac&cheese'
    ingredient_dict['maple extract','maple flavoring','maple syrup'] = 'maple'
    ingredient_dict['maraschino cherries','maraschino liqueur','grenadine'] = 'maraschino'
    ingredient_dict['microwave popcorn', 'popcorn','popped corn',
                    'sacos de pipoca de microondas ou 9 xรญcaras de de pipoca pronta'] = 'popcorn'
    ingredient_dict['mid-sized skewers', 'wooden skewers'] = 'skewer'
    ingredient_dict['vanilla powder','vanilla protein powder','soy protein','soy protein powder'] = 'protein_powder'
    ingredient_dict['polenta'] = 'polenta'
    ingredient_dict['brine'] = 'brine'

    # Fruits
    ingredient_dict['dried apricots','dried cherries','dried cranberries','dried fruit',
                    'sweetened dried cranberries','raisins','golden raisins'] = 'dried_fruit'
    ingredient_dict['whole berry cranberry sauce','whole cranberry sauce'] = 'cranberry_sauce'
    ingredient_dict['peach','peaches', 'peach nectar','peach schnapps'] = 'peach'
    ingredient_dict['rhubarb'] = 'rhubarb'
    ingredient_dict['pineapple','pineapple chunks','pineapple in juice','pineapple juice'] = 'pineapple'
    ingredient_dict['pomegranate arils','pomegranate juice','pomegranate seeds','pomegranates',
                    'seeds of pomegranate'] = 'pomegranate'
    ingredient_dict['mango','mangoes','mangos', 'mango chutney','mango puree'] = 'mango'
    ingredient_dict['lemon peel', 'lemon zest', 'orange peel','orange zest', 'lime peel', 'lime zest',
                    'finely grated lime zest'] = 'citrus_zest'
    ingredient_dict['juice of lemon', 'lemon', 'lemon juice', 'lemons', 'meyer lemon juice','lemon curd','lemon extract'] = 'lemon'
    ingredient_dict['juice of lime', 'lime','lime juice', 'lime wedge','lime wedges','limes'] = 'lime'
    ingredient_dict['juice of orange', 'mandarin orange segments','mandarin oranges','mandarins', 'orange',
                    'oranges','navel oranges','nectarines', 'orange juice','orange juice concentrate',
                    'tangerine juice', 'orange extract','clementines', 'blood orange','blood orange juice'] = 'orange'
    ingredient_dict['guava juice'] = 'guava_juice'
    ingredient_dict['grapefruit','grapefruit juice'] = 'grapefruit'
    ingredient_dict['grapes', 'red grapes','white grape juice'] = 'grapes'
    ingredient_dict['watermelon'] = 'watermelon'
    ingredient_dict['plums'] = 'plum'
    ingredient_dict['currants', 'currant']   = 'currant'
    ingredient_dict['date','dates', 'medjool dates'] = 'date'
    ingredient_dict['figs', 'fig', 'fresh figs'] = 'fig'
    ingredient_dict['cherries','cherry','sweet cherries','cherry juice','cherry pie filling'] = 'cherry'
    ingredient_dict['berries', 'blackberries', 'blueberries', 'cranberries', 'mixed berries', 'strawberries',
                    'strawberry','raspberries','raspberry', 'freeze-dried strawberries'] = 'berry'
    ingredient_dict['banana','bananas','plantain','plantains'] = 'banana'
    ingredient_dict['apple', 'apples', 'fuji apple', 'gala apples', 'granny smith apples',
                    'golden delicious apple','mcintosh apple','tart apple','tart apples','apple butter',
                    'apple cider', 'apple juice','applesauce', 'unsweetened applesauce'] = 'apple'
    ingredient_dict['bartlett pears', 'pear','pears'] = 'pear'
    ingredient_dict['musk melon','cantaloupe'] = 'melon'

    # Meat
    ingredient_dict['93% lean ground turkey meat', 'ground turkey', 'lean ground turkey','ground beef',
                    'ground beef chuck','ground bison','hamburger meat', 'lean beef', 'lean ground beef',
                    'ground lamb','ground pork','meatballs','ground chicken'] = 'ground_meat'
    ingredient_dict['breakfast sausage', 'bulk sausage', 'ground sausage', 'italian turkey sausage',
                    'italian sausage', 'linguiรงa and/or presunto', 'polish sausage','pork sausage',
                    'pork sausages','sausage','sausage links','sausages','spanish chorizo','smoked sausage',
                    'turkey sausage','andouille sausage', 'andouille sausages','chicken sausage',
                    'chicken sausage links','chorizo','franks'] = 'sausage'
    ingredient_dict['bone in chicken thighs', 'bone-in skin-on chicken thighs', 'chicken','chicken breast','chicken breasts',
                    'chicken drumsticks and thighs','chicken meat','chicken pieces', 'chicken strips',
                    'chicken tenderloins','chicken tenders','chicken thigh','chicken thighs','chicken wings',
                    'chickens','cooked chicken','cooked chicken breast','cooked chicken breasts', 'roasted chicken',
                    'rotisserie chicken','skinless boneless chicken breast','shredded chicken',
                    'skinless boneless chicken breast halves','skinless boneless chicken breasts',
                    'skinless boneless chicken thighs'] = 'chicken'
    ingredient_dict['beef','beef brisket', 'beef chuck roast', 'beef shoulder roast', 'beef steak',
                    'beef stew meat', 'beef tenderloin', 'chuck roast', 'porterhouse steak','rib roast',
                    'rib-eye','rib-eye steak','ribeye steaks','ribs','roast beef','round steak', 'short ribs',
                    'steak', 'steaks','skirt steak'] = 'beef'
    ingredient_dict['boneless pork loin roast','boneless pork shoulder','boston butt', 'cooked pork',
                    'lean pork tenderloin', 'pork','pork belly','pork butt','pork chops','pork loin',
                    'pork loin chops','pork ribs','pork shoulder','pork sirloin tip roast','pork tenderloin',
                    'pork tenderloins','roast pork','roasted pork'] = 'pork'
    ingredient_dict['turkey','roast turkey breast'] = 'turkey'
    ingredient_dict['lamb','lamb stew meat'] = 'lamb'
    ingredient_dict['duck','duck breast'] = 'duck'
    ingredient_dict['bacon','bacon bits','bacon rashers','bacon strips', 'cooked bacon','cooked bacon strips',
                    'thick-cut bacon','pan-fried bacon','turkey bacon'] = 'bacon'
    ingredient_dict['canadian bacon', 'cooked ham', 'deli ham', 'diced ham', 'ham','ham bone','ham steak'] = 'ham'
    ingredient_dict['mortadella', 'pancetta','pepperoni','prosciutto', 'salami'] = 'cured_meat'

    # Seafood
    ingredient_dict['tilapia','tilapia fillets','cod','cod filets','cod fillets','halibut','catfish fillets',
                    'squid','skate wings'] = 'mild_fish'
    ingredient_dict['swordfish','red snapper fillets'] = 'medium_fish'
    ingredient_dict['ahi tuna', 'ahi tuna steak', 'fresh tuna','salmon','salmon fillet','salmon fillets'] = 'strong_fish'
    ingredient_dict['raw shrimp','shrimp','prawns','canned crabmeat', 'crab meat','crabmeat', 'imitation crab meat',
                    'lump crab meat','lobster'] = 'crustacean'
    ingredient_dict['light tuna', 'tuna','water-packed tuna','anchovies', 'anchovies in olive oil', 'anchovy',
                    'anchovy fillets'] = 'canned_fish'
    ingredient_dict['fish'] = 'fish'
    ingredient_dict['clam juice'] = 'clam_juice'
    ingredient_dict['smoked salmon'] = 'smoked_salmon'


    # Herbs & Spices
    ingredient_dict['cumin','cumin powder','cumin seeds', 'ground cumin','ground cumin seed', 'whole cumin'] = 'cumin'
    ingredient_dict['curry leaves', 'curry powder', 'curry paste', 'red curry paste'] = 'curry'
    ingredient_dict['coarse salt', 'coarse sea salt', 'fleur de sel', 'kosher salt','salt','sea salt',
                    'sea-salt','table salt','seasoned salt','seasoning salt','uma pitada de sal'] = 'salt'
    ingredient_dict['cloves ground', 'ground cloves'] = 'clove'
    ingredient_dict['cilantro','cilantro leaves', 'fresh cilantro','fresh cilantro leaves'] = 'cilantro'
    ingredient_dict['celery salt','celery seed'] = 'ground_celery'

    ingredient_dict['caraway seeds'] = 'caraway'
    ingredient_dict['cardamom pods','cardamon','carom seeds', 'ground cardamom'] = 'cardamom'
    ingredient_dict['black pepper', 'black peppercorns', 'ground pepper', 'peppercorn','peppercorns','pepper',
                    'white pepper','whole peppercorns'] = 'black_pepper'
    ingredient_dict['black mustard seeds', 'dry mustard', 'ground mustard', 'mustard powder','mustard seeds',
                    'yellow mustard seed','yellow mustard seeds'] = 'ground_mustard'
    ingredient_dict['bay leaf','bay leaves', 'dried bay leaf'] = 'bay_leaf'
    ingredient_dict['basil','basil leaves'] = 'basil'
    ingredient_dict['allspice'] = 'allspice'
    ingredient_dict['black sesame seeds', 'sesame','sesame seed','sesame seeds','white sesame seeds'] = 'sesame'
    ingredient_dict['cinnamon','cinnamon stick','cinnamon sticks', 'ground cinnamon'] = 'cinnamon'
    ingredient_dict['star anise'] = 'star_anise'
    ingredient_dict['oregano','oregano leaves'] = 'oregano'
    ingredient_dict['tamari'] = 'tamari'
    ingredient_dict['tahini'] = 'tahini'
    ingredient_dict['poppy seed','poppy seeds'] = 'poppy seed'
    ingredient_dict['smoked paprika','paprika'] = 'paprika'
    ingredient_dict['saffron'] = 'saffron'
    ingredient_dict['lavender'] = 'lavender'
    ingredient_dict['lemon pepper seasoning'] = 'lemon_pepper'
    ingredient_dict['italian seasoning'] = 'italian_seasoning'
    ingredient_dict['herbes de provence'] = 'herbes_de_provence'
    ingredient_dict['ground turmeric', 'turmeric','turmeric powder'] = 'turmeric'
    ingredient_dict['ground all spice','ground allspice', 'whole allspice'] = 'allspice'
    ingredient_dict['ground ginger'] = 'ground_ginger'
    ingredient_dict['ground hazelnuts', 'hazelnuts'] = 'hazelnut'
    ingredient_dict['fennel seed', 'fennel seeds'] = 'fennel'
    ingredient_dict['fenugreek leaves','fenugreek seeds'] = 'fenugreek'
    ingredient_dict['dried basil'] = 'basil'
    ingredient_dict['dried chives'] = 'dried_chives'
    ingredient_dict['dried cilantro'] = 'dried_cilantro'
    ingredient_dict['dried garlic', 'garlic flakes','garlic granules','garlic powder', 'granulated garlic',
                    'garlic salt'] = 'ground_garlic'
    ingredient_dict['dried marjoram'] = 'dried_marjoram'
    ingredient_dict['dried onion', 'onion flakes','onion powder'] = 'dried_onion'
    ingredient_dict['dried parsley'] = 'dried_parsley'
    ingredient_dict['dried porcini mushrooms'] = 'dried_mushroom'
    ingredient_dict['dried rosemary'] = 'dried_rosemary'
    ingredient_dict['dried tarragon'] = 'dried_tarragon'
    ingredient_dict['dried thyme'] = 'dried_thyme'
    ingredient_dict['coriander','coriander powder','coriander seeds', 'ground coriander', 'whole coriander seeds'] = 'coriander'
    ingredient_dict['crystallized ginger'] = 'crystallized_ginger'
    ingredient_dict['ground nutmeg', 'nutmeg'] = 'nutmeg'
    ingredient_dict['kefir'] = 'kefir'
    ingredient_dict['hing'] = 'hing'
    ingredient_dict['harissa'] = 'harissa'
    ingredient_dict['garam masala'] = 'garam_masala'
    ingredient_dict['cajun seasoning'] = 'cajun seasoning'
    ingredient_dict['dill seed', 'dried dill','dried dill weed'] = 'dill'

    # Chilies
    ingredient_dict['anaheim chiles','poblano chile','poblano pepper','poblano peppers','green chiles','green chili',
                    'green chilies','green chilis','green chillies','chile peppers', 'chiles', 'chili', 'chilies',
                    'chillies', 'chili peppers','thai chili','thai chili pepper','thai chilis','canned green chiles'] = 'mild_chile'
    ingredient_dict['serrano chili pepper','jalapeno','jalapeno chiles','jalapeno pepper','jalapeno peppers',
                    'jalapenos'] = 'hot_chile'
    ingredient_dict['chile flakes','chili flakes','chilli flakes','chilli powder','chili powder','chile powder',
                    'chipotle','chipotle chili powder','crushed red pepper','dried chile pepper',
                    'ground chipotle chile pepper','red pepper','red pepper flake','red pepper flakes','red chili',
                    'red chili powder','cayenne','cayenne pepper','ground cayenne pepper','ancho chile',
                    'ancho chile powder', 'ancho chili powder', 'ground ancho chile'] = 'ground_chile'
    ingredient_dict['chile garlic sauce','chili oil','sweet chili sauce'] = 'chile_sauce'
    ingredient_dict['canned chipotle in adobo','chipotle chilies in adobo','chipotle in adobo',
                    'chipotle pepper in adobo','chipotle peppers','chipotle peppers in adobo',
                    'chipotle chile in adobo'] = 'chipotle_adobo'

    # Sweetners
    ingredient_dict['erythritol', 'liquid stevia', 'truvia','stevia','stevia extract','swerve sweetener',
                    'sukrin sweetener'] = 'erythritol'
    ingredient_dict['date palm sugar'] = 'date_sugar'
    ingredient_dict['corn syrup', 'golden syrup'] = 'corn_syrup'
    ingredient_dict['confectioners sugar',"confectioners' sugar", 'icing sugar', 'powdered sugar'] = 'powdered_sugar'
    ingredient_dict['coconut palm sugar','coconut sugar', 'gula melaka'] = 'coconut_sugar'
    ingredient_dict['cinnamon sugar'] = 'cinnamon_sugar'
    ingredient_dict['cane sugar', 'granulated sugar','natural cane sugar','raw sugar','sugar','sugar cubes',
                    'turbinado sugar','white sugar','xรญcara de de aรงรบcar','simple syrup'] = 'sugar'
    ingredient_dict['brown sugar', 'dark brown sugar', 'demerara sugar', 'golden brown sugar', 'jaggery',
                    'light brown sugar'] = 'brown_sugar'
    ingredient_dict['agave', 'agave nectar', 'agave syrup'] = 'agave'
    ingredient_dict['black treacle', 'molasses', 'light muscovado sugar'] = 'molasses'
    ingredient_dict['clear honey', 'honey', 'raw honey'] = 'honey'

    # Veggies
    ingredient_dict['edamame'] = 'edamame'
    ingredient_dict['eggplant','eggplants'] = 'eggplant'
    ingredient_dict['fennel bulb', 'fennel bulbs'] = 'fennel_bulb'
    ingredient_dict['fire roasted canned tomatoes', 'fire roasted tomatoes', 'fire-roasted tomatoes'] = 'fire_roasted_tomato'
    ingredient_dict['green peas', 'pea pods','peas','petite peas','snow peas','sugar snap peas'] = 'pea'
    ingredient_dict['green tomatoes', 'tomatillos'] = 'green_tomato'
    ingredient_dict['jicama'] = 'jicama'
    ingredient_dict['leek','leeks'] = 'leek'
    ingredient_dict['lemon lime soda','squirt'] = 'citrus_soda'
    ingredient_dict['lemongrass'] = 'lemongrass'
    ingredient_dict['lima beans'] = 'lima_bean'
    ingredient_dict['sprouts'] = 'sprouts'
    ingredient_dict['radicchio'] = 'radicchio'
    ingredient_dict['spaghetti squash'] = 'spaghetti_squash'
    ingredient_dict['turnip', 'turnips'] = 'turnip'
    ingredient_dict['radishes'] = 'radish'
    ingredient_dict['okra'] = 'okra'
    ingredient_dict['rutabaga','rutabagas'] = 'rutabaga'
    ingredient_dict['sweet potato','sweet potatoes'] = 'sweet_potato'
    ingredient_dict['red onion','red onions'] = 'red_onion'
    ingredient_dict['shallot','shallots'] = 'shallot'
    ingredient_dict['oil packed sun dried tomatoes','sun-dried tomatoes','sundried tomatoes'] = 'sun_dried_tomato'
    ingredient_dict['onion','onions','sweet onion','sweet onions','vidalia onion','vidalia onions','white onion','white onions','yellow onion','yellow onions'] = 'onion'
    ingredient_dict['zucchini','zucchini noodles','zucchinis'] = 'zucchini'
    ingredient_dict['parsnips'] = 'parsnip'
    ingredient_dict['roasted red pepper','roasted red peppers'] = 'roasted_red_pepper'
    ingredient_dict['acorn squash'] = 'acorn_squash'
    ingredient_dict['canned corn','cobs corn','corn','corn kernels','ear of corn','ears corn','ears of corn',
                    'fresh corn','fresh corn kernels', 'frozen corn','whole kernel corn'] =  'corn'
    ingredient_dict['cabbage', 'green cabbage', 'napa cabbage','purple cabbage','red cabbage','savoy cabbage'] = 'cabbage'
    ingredient_dict['butternut squash'] = 'butternut_squash'
    ingredient_dict['broccoli carrot cauliflower mix', 'mixed veggies', 'root vegetables','vegetable','veggie mix'] = 'mixed_vege'
    ingredient_dict['broccoli','broccoli florets','broccoli rabe','broccolini'] = 'broccoli'
    ingredient_dict['bok choy'] = 'bok_choy'
    ingredient_dict['cos lettuce','boston lettuce', 'boston lettuce leaves', 'butter lettuce', 'iceberg lettuce',
                    'iceburg lettuce', 'hearts of romaine', 'lettuce','lettuce leaf','romaine lettuce','romaine lettuce leaves','salad greens','salad mix', 'spring mix'] = 'lettuce'
    ingredient_dict['black eyed peas', 'canned black eyed peas'] = 'black_eyed_pea'
    ingredient_dict['beet', 'beetroot','beets', 'canned beets'] = 'beet'
    ingredient_dict['beet greens'] = 'beet_greens'
    ingredient_dict['bell pepper', 'green bell pepper','green bell peppers', 'green peppers','orange bell pepper','red bell pepper','red bell peppers','yellow bell pepper','peppers'] = 'bell_pepper'
    ingredient_dict['bean sprouts'] = 'bean_sprouts'
    ingredient_dict['baby bella mushrooms', 'button mushrooms', 'crimini mushrooms', 'fresh mushrooms',
                    'mushroom','mushrooms', 'mixed mushrooms','portabella mushrooms','shiitake mushrooms',
                    'white mushrooms'] = 'mushroom'
    ingredient_dict['baby carrots', 'carrot','carrots'] = 'carrot'
    ingredient_dict['baby corn', 'baby corns'] = 'baby_corn'
    ingredient_dict['baby peas'] = 'peas'
    ingredient_dict['baby potatoes','creamer potatoes','fingerling potatoes','gold potatoes','new potatoes',
                    'potato','potatoes','red potato','red potatoes','russet potato','russet potatoes',
                    'white potatoes','yukon gold potatoes','tater tots','hash brown potatoes','hashbrowns','french fries'] = 'potato'
    ingredient_dict['baby spinach','baby spinach leaves', 'frozen spinach','spinach','spinach leaves'] = 'spinach'
    ingredient_dict['artichoke','artichoke bottoms','artichoke hearts','artichokes', 'frozen artichoke hearts',
                    'marinated artichoke'] = 'artichoke'
    ingredient_dict['arugula', 'baby arugula'] = 'arugula'
    ingredient_dict['asparagus','asparagus spears'] = 'asparagus'
    ingredient_dict['avocado','avocados', 'haas avocados'] = 'avocado'
    ingredient_dict['fresh dill', 'dill'] = 'fresh_dill'
    ingredient_dict['fresh ginger','fresh ginger root', 'ginger'] = 'ginger'
    ingredient_dict['fresh green beans', 'green beans', 'haricots verts'] = 'green_bean'
    ingredient_dict['fresh herbs'] = 'freshh_herbs'
    ingredient_dict['fresh mint','fresh mint leaves', 'mint', 'mint leaves'] = 'fresh_mint'
    ingredient_dict['fresh rosemary','fresh rosemary leaves', 'rosemary','rosemary leaves'] = 'rosemary'
    ingredient_dict['fresh sage','fresh sage leaves', 'ground sage', 'sage','sage leaves'] = 'sage'
    ingredient_dict['fresh tarragon', 'tarragon'] = 'tarragon'
    ingredient_dict['fresh thyme','fresh thyme leaves','thyme','thyme leaves','thyme sprigs'] = 'thyme'
    ingredient_dict['fresh basil','fresh basil leaves','fresh bay leaves', 'lemon basil'] = 'fresh_basil'
    ingredient_dict['fresh coriander','fresh coriander leaves'] = 'fresh_coriander'
    ingredient_dict['flat leaf parsley','flat leaf parsley leaves','flat-leaf parsley','fresh flat leaf parsley',
                    'fresh parsley', 'fresh parsley leaves', 'parsley','parsley leaves'] = 'parsley'
    ingredient_dict['cucumber', 'cucumbers', 'english cucumber'] = 'cucumber'
    ingredient_dict['coleslaw mix'] = 'coleslaw_mix'
    ingredient_dict['collard greens', 'greens', 'mustard greens', 'leafy greens', 'turnip greens','swiss chard',
                    'water spinach','watercress'] = 'greens'
    ingredient_dict['chive','chives', 'green onion','green onions', 'scallion','scallion greens','scallions',
                    'spring onions','tokyo negi'] = 'chive'
    ingredient_dict['cherry tomato','cherry tomatoes', 'grape tomatoes', 'plum tomato','plum tomatoes'] = 'sweet_tomato'
    ingredient_dict['celery','celery stalk','celery stalks','celery stick','celery leaves','celery root'] = 'celery'
    ingredient_dict['cauliflower','cauliflower florets','cauliflowerets'] = 'cauliflower'
    ingredient_dict['canned diced tomatoes', 'canned tomatoes', 'heirloom tomato', 'roma tomato','roma tomatoes',
                    'stewed tomatoes','tomatoes','tomatos', 'tomato', 'tomaoes','vine ripened tomatoes'] = 'tomato'
    ingredient_dict['capers'] = 'caper'
    ingredient_dict['kiwi','kiwis'] = 'kiwi'
    ingredient_dict['kale', 'lacinato kale'] = 'kale'
    ingredient_dict['horseradish'] = 'horseradish'
    ingredient_dict['green grams'] = 'mung_bean'
    ingredient_dict['ginger garlic paste','ginger paste','ginger-garlic paste'] = 'ginger_paste'
    ingredient_dict['garlic','garlic clove','garlic cloves', 'garlics', 'roasted garlic','whole garlic',
                    'whole garlic clove'] = 'garlic'
    ingredient_dict['bamboo shoots'] = 'bamboo_shoot'
    ingredient_dict['brussels sprouts']  = 'brussels_sprouts'
    ingredient_dict['galangal'] = 'galangal'
    ingredient_dict['creamed corn'] = 'creamed_corn'
    ingredient_dict['delicata squash', 'squash','summer squash','winter squash','yellow squash',
                    'yellow summer squash'] = 'squash'
    ingredient_dict['guacamole'] = 'guacamole'
    ingredient_dict['hominy'] = 'hominy'
    ingredient_dict['edible flowers','squash blossoms'] = 'edible_flowers'
    ingredient_dict['pepperoncini','pickled jalapenos','pickled ginger','pimentos'] = 'pickled_veg'
    ingredient_dict['dill pickle chips', 'dill pickles','pickle','pickles','dill pickle juice'] = 'dill_pickle'
    ingredient_dict['dill pickle relish','pickle relish','sweet pickle relish'] = 'pickle_relish'
    ingredient_dict['canned pumpkin', 'canned pumpkin puree','solid pack pumpkin','pumpkin','pumpkin pie mix',
                    'pumpkin puree'] = 'pumpkin'
    ingredient_dict['black olives', 'greek olives', 'green olives', 'kalamata olives', 'oil cured black olives',
                    'olives','pimento stuffed olives'] = 'olive'

    # Thickening Agents / Grains / Flours
    ingredient_dict['agar'] = 'agar'
    ingredient_dict['sorghum flour', 'teff flour','semolina flour', 'quinoa flakes','quinoa flour','soy flour',
                    'spelt','spelt flour'] = 'flour_sub'
    ingredient_dict['millet','millet flour'] = 'millet'
    ingredient_dict['corn flour'] = 'corn_flour'
    ingredient_dict['coconut flour'] = 'coconut_flour'
    ingredient_dict['bread flour'] = 'bread_flour'
    ingredient_dict['buckwheat flour'] = 'buckwheat_flour'
    ingredient_dict['brown rice flour', 'rice flour','sweet rice flour'] = 'rice_flour'
    ingredient_dict['besan flour', 'kadalai maavu'] = 'gram_flour'
    ingredient_dict['arrowroot','arrowroot powder'] = 'arrowroot'
    ingredient_dict['almond flour', 'almond meal', 'almond meal flour', 'blanched almond flour', 'ground almonds'] = 'almond_flour'
    ingredient_dict['alfredo pasta sauce', 'alfredo sauce'] = 'alfredo'
    ingredient_dict['all purpose flour', 'flour', 'unbleached all purpose flour','unbleached flour','plain flour',
                    'self-raising flour','white flour','white whole wheat flour','whole wheat flour',
                    'whole wheat white flour'] = 'ap_flour'
    ingredient_dict['corn meal', 'cornmeal', 'fine cornmeal', 'ground cornmeal', 'yellow cornmeal',] = 'cornmeal'
    ingredient_dict['corn starch', 'cornstarch'] = 'corn_starch'
    ingredient_dict['amaranth grain'] = 'amaranth_grain'
    ingredient_dict['brown rice', 'cooked brown rice']    = 'brown_rice'
    ingredient_dict['grain blend'] = 'grain_blend'
    ingredient_dict['quick cooking grits', 'oatmeal'] = 'hot_cereal'
    ingredient_dict['old fashioned oats','old fashioned rolled oats','old-fashioned oats','oats','quick cooking oats',
                    'rolled oats','steel cut oats'] = 'oats'
    ingredient_dict['tapioca','tapioca flour','tapioca starch','quick cooking tapioca'] = 'tapioca'
    ingredient_dict['whole wheat pastry flour','pastry flour','cake flour'] = 'pastry_flour'
    ingredient_dict['pearl barley','quick cooking barley'] = 'barley'
    ingredient_dict['potato starch','potato starch flour'] = 'potato_flour'
    ingredient_dict['oat bran','oat flour'] = 'oat_flour'
    ingredient_dict['wheat berries','wheat bran','wheat germ','vital wheat gluten'] = 'wheat'
    ingredient_dict['cooked couscous', 'dry couscous'] = 'couscous'
    ingredient_dict['cooked quinoa','quinoa'] = 'quinoa'
    ingredient_dict['arborio rice','risotto rice'] = 'arborio_rice'
    ingredient_dict['basmati rice'] = 'basmati_rice'
    ingredient_dict['cooked rice', 'cooked white rice', 'instant white rice', 'rice','white rice',
                    'ready-to-serve asian fried rice'] = 'rice'
    ingredient_dict['corn bread mix'] = 'corn_bread_mix'

    # Nuts & Seeds
    ingredient_dict['flax meal','flax seed','flaxmeal','ground flaxseed'] = 'flax'
    ingredient_dict['hemp seeds'] = 'hemp_seed'
    ingredient_dict['sunflower seeds'] = 'sunflower_seed'
    ingredient_dict['pine nuts'] = 'pine_nut'
    ingredient_dict['unsalted pistachios','pistachios'] = 'pistachio'
    ingredient_dict['raw pumpkin seeds','roasted pumpkin seeds','pepitas'] = 'pumpkin_seed'
    ingredient_dict['pecan','pecan pieces','pecans'] = 'pecan'
    ingredient_dict['almond', 'almonds','slivered almonds','almond extract'] = 'almond'
    ingredient_dict['dry roasted peanuts', 'peanut','peanuts','roasted peanuts','unsalted peanuts'] = 'peanut'
    ingredient_dict['creamy peanut butter', 'crunchy peanut butter', 'peanut butter','powdered peanut butter',
                    'smooth peanut butter'] = 'peanut_butter'
    ingredient_dict['cashews', 'roasted cashews','salted cashews','salted roasted cashews','raw cashews'] = 'cashew'
    ingredient_dict['almond butter', 'nut butter'] = 'almond_butter'
    ingredient_dict['chia seed','chia seeds'] = 'chia_seed'
    ingredient_dict['walnuts'] = 'walnut'

    # Beverages
    ingredient_dict['tequila'] = 'tequila'
    ingredient_dict['tea'] = 'tea'
    ingredient_dict['sake'] = 'sake'
    ingredient_dict['rose water'] = 'rose_water'
    ingredient_dict['vodka'] = 'vodka'
    ingredient_dict['whiskey'] = 'whiskey'
    ingredient_dict['matcha tea'] = 'matcha'
    ingredient_dict['lemonade'] = 'lemonade'
    ingredient_dict['kahlua'] = 'kahlua'
    ingredient_dict['gin'] = 'gin'
    ingredient_dict['fernet-branca'] = 'fernet'
    ingredient_dict['dessert wine'] = 'dessert_wine'
    ingredient_dict['dark rum','rum','rum extract','spiced rum'] = 'rum'
    ingredient_dict['crรจme de cacao'] = 'crรจme_de_cacao'
    ingredient_dict['club soda','seltzer water'] = 'club_soda'
    ingredient_dict['chardonnay', 'dry white wine', 'wine', 'white wine'] = 'white_wine'
    ingredient_dict['champagne', 'sparkling wine'] = 'sparkling_wine'
    ingredient_dict['bourbon'] = 'bourbon'
    ingredient_dict['brandy'] = 'brandy'
    ingredient_dict['beer', 'dark beer', 'guinness', 'lager', 'rye beer'] = 'beer'
    ingredient_dict['coca cola', 'coke', 'cola flavored carbonated beverage', 'diet soda', 'dr. pepper'] = 'cola'
    ingredient_dict['dry sherry'] = 'sherry'
    ingredient_dict['dry cider', 'stella artois cidre'] = 'cider'
    ingredient_dict['cabernet sauvignon', 'dry red wine', 'pinot noir', 'red wine'] = 'red_wine'
    ingredient_dict['amaretto'] = 'amaretto'
    ingredient_dict['espresso powder', 'instant espresso','instant espresso powder'] = 'espresso_powder'
    ingredient_dict['decaf coffee'] = 'decaf_coffee'
    ingredient_dict['coffee','coffee beans', 'strong coffee'] = 'coffee'
    ingredient_dict['coffee extract'] = 'coffee_extract'
    ingredient_dict['instant coffee','instant coffee granules'] = 'instant_coffee'
    ingredient_dict['ginger beer'] = 'ginger_beer'
    ingredient_dict['cointreau'] = 'cointreau'
    ingredient_dict['eggnog'] = 'eggnog'
    ingredient_dict['irish cream'] = 'irish_cream'

    # Dessert
    ingredient_dict['white chocolate','white chocolate chips'] = 'white_chocolate'
    ingredient_dict['toffee bar','toffee bits'] = 'toffee'
    ingredient_dict['peanut butter candies','peanut butter candy','peanut butter chips','pb cups','snickers'] = 'candy'
    ingredient_dict['mint extract','peppermint baking chips','peppermint extract','andes mints',
                    'crรจme de menthe baking chips'] = 'mint'
    ingredient_dict['marshmallow cream','marshmallow creme','marshmallow fluff','marshmallow peeps',
                    'marshmallows'] = 'marshmallow'
    ingredient_dict['lemon cake mix','spice cake mix','vanilla cake mix','white cake mix','yellow cake mix'] = 'cake_mix'
    ingredient_dict['jelly beans'] = 'jelly_beans'
    ingredient_dict['hot chocolate mix'] = 'hot_choc'
    ingredient_dict['graham cracker crumbs','graham cracker crust','graham cracker sheets','graham crackers'] = 'graham_cracker'
    ingredient_dict['ginger snap crumbs','ginger snaps','gingerbread','gingersnap crumbs'] = 'gingerbread'
    ingredient_dict['fat free cool whip', 'lightly sweetened whipped cream', 'whipped cream','whipped topping',
                    'nonfat cool whip'] = 'whipped_cream'
    ingredient_dict['dark chocolate','dark chocolate bar','dark chocolate candy bars', 'dark chocolate chips'] = "dark_chocolate"
    ingredient_dict['cream cheese frosting', 'cream cheese icing', 'icing'] = 'frosting'
    ingredient_dict['chocolate chip cookie', 'chocolate cookie crust', 'chocolate wafer cookies', 'cookie',
                    'cookie crumbs','cookie mix','cookies', 'ladyfingers','nilla wafers','oreo cookies','oreos',
                    'shortbread cookies','vanilla wafer cookies','vanilla wafers', 'scones'] = 'cookie'
    ingredient_dict['chocolate hazelnut spread', 'nutella'] = 'nutella'
    ingredient_dict['chocolate ice cream sauce', 'chocolate syrup', 'fudge ice cream topping','fudge topping',
                    'hot fudge sauce'] = 'chocolate_sauce'
    ingredient_dict['caramel','caramel sauce','caramel topping','caramels', 'dulce de leche'] = 'caramel'
    ingredient_dict['candy cane','candy canes'] = 'candy_cane'
    ingredient_dict['candy coating','candy melting wafers','candy melts'] = 'candymelt'
    ingredient_dict['baking chocolate', 'bittersweet chocolate', 'chocolate', 'cocoa', 'dutch process cocoa',
                    'dutch processed cocoa', 'german chocolate'] = 'chocolate'
    ingredient_dict['baking cocoa', 'cacao powder', 'cocoa powder', 'dutch processed cocoa powder',
                    'dutch process cocoa powder', 'unsweetened baking cocoa','unsweetened cocoa',
                    'unsweetened cocoa powder'] = 'cocoa_powder'
    ingredient_dict['allergy friendly chocolate chips', 'bittersweet chocolate chips', 'cacao nibs',
                    'chocolate chips', 'milk chocolate chips','semi sweet chocolate chips',
                    'semi sweet chocolate morsels','semi-sweet chocolate','semi-sweet chocolate baking chips',
                    'semisweet chocolate','semisweet chocolate chips','unsweetened chocolate'] = 'chocolate_chips'
    ingredient_dict['chocolate shavings', 'chocolate sprinkles','sprinkles','rainbow sprinkles'] = 'sprinkles'
    ingredient_dict['brownie mix'] = 'brownie_mix'
    ingredient_dict['angel food cake', 'lb cake', 'pound cake'] = 'sponge_cake'
    ingredient_dict['butterscotch chips'] = 'butterscotch_chips'
    ingredient_dict['butterfingers'] = 'butterfingers'
    ingredient_dict['gelatin'] = 'gelatin'
    ingredient_dict['ice cream', 'vanilla ice cream','sherbet'] = 'ice_cream'
    ingredient_dict['instant chocolate pudding mix', 'instant lemon pudding mix','instant vanilla pudding mix',
                    'lemon pie filling','lemon pudding mix', 'vanilla pudding mix'] = 'pudding'
    ingredient_dict["m & m's para decorar",'m&m candies','mini m&m', 'mnm minis'] = 'm&m'

    # Cheese
    ingredient_dict['romano cheese','pecorino romano cheese','parmesan cheese','swiss cheese','asiago cheese',
                    'parmigiano reggiano','pecorino','parmesan','sharp cheddar','extra sharp cheddar cheese',
                    'white cheddar cheese','sharp cheddar cheese'] = 'hard_cheese'
    ingredient_dict['provolone cheese','provolone','gouda','gouda cheese','gruyere','gruyere cheese','halloumi cheese'] = 'semi_hard_cheese'
    ingredient_dict['mozzarella','mozzarella cheese','part skim mozzarella','part-skim mozzarella',
                    'part-skim mozzarella cheese','skim milk mozzarella cheese','havarti cheese',
                    'pepperjack cheese','fontina cheese'] = 'semi_soft_cheese'
    ingredient_dict['ricotta','ricotta salata','feta','feta cheese','low fat ricotta cheese',
                    'skim milk ricotta cheese','part skim ricotta cheese','ricotta cheese','skim milk ricotta',
                    'cotija cheese','goat cheese','buffalo mozzarella', 'fresh mozzarella','fresh mozzarella ball',
                    'fresh mozzarella cheese','mascarpone','mascarpone cheese'] = 'soft_cheese'
    ingredient_dict['bleu cheese', 'blue cheese', 'blue cheese crumbles', 'gorgonzola','gorgonzola cheese'] = 'blue_cheese'
    ingredient_dict['processed american cheese','nacho cheese sauce','queso dip'] = 'processed_cheese'
    ingredient_dict['cheese','italian cheese blend','jack cheese','mexican cheese','monterey jack cheese',
                    'low fat cheese','shredded mexican cheese blend','shredded mozzarella',
                    'shredded mozzarella cheese','shredded cheddar','shredded cheddar cheese','shredded cheese',
                    'reduced fat shredded cheddar cheese','cheddar cheese','colby and monterey jack cheese',
                    'colby jack cheese'] = 'cheese'

    # Dairy
    ingredient_dict['low fat sour cream', 'mexican crema', 'sour cream','crรจme fraรฎche'] = 'sour_cream'
    ingredient_dict['cream', 'double cream', 'heavy cream','heavy whipping cream','half & half','half and half',
                    'half n half','half n half cream', 'whipping cream'] = 'cream'
    ingredient_dict['cream cheese', 'cream cheese block', 'light cream cheese', 'neufchatel cheese'] = 'cream_cheese'
    ingredient_dict['chocolate milk'] = 'chocolate_milk'
    ingredient_dict['buttermilk'] = 'buttermilk'
    ingredient_dict['evaporated milk', 'milk powder','skim evaporated milk','nonfat milk powder','skim milk powder'] = 'evaporated_milk'
    ingredient_dict['fat-free cottage cheese'] = 'cottage_cheese'
    ingredient_dict['fat-free milk', 'milk', 'low fat milk', 'whole milk','skimmed milk','nonfat milk'] = 'milk'
    ingredient_dict['full fat plain yogurt', 'low fat plain yogurt', 'low fat yogurt', 'low-fat yogurt',
                    'natural yogurt','plain yogurt','vanilla yogurt','yoghurt','yogourt','yogurt'] = 'yogurt'
    ingredient_dict['0% fat greek yogurt', 'greek yogurt', 'low fat greek yogurt', 'lowfat greek yoghurt',
                    'skim vanilla greek yogurt','plain greek yogurt','nonfat greek yogurt',
                    'non-fat greek yogurt'] = 'greek_yogurt'
    ingredient_dict['a 4 colheres de de leite condensado', 'condensed milk','sweetened condensed milk'] = 'condensed_milk'
    ingredient_dict['egg', 'eggs', 'whole egg','whole eggs'] = 'egg'
    ingredient_dict['egg white','egg white powder','egg whites'] = 'egg_white'
    ingredient_dict['egg yolk','egg yolks'] = 'egg_yolk'
    ingredient_dict['hard cooked eggs','hard-boiled eggs','hardboiled egg','hardboiled eggs'] = 'hard_boiled_egg'

    # Oils and Fats
    ingredient_dict['grape seed oil', 'grapeseed oil'] = 'grape_seed_oil'
    ingredient_dict['dark sesame oil', 'sesame oil'] = 'sesame_oil'
    ingredient_dict['coconut oil','coconut butter'] = 'coconut_oil'
    ingredient_dict['canola oil', 'cooking oil', 'oil','peanut oil','vegetable oil','palm oil','rapeseed oil',
                    'walnut oil'] = 'light_oil'
    ingredient_dict['avocado oil'] = 'avocado_oil'
    ingredient_dict['bacon fat', 'lard'] = 'animal_fat'
    ingredient_dict['butter', 'light butter', 'margarine', 'salted butter','unsalted butter','ghee'] = 'butter'
    ingredient_dict['butter flavored shortening', 'shortening','solid vegetable shortening','vegetable shortening'] = 'shortening'
    ingredient_dict['extra virgin olive oil','extra-virgin olive oil', 'light olive oil', 'olive oil'] = 'olive_oil'


    # Beans
    ingredient_dict['canned pinto beans', 'pinto beans'] = 'pinto_bean'
    ingredient_dict['canned kidney beans', 'canned red kidney beans', 'chili beans', 'dried kidney beans',
                    'kidney beans', 'red kidney beans'] = 'kidney_bean'
    ingredient_dict['canned garbanzo beans'] = 'garbanzo_bean'
    ingredient_dict['canned great northern beans', 'great northern beans'] = 'great_northern_bean'
    ingredient_dict['canned cannellini beans','canned white beans', 'canned white cannellini beans',
                    'cannellini beans', 'white beans'] = 'cannellini_beans'
    ingredient_dict['canned chickpeas', 'chickpeas'] = 'chickpeas'
    ingredient_dict['black beans', 'canned black beans', 'cooked black beans', 'refried beans'] = 'black_bean'
    ingredient_dict['mat beans'] = 'mat_bean'
    ingredient_dict['canned lentils', 'cooked red lentils', 'dried lentils', 'lentils','red lentils'] = 'lentil'

    # Breads & Pastas
    ingredient_dict['burger bun', 'hamburger buns', 'sandwich bun','sandwich buns','sandwich rolls',
                    'slider buns','sub buns','sub roll','sub rolls','whole wheat buns', 'poppyseed roll'] = 'bun'
    ingredient_dict['bread', 'multi grain bread','wholemeal bread', 'white sandwich bread','white bread',
                    'sourdough bread','pita','pita breads','wheat flatbreads','naan','naan bread','texas toast',
                    'hawaiian bread','pizza crust','pizza dough'] = 'bread'
    ingredient_dict['bread crumbs', 'breadcrumb', 'breadcrumbs', 'dry bread crumbs', 'dry breadcrumbs', 'italian seasoned bread crumbs', 'panko','panko bread crumbs','panko breadcrumbs','seasoned bread crumbs'] = 'breadcrumb'
    ingredient_dict['bread dough'] = 'bread_dough'
    ingredient_dict['blintzes -)', 'pancake mix'] = 'pancake'
    ingredient_dict['biscuits', 'buttermilk biscuits'] = 'biscuits'
    ingredient_dict['bagels'] = 'bagel'
    ingredient_dict['baguette','baguettes'] = 'baguette'
    ingredient_dict['brioche','brioche buns'] = 'brioche'
    ingredient_dict['ciabatta loaf','ciabatta rolls'] = 'ciabatta'
    ingredient_dict['crescent roll dough','crescent rolls', 'croissants', 'refrigerated crescent dinner rolls'] = 'croissant'
    ingredient_dict['crostini', 'croutons'] = 'croutons'
    ingredient_dict['filo dough','filo pastry', 'puff pastry','puff pastry dough','puff pastry sheets',
                    'puff pastry shells','shortcrust pastry','pastry dough','pie crust','pie shell','pie shells',
                    'refrigerated pie crust','refrigerated pie crusts'] = 'pastry_dough'
    ingredient_dict['english muffins'] = 'english_muffin'
    ingredient_dict['egg noodles'] = 'egg_noodles'
    ingredient_dict['crackers', 'cracker', 'ritz crackers','saltine crackers','saltines','pita chips',
                    'pretzels'] = 'crackers'
    ingredient_dict['angel hair', 'big shells', 'cavatappi pasta', 'cooked penne pasta', 'ditalini pasta',
                    'elbow macaroni','fettuccine','fettuccini', 'fusilli', 'linguine', 'lasagna noodles',
                    'long pasta', 'orzo','orzo pasta','pasta','pasta shells','penne','penne pasta','rigatoni',
                    'shells','ziti', 'whole wheat spaghetti','spaghetti','spaghetti noodles','spaghetti pasta',
                    'refrigerated spinach tortellini','noodles','rice noodles','soba noodles'] = 'pasta'
    ingredient_dict['flour tortillas', 'taco shells','tacos','whole wheat tortillas','tortillas',
                    'tortilla chips','corn tortillas','corn chips', 'corn tortilla chips'] = 'tortilla'
    ingredient_dict['gnocchi'] = 'gnocchi'

    # Alternatives
    ingredient_dict['soy buttery spread', 'vegan margarine'] = 'df_butter'
    ingredient_dict['quorn mince'] = 'meat_sub'
    ingredient_dict['egg replacer', 'ener-g egg replacer', 'chia eggs'] = 'egg_replacement'
    ingredient_dict['dairy free cheese', 'vegan cheese','marzipan'] = 'df_cheese'
    ingredient_dict['dairy free milk', 'non-dairy milk', 'unsweetened soy milk'] = 'df_milk'
    ingredient_dict['almond milk'] = 'almond_milk'
    ingredient_dict['extra firm tofu', 'tofu','tempeh','seitan'] = 'tofu'
    ingredient_dict['vegan chocolate chips'] = 'df_choc_chip'
    ingredient_dict['gf chocolate cake mix'] = 'gf_cake_mix'
    ingredient_dict['gluten free all purpose flour','gluten-free flour'] = 'gf_flour'
    ingredient_dict['dairy-free chocolate chips'] = 'df_choc_chips'

    # Stock
    ingredient_dict['chicken bouillon','chicken bouillon cube','chicken bouillon cubes','chicken broth',
                    'chicken stock','fat free chicken broth','low sodium chicken broth','low sodium chicken stock',
                    'low-salt chicken broth', 'stock','turkey stock', 'reduced sodium chicken broth'] = "chicken_stock"
    ingredient_dict['vegetable broth','vegetable stock'] = 'vege_stock'
    ingredient_dict['beef broth', 'beef consomme', 'beef stock', 'canned beef broth', 'low sodium beef broth'] = 'beef_stock'

    # Sauces
    ingredient_dict['ranch','ranch dressing','ranch dressing mix','ranch mix','ranch salad dressing',
                    'ranch salad dressing mix'] = 'ranch'
    ingredient_dict['ketchup'] = 'ketchup'
    ingredient_dict['hot sauce', 'sriracha','sriracha hot sauce','sriracha sauce','tabasco','tabasco sauce',
                    'pepper sauce','sambal oelek','buffalo sauce','buffalo wing sauce','chili paste',
                    'chili sauce'] = 'hot_sauce'
    ingredient_dict['hoisin sauce'] = 'hoisin'
    ingredient_dict['canned tomato sauce', 'marinara sauce','pasta sauce','pizza sauce','spaghetti sauce',
                    'tomato puree','tomato sauce', 'tomato juice','tomato paste'] = 'tomato_sauce'
    ingredient_dict['caesar dressing'] = 'caesar_dressing'
    ingredient_dict['browning sauce'] = 'browning_sauce'
    ingredient_dict['barbecue sauce', 'bbq sauce'] = 'bbq_sauce'
    ingredient_dict['basil pesto', 'pesto'] = 'pesto'
    ingredient_dict['adobo sauce'] = 'adobo'
    ingredient_dict['worcestershire sauce'] = 'worcestershire'
    ingredient_dict['tzatziki sauce'] = 'tzatziki'
    ingredient_dict['balsamic glaze','balsamic vinegar'] = 'balsamic'
    ingredient_dict['italian dressing','italian salad dressing mix'] = 'italian_dressing'
    ingredient_dict['fat free mayo', 'fat-free mayonnaise', 'low fat mayonnaise', 'mayo','mayonnaise',
                    'light mayonnaise', 'reduced fat mayo'] = 'mayo'
    ingredient_dict['dijon mustard', 'grainy mustard', 'mustard', 'spicy brown mustard','whole-grain mustard',
                    'yellow mustard'] = 'mustard'
    ingredient_dict['hummus'] = 'hummus'

    ingredient_dict['tomato ketchup'] = 'ketchup'
    ingredient_dict['pico de gallo','salsa'] = 'salsa'
    ingredient_dict['enchilada sauce', 'red enchilada sauce'] = 'enchilada_sauce'

    # Asian
    ingredient_dict['canned water chestnuts','water chestnuts'] = 'water_chestnut'
    ingredient_dict['dashi'] = 'dashi'
    ingredient_dict['fish sauce', 'oyster sauce'] = 'fish_sauce'
    ingredient_dict['mirin','shaoxing wine'] = 'mirin'
    ingredient_dict['miso soybean paste', 'yellow miso'] = 'miso'
    ingredient_dict['kombu'] = 'seaweed'
    ingredient_dict['wasabi paste'] = 'wasabi'
    ingredient_dict['won ton wrappers','wonton wrappers'] = 'wonton'
    ingredient_dict['tamarind'] = 'tamarind'
    ingredient_dict['light soy sauce','low sodium soy sauce','kecap manis','reduced sodium soy sauce','soy sauce',
                    'coconut aminos'] = 'soy_sauce'
    ingredient_dict['garlic oil'] = 'garlic_oil'
    ingredient_dict['coconut milk','coconut water','canned coconut milk','light coconut milk',
                    'unsweetened coconut milk'] = 'coconut_milk'

    remove_set = set(['as required', 'bake your own', 'condiments', 'cutters', 'each', 'enough', 'feeds', 'garnish',
                  'ground', 'guar gum', 'i swear', 'juice', 'just over', 'mason jars', 'mix', 'mixed peel',
                  'mixed spice', 'moist', 'meat','optional','see post above','saucepan','slow cooker','time',
                  'to','toppings','veined','salt & pepper','salt and pepper','omelette','nuts','seeds','wrap',
                  'xanthan gum','rub', 'taco seasoning','taco seasoning mix','steak seasoning','spice rub',
                  'seasoning','seasoning blend','seasoning mix','pumpkin pie spice','pumpkin spice mix',
                  'old bay seasoning','queso quesadilla','to 4 suman sa ibus','slit','steak sauce',
                  'apple pie spice','chicken seasoning', 'creole seasoning','fruit','salad dressing',
                  'slaw dressing'])

    feature_dict = dict([('dairy free', 'dairy_free'), ('fodmap friendly', 'fodmap_friendly'), ('gluten free', 'gluten_free'),
                         ('ketogenic', 'keto'), ('lacto ovo vegetarian', 'vegetarian'), ('paleolithic', 'paleo'),
                         ('pescatarian', 'pescatarian'), ('primal', 'primal'), ('vegan', 'vegan'), ('whole 30', 'whole_30'),
                         ('american', 'american'), ('asian', 'asian'), ('british', 'british'), ('caribbean', 'caribbean'),
                         ('central american', 'central_american'), ('chines', 'chinese'), ('english', 'english'),
                         ('european','european'),('french', 'french'), ('german', 'german'), ('greek', 'greek'),
                         ('indian', 'indian'), ('italian', 'italian'),('jewish', 'jewish'), ('mediterranean', 'mediterranean'),
                         ('mexican', 'mexican'), ('middl eastern', 'middle_eastern'),('scottish', 'scottish'),
                         ('southern', 'southern'), ('spanish', 'spanish'),('vietnames', 'vietnamese'), ('antipasti', 'appetizer'),
                         ('antipasto', 'appetizer'),('appetizer', 'appetizer'), ('batter', 'batter'), ('bread', 'bread'),
                         ('breakfast', 'breakfast'),('brunch', 'breakfast'), ('condiment', 'condiment'), ('dessert', 'dessert'),
                         ('dinner', 'dinner'), ('dip', 'dip'), ("hor d'oeuvre", 'appetizer'), ('lunch', 'lunch'),
                         ('main course', 'main_dish'),('main dish', 'main_dish'), ('morning meal', 'breakfast'),('salad', 'salad'),
                         ('sauce', 'condiment'),('side dish', 'side_dish'), ('snack', 'snack'),('soup', 'soup'),
                         ('spread', 'spread'), ('starter', 'appetizer'), ('african', 'african'), ('cajun', 'cajun'), ('creol', 'cajun'),
                         ('south american', 'south_american'), ('latin american', 'latin_american'), ('irish', 'irish'), ('thai', 'thai'),
                         ('bbq', 'bbq'), ('barbecu', 'bbq'), ('japanes', 'japenese'), ('scandinavian', 'eastern_european'),
                         ('nordic', 'eastern_european'), ('beverage', 'beverage'), ('drink', 'beverage'), ('frosting', 'dessert'),
                         ('icing', 'dessert'), ('crust', 'bread')])

    categorical_feat = []
    unbucketed_ingredients = []
    for recipe in recipes_json:
        feats = []

        for ingredient in recipe['extendedIngredients']:
            if ingredient['name'].lower() in remove_set:
                continue
            elif ingredient_dict.get(ingredient['name'].lower()) == None:
                unbucketed_ingredients.append(ingredient['name'].lower())
            else:
                feats.append(ingredient_dict.get(ingredient['name'].lower()))
        for diet in recipe['diets']:
            feats.append(feature_dict.get(diet.lower()))
        for dt in recipe['dishTypes']:
            feats.append(feature_dict.get(dt.lower()))
        for cuisine in recipe['cuisines']:
            feats.append(feature_dict.get(cuisine.lower()))
        categorical_feat.append(feats)

    return categorical_feat, unbucketed_ingredients
Ejemplo n.ยบ 28
0
from os.path import join, exists

# change this variable to set a Skill name that does not sound strange in your used language:
SKILL_NAME = 'FH-SWF Raumbelegung'

VPIS_BASE_URL = 'https://vpis.fh-swf.de'
VPIS_CONTROL_URL = VPIS_BASE_URL + '/vpisapp.php'
# location = path after base url ;SEMESTER; is used here as a variable.
VPIS_COURSES_URL_LOCATION = '/;SEMESTER;/faecherangebotplanung.php3'

additionalRequestHeaders = {
    'User-Agent':
    'Mycroft FhSwfRoomQuerySkill (https://github.com/fhswf/mycroft-fhswf-raumbelegung-skill) [2021, Silvio Marra]'
}

fhswfLocationMap = multi_key_dict()
fhswfLocationMap['iserlohn', 'is', 'frauenstuhlweg', 'frauenstuhl weg',
                 'campus iserlohn'] = 'Iserlohn'
fhswfLocationMap['hagen', 'ha', 'haldener strasse', 'haldener straรŸe',
                 'haldener str', 'campus hagen'] = 'Hagen'
fhswfLocationMap['lรผdenscheid', 'luedenscheid', 'ls', 'bahnhofsallee',
                 'campus luedenscheid', 'campus lรผdenscheid'] = 'Lรผdenscheid'
fhswfLocationMap['meschede', 'me', 'lindenstrasse', 'lindenstraรŸe',
                 'linden straรŸe', 'linden strasse', 'linden str',
                 'campus meschede'] = 'Meschede'
fhswfLocationMap['soest', 'so', 'lรผbecker ring', 'luebecker ring',
                 'campus soest'] = 'Soest'
# location "Im Alten Holz" seems to be invalid for API
# fhswfLocationMap['im alten holz', 'hagen iah', 'ha iah', 'hagen im alten holz'] = 'Hagen IAH'

fhswfLocationVpisShortKey = {
Ejemplo n.ยบ 29
0
def random_picture(request, keyword_for_picture):

    c = multi_key_dict()

    c['ํ•ญ๊ณต๋ชจํ•จ', '์ „ํˆฌํ•จ'] = 'aircraft carrier.npy'
    c['๋น„ํ–‰๊ธฐ', 'ํ•ญ๊ณต๊ธฐ', '๊ณตํ•ญ', '์—ฌํ–‰', 'ํ•ด์™ธ', 'ํ•ด์™ธ์—ฌํ–‰', '์—ฌ๊ฐ๊ธฐ'] = 'airplane.npy'
    c['์•Œ๋žŒ', '์•Œ๋žŒ์‹œ๊ณ„', '์ž๋ช…์ข…'] = 'alarm clock.npy'
    c['๊ตฌ๊ธ‰์ฐจ', '์•ฐ๋ทธ๋Ÿฐ์Šค', '์— ๋ทธ๋Ÿฐ์Šค', '์•ฐ๋ทธ๋ž€์Šค', '์ด์†ก', '์ฝ”๋กœ๋‚˜'] = 'ambulance.npy'
    c['์ฒœ์‚ฌ', '์•ค์ ค', '์š”์ •'] = 'angel.npy'
    c['๊ฐˆ๋งค๊ธฐ', '์ด์ฃผ', '๋™๋ฌผ์ด๋™', '์ฒ ์ƒˆ', '์ƒˆ๋–ผ'] = 'animal migration.npy'
    c['๊ฐœ๋ฏธ', '๋ฒŒ๋ ˆ', '๊ณค์ถฉ'] = 'ant.npy'
    c['๋ชจ๋ฃจ'] = 'anvil.npy'
    c['ํŒ”', 'ํŒ”๋š'] = 'arm.npy'
    c['์•„์ŠคํŒŒ๋ผ๊ฑฐ์Šค'] = 'asparagus.npy'
    c['๋„๋ผ', 'ํ‰๊ธฐ', '๋ฌด๊ธฐ'] = 'axe.npy'
    c['๊ฐ€๋ฐฉ', '๋ฒ ๋‚ญ', '๋ฐฐ๋‚ญ', '๋ฐฑํŒฉ', '์ฑ…๊ฐ€๋ฐฉ'] = 'backpack.npy'
    c['๋ฐ”๋‚˜๋‚˜'] = 'banana.npy'
    c['๋ฐด๋“œ', '๋ฐ˜์ฐฝ๊ณ ', 'ํ‰ํ„ฐ', '์ƒ์ฒ˜'] = 'bandage.npy'
    c['์™ธ์–‘๊ฐ„'] = 'barn.npy'
    c['์•ผ๊ตฌ๊ณต', '์•ผ๊ตฌ', '์•ผ๊ตฌ์žฅ'] = 'baseball.npy'
    c['์•ผ๊ตฌ๋ฐฐํŠธ', '๋ฐฐํŠธ', '๋น ๋”ฐ', '์•ผ๊ตฌ๋น ๋”ฐ', '๋ชฝ๋‘ฅ์ด', '๋ฐฉ๋ง์ด', 'ํšŒ์ดˆ๋ฆฌ'] = 'baseball bat.npy'
    c['๋ฐ”๊ตฌ๋‹ˆ', '๊ณผ์ผ๋ฐ”๊ตฌ๋‹ˆ'] = 'basket.npy'
    c['๋†๊ตฌ๊ณต', '๋†๊ตฌ'] = 'basketball.npy'
    c['๋ฐ•์ฅ', '๋ฐฐํŠธ๋งจ'] = 'bat.npy'
    c['์š•์กฐ', '์š•์‹ค'] = 'bathtub.npy'
    c['ํ•ด๋ณ€', 'ํ•ด์ˆ˜์š•์žฅ', 'ํ•ด๋ณ€๊ฐ€', 'ํ•ด์šด๋Œ€', '๊ฒฝํฌ๋Œ€'] = 'beach.npy'
    c['๊ณฐ', '๊ณฐ๋Œ์ด'] = 'bear.npy'
    c['์‚ฐ์ ', '์ˆ˜์—ผ'] = 'beard.npy'
    c['์นจ๋Œ€', '์นจ์‹ค', '์ž ', '๊ฟˆ'] = 'bed.npy'
    c['๋ฒŒ', '๊ฟ€๋ฒŒ', '๋ง๋ฒŒ', '์žฅ์ˆ˜๋ง๋ฒŒ', '์ผ๋ฒŒ', '๋ฒŒ์นจ'] = 'bee.npy'
    c['๋ฒจํŠธ', 'ํ—ˆ๋ฆฌ๋ '] = 'belt.npy'
    c['๋ฒค์น˜', '๊ณต์›'] = 'bench.npy'
    c['๋‘๋ฐœ์ž์ „๊ฑฐ', '์„ธ๋ฐœ์ž์ „๊ฑฐ', '์ž์ „๊ฑฐ', '์ „๊ธฐ์ž์ „๊ฑฐ', '๋”ฐ๋ฆ‰์ด', '์นด์นด์˜ค๋ฐ”์ดํฌ'] = 'bicycle.npy'
    c['๋ง์›๊ฒฝ'] = 'binoculars.npy'
    c['์ƒ์ผ', '์ƒ์ผ์ผ€์ดํฌ', 'ํŒŒํ‹ฐ', '์ƒ์ผํŒŒํ‹ฐ', '์ถ•ํ•˜', '๊ธฐ๋…์ผ'] = 'birthday cake.npy'
    c['๋ธ”๋ž™๋ฒ ๋ฆฌ', '๋ณต๋ถ„์ž', '์‚ฐ๋”ธ๊ธฐ'] = 'blackberry.npy'
    c['๋ธ”๋ฃจ๋ฒ ๋ฆฌ', '์—ด๋งค'] = 'blueberry.npy'
    c['์ฑ…', '๋…์„œ', '๊ณต๋ถ€', '๊ต๊ณผ์„œ', '์ „๊ณต์ฑ…', '๊ธ€'] = 'book.npy'
    c['๋ถ€๋ฉ”๋ž‘'] = 'boomerang.npy'
    c['๋ณ‘๋šœ๊ป‘', '๋šœ๊ป‘'] = 'bottlecap.npy'
    c['๋‚˜๋น„๋„ฅํƒ€์ด', '๋ณดํƒ€์ด', '๋ณด์šฐํƒ€์ด', '๋ฆฌ๋ณธ'] = 'bowtie.npy'
    c['ํŒ”์ฐŒ', '๋จธ๋ฆฌ๋ˆ'] = 'bracelet.npy'
    c['๋‡Œ', '์ขŒ๋‡Œ', '์šฐ๋‡Œ', '์ฒœ์žฌ', '๋‡Œ์„ธํฌ'] = 'brain.npy'
    c['๋นต', '๋šœ๋ ˆ์ฃผ๋ฅด', 'ํŒŒ๋ฆฌ๋ฐ”๊ฒŒํŠธ'] = 'bread.npy'
    c['๋Œ€๊ต', 'ํ•œ๊ฐ•๋Œ€๊ต'] = 'bridge.npy'
    c['๋ธŒ๋กœ์ฝœ๋ฆฌ'] = 'broccoli.npy'
    c['๋น—์ž๋ฃจ', '์ฒญ์†Œ'] = 'broom.npy'
    c['์–‘๋™์ด', '๋ฒ„ํ‚ท', '์•„์ด์Šค๋ฒ„ํ‚ท์ฑŒ๋ฆฐ์ง€'] = 'bucket.npy'
    c['๋ถˆ๋„์ €', '์Šค์œ™์Šค'] = 'bulldozer.npy'
    c['๋ฒ„์Šค', '๊ณ ์†๋ฒ„์Šค', '์ผ๋ฐ˜๋ฒ„์Šค', '๋Œ€์ค‘๊ตํ†ต', '๋งŒ์›๋ฒ„์Šค', '์‹œ๋‚ด๋ฒ„์Šค', '๋งˆ์„๋ฒ„์Šค'] = 'bus.npy'
    c['๋ถ€์‰ฌ', 'ํ’€์ˆฒ', 'ํ’€๋”๋ฏธ', '๋ถ€์‹œ'] = 'bush.npy'
    c['๋‚˜๋น„', '๋‚˜๋ฐฉ'] = 'butterfly.npy'
    c['์„ ์ธ์žฅ'] = 'cactus.npy'
    c['์ผ€์ดํฌ'] = 'cake.npy'
    c['๊ณ„์‚ฐ๊ธฐ', '๊ณตํ•™์šฉ๊ณ„์‚ฐ๊ธฐ', '์ „์ž๊ณ„์‚ฐ๊ธฐ'] = 'calculator.npy'
    c['๋‹ฌ๋ ฅ', '์ผ์ •', '์บ˜๋ฆฐ๋”'] = 'calendar.npy'
    c['๋‚™ํƒ€', '์‚ฌ๋ง‰', '์ค‘๋™'] = 'camel.npy'
    c['์นด๋ฉ”๋ผ', '๋””์นด', '์‚ฌ์ง„๊ธฐ', '์‚ฌ์ง„'] = 'camera.npy'
    c['์นด๋ชจํ”Œ๋ผ์ฃผ', '๊ตฐ๋ณต', '๋ฐ€๋ฆฌํ„ฐ๋ฆฌ', '๊ตฐ๋Œ€', '๊ตญ๋ฐฉ'] = 'camouflage.npy'
    c['์บ ํ”„ํŒŒ์ด์–ด', '๋ชจ๋‹ฅ๋ถˆ', '๋ถˆ๋†€์ด'] = 'campfire.npy'
    c['์–‘์ดˆ', '์บ”๋“ค', '์ด›๋ถˆ', '์ด›๋†'] = 'candle.npy'
    c['๋Œ€ํฌ', '๋ฐ”์ฃผ์นดํฌ', '๋ฐ•๊ฒฉํฌ', '์บ๋…ผ'] = 'cannon.npy'
    c['์นด๋ˆ„', '์กฐ์ •', '๋‚˜๋ฃป๋ฐฐ'] = 'canoe.npy'
    c['๋‹น๊ทผ'] = 'carrot.npy'
    c['์„ฑ', '๊ถ์ „', '์บ์Šฌ'] = 'castle.npy'
    c['๊ณ ์–‘์ด', '์ง‘์‚ฌ', '๋ƒฅ์ด', '๊ธธ๋ƒฅ์ด', '์บฃํƒ€์›Œ'] = 'cat.npy'
    c['์ฒœ์žฅ์„ ํ’๊ธฐ', '์ฒœ์žฅ์žฅ์‹'] = 'ceiling fan.npy'
    c['ํœด๋Œ€์ „ํ™”', '์Šค๋งˆํŠธํฐ', 'ํœด๋Œ€ํฐ', 'ํฐ', 'ํ•ธ๋“œํฐ'] = 'cell phone.npy'
    c['์ฒผ๋กœ', 'ํ˜„์•…๊ธฐ'] = 'cello.npy'
    c['์‹ํƒ์˜์ž', '์˜์ž', '๊ฑธ์ƒ'] = 'chair.npy'
    c['์ƒน๋“ค๋ฆฌ์—'] = 'chandelier.npy'
    c['๊ตํšŒ', '๊ธฐ๋…๊ต', '์„ฑ๊ฒฝ'] = 'church.npy'
    c['์›', '๋™๊ทธ๋ผ๋ฏธ', '๊ณต', 'ํŽ„'] = 'circle.npy'
    c['ํด๋ผ๋ฆฌ๋„ท'] = 'clarinet.npy'
    c['์‹œ๊ณ„', '์‹œ๊ฐ„'] = 'clock.npy'
    c['๊ตฌ๋ฆ„', 'ํŒŒ๋งˆ๋จธ๋ฆฌ', 'ํŒŒ๋งˆ', 'ํŽŒ'] = 'cloud.npy'
    c['์ปคํ”ผ์ž”', '์ปคํ”ผ', '์•„๋ฉ”๋ฆฌ์นด๋…ธ', '๋…น์ฐจ'] = 'coffee cup.npy'
    c['๋‚˜์นจ๋ฐ˜', '๋ฐฉํ–ฅ'] = 'compass.npy'
    c['์ปดํ“จํ„ฐ', '์ปด๊ณต', '๊ณผ์ œ', '๋ฐค์ƒ˜', '๋ฐ์Šคํฌํƒ‘'] = 'computer.npy'
    c['์ฟ ํ‚ค'] = 'cookie.npy'
    c['์ฟจ๋Ÿฌ'] = 'cooler.npy'
    c['์†ŒํŒŒ'] = 'couch.npy'
    c['์†Œ', '์ –์†Œ', '์†Œ๊ณ ๊ธฐ', '์•”์†Œ', 'ํ•œ์šฐ'] = 'cow.npy'
    c['ํฌ๋ ˆํŒŒ์Šค', 'ํฌ๋ ˆ์šฉ'] = 'crayon.npy'
    c['์•…์–ด', '๋ผ์ฝ”์Šคํ…Œ', 'ํฌ๋กœ์ปค๋‹ค์ผ'] = 'crocodile.npy'
    c['์—ฌ๊ฐ์„ ', 'ํฌ๋ฃจ์ฆˆ'] = 'cruise ship.npy'
    c['์ปต', '๋ฌผ์ปต'] = 'cup.npy'
    c['๋‹ค์ด์•„๋ชฌ๋“œ', '๋ณด์„'] = 'diamond.npy'
    c['์„ค๊ฑฐ์ง€', '์‹๊ธฐ์„ธ์ฒ™๊ธฐ'] = 'dishwasher.npy'
    c['๋‹ค์ด๋น™', '๋‹ค์ด๋น™๋Œ€'] = 'diving board.npy'
    c['๊ฐœ', '๊ฐ•์•„์ง€', 'ํ‘ธ๋“ค', '์• ๊ฒฌ', '๋ฐ˜๋ ค๋™๋ฌผ'] = 'dog.npy'
    c['๋Œ๊ณ ๋ž˜', '๋Œํ•€'] = 'dolphin.npy'
    c['๋„๋„›', '๋˜์ปจ๋„๋„ˆ์ธ ', '๋˜ํ‚จ', '๊ฐ„์‹', '๋„๋„›๋ฐฉ์„'] = 'donut.npy'
    c['๋ฌธ', '๋ฐฉ๋ฌธ', '์ž…๊ตฌ', '์ถœ์ž…๊ตฌ'] = 'door.npy'
    c['์šฉ', '๊ดด๋ฌผ'] = 'dragon.npy'
    c['์ˆ˜๋‚ฉ์žฅ', '์„œ๋ž์žฅ', '์„œ๋ž'] = 'dresser.npy'
    c['๋“œ๋ฆด', '์ „๊ธฐ๋“œ๋ฆด'] = 'drill.npy'
    c['๋“œ๋Ÿผ', '๋ถ', '๋ถ์น˜๊ธฐ'] = 'drums.npy'
    c['์˜ค๋ฆฌ', '๋ถ๊ฒฝ์˜ค๋ฆฌ'] = 'duck.npy'
    c['๋ค๋ฒจ', '์•„๋ น', 'ํ—ฌ์Šค', 'ํ—ฌ์ฐฝ', '์šด๋™'] = 'dumbbell.npy'
    c['๊ท€'] = 'ear.npy'
    c['ํŒ”๊ฟˆ์น˜', '์—˜๋ณด์šฐ'] = 'elbow.npy'
    c['์ฝ”๋ผ๋ฆฌ'] = 'elephant.npy'
    c['ํŽธ์ง€๋ด‰ํˆฌ', 'ํŽธ์ง€', 'ํŽธ์ง€์ง€', '๋ฉ”์ผ', '๋ฉ”์ผํ•จ', '์ด๋ฉ”์ผ'] = 'envelope.npy'
    c['์ง€์šฐ๊ฐœ'] = 'eraser.npy'
    c['์–ผ๊ตด', '๋ฉด์ƒ', '์™€๊พธ', 'ํ‘œ์ •'] = 'face.npy'
    c['์„ ํ’๊ธฐ', 'ํœด๋Œ€์šฉ์„ ํ’๊ธฐ'] = 'fan.npy'
    c['์ƒˆํ„ธ', '๊นƒํ„ธ', 'ํ„ธ', '๊ตฌ์Šค๋‹ค์šด'] = 'feather.npy'
    c['์šธํƒ€๋ฆฌ', 'ํœ€์Šค', '๋‹ด์žฅ', 'ํŽœ์Šค'] = 'fence.npy'
    c['์†๊ฐ€๋ฝ'] = 'finger.npy'
    c['์†Œํ™”์ „'] = 'fire hydrant.npy'
    c['๋‚œ๋กœ', '๋ฒฝ๋‚œ๋กœ'] = 'fireplace.npy'
    c['์†Œ๋ฐฉ์ฐจ', '์†Œ๋ฐฉ์„œ', '์†Œ๋ฐฉ๋Œ€์›'] = 'firetruck.npy'
    c['๋ฌผ๊ณ ๊ธฐ', '์ƒ์„ ', 'ํšŒ', '์–ด๋ฅ˜'] = 'fish.npy'
    c['ํ”Œ๋ผ๋ฐ๊ณ ', 'ํ•™', '๋‘๋ฃจ๋ฏธ'] = 'flamingo.npy'
    c['ํ›„๋ ˆ์‰ฌ', 'ํ›„๋ ˆ์‹œ', '์†์ „๋“ฑ', '๋ผ์ดํŠธ'] = 'flashlight.npy'
    c['์ชผ๋ฆฌ', 'ํ”Œ๋ฆฝํ”Œ๋ž', '์ƒŒ๋“ค'] = 'flip flops.npy'
    c['์กฐ๋ช…'] = 'floor lamp.npy'
    c['๊ฝƒ', '๊ฝƒ๋‹ค๋ฐœ', '๊ฝƒ์ง‘'] = 'flower.npy'
    c['์œ ์—ํ”„์˜ค', '๋ฏธํ™•์ธ๋น„ํ–‰๋ฌผ์ฒด', '์™ธ๊ณ„์ธ'] = 'flying saucer.npy'
    c['๋ฐœ', '๋ฐœ๋ฐ”๋‹ฅ', '๋ฐœ๋“ฑ', '๋ฐœ๋’ค๊ฟˆ์น˜'] = 'foot.npy'
    c['ํฌํฌ', '์‚ผ์ง€์ฐฝ', 'ํฌ์นด๋ฝ'] = 'fork.npy'
    c['๊ฐœ๊ตฌ๋ฆฌ', 'ํ™ฉ์†Œ๊ฐœ๊ตฌ๋ฆฌ', '๋‘๊บผ๋น„'] = 'frog.npy'
    c['ํ›„๋ผ์ดํŒฌ'] = 'frying pan.npy'
    c['ํ˜ธ์Šค', '์†Œ๋ฐฉํ˜ธ์Šค', '์ •์›ํ˜ธ์Šค'] = 'garden hose.npy'
    c['์ •์›', '๊ฝƒ๋ฐญ', '๊ฐ€๋“ '] = 'garden.npy'
    c['๊ธฐ๋ฆฐ', '๋ฉ€๋Œ€', '์ด๊ด‘์ˆ˜', '๊ด‘์ˆ˜'] = 'giraffe.npy'
    c['์—ผ์†Œ์ˆ˜์—ผ', '์—ผ์†Œ'] = 'goatee.npy'
    c['๊ณจํ”„', '๊ณจํ”„์žฅ', '๋ผ์šด๋“œ', 'ํ•„๋“œ', '๊ณจํผ', '๊ณจํ”„๊ณต'] = 'golf club.npy'
    c['ํฌ๋„', '์ฒญํฌ๋„', '๊ฑฐ๋ด‰', '์ƒค์ธ๋จธ์Šค์บฃ', '์ƒค์ธ๋จธ์Šค์ผ“'] = 'grapes.npy'
    c['ํ’€', '์ž”๋””', '์ž์—ฐ'] = 'grass.npy'
    c['๊ธฐํƒ€', '์šฐ์ฟ ๋ ๋ ˆ', '๋ฒ ์ด์Šค'] = 'guitar.npy'
    c['ํ–„๋ฒ„๊ฑฐ', '๋ฒ„๊ฑฐ', '๋ง˜์Šคํ„ฐ์น˜', '๋งฅ๋„๋‚ ๋“œ', '๋กฏ๋ฐ๋ฆฌ์•„', '๋ฒ„๊ฑฐํ‚น', '์นด์šฐ๋ฒ„๊ฑฐ'] = 'hamburger.npy'
    c['๋ง์น˜', '๋ง์น˜์งˆ'] = 'hammer.npy'
    c['์†', '์†๋“ฑ', '์†๋ฐ”๋‹ฅ'] = 'hand.npy'
    c['ํ•˜ํ”„'] = 'harp.npy'
    c['๋ชจ์ž'] = 'hat.npy'
    c['ํ—ค๋“œํฐ', 'ํ—ค๋“œ์…‹'] = 'headphones.npy'
    c['๊ณ ์Šด๋„์น˜', '๋„์น˜'] = 'hedgehog.npy'
    c['ํ—ฌ๋ฆฌ์ฝฅํ„ฐ', 'ํ—ฌ๊ธฐ'] = 'heliconpyer.npy'
    c['ํ—ฌ๋ฉง', '๋ฐฉํƒ„ํ—ฌ๋ฉง', '๋ณดํ˜ธ์žฅ๋น„', '๊ณต์‚ฌ'] = 'helmet.npy'
    c['์œก๊ฐํ˜•', '์œก๊ฐ๋„ˆํŠธ', '๊นจ๋ฐ•์ด'] = 'hexagon.npy'
    c['ํ•˜ํ‚คํฝ'] = 'hockey puck.npy'
    c['ํ•˜ํ‚ค์ฑ„'] = 'hockey stick.npy'
    c['๋ง', '๋ง์•„์ง€', '๋ง๊ณ ๊ธฐ', '์Šน๋งˆ'] = 'horse.npy'
    c['๋ณ‘์›', '์˜์‚ฌ', 'ํ™˜์ž', '๋ณ‘๋™'] = 'hospital.npy'
    c['์—ด๊ธฐ๊ตฌ', '๊ธฐ๊ตฌ'] = 'hot air balloon.npy'
    c['ํ•ซ๋„๊ทธ', '๋ช…๋Ÿ‰ํ•ซ๋„๊ทธ'] = 'hot dog.npy'
    c['์˜จํƒ•', '์—ดํƒ•', '๋ชฉ์š•ํƒ•'] = 'hot tub.npy'
    c['์ดˆ์‹œ๊ณ„', '๋ชจ๋ž˜์‹œ๊ณ„'] = 'hourglass.npy'
    c['์‹๋ฌผ', 'ํ™”์ดˆ'] = 'house plant.npy'
    c['์ง‘', '๋ณธ๊ฐ€'] = 'house.npy'
    c['ํ—ˆ๋ฆฌ์ผ€์ธ', 'ํƒœํ’', 'ํ˜ผ๋ˆ'] = 'hurricane.npy'
    c['์•„์ด์Šคํฌ๋ฆผ', '๋ฒ ์Šคํ‚จ๋ผ๋นˆ์Šค'] = 'ice cream.npy'
    c['์ž์ผ“', '์žฌํ‚ท', '๋งˆ์ด', '์ •์žฅ'] = 'jacket.npy'
    c['๋ฒ”์ฃ„์ž', '๊ฐ์˜ฅ', '๊ฐ๋ฐฉ', '๋ฒ”์ฃ„'] = 'jail.npy'
    c['์บฅ๊ฑฐ๋ฃจ', 'ํ˜ธ์ฃผ'] = 'kangaroo.npy'
    c['์—ด์‡ ', '์ง‘์—ด์‡ ', '์ง‘ํ‚ค'] = 'key.npy'
    c['ํ‚ค๋ณด๋“œ', '์ƒท๊ฑด'] = 'keyboard.npy'
    c['๋ฌด๋ฆŽ', '๋‹ˆํ‚ฅ'] = 'knee.npy'
    c['์นผ', '๊ณผ๋„', '์‹์นผ', '์นผ์งˆ'] = 'knife.npy'
    c['์‚ฌ๋‹ค๋ฆฌ', '์‚ฌ๋‹ค๋ฆฌ๊ฒŒ์ž„', '์‚ฌ๋‹ค๋ฆฌํƒ€๊ธฐ'] = 'ladder.npy'
    c['๋žœํ„ด', '๋žจํ”„'] = 'lantern.npy'
    c['๋…ธํŠธ๋ถ', '๋งฅ๋ถ', '๊ทธ๋žจ'] = 'lanpyop.npy'
    c['๊นป์žŽ', '์žŽ', '์žŽ์ƒˆ', '์žŽ์‚ฌ๊ท€', '๋‚™์—ฝ', '์ดํŒŒ๋ฆฌ', '๋‚˜๋ญ‡์žŽ'] = 'leaf.npy'
    c['๋‹ค๋ฆฌ', '๋‘๋‹ค๋ฆฌ', 'ํ•˜๋ฐ˜์‹ ', 'ํ•˜์ฒด', 'ํ•˜์˜'] = 'leg.npy'
    c['์ „๊ตฌ', '์—๋””์Šจ', '๊ผฌ๋งˆ์ „๊ตฌ'] = 'light bulb.npy'
    c['๋ผ์ดํ„ฐ'] = 'lighter.npy'
    c['๋“ฑ๋Œ€'] = 'lighthouse.npy'
    c['๋ฒˆ๊ฐœ', '์ฒœ๋‘ฅ', '์ฒœ๋‘ฅ๋ฒˆ๊ฐœ'] = 'lighting.npy'
    c['์„ ', '์ง์„ ', '์ผ์ž'] = 'line.npy'
    c['์‚ฌ์ž', '๋™๋ฌผ์˜์™•๊ตญ', '๋™๋ฌผ์›'] = 'lion.npy'
    c['๋ฆฝ์Šคํ‹ฑ', '๋ฆฝ๊ธ€๋กœ์ฆˆ', '๋ฆฝ๋ฐค'] = 'lipstick.npy'
    c['๋ž์Šคํ„ฐ', '๊ฐ€์žฌ', '๋ž์Šคํ„ฐ๊ตฌ์ด', '๋ž์Šคํƒ€', '๋ฐ”๋‹ท๊ฐ€์žฌ'] = 'lobster.npy'
    c['ํ™”์ดํŠธ๋ฐ์ด', '์‚ฌํƒ•', '๋กค๋ฆฌํŒ', '๋ง‰๋Œ€์‚ฌํƒ•'] = 'lollipop.npy'
    c['์šฐํŽธํ•จ', '์šฐ์ฒด๊ตญ', '์šฐ์ฒดํ†ต'] = 'mailbox.npy'
    c['์ง€๋„', '๋งต'] = 'map.npy'
    c['๋ณด๋“œ๋งˆ์นด', '๋งˆ์นด'] = 'marker.npy'
    c['์„ฑ๋ƒฅ', '์„ฑ๋ƒฅ๊ฐœ๋น„', '์„ฑ๋ƒฅํŒ”์ด์†Œ๋…€'] = 'matches.npy'
    c['ํ™•์„ฑ๊ธฐ'] = 'megaphone.npy'
    c['์ธ์–ด', '์ธ์–ด๊ณต์ฃผ'] = 'mermaid.npy'
    c['๊ฐ€์ˆ˜', '๋งˆ์ดํฌ', '๋…ธ๋ž˜๋ฐฉ', '์ฝ”๋…ธ', '์ฝ”์ธ๋…ธ๋ž˜๋ฐฉ', '๋…ธ๋ž˜'] = 'microphone.npy'
    c['์ „์ž๋ ˆ์ธ์ง€', '์ „์ž๋ Œ์ง€'] = 'microwave.npy'
    c['์›์ˆญ์ด'] = 'monkey.npy'
    c['๋‹ฌ', '์ดˆ์Šน๋‹ฌ', '๊ทธ๋ฏ๋‹ฌ', '๋ณด๋ฆ„๋‹ฌ', '๋‹ฌ๋ฐค'] = 'moon.npy'
    c['๋ชจ๊ธฐ'] = 'mosquito.npy'
    c['์˜คํ† ๋ฐ”์ด', '๋ ˆ์ด์‹ฑ'] = 'motorbike.npy'
    c['์‚ฐ', '๋“ฑ์‚ฐ', '์‚ฐ๋งฅ', '์ •์ƒ'] = 'mountain.npy'
    c['๋งˆ์šฐ์Šค', '๋ฌด์„ ๋งˆ์šฐ์Šค'] = 'mouse.npy'
    c['์ฝง์ˆ˜์—ผ', 'ํ”„๋ง๊ธ€์Šค', '๋‚ด์‹œ์ˆ˜์—ผ', '๋ฉด๋„'] = 'moustache.npy'
    c['์ž…', '์ž…์ˆ '] = 'mouth.npy'
    c['๋จธ๊ทธ', '๋จธ๊ทธ์ปต', '๋จธ๊ทธ์ž”'] = 'mug.npy'
    c['๋ฒ„์„ฏ', '๋…๋ฒ„์„ฏ', '์ดˆ์ฝ”์†ก์ด'] = 'mushroom.npy'
    c['๋ชป', '๋ชป๋ฐ•๊ธฐ'] = 'nail.npy'
    c['๋ชฉ๊ฑธ์ด', '์ฅฌ์–ผ๋ฆฌ'] = 'necklace.npy'
    c['์ฝ”', '์ฝง๊ตฌ๋ฉ', '์ฝง๋Œ€', '์ฝง๋ฌผ', '์ฝง๋ณผ', '๋ƒ„์ƒˆ'] = 'nose.npy'
    c['๋ฐ”๋‹ค', '๋…ธ์„', '๋ฐ”๋‹ท๊ฐ€'] = 'ocean.npy'
    c['ํŒ”๊ฐํ˜•', 'ํŒ”๊ฐ์ •'] = 'octagon.npy'
    c['๋ฌธ์–ด', '์ญˆ๊พธ๋ฏธ', '์ฃผ๊พธ๋ฏธ', '๋‚™์ง€', 'ํ•ด๋ฌผ'] = 'octopus.npy'
    c['์–‘ํŒŒ'] = 'onion.npy'
    c['์˜ค๋ธ๊ตฌ์ด', '์˜ค๋ธ'] = 'oven.npy'
    c['๋ถ€์—‰์ด', '์˜ฌ๋นผ๋ฏธ'] = 'owl.npy'
    c['ํŽ˜์ธํŠธํ†ต', 'ํŽ˜์ธํŠธ'] = 'paint can.npy'
    c['ํŽ˜์ธํŠธ๋ถ“', 'ํŽ˜์ธํŠธ์น '] = 'paintbrush.npy'
    c['์•ผ์ž์ˆ˜', '์ œ์ฃผ๋„', '์ œ์ฃผ', 'ํ•˜์™€์ด', '์•ผ์ž๋‚˜๋ฌด', '์•ผ์ž'] = 'palm tree.npy'
    c['ํŒ๋‹ค', 'ํŒฌ๋”', 'ํŒ๋‹ค๊ณฐ', 'ํŒฌ๋”๊ณฐ'] = 'panda.npy'
    c['๋ฐ”์ง€', '์•„๋žซ๋„๋ฆฌ', '์ฒญ๋ฐ”์ง€', '์Šฌ๋ž™์Šค', '๋ฉด๋ฐ”์ง€'] = 'pants.npy'
    c['์˜ทํ•€', 'ํด๋ฆฝ'] = 'paper clip.npy'
    c['๋‚™ํ•˜์‚ฐ', '๋ฐฐ๊ทธ', '๋‚™ํ•˜'] = 'parachute.npy'
    c['์•ต๋ฌด์ƒˆ'] = 'parrot.npy'
    c['์—ฌ๊ถŒ'] = 'passport.npy'
    c['๋•…์ฝฉ', '๋•…์ฝฉ๋ฒ„ํ„ฐ'] = 'peanut.npy'
    c['๋ฐฐ'] = 'pear.npy'
    c['๊ฐ•๋‚ญ์ฝฉ', '์ฝฉ'] = 'peas.npy'
    c['์—ฐํ•„', 'ํ•„๊ธฐ๊ตฌ', 'ํ•„๊ธฐ', '์“ฐ๊ธฐ'] = 'pencil.npy'
    c['ํŽญ๊ท„', '๋‚จ๊ทน', '๋ถ๊ทน', 'ํŽญ์ˆ˜', 'ํ•‘๊ตฌ'] = 'penguin.npy'
    c['ํ”ผ์•„๋…ธ', '๊ทธ๋žœ๋“œํ”ผ์•„๋…ธ', '์•…๊ธฐ'] = 'piano.npy'
    c['ํ”ฝ์—…ํŠธ๋Ÿญ'] = 'pickup truck.npy'
    c['์•ก์ž', '์‚ฌ์ง„์•ก์ž'] = 'picture frame.npy'
    c['๋ผ์ง€', '๊ฟ€๊ฟ€์ด', '๋จน๋ณด', '๋จน๋ฐฉ'] = 'pig.npy'
    c['๋ฒ ๊ฐœ', '๋ฒ ๊ฐœ์‹ธ์›€'] = 'pillow.npy'
    c['ํŒŒ์ธ์• ํ”Œ'] = 'pineapple.npy'
    c['ํ”ผ์ž', '๋„๋ฏธ๋…ธํ”ผ์ž', 'ํ”ผ์ž์Šค์ฟจ'] = 'pizza.npy'
    c['ํŽœ์น˜', '๋ปฐ์ฐŒ', '๋ปฐ์น˜'] = 'pliers.npy'
    c['๊ฒฝ์ฐฐ์ฐจ', '๊ฒฝ์ฐฐ'] = 'police car.npy'
    c['์—ฐ๋ชป'] = 'pond.npy'
    c['ํ’€์žฅ', '์ˆ˜์˜์žฅ'] = 'pool.npy'
    c['ํ•˜๋“œ', '์•„์ด์Šค๋ฐ”'] = 'popsicle.npy'
    c['์—ฝ์„œ', '์—ฝ์„œ์‚ฌ์ง„'] = 'postcard.npy'
    c['๊ฐ์ž', '๊ฐ์ž์ „', '์ฐ๊ฐ์ž', '์™•๊ฐ์ž'] = 'potato.npy'
    c['์ฝ˜์„ผํŠธ'] = 'power outlet.npy'
    c['์ง€๊ฐ‘', '์žฅ์ง€๊ฐ‘'] = 'purse.npy'
    c['ํ† ๋ผ', '์‚ฐํ† ๋ผ'] = 'rabbit.npy'
    c['๋ผ์ฟค', '๋„ˆ๊ตฌ๋ฆฌ'] = 'raccoon.npy'
    c['๋ผ๋””์˜ค'] = 'radio.npy'
    c['๋น„', '์šฐ๋ฐ•'] = 'rain.npy'
    c['๋ฌด์ง€๊ฐœ๋‹ค๋ฆฌ', '๋ฌด์ง€๊ฐœ'] = 'rainbow.npy'
    c['๋†๊ธฐ๊ตฌ'] = 'rake.npy'
    c['๋ฆฌ๋ชจ์ปจ', '์—์–ด์ปจ๋ฆฌ๋ชจ์ปจ'] = 'remote control.npy'
    c['์ฝ”๋ฟ”์†Œ'] = 'rhinoceros.npy'
    c['๋”ฐ๋ฐœ์ด', '์ด'] = 'rifle.npy'
    c['๊ฐ•', 'ํ•œ๊ฐ•', '๊ฐ•๋ฌผ'] = 'river.npy'
    c['๋กค๋Ÿฌ์ฝ”์Šคํ„ฐ', '๋†€์ด๊ธฐ๊ตฌ', '๋†€์ด๋™์‚ฐ', '๋†€์ด๊ณต์›'] = 'roller coaster.npy'
    c['๋กค๋Ÿฌ์Šค์ผ€์ดํŠธ', '์Šค์ผ€์ดํŠธ', '๋กค๋Ÿฌ์žฅ'] = 'rollerskates.npy'
    c['๋›๋‹จ๋ฐฐ'] = 'sailboat.npy'
    c['์ƒŒ๋“œ์œ„์น˜', '์„œ๋ธŒ์›จ์ด'] = 'sandwich.npy'
    c['ํ†ฑ์งˆ', 'ํ†ฑ', '์ „๊ธฐํ†ฑ'] = 'saw.npy'
    c['์ƒ‰์†Œํฐ'] = 'saxophone.npy'
    c['ํ•™๊ต๋ฒ„์Šค', 'ํ†ตํ•™๋ฒ„์Šค'] = 'school bus.npy'
    c['๊ฐ€์œ„', '๋ถ€์—Œ๊ฐ€์œ„', '๊ฐ€์œ„์งˆ'] = 'scissors.npy'
    c['์ „๊ฐˆ', '์Šค์ฝœํ”ผ์˜จ'] = 'scorpion.npy'
    c['๋“œ๋ผ์ด๋ฒ„'] = 'screwdriver.npy'
    c['๊ฑฐ๋ถ์ด', '์ž๋ผ'] = 'sea turtle.npy'
    c['์‹œ์†Œ', '๋†€์ดํ„ฐ'] = 'see saw.npy'
    c['์ƒ์–ด', '์ƒคํฌ', '์ฃ ์Šค'] = 'shark.npy'
    c['์–‘', '์–‘๋–ผ', '๋ชฉ์žฅ', '์–‘๋–ผ๋ชฉ์žฅ'] = 'sheep.npy'
    c['์‹ ๋ฐœ', '๊ตฌ๋‘', '์šด๋™ํ™”', '์Šค๋‹ˆ์ปค์ฆˆ'] = 'shoe.npy'
    c['๋ฐ˜๋ฐ”์ง€'] = 'shorts.npy'
    c['์‚ฝ', '์•ผ์ „์‚ฝ', '์‚ฝ์งˆ'] = 'shovel.npy'
    c['์‹ฑํฌ๋Œ€', '์„ธ๋ฉด๋Œ€'] = 'sink.npy'
    c['์Šค์ผ€์ดํŠธ๋ณด๋“œ', '๋ณด๋“œ', '๋กฑ๋ณด๋“œ'] = 'skateboard.npy'
    c['ํ•ด๊ณจ', 'ํ•ด๊ณจ๋ฐ”๊ฐ€์ง€', '์œ ๋ น', '๊ณตํฌ'] = 'skull.npy'
    c['๋งˆ์ฒœ๋ฃจ', '๋กฏ๋ฐํƒ€์›Œ', '๋ถ€๋ฅด์ฆˆ์นผ๋ฆฌํŒŒ', '์ดˆ๊ณ ์ธต', '์ดˆ๊ณ ์ธต๋นŒ๋”ฉ'] = 'skyscraper.npy'
    c['์นจ๋‚ญ'] = 'sleeping bag.npy'
    c['๋ฏธ์†Œ', '์›ƒ๋Š”ํ‘œ์ •', '์Šค๋งˆ์ผ', '๊ธฐ๋ถ„'] = 'smiley face.npy'
    c['๋‹ฌํŒฝ์ด', '๋Š๋ฆผ๋ณด'] = 'snail.npy'
    c['๋ฑ€', '๋ฑ€์žฅ์–ด', '๋ณด์•„๋ฑ€', '๊ตฌ๋ ์ด'] = 'snake.npy'
    c['์Šค๋…ธํด๋ง', '์Šค๋…ธํด', '์ž ์ˆ˜'] = 'snorkel.npy'
    c['๋ˆˆ๋ณด๋ผ', '์„œ๋ฆฌ'] = 'snowflake.npy'
    c['๋ˆˆ์‚ฌ๋žŒ', '๊ฒจ์šธ'] = 'snowman.npy'
    c['๊ณจ', '์ถ•๊ตฌ๊ณต', '์ถ•๊ตฌ', '์ถ•๊ตฌ์„ ์ˆ˜'] = 'soccer ball.npy'
    c['์–‘๋ง', '๋ฐœ๋ชฉ์–‘๋ง'] = 'sock.npy'
    c['๋ณดํŠธ', '๊ณ ์†๋ณดํŠธ', '์ˆ˜์ƒ์Šคํ‚ค'] = 'speedboat.npy'
    c['๊ฑฐ๋ฏธ', '์ŠคํŒŒ์ด๋”๋งจ'] = 'spider.npy'
    c['์Šคํ‘ผ', '์ˆŸ๊ฐ€๋ฝ', '์›๋”œ', '์ˆ˜์ €'] = 'spoon.npy'
    c['์Šคํ”„๋ ˆ๋“œ์‹œํŠธ', 'ํ‘œ', '์—‘์…€'] = 'spreadsheet.npy'
    c['๋„ค๋ชจ', 'ํ™”๋ฉด', '์‚ฌ๊ฐํ˜•'] = 'square.npy'
    c['๊ผฌ๋ถˆ๊ผฌ๋ถˆ', '๊ณก์„ '] = 'squiggle.npy'
    c['๋‹ค๋žŒ์ฅ', '์ฒญ์„ค๋ชจ'] = 'squirrel.npy'
    c['๋น„์ƒ๊ณ„๋‹จ', '๊ณ„๋‹จ'] = 'stairs.npy'
    c['๋ณ„', '๋ณ„๋ชจ์–‘', '์Šคํƒ€'] = 'star.npy'
    c['์Šคํ…Œ์ดํฌ', '๊ณ ๊ธฐ'] = 'steak.npy'
    c['์Šคํ…Œ๋ ˆ์˜ค', '์นด์„ธํŠธ'] = 'stereo.npy'
    c['์ง„๋‹จ', '์ฒญ์ง„๊ธฐ'] = 'stethoscope.npy'
    c['๋ฐ”๋Š์งˆ'] = 'stitches.npy'
    c['์ •์ง€์„ ', '์ •์ง€', '๊ทธ๋งŒ'] = 'stop sign.npy'
    c['๊ฐ€์Šค๋ Œ์ง€', '๊ฐ€์Šค๋ ˆ์ธ์ง€', '์ธ๋•์…˜'] = 'stove.npy'
    c['๋”ธ๊ธฐ', '์ŠคํŠธ๋กœ๋ฒ ๋ฆฌ'] = 'strawberry.npy'
    c['๊ฐ€๋กœ๋“ฑ', '๊ฑฐ๋ฆฌ๋ถˆ๋น›', '๊ฐ€๋กœ๋“ฑ๋ถˆ๋น›'] = 'streetlight.npy'
    c['์™„๋‘์ฝฉ'] = 'string bean.npy'
    c['์ž ์ˆ˜ํ•จ', '์ž ์ˆ˜์ •'] = 'submarine.npy'
    c['์†๊ฐ€๋ฐฉ', '์„œ๋ฅ˜๊ฐ€๋ฐฉ'] = 'suitcase.npy'
    c['ํ•ด', '๋‚ฎ', 'ํƒœ์–‘', '์—ฌ๋ฆ„'] = 'sun.npy'
    c['๋ฐฑ์กฐ'] = 'swan.npy'
    c['์Šค์›จํ„ฐ', '๋งจํˆฌ๋งจ', '๋‹ˆํŠธ', '์ƒ์˜', '๋กฑ์Šฌ๋ฆฌ๋ธŒ'] = 'sweater.npy'
    c['๊ทธ๋„ค', '๊ทธ๋„ค๋†€์ด', '๊ทธ๋„คํƒ€๊ธฐ'] = 'swing set.npy'
    c['๊ฒ€', '๋Œ€๊ฒ€'] = 'sword.npy'
    c['์ฃผ์‚ฌ๊ธฐ', '์ฃผ์‚ฌ', '์ฃผ์‚ฌ๋ฐ”๋Š˜', '๊ฐ„ํ˜ธ์‚ฌ', '๊ฐ๊ธฐ'] = 'syringe.npy'
    c['ํ‹ฐ์…”์ธ ', 'ํ‹ฐ', '๋ฐ˜ํŒ”ํ‹ฐ', '๋ฐ˜ํŒ”', '๋ฐ˜ํŒ”ํ‹ฐ์…”์ธ '] = 't-shirt.npy'
    c['ํ…Œ์ด๋ธ”', '์ฑ…์ƒ', '์‹ํƒ'] = 'table.npy'
    c['์ฃผ์ „์ž'] = 'teapot.npy'
    c['ํ…Œ๋””๋ฒ ์–ด', '๊ณฐ์ธํ˜•', '์ธํ˜•'] = 'teddy-bear.npy'
    c['๋ฒจ์†Œ๋ฆฌ', '์ „ํ™”๊ธฐ', '์ง‘์ „ํ™”', '์ „ํ™”'] = 'telephone.npy'
    c['ํ‹ฐ๋น„', 'ํ…”๋ ˆ๋น„์ „', '์˜ˆ๋Šฅ', '๋“œ๋ผ๋งˆ'] = 'television.npy'
    c['ํ…Œ๋‹ˆ์Šค๋ผ์ผ“', '๋ผ์ผ“', 'ํ…Œ๋‹ˆ์Šค์ฑ„'] = 'tennis racquet.npy'
    c['ํ…ํŠธ', '์บ ํ•‘'] = 'tent.npy'
    c['๋งŒ๋ฆฌ์žฅ์„ฑ', '์ค‘๊ตญ'] = 'The Great Wall of China.npy'
    c['๋ชจ๋‚˜๋ฆฌ์ž'] = 'The Mona Lisa.npy'
    c['ํ˜ธ๋ž‘์ด', '์ง์Šน'] = 'tiger.npy'
    c['ํ† ์ŠคํŠธ', 'ํ† ์ŠคํŠธ๊ธฐ๊ณ„', 'ํ† ์Šคํ„ฐ๊ธฐ'] = 'toaster.npy'
    c['๋ฐœ๊ฐ€๋ฝ', '๋ฐœํ†ฑ'] = 'toe.npy'
    c['ํ™”์žฅ์‹ค', '๋ณ€๊ธฐ'] = 'toilet.npy'
    c['์ด๋นจ', '์ด', '์–ด๊ธˆ๋‹ˆ', '์‚ฌ๋ž‘๋‹ˆ', '์•ž๋‹ˆ', '์ž„ํ”Œ๋ž€ํŠธ', '๊ต์ •', '์น˜์•„'] = 'tooth.npy'
    c['์นซ์†”', '์–‘์น˜', '์–‘์น˜์งˆ'] = 'toothbrush.npy'
    c['์น˜์•ฝ'] = 'toothpaste.npy'
    c['ํ† ๋„ค์ด๋„', '๋Œํ’', '๊ฐ•ํ’'] = 'tornado.npy'
    c['ํŠธ๋ž™ํ„ฐ'] = 'tractor.npy'
    c['์‹ ํ˜ธ๋“ฑ', '์‹ ํ˜ธ', '์‹ ํ˜ธ์œ„๋ฐ˜', '์ดˆ๋ก๋ถˆ'] = 'traffic light.npy'
    c['๊ธฐ์ฐจ', '์—ด์ฐจ', '์ง€ํ•˜์ฒ '] = 'train.npy'
    c['๋‚˜๋ฌด'] = 'tree.npy'
    c['์‚ผ๊ฐํ˜•', '์‚ผ๊ฐ๊น€๋ฐฅ'] = 'triangle.npy'
    c['ํŠธ๋Ÿผ๋ณธ'] = 'trombone.npy'
    c['ํŠธ๋Ÿญ', 'ํ™”๋ฌผ์ฐจ', 'ํฌํ„ฐ'] = 'truck.npy'
    c['ํŠธ๋ŸผํŽซ'] = 'trumpet.npy'
    c['์šฐ์‚ฐ', '์–‘์‚ฐ'] = 'umbrella.npy'
    c['์†์˜ท', 'ํŒฌํ‹ฐ'] = 'underwear.npy'
    c['๋ฐด', '์Šนํ•ฉ์ฐจ'] = 'van.npy'
    c['ํ™”๋ถ„', '๊ฝƒ๋ณ‘'] = 'vase.npy'
    c['๋ฐ”์ด์˜ฌ๋ฆฐ'] = 'violin.npy'
    c['๋นจ๋ž˜', '์„ธํƒ', '์„ธํƒ๊ธฐ', '๋“œ๋Ÿผ์„ธํƒ๊ธฐ'] = 'washing machine.npy'
    c['์ˆ˜๋ฐ•'] = 'watermelon.npy'
    c['์›Œํ„ฐํŒŒํฌ', '๋ฏธ๋„๋Ÿผํ‹€', '์Šฌ๋ผ์ด๋“œ'] = 'waterslide.npy'
    c['๊ณ ๋ž˜', '๊ณ ๋ž˜๋ฐฅ'] = 'whale.npy'
    c['์‚ฌ๊ณผ'] = 'apple.npy'
    c['๋น„๋‘˜๊ธฐ', '์ƒˆ', '์ฐธ์ƒˆ'] = 'bird.npy'
    c['์ž๋™์ฐจ', '์ฐจ', '์ž๊ฐ€์šฉ', '์˜์นด', '๋“œ๋ผ์ด๋ธŒ'] = 'car.npy'
    c['๊ฒŒ', '๊ฝƒ๊ฒŒ', '๋Œ€๊ฒŒ', '๊ฐ„์žฅ๊ฒŒ์žฅ', '์–‘๋…๊ฒŒ์žฅ'] = 'crab.npy'
    c['์™•๊ด€', '์™•'] = 'crown.npy'
    c['๋ˆˆ', '๋ˆˆ์•Œ', '๋ˆˆ๋™์ž', '๋™๊ณต', '๋ Œ์ฆˆ'] = 'eye.npy'
    c['์„ ๊ธ€๋ผ์Šค', '์•ˆ๊ฒฝ'] = 'eyeglasses.npy'
    c['์—ํŽ ํƒ‘', '์†ก์ „ํƒ‘', '๊ธฐ์ง€๊ตญ'] = 'The Eiffel Tower.npy'
    c['๋ฐ”ํ€ด', '์ˆ˜๋ ˆ๋ฐ”ํ€ด'] = 'wheel.npy'
    c['ํ’์ฐจ', '๋„ค๋œ๋ž€๋“œ'] = 'windmill.npy'
    c['์™€์ธ๋ณ‘', '์™€์ธ'] = 'wine bottle.npy'
    c['์™€์ธ์ž”'] = 'wine glass.npy'
    c['์†๋ชฉ์‹œ๊ณ„'] = 'wristwatch.npy'
    c['์š”๊ฐ€', '์ŠคํŠธ๋ ˆ์นญ'] = 'yoga.npy'
    c['์–ผ๋ฃฉ๋ง'] = 'zebra.npy'
    c['์ง€๊ทธ์žฌ๊ทธ'] = 'zigzag.npy'

    category = {
        '์‚ฌ๊ณผ': 'apple.npy',
        '์ž์ „๊ฑฐ': 'bicycle.npy',
        '์ƒˆ': 'bird.npy',
        '์ž๋™์ฐจ': 'car.npy',
        '๊ฒŒ': 'crab.npy',
        '์™•๊ด€': 'crown.npy',
        '๋ˆˆ': 'eye.npy',
        '์•ˆ๊ฒฝ': 'eyeglasses.npy',
        'ํฌํฌ': 'fork.npy',
        '์—ํŽ ํƒ‘': 'the eiffel tower.npy',
        '๋ฐ”ํ€ด': 'wheel.npy',
        'ํ’์ฐจ': 'windmill.npy',
        '์™€์ธ๋ณ‘': 'wine bottle.npy',
        '์™€์ธ์ž”': 'wine glass.npy',
        '์†๋ชฉ์‹œ๊ณ„': 'wristwatch.npy',
        '์š”๊ฐ€': 'yoga.npy',
        '์–ผ๋ฃฉ๋ง': 'zebra.npy'
    }

    # value = category.get(keyword_for_picture)
    value = c.get(keyword_for_picture)
    # value = "sliced_npydata/" + value

    if value is None:
        print('There is no category of ' + keyword_for_picture)
        return Response('no Value')
    else:

        import random
        value = "sliced_npydata/" + value
        nparry = np.load(value)
        length = len(nparry)
        random_image = nparry[random.randint(0, length - 1)].reshape((28, 28))
        resize_img = cv2.resize(random_image, (0, 0),
                                fx=81,
                                fy=81,
                                interpolation=cv2.INTER_LANCZOS4)
        resize_img = cv2.bitwise_not(resize_img)

        matplotlib.image.imsave('./static/random.png', resize_img, cmap='gray')
        src = cv2.imread("./static/random.png", cv2.IMREAD_COLOR)
        ret, resize_img = cv2.threshold(resize_img, 120, 255,
                                        cv2.THRESH_BINARY)
        resize_img = cv2.resize(resize_img, (0, 0),
                                fx=0.3,
                                fy=0.3,
                                interpolation=cv2.INTER_AREA)
        ret, resize_img = cv2.threshold(resize_img, 120, 255,
                                        cv2.THRESH_BINARY)
        resize_img = cv2.resize(resize_img, (0, 0),
                                fx=0.3,
                                fy=0.3,
                                interpolation=cv2.INTER_AREA)
        matplotlib.image.imsave('./static/random.png', resize_img, cmap='gray')

        resize_img = cv2.imread('./static/random.png', cv2.IMREAD_COLOR)
        for x in range(0, 204):
            for y in range(0, 204):
                if resize_img[x][y][0] == 255 & resize_img[x][y][
                        1] == 255 & resize_img[x][y][2] == 255:
                    resize_img[x][y] = [214, 215, 219]

        matplotlib.image.imsave('./static/random.png', resize_img, cmap='gray')
        return FileResponse(open('./static/random.png', 'rb'))
Ejemplo n.ยบ 30
0
import sys
import os
import re

from multi_key_dict import multi_key_dict


__all__ = []


VERSION_REGEX = (
    "version: "
    "(?P<major>\d+)-(?P<minor>\d+)-(?P<state>.+)-(?P<revision>\d+)")
STATE = multi_key_dict({
    ('a', '0'): "Alpha",
    ('b', '1'): "Beta",
    ('rc', '2'): "Release Candidate",
    ('r', '3'): "Release",
    })
args = multi_key_dict({
    ("-V", "--version-file", 0): "VERSION",
    ("-s", "--summary", 1): "summary.",
    })
TEMPLATE = """V{version}, {summary}

CHANGES:
    - none

BUG FIXES:
    - none
"""
Ejemplo n.ยบ 31
0
import wx
import analyse #soundanalyse
import Layout as ly  # Layout code generated by wxGlade
import gettext # for localisation shit required by wxGlade
import numpy,time ,math
import alsaaudio 
import threading 
from multi_key_dict import multi_key_dict #this lib allow to point multiple keys to a value which is not realized in standart dictionary lib

#note_dict is a dictionary of midi key values which point to a note
note_dict = multi_key_dict()
note_dict[0,12,24,36,48,60,72,84,96,108,120] = "C"
note_dict[1,13,25,37,49,61,73,85,97,109,121] = "C#"
note_dict[2,14,26,38,50,62,74,86,98,110,122] = "D"
note_dict[3,15,27,39,51,63,75,87,99,111,123] = "D#"
note_dict[4,16,28,40,52,64,76,88,100,112,124]= "E"
note_dict[5,17,29,41,53,65,77,89,101,113,125]= "F"
note_dict[6,18,30,42,54,66,78,90,102,114,126]= "F#"
note_dict[7,19,31,43,55,67,79,91,103,115,127]= "G"
note_dict[8,20,32,44,56,68,80,92,104,116] =    "G#"
note_dict[9,21,33,45,57,69,81,93,105,117] =    "A"
note_dict[10,22,34,46,58,70,82,94,106,118]=    "A#"
note_dict[11,23,35,47,59,71,83,95,107,119]=    "B"



def set_input_list():
    input_devices_list = get_input_devices()
    for i in input_devices_list :
        frame.input_list.Append(i)
        
Ejemplo n.ยบ 32
0
part = world.add_emitter(angle=[360, 360],
                         life=[1, 3],
                         colors=[
                             COLORS["aliceblue"], COLORS["cadetblue1"],
                             COLORS["darkslategray2"], COLORS["lightblue2"]
                         ])
#  add_body("d", (21, 45), (2, 1)),
#  add_body("d", (23, 45), (2, 1)),
#  add_body("d", (28, 45), (2, 1)),
player.set_phis(phis.player_body[0][0], phis.meter)
player.def_box2d_pos(world.height)
player_id = world.add_rect(player.get_rect(), COLORS["red"])
# phis.add_body("s", (0, 0), (50, 1), world.boxes)
# id2 = world.add_box()

KEY = multi_key_dict()
KEY[K_RIGHT, K_d] = (4, 0)
KEY[K_LEFT, K_a] = (-4, 0)
KEY[K_DOWN, K_s] = (0, 4)

menu(
    **{
        "img_DIR": IMG_DIR + "menu/",
        "fdir": FONTS_DIR,
        "theme_index": THEME,
        "save": save,
        "save_main": save_main
    })

clock = pygame.time.Clock()