import pytest
from PIL import Image

from plantID.utils import PlantIdClient
from trefle_api.utils import ClientTrefleApi

#PLANTID FIXTURES
@pytest.fixture
def image_file(tmp_path):
    image_path = str(tmp_path / "temp.jpg")
    im = Image.new("RGB", (496, 496), 0xFF3333)
    im.save(image_path, format="JPEG", optimize=True)
    return image_path

@pytest.fixture
def plant_client():
    return PlantIdClient()

@pytest.fixture(autouse=True)
def no_requestes(monkeypatch):
    monkeypatch.delattr('requests.sessions.Session.request')

#TREFLE_API FIXTURES
@pytest.fixture
def trefle_client():
    return ClientTrefleApi(api_key="test")

@pytest.fixture
def plant_name():
    return "fraxinus pennsylvanica"

#TREFLE_API BACKEND REPONSE
@pytest.fixture
def get_resource_backend_resp():
    return {   'data': [   {   'author': 'Marshall',
                    'bibliography': 'Arbust. Amer.: 51 (99999)',
                    'common_name': 'Green ash',
                    'family': 'Oleaceae',
                    'family_common_name': 'Olive family',
                    'genus': 'Fraxinus',
                    'genus_id': 3064,
                    'id': 137845,
                    'image_url': 'https://bs.floristic.org/image/o/92e034dda311bcc34a497da70e2bc2fb2e554f17',
                    'links': {   'genus': '/api/v1/genus/fraxinus',
                                 'plant': '/api/v1/plants/fraxinus-pennsylvanica',
                                 'self': '/api/v1/species/fraxinus-pennsylvanica'},
                    'rank': 'species',
                    'scientific_name': 'Fraxinus pennsylvanica',
                    'slug': 'fraxinus-pennsylvanica',
                    'status': 'accepted',
                    'synonyms': [   'Fraxinus darlingtonii',
                                    'Fraxinus pennsylvanica var. austinii',
                                    'Fraxinus lanceolata',
                                    'Fraxinus pennsylvanica var. '
                                    'subintegerrima',
                                    'Fraxinus campestris',
                                    'Fraxinus smallii',
                                    'Fraxinus expansa',
                                    'Fraxinus viridis',
                                    'Fraxinus oblongocarpa',
                                    'Leptalix ovata',
                                    'Fraxinus americana var. subpubescens',
                                    'Fraxinus pennsylvanica f. erythrocarpa',
                                    'Fraxinus platyphylla',
                                    'Fraxinus americana var. normale',
                                    'Fraxinus lanceolata var. viridis',
                                    'Leptalix richardii',
                                    'Leptalix longifolia',
                                    'Leptalix rufa',
                                    'Calycomelia lanceolata',
                                    'Calycomelia pubescens',
                                    'Fraxinus cerasifolia',
                                    'Fraxinus pubescens var. nana',
                                    'Fraxinus pubescens var. boscii',
                                    'Fraxinus lancifolia',
                                    'Fraxinus pennsylvanica var. pubescens',
                                    'Fraxinus viridis var. pubescens',
                                    'Fraxinus pubescens',
                                    'Fraxinus ovata',
                                    'Calycomelia ovata',
                                    'Fraxinus pennsylvanica var. typica',
                                    'Fraxinus pennsylvanica f. megaphylla',
                                    'Leptalix fusca',
                                    'Fraxinus longifolia',
                                    'Leptalix pubescens',
                                    'Fraxinus subvillosa',
                                    'Fraxinus aucubifolia',
                                    'Calycomelia pennsylvanica',
                                    'Fraxinus pennsylvanica f. scotica',
                                    'Calycomelia elliptica',
                                    'Calycomelia expansa',
                                    'Calycomelia lancea',
                                    'Fraxinus rubicunda',
                                    'Fraxinus concolor',
                                    'Leptalix cinerea',
                                    'Fraxinus pubescens var. ovata',
                                    'Fraxinus cinerea',
                                    'Fraxinus americana var. rubicunda',
                                    'Calycomelia richardii',
                                    'Fraxinus media',
                                    'Fraxinus pennsylvanica var. campestris',
                                    'Fraxinus lancea',
                                    'Calycomelia campestris',
                                    'Fraxinus lanceolata var. lindheimeri',
                                    'Leptalix media',
                                    'Leptalix rubicunda',
                                    'Fraxinus fusca',
                                    'Fraxinus elliptica',
                                    'Fraxinus trialata',
                                    'Fraxinus arbutifolia',
                                    'Leptalix lancifolia',
                                    'Fraxinus pubescens var. lindheimeri',
                                    'Fraxinus ovalis',
                                    'Fraxinus pennsylvanica subsp. '
                                    'subintegerrima',
                                    'Fraxinus richardii',
                                    'Leptalix elliptica',
                                    'Fraxinus viridis var. trialata',
                                    'Leptalix expansa',
                                    'Fraxinus pennsylvanica f. colorata',
                                    'Fraxinus nigra var. pubescens',
                                    'Fraxinus americana subsp. pennsylvanica',
                                    'Fraxinus juglandifolia var. '
                                    'subintegerrima',
                                    'Fraxinus rufa',
                                    'Fraxinus pennsylvanica var. integerrima',
                                    'Fraxinus pennsylvanica var. lanceolata'],
                    'year': 1785},
                {   'author': 'Benth.',
                    'bibliography': 'Bot. Voy. Sulphur: 33 (1844)',
                    'common_name': 'Oregon ash',
                    'family': 'Oleaceae',
                    'family_common_name': 'Olive family',
                    'genus': 'Fraxinus',
                    'genus_id': 3064,
                    'id': 137837,
                    'image_url': 'https://bs.floristic.org/image/o/51ed787210015e2054b045c57e68bdabd1719440',
                    'links': {   'genus': '/api/v1/genus/fraxinus',
                                 'plant': '/api/v1/plants/fraxinus-latifolia',
                                 'self': '/api/v1/species/fraxinus-latifolia'},
                    'rank': 'species',
                    'scientific_name': 'Fraxinus latifolia',
                    'slug': 'fraxinus-latifolia',
                    'status': 'accepted',
                    'synonyms': [   'Fraxinus oregona',
                                    'Fraxinus oregona var. latifolia',
                                    'Fraxinus californica',
                                    'Fraxinus pennsylvanica subsp. oregona'],
                    'year': 1844},
                {   'author': '(Bush) Bush',
                    'bibliography': 'N.L.Britton, Man. Fl. N. States: 725 '
                                    '(1901)',
                    'common_name': 'Pumpkin ash',
                    'family': 'Oleaceae',
                    'family_common_name': 'Olive family',
                    'genus': 'Fraxinus',
                    'genus_id': 3064,
                    'id': 137854,
                    'image_url': None,
                    'links': {   'genus': '/api/v1/genus/fraxinus',
                                 'plant': '/api/v1/plants/fraxinus-profunda',
                                 'self': '/api/v1/species/fraxinus-profunda'},
                    'rank': 'species',
                    'scientific_name': 'Fraxinus profunda',
                    'slug': 'fraxinus-profunda',
                    'status': 'accepted',
                    'synonyms': [   'Fraxinus tomentosa',
                                    'Fraxinus michauxii',
                                    'Fraxinus pennsylvanica subsp. profunda',
                                    'Fraxinus americana var. profunda',
                                    'Calycomelia profunda',
                                    'Calycomelia tomentosa',
                                    'Fraxinus pennsylvanica var. profunda',
                                    'Fraxinus profunda var. ashei'],
                    'year': 1901},
                {   'author': 'Roxb.',
                    'bibliography': 'Fl. Ind. 1: 150 (1820)',
                    'common_name': 'Chinese ash',
                    'family': 'Oleaceae',
                    'family_common_name': 'Olive family',
                    'genus': 'Fraxinus',
                    'genus_id': 3064,
                    'id': 137826,
                    'image_url': 'https://bs.floristic.org/image/o/b09794d24514f653261378a8616995ba63d8ef1f',
                    'links': {   'genus': '/api/v1/genus/fraxinus',
                                 'plant': '/api/v1/plants/fraxinus-chinensis',
                                 'self': '/api/v1/species/fraxinus-chinensis'},
                    'rank': 'species',
                    'scientific_name': 'Fraxinus chinensis',
                    'slug': 'fraxinus-chinensis',
                    'status': 'accepted',
                    'synonyms': [   'Fraxinus velutina',
                                    'Fraxinus rhynchophylla var. huashanensis',
                                    'Fraxinus szaboana',
                                    'Fraxinus medicinalis',
                                    'Fraxinus yunnanensis',
                                    'Fraxinus lingelsheimii',
                                    'Fraxinus sargentiana',
                                    'Fraxinus pistaciifolia',
                                    'Fraxinus velutina var. toumeyi',
                                    'Fraxinus pennsylvanica subsp. velutina',
                                    'Fraxinus coriacea',
                                    'Fraxinus velutina var. typica',
                                    'Fraxinus americana var. pistaciifolia',
                                    'Fraxinus pistaciifolia var. coriacea',
                                    'Fraxinus velutina var. glabrata',
                                    'Fraxinus attenuata',
                                    'Fraxinus velutina var. glabra',
                                    'Fraxinus velutina var. coriacea',
                                    'Fraxinus toumeyi',
                                    'Fraxinus standleyi',
                                    'Fraxinus standleyi var. lasia',
                                    'Fraxinus pistaciifolia var. velutina'],
                    'year': 1820},
                {   'author': 'L.',
                    'bibliography': 'Sp. Pl.: 1057 (1753)',
                    'common_name': 'White ash',
                    'family': 'Oleaceae',
                    'family_common_name': 'Olive family',
                    'genus': 'Fraxinus',
                    'genus_id': 3064,
                    'id': 137810,
                    'image_url': 'https://bs.floristic.org/image/o/c72fb9d4dd55867f71c108bb770b1ce0342c82cc',
                    'links': {   'genus': '/api/v1/genus/fraxinus',
                                 'plant': '/api/v1/plants/fraxinus-americana',
                                 'self': '/api/v1/species/fraxinus-americana'},
                    'rank': 'species',
                    'scientific_name': 'Fraxinus americana',
                    'slug': 'fraxinus-americana',
                    'status': 'accepted',
                    'synonyms': [   'Fraxinus americana var. curtissii',
                                    'Fraxinus biltmoreana',
                                    'Fraxinus americana f. iodocarpa',
                                    'Fraxinus americana var. epiptera',
                                    'Calycomelia alba',
                                    'Fraxinus americana f. barrii',
                                    'Calycomelia pistaciifolia',
                                    'Aplilia macrophyla',
                                    'Fraxinus americana subsp. biltmoreana',
                                    'Calycomelia biltmoreana',
                                    'Fraxinus glauca',
                                    'Fraxinus americana var. ascidiata',
                                    'Calycomelia americana',
                                    'Fraxinus novae-angliae',
                                    'Fraxinus americana f. acuminata',
                                    'Leptalix grandifolia',
                                    'Leptalix epiptera',
                                    'Fraxinus villosa',
                                    'Leptalix alba',
                                    'Ornus americana',
                                    'Fraxinus juglandifolia',
                                    'Fraxinus macrophylla',
                                    'Fraxinus discolor',
                                    'Fraxinus biltmoreana var. subcoriacea',
                                    'Fraxinus americana var. longifolia',
                                    'Calycomelia acuminata',
                                    'Calycomelia viridis',
                                    'Leptalix viridis',
                                    'Fraxinus americana f. ascidiata',
                                    'Fraxinus epiptera',
                                    'Fraxinus americana var. microcarpa',
                                    'Fraxinus americana var. biltmoreana',
                                    'Fraxinus americana var. crassifolia',
                                    'Fraxinus americana var. subcoriacea',
                                    'Fraxinus alba',
                                    'Fraxinus americana subsp. typicum',
                                    'Fraxinus acuminata',
                                    'Fraxinus pubescens var. longifolia',
                                    'Fraxinoides alba',
                                    'Fraxinus nigra var. juglandifolia',
                                    'Fraxinus curtissii',
                                    'Leptalix glauca',
                                    'Leptalix juglandifolia',
                                    'Fraxinus americana f. lasiophylla',
                                    'Calycomelia epiptera',
                                    'Calycomelia juglandifolia',
                                    'Fraxinus pennsylvanica subsp. '
                                    'novae-angliae',
                                    'Ornanthes americana',
                                    'Fraxinus canadensis',
                                    'Leptalix acuminata',
                                    'Fraxinus americana subsp. novae-angliae',
                                    'Fraxinus albicans',
                                    'Fraxinus americana var. juglandifolia',
                                    'Fraxinus americana subsp. texensis',
                                    'Fraxinus americana var. texensis',
                                    'Fraxinus americana var. albicans',
                                    'Fraxinus texensis'],
                    'year': 1753},
                {   'author': 'Mill.',
                    'bibliography': 'Gard. Dict. ed. 8: n.º 6 (1768)',
                    'common_name': 'Carolina ash',
                    'family': 'Oleaceae',
                    'family_common_name': 'Olive family',
                    'genus': 'Fraxinus',
                    'genus_id': 3064,
                    'id': 137822,
                    'image_url': 'https://d2seqvvyy3b8p2.cloudfront.net/6e685d0c142457bf53bba8f061287572.jpg',
                    'links': {   'genus': '/api/v1/genus/fraxinus',
                                 'plant': '/api/v1/plants/fraxinus-caroliniana',
                                 'self': '/api/v1/species/fraxinus-caroliniana'},
                    'rank': 'species',
                    'scientific_name': 'Fraxinus caroliniana',
                    'slug': 'fraxinus-caroliniana',
                    'status': 'accepted',
                    'synonyms': [   'Fraxinus caroliniana var. cubensis',
                                    'Fraxinus pauciflora',
                                    'Fraxinus platycarpa var. floridana',
                                    'Leptalix caroliniana',
                                    'Fraxinus platycarpa var. triptera',
                                    'Fraxinus pleurodes',
                                    'Leptalix pallida',
                                    'Samarpses triptera',
                                    'Fraxinus pennsylvanica var. cubensis',
                                    'Fraxinus palustris',
                                    'Fraxinus pennsylvanica subsp. cubensis',
                                    'Fraxinus platycarpa',
                                    'Calycomelia caroliniana',
                                    'Fraxinus caroliniana var. platycarpa',
                                    'Calycomelia platycarpa',
                                    'Fraxinus caroliniana var. oblaceolata',
                                    'Fraxinus triptera',
                                    'Fraxinus caroliniana subsp. cubensis',
                                    'Fraxinus floridana',
                                    'Fraxinus nigra subsp. caroliniana',
                                    'Fraxinus curvidens',
                                    'Fraxinus pallida',
                                    'Fraxinus nuttallii',
                                    'Fraxinus nigrescens',
                                    'Leptalix pleurodes',
                                    'Fraxinus caroliniana var. pubescens',
                                    'Fraxinus caroliniana f. hypomalaca',
                                    'Leptalix palustris',
                                    'Calycomelia pallida',
                                    'Fraxinus caroliniana f. pubescens',
                                    'Leptalix platycarpa',
                                    'Leptalix cordata',
                                    'Fraxinus caroliniana f. lasiophylla',
                                    'Fraxinus cubensis',
                                    'Fraxinus cordata',
                                    'Fraxinus caroliniana var. pauciflora',
                                    'Fraxinus caroliniana var. oblanceolata'],
                    'year': 1768}],
    'links': {   'first': '/api/v1/plants/search?page=1&q=fraxinus+pensylvanica',
                 'last': '/api/v1/plants/search?page=1&q=fraxinus+pensylvanica',
                 'self': '/api/v1/plants/search?q=fraxinus+pensylvanica'},
    'meta': {'total': 6}}

@pytest.fixture
def get_detail_info_backend_response():
    return {   'data': {   'author': 'Siebold & Zucc. ex J.J.Hoffm. & J.H.Schult.bis',
                'bibliography': 'J. Asiat., sér. 4, 20: 282 (1852)',
                'common_name': 'katsura tree',
                'family': {   'common_name': 'Katsura-tree family',
                              'id': 259,
                              'links': {   'division_order': '/api/v1/division_orders/hamamelidales',
                                           'genus': '/api/v1/families/cercidiphyllaceae/genus',
                                           'self': '/api/v1/families/cercidiphyllaceae'},
                              'name': 'Cercidiphyllaceae',
                              'slug': 'cercidiphyllaceae'},
                'family_common_name': 'Katsura-tree family',
                'forms': [],
                'genus': {   'id': 1617,
                             'links': {   'family': '/api/v1/families/cercidiphyllaceae',
                                          'plants': '/api/v1/genus/cercidiphyllum/plants',
                                          'self': '/api/v1/genus/cercidiphyllum',
                                          'species': '/api/v1/genus/cercidiphyllum/species'},
                             'name': 'Cercidiphyllum',
                             'slug': 'cercidiphyllum'},
                'genus_id': 1617,
                'hybrids': [],
                'id': 113104,
                'image_url': 'https://bs.floristic.org/image/o/4431c5c6fa6b72afffdc08f38342080dedbfdd82',
                'links': {   'genus': '/api/v1/genus/cercidiphyllum',
                             'self': '/api/v1/plants/cercidiphyllum-japonicum',
                             'species': '/api/v1/plants/cercidiphyllum-japonicum/species'},
                'main_species': {   'author': 'Siebold & Zucc. ex J.J.Hoffm. & '
                                              'J.H.Schult.bis',
                                    'bibliography': 'J. Asiat., sér. 4, 20: '
                                                    '282 (1852)',
                                    'common_name': 'Katsura tree',
                                    'common_names': {   'eng': [   'katsura '
                                                                   'tree',
                                                                   'katsura-tree']},
                                    'duration': ['perennial'],
                                    'edible': False,
                                    'edible_part': None,
                                    'family': 'Cercidiphyllaceae',
                                    'family_common_name': 'Katsura-tree family',
                                    'flower': {   'color': None,
                                                  'conspicuous': None},
                                    'foliage': {   'color': None,
                                                   'leaf_retention': None,
                                                   'texture': None},
                                    'fruit_or_seed': {   'color': None,
                                                         'conspicuous': None,
                                                         'seed_persistence': None,
                                                         'shape': None},
                                    'genus': 'Cercidiphyllum',
                                    'genus_id': 1617,
                                    'growth': {   'atmospheric_humidity': None,
                                                  'bloom_months': None,
                                                  'days_to_harvest': None,
                                                  'description': None,
                                                  'fruit_months': "may",
                                                  'growth_months': None,
                                                  'light': 10,
                                                  'maximum_precipitation': {   'mm': None},
                                                  'maximum_temperature': {   'deg_c': 88,
                                                                             'deg_f': None},
                                                  'minimum_precipitation': {   'mm': None},
                                                  'minimum_root_depth': {   'cm': None},
                                                  'minimum_temperature': {   'deg_c': None,
                                                                             'deg_f': None},
                                                  'ph_maximum': 5.6,
                                                  'ph_minimum': None,
                                                  'row_spacing': {'cm': None},
                                                  'soil_humidity': None,
                                                  'soil_nutriments': None,
                                                  'soil_salinity': None,
                                                  'soil_texture': None,
                                                  'sowing': None,
                                                  'spread': {'cm': None}},
                                    'id': 118737,
                                    'image_url': 'https://bs.floristic.org/image/o/4431c5c6fa6b72afffdc08f38342080dedbfdd82',
                                    'images': {   '': [   {   'copyright': '© '
                                                                           'copyright '
                                                                           'of '
                                                                           'the '
                                                                           'Board '
                                                                           'of '
                                                                           'Trustees '
                                                                           'of '
                                                                           'the '
                                                                           'Royal '
                                                                           'Botanic '
                                                                           'Gardens, '
                                                                           'Kew.',
                                                              'id': 3467024,
                                                              'image_url': 'https://d2seqvvyy3b8p2.cloudfront.net/7fd07ef811bcaa8f5539d4edad06e0ab.jpg'}],
                                                  'bark': [   {   'copyright': 'Taken '
                                                                               'Aug '
                                                                               '28, '
                                                                               '2019 '
                                                                               'by '
                                                                               'Fedan '
                                                                               'Hacizade '
                                                                               '(cc-by-sa)',
                                                                  'id': 3257678,
                                                                  'image_url': 'https://bs.floristic.org/image/o/4431c5c6fa6b72afffdc08f38342080dedbfdd82'}]},
                                    'links': {   'genus': '/api/v1/genus/cercidiphyllum',
                                                 'plant': '/api/v1/plants/cercidiphyllum-japonicum',
                                                 'self': '/api/v1/species/cercidiphyllum-japonicum'},
                                    'observations': 'China, Japan',
                                    'rank': 'species',
                                    'scientific_name': 'Cercidiphyllum '
                                                       'japonicum',
                                    'slug': 'cercidiphyllum-japonicum',
                                    
                                    'specifications': {   'average_height': {   'cm': 1500},
                                                          'growth_form': None,
                                                          'growth_habit': 'Tree',
                                                          'growth_rate': None,
                                                          'ligneous_type': 'tree',
                                                          'maximum_height': {   'cm': None},
                                                          'nitrogen_fixation': None,
                                                          'shape_and_orientation': None,
                                                          'toxicity': None},
                                    'status': 'accepted',
                                    
                                    'vegetable': False,
                                    'year': 1852},
                'main_species_id': 118737,
                'observations': 'China, Japan',
                'scientific_name': 'Cercidiphyllum japonicum',
                'slug': 'cercidiphyllum-japonicum',
                'sources': [   {   'citation': 'https://plants.sc.egov.usda.gov/core/profile?symbol=CEJA2',
                                   'id': 'CEJA2',
                                   'last_update': '2020-06-21T20:14:58.650Z',
                                   'name': 'USDA',
                                   'url': 'https://plants.usda.gov/core/profile?symbol=CEJA2'},
                               {   'citation': 'POWO (2019). Plants of the '
                                               'World Online. Facilitated by '
                                               'the Royal Botanic Gardens, '
                                               'Kew. Published on the '
                                               'Internet; '
                                               'http://www.plantsoftheworldonline.org/ '
                                               'Retrieved 2020-06-23',
                                   'id': 'urn:lsid:ipni.org:names:77084481-1',
                                   'last_update': '2020-06-23T22:56:51.425Z',
                                   'name': 'POWO',
                                   'url': 'http://powo.science.kew.org/taxon/urn:lsid:ipni.org:names:77084481-1'},
                               {   'citation': None,
                                   'id': '8060423',
                                   'last_update': '2020-07-01T20:10:56.874Z',
                                   'name': 'GBIF',
                                   'url': 'https://www.gbif.org/species/8060423'},
                               {   'citation': None,
                                   'id': 'Cercidiphyllum japonicum Siebold & '
                                         'Zucc. ex J.J.Hoffm. & J.H.Schult.bis',
                                   'last_update': '2020-06-16T20:30:19.982Z',
                                   'name': 'PlantNet',
                                   'url': 'https://identify.plantnet.org/species/the-plant-list/Cercidiphyllum '
                                          'japonicum Siebold & Zucc. ex '
                                          'J.J.Hoffm. & J.H.Schult.bis'},
                               {   'citation': None,
                                   'id': 'Cercidiphyllum japonicum',
                                   'last_update': '2020-09-24T09:19:17.803Z',
                                   'name': 'Wikipedia',
                                   'url': 'https://en.wikipedia.org/wiki/Cercidiphyllum '
                                          'japonicum'}],
                'species': [   {   'author': 'Siebold & Zucc. ex J.J.Hoffm. & '
                                             'J.H.Schult.bis',
                                   'bibliography': 'J. Asiat., sér. 4, 20: 282 '
                                                   '(1852)',
                                   'common_name': 'Katsura tree',
                                   'family': 'Cercidiphyllaceae',
                                   'family_common_name': 'Katsura-tree family',
                                   'genus': 'Cercidiphyllum',
                                   'genus_id': 1617,
                                   'id': 118737,
                                   'image_url': 'https://bs.floristic.org/image/o/4431c5c6fa6b72afffdc08f38342080dedbfdd82',
                                   'links': {   'genus': '/api/v1/genus/cercidiphyllum',
                                                'plant': '/api/v1/plants/cercidiphyllum-japonicum',
                                                'self': '/api/v1/species/cercidiphyllum-japonicum'},
                                   'rank': 'species',
                                   'scientific_name': 'Cercidiphyllum '
                                                      'japonicum',
                                   'slug': 'cercidiphyllum-japonicum',
                                   'status': 'accepted',
                                   'synonyms': [   'Cercidiphyllum magnificum '
                                                   'f. pendulum',
                                                   'Cercidiphyllum ovale',
                                                   'Cercidiphyllum japonicum '
                                                   'f. piramidale'],
                                   'year': 1852}],
                'subspecies': [],
                'subvarieties': [],
                'varieties': [],
                'vegetable': False,
                'year': 1852},
    'meta': {'last_modified': '2020-12-14T00:59:08.101Z'}}



#PLANTID MOCK BACKEND RESPONSE
@pytest.fixture
def backend_response():
    return { 'countable': True,
    'custom_id': None,
    'fail_cause': None,
    'feedback': None,
    'finished_datetime': 1609707942.857562,
    'id': 8491002,
    'images': [   {   'file_name': 'd7e7e5ed1774425395c59982739eb4b4.jpg',
                      'url': 'https://plant.id/media/images/d7e7e5ed1774425395c59982739eb4b4.jpg'}],
    'meta_data': {   'date': '2021-01-03',
                     'datetime': '2021-01-03',
                     'latitude': None,
                     'longitude': None},
    'modifiers': [],
    'secret': '2ksfZHt1GeJozkG',
    'suggestions': [   {   'confirmed': False,
                           'id': 62955282,
                           'plant_details': {   'common_names': [   'Camellia',
                                                                    'Japanese '
                                                                    'camellia',
                                                                    'Common '
                                                                    'camellia',
                                                                    'Tsubaki',
                                                                    'Rose of '
                                                                    'winter',
                                                                    'Japonica'],
                                                'name_authority': 'Camellia '
                                                                  'japonica L.',
                                                'scientific_name': 'Camellia '
                                                                   'japonica',
                                                'structured_name': {   'genus': 'camellia',
                                                                       'species': 'japonica'},
                                                'taxonomy': {   'class': 'Magnoliopsida',
                                                                'family': 'Theaceae',
                                                                'genus': 'Camellia',
                                                                'kingdom': 'Plantae',
                                                                'order': 'Ericales',
                                                                'phylum': 'Tracheophyta'},
                                                'url': 'http://en.wikipedia.org/wiki/Camellia_japonica'},
                           'plant_name': 'Camellia japonica',
                           'probability': 0.21745800378612892},
                       {   'confirmed': False,
                           'id': 62955283,
                           'plant_details': {   'common_names': [   'Rose',
                                                                    'De rosa'],
                                                'name_authority': None,
                                                'scientific_name': 'Rosa',
                                                'structured_name': {   'genus': 'rosa'},
                                                'taxonomy': {   'class': 'Magnoliopsida',
                                                                'family': 'Rosaceae',
                                                                'genus': 'Rosa',
                                                                'kingdom': 'Plantae',
                                                                'order': 'Rosales',
                                                                'phylum': 'Tracheophyta'},
                                                'url': 'http://en.wikipedia.org/wiki/Rosa'},
                           'plant_name': 'Rosa',
                           'probability': 0.15403643894196734},
                       {   'confirmed': False,
                           'id': 62955284,
                           'plant_details': {   'common_names': [   'Paeony',
                                                                    'Paionia'],
                                                'name_authority': None,
                                                'scientific_name': 'Paeonia',
                                                'structured_name': {   'genus': 'paeonia'},
                                                'taxonomy': {   'class': 'Magnoliopsida',
                                                                'family': 'Paeoniaceae',
                                                                'genus': 'Paeonia',
                                                                'kingdom': 'Plantae',
                                                                'order': 'Saxifragales',
                                                                'phylum': 'Tracheophyta'},
                                                'url': 'http://en.wikipedia.org/wiki/Paeonia'},
                           'plant_name': 'Paeonia',
                           'probability': 0.10401217950351851},
                       {   'confirmed': False,
                           'id': 62955285,
                           'plant_details': {   'common_names': [   'China '
                                                                    'rose',
                                                                    'Chinese '
                                                                    'rose'],
                                                'name_authority': 'Rosa '
                                                                  'chinensis '
                                                                  'Jacq.',
                                                'scientific_name': 'Rosa '
                                                                   'chinensis',
                                                'structured_name': {   'genus': 'rosa',
                                                                       'species': 'chinensis'},
                                                'taxonomy': {   'class': 'Magnoliopsida',
                                                                'family': 'Rosaceae',
                                                                'genus': 'Rosa',
                                                                'kingdom': 'Plantae',
                                                                'order': 'Rosales',
                                                                'phylum': 'Tracheophyta'},
                                                'url': 'http://en.wikipedia.org/wiki/Rosa_chinensis'},
                           'plant_name': 'Rosa chinensis',
                           'probability': 0.06035186881000735},
                       {   'confirmed': False,
                           'id': 62955286,
                           'plant_details': {   'common_names': [   'Wild '
                                                                    'peony',
                                                                    'Common '
                                                                    'peony',
                                                                    'Garden '
                                                                    'peony'],
                                                'name_authority': 'Paeonia '
                                                                  'officinalis '
                                                                  'L.',
                                                'scientific_name': 'Paeonia '
                                                                   'officinalis',
                                                'structured_name': {   'genus': 'paeonia',
                                                                       'species': 'officinalis'},
                                                'taxonomy': {   'class': 'Magnoliopsida',
                                                                'family': 'Paeoniaceae',
                                                                'genus': 'Paeonia',
                                                                'kingdom': 'Plantae',
                                                                'order': 'Saxifragales',
                                                                'phylum': 'Tracheophyta'},
                                                'url': 'http://en.wikipedia.org/wiki/Paeonia_officinalis'},
                           'plant_name': 'Paeonia officinalis',
                           'probability': 0.05461902940073029},
                       {   'confirmed': False,
                           'id': 62955287,
                           'plant_details': {   'common_names': [   'Shrub '
                                                                    'althea',
                                                                    'Rose of '
                                                                    'sharon',
                                                                    'Korean '
                                                                    'rose',
                                                                    'Syrian '
                                                                    'ketmia',
                                                                    'Rose '
                                                                    'mallow'],
                                                'name_authority': 'Hibiscus '
                                                                  'syriacus L.',
                                                'scientific_name': 'Hibiscus '
                                                                   'syriacus',
                                                'structured_name': {   'genus': 'hibiscus',
                                                                       'species': 'syriacus'},
                                                'taxonomy': {   'class': 'Magnoliopsida',
                                                                'family': 'Malvaceae',
                                                                'genus': 'Hibiscus',
                                                                'kingdom': 'Plantae',
                                                                'order': 'Malvales',
                                                                'phylum': 'Tracheophyta'},
                                                'url': 'http://en.wikipedia.org/wiki/Hibiscus_syriacus'},
                           'plant_name': 'Hibiscus syriacus',
                           'probability': 0.02330138696669},
                       {   'confirmed': False,
                           'id': 62955288,
                           'plant_details': {   'common_names': [   'China '
                                                                    'rose',
                                                                    'Chinese '
                                                                    'hibiscus',
                                                                    'Hawaiian '
                                                                    'hibiscus',
                                                                    'Shoeblackplant',
                                                                    'Rose '
                                                                    'mallow'],
                                                'name_authority': 'Hibiscus '
                                                                  'rosa-sinensis '
                                                                  'L.',
                                                'scientific_name': 'Hibiscus '
                                                                   'rosa-sinensis',
                                                'structured_name': {   'genus': 'hibiscus',
                                                                       'species': 'rosa-sinensis'},
                                                'taxonomy': {   'class': 'Magnoliopsida',
                                                                'family': 'Malvaceae',
                                                                'genus': 'Hibiscus',
                                                                'kingdom': 'Plantae',
                                                                'order': 'Malvales',
                                                                'phylum': 'Tracheophyta'},
                                                'url': 'http://en.wikipedia.org/wiki/Hibiscus_rosa-sinensis'},
                           'plant_name': 'Hibiscus rosa-sinensis',
                           'probability': 0.023200246135538286},
                       {   'confirmed': False,
                           'id': 62955289,
                           'plant_details': {   'common_names': [   'Peony',
                                                                    'Chinese '
                                                                    'peony',
                                                                    'Common '
                                                                    'garden '
                                                                    'peony'],
                                                'name_authority': 'Paeonia '
                                                                  'lactiflora '
                                                                  'Pall.',
                                                'scientific_name': 'Paeonia '
                                                                   'lactiflora',
                                                'structured_name': {   'genus': 'paeonia',
                                                                       'species': 'lactiflora'},
                                                'taxonomy': {   'class': 'Magnoliopsida',
                                                                'family': 'Paeoniaceae',
                                                                'genus': 'Paeonia',
                                                                'kingdom': 'Plantae',
                                                                'order': 'Saxifragales',
                                                                'phylum': 'Tracheophyta'},
                                                'url': 'http://en.wikipedia.org/wiki/Paeonia_lactiflora'},
                           'plant_name': 'Paeonia lactiflora',
                           'probability': 0.022470811666973775},
                       {   'confirmed': False,
                           'id': 62955290,
                           'plant_details': {   'common_names': [   'Hollyhock',
                                                                    'Common '
                                                                    'hollyhock'],
                                                'name_authority': 'Alcea rosea '
                                                                  'L.',
                                                'scientific_name': 'Alcea '
                                                                   'rosea',
                                                'structured_name': {   'genus': 'alcea',
                                                                       'species': 'rosea'},
                                                'taxonomy': {   'class': 'Magnoliopsida',
                                                                'family': 'Malvaceae',
                                                                'genus': 'Alcea',
                                                                'kingdom': 'Plantae',
                                                                'order': 'Malvales',
                                                                'phylum': 'Tracheophyta'},
                                                'url': 'http://en.wikipedia.org/wiki/Alcea_rosea'},
                           'plant_name': 'Alcea rosea',
                           'probability': 0.010949768602862753}],
    'uploaded_datetime': 1609707941.380085}